Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

jsonrpc: fix OnVolumeChanged notifications after AE merge #1076

Merged
merged 1 commit into from

2 participants

@Montellese
Owner

I thought that I committed this quite a while ago but seems like I forgot. With the AE merge, the Application.OnVolumeChanged notification was (almost) completely lost. This fix adds that announcement back.

@Montellese Montellese was assigned
@jmarshallnz

Looks good.

@Montellese Montellese merged commit 608efad into xbmc:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 6 deletions.
  1. +12 −6 xbmc/Application.cpp
  2. +2 −0  xbmc/Application.h
View
18 xbmc/Application.cpp
@@ -2684,7 +2684,7 @@ bool CApplication::OnAction(const CAction &action)
else
volume -= (float)fabs(action.GetAmount()) * action.GetAmount() * step;
- SetHardwareVolume(volume);
+ SetVolume(volume, false);
}
// show visual feedback of volume change...
ShowVolumeBar(&action);
@@ -5186,6 +5186,7 @@ void CApplication::Mute()
CAEFactory::AE->SetMute(true);
g_settings.m_bMute = true;
+ VolumeChanged();
}
void CApplication::UnMute()
@@ -5195,6 +5196,7 @@ void CApplication::UnMute()
CAEFactory::AE->SetMute(false);
g_settings.m_bMute = false;
+ VolumeChanged();
}
void CApplication::SetVolume(float iValue, bool isPercentage/*=true*/)
@@ -5205,11 +5207,7 @@ void CApplication::SetVolume(float iValue, bool isPercentage/*=true*/)
hardwareVolume /= 100.0f;
SetHardwareVolume(hardwareVolume);
-
- CVariant data(CVariant::VariantTypeObject);
- data["volume"] = (int)(hardwareVolume * 100.0f + 0.5f);
- data["muted"] = g_settings.m_bMute;
- CAnnouncementManager::Announce(Application, "xbmc", "OnVolumeChanged", data);
+ VolumeChanged();
}
void CApplication::SetHardwareVolume(float hardwareVolume)
@@ -5235,6 +5233,14 @@ int CApplication::GetVolume() const
return (int)(g_settings.m_fVolumeLevel * 100.0f);
}
+void CApplication::VolumeChanged() const
+{
+ CVariant data(CVariant::VariantTypeObject);
+ data["volume"] = GetVolume();
+ data["muted"] = g_settings.m_bMute;
+ CAnnouncementManager::Announce(Application, "xbmc", "OnVolumeChanged", data);
+}
+
int CApplication::GetSubtitleDelay() const
{
// converts subtitle delay to a percentage
View
2  xbmc/Application.h
@@ -410,6 +410,8 @@ class CApplication : public CXBApplicationEx, public IPlayerCallback, public IMs
void UpdateLCD();
void FatalErrorHandler(bool WindowSystemInitialized, bool MapDrives, bool InitNetwork);
+ void VolumeChanged() const;
+
bool PlayStack(const CFileItem& item, bool bRestart);
bool SwitchToFullScreen();
bool ProcessMouse();
Something went wrong with that request. Please try again.