Add OSD API for media player's volume changes
Reviewed-by: Marco Martin
This commit is contained in:
parent
605ab0f130
commit
a4c4fc05af
@ -75,6 +75,11 @@ void Osd::volumeChanged(int percent)
|
||||
showProgress(icon, percent);
|
||||
}
|
||||
|
||||
void Osd::mediaPlayerVolumeChanged(int percent, const QString &playerName, const QString &playerIconName)
|
||||
{
|
||||
showProgress(playerIconName, percent, playerName);
|
||||
}
|
||||
|
||||
void Osd::kbdLayoutChanged(const QString &layoutName)
|
||||
{
|
||||
//FIXME: need a kbd icon
|
||||
@ -87,9 +92,10 @@ void Osd::virtualDesktopChanged(const QString ¤tVirtualDesktopName)
|
||||
showText(QString(), currentVirtualDesktopName);
|
||||
}
|
||||
|
||||
void Osd::showProgress(const QString &icon, const int percent)
|
||||
void Osd::showProgress(const QString &icon, const int percent, const QString &additionalText)
|
||||
{
|
||||
m_osdObject->rootObject()->setProperty("osdValue", percent);
|
||||
m_osdObject->rootObject()->setProperty("osdAdditionalText", additionalText);
|
||||
m_osdObject->rootObject()->setProperty("showingProgress", true);
|
||||
m_osdObject->rootObject()->setProperty("icon", icon);
|
||||
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
public Q_SLOTS:
|
||||
void brightnessChanged(int percent);
|
||||
void volumeChanged(int percent);
|
||||
void mediaPlayerVolumeChanged(int percent, const QString &playerName, const QString &playerIconName);
|
||||
void kbdLayoutChanged(const QString &layoutName);
|
||||
void virtualDesktopChanged(const QString ¤tVirtualDesktopName);
|
||||
|
||||
@ -49,7 +50,7 @@ private Q_SLOTS:
|
||||
void hideOsd();
|
||||
|
||||
private:
|
||||
void showProgress(const QString &icon, const int percent);
|
||||
void showProgress(const QString &icon, const int percent, const QString &additionalText = QString());
|
||||
void showText(const QString &icon, const QString &text);
|
||||
void showOsd();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user