Commit ebca1f84 authored by Jonathan Marten's avatar Jonathan Marten
Browse files

Add Mixer::iconName() to find an icon for the master channel

parent dbfc1788
......@@ -197,7 +197,7 @@ const QString Mixer::dbusPath()
return QString("/Mixers/" + cardPath);
}
void Mixer::volumeSave( KConfig *config )
void Mixer::volumeSave(KConfig *config) const
{
// qCDebug(KMIX_LOG) << "Mixer::volumeSave()";
_mixerBackend->readSetFromHW();
......@@ -210,7 +210,7 @@ void Mixer::volumeSave( KConfig *config )
config->sync();
}
void Mixer::volumeLoad( KConfig *config )
void Mixer::volumeLoad(KConfig *config)
{
QString grp("Mixer");
grp.append(id());
......@@ -325,7 +325,7 @@ void Mixer::readSetFromHWforceUpdate() const {
}
/// Returns translated WhatsThis messages for a control.Translates from
QString Mixer::translateKernelToWhatsthis(const QString &kernelName)
QString Mixer::translateKernelToWhatsthis(const QString &kernelName) const
{
return _mixerBackend->translateKernelToWhatsthis(kernelName);
}
......@@ -591,7 +591,7 @@ shared_ptr<MixDevice> Mixer::find(const QString& mixdeviceID) const
}
shared_ptr<MixDevice> Mixer::getMixdeviceById( const QString& mixdeviceID )
shared_ptr<MixDevice> Mixer::getMixdeviceById( const QString& mixdeviceID ) const
{
qCDebug(KMIX_LOG) << "id=" << mixdeviceID << "md=" << _mixerBackend->m_mixDevices.get(mixdeviceID).get()->id();
return _mixerBackend->m_mixDevices.get(mixdeviceID);
......@@ -700,7 +700,7 @@ void Mixer::setDynamic ( bool dynamic )
m_dynamic = dynamic;
}
bool Mixer::isDynamic()
bool Mixer::isDynamic() const
{
return m_dynamic;
}
......@@ -719,3 +719,11 @@ QString Mixer::currentStreamDevice(const QString &id) const
{
return (_mixerBackend->currentStreamDevice(id));
}
QString Mixer::iconName() const
{
const shared_ptr<MixDevice> master = getLocalMasterMD();
if (master!=nullptr) return (master->iconName());
return ("media-playback-start"); // fallback default icon
}
......@@ -70,8 +70,8 @@ public:
shared_ptr<MixDevice> find(const QString& devPK) const;
static Mixer* findMixer( const QString& mixer_id);
void volumeSave( KConfig *config );
void volumeLoad( KConfig *config );
void volumeSave(KConfig *config) const;
void volumeLoad(KConfig *config);
/// Tells the number of the mixing devices
unsigned int size() const;
......@@ -79,7 +79,7 @@ public:
/// Returns a pointer to the mix device whose type matches the value
/// given by the parameter and the array MixerDevNames given in
/// mixer_oss.cpp (0 is Volume, 4 is PCM, etc.)
shared_ptr<MixDevice> getMixdeviceById( const QString& deviceID );
shared_ptr<MixDevice> getMixdeviceById( const QString& deviceID ) const;
/// Open/grab the mixer for further interaction
bool openIfValid();
......@@ -105,7 +105,7 @@ public:
virtual QString getBaseName() const;
/// Wrapper to Mixer_Backend
QString translateKernelToWhatsthis(const QString &kernelName);
QString translateKernelToWhatsthis(const QString &kernelName) const;
/**
* Get a name suitable for a human user to read, possibly with quoted ampersand.
......@@ -145,7 +145,7 @@ public:
// Used also by MixDevice to bind to this path
const QString dbusPath();
static QList<Mixer*> & mixers();
static QList<Mixer *> &mixers();
/******************************************
The KMix GLOBAL master card. Please note that KMix and KMixPanelApplet can have a
......@@ -158,6 +158,7 @@ public:
static Mixer* getGlobalMasterMixer();
static Mixer* getGlobalMasterMixerNoFalback();
static MasterControl& getGlobalMasterPreferred(bool fallbackAllowed = true);
QString getRecommendedDeviceId();
/******************************************
......@@ -166,6 +167,11 @@ public:
shared_ptr<MixDevice> getLocalMasterMD() const;
void setLocalMasterMD(QString&);
/**
* An icon for the mixer's master channel
*/
QString iconName() const;
/// get the actual MixSet
MixSet &getMixSet() const;
......@@ -175,7 +181,7 @@ public:
/// Says if we are dynamic (e.g. widgets can come and go)
virtual void setDynamic( bool dynamic = true );
virtual bool isDynamic();
virtual bool isDynamic() const;
static bool dynamicBackendsPresent();
static bool pulseaudioPresent();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment