-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gui] Kill g_audioManager #14198
[gui] Kill g_audioManager #14198
Conversation
Looks good. There may be some places where we need to check |
@@ -52,7 +52,7 @@ JSONRPC_STATUS CInputOperations::SendAction(int actionID, bool wakeScreensaver / | |||
if(!wakeScreensaver || !handleScreenSaver()) | |||
{ | |||
g_application.ResetSystemIdleTimer(); | |||
g_audioManager.PlayActionSound(actionID); | |||
CServiceBroker::GetGUI()->GetAudioManager().PlayActionSound(actionID); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/addons/UISoundsResource.cpp
Outdated
@@ -42,7 +42,7 @@ bool CUISoundsResource::IsInUse() const | |||
void CUISoundsResource::OnPostInstall(bool update, bool modal) | |||
{ | |||
if (IsInUse()) | |||
g_audioManager.Load(); | |||
CServiceBroker::GetGUI()->GetAudioManager().Load(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/input/InputManager.cpp
Outdated
@@ -697,11 +697,11 @@ bool CInputManager::ExecuteInputAction(const CAction &action) | |||
{ | |||
bResult = g_application.OnAction(action); | |||
if (bResult) | |||
g_audioManager.PlayActionSound(action); | |||
CServiceBroker::GetGUI()->GetAudioManager().PlayActionSound(action); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/input/InputManager.cpp
Outdated
} | ||
else | ||
{ | ||
g_audioManager.PlayActionSound(action); | ||
CServiceBroker::GetGUI()->GetAudioManager().PlayActionSound(action); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
all calls from non gui components should test for nullptr |
Done. Thanks for the review. |
xbmc/Application.cpp
Outdated
@@ -2096,7 +2096,7 @@ bool CApplication::OnAction(const CAction &action) | |||
if (!m_appPlayer.IsPaused() && m_appPlayer.GetPlaySpeed() != 1) | |||
m_appPlayer.SetPlaySpeed(1); | |||
|
|||
g_audioManager.Enable(m_appPlayer.IsPaused()); | |||
CServiceBroker::GetGUI()->GetAudioManager().Enable(m_appPlayer.IsPaused()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
9640667
to
248e4cf
Compare
xbmc/Application.cpp
Outdated
@@ -2156,7 +2158,7 @@ bool CApplication::OnAction(const CAction &action) | |||
{ | |||
// unpause, and set the playspeed back to normal | |||
m_appPlayer.Pause(); | |||
g_audioManager.Enable(m_appPlayer.IsPaused()); | |||
CServiceBroker::GetGUI()->GetAudioManager().Enable(m_appPlayer.IsPaused()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/Application.cpp
Outdated
@@ -2869,7 +2871,7 @@ void CApplication::Stop(int exitCode) | |||
UnregisterActionListener(&m_appPlayer.GetSeekHandler()); | |||
UnregisterActionListener(&CPlayerController::GetInstance()); | |||
|
|||
g_audioManager.DeInitialize(); | |||
CServiceBroker::GetGUI()->GetAudioManager().DeInitialize(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/Application.cpp
Outdated
@@ -3205,7 +3207,7 @@ bool CApplication::PlayFile(CFileItem item, const std::string& player, bool bRes | |||
m_appPlayer.SetMute(m_muted); | |||
|
|||
#if !defined(TARGET_POSIX) | |||
g_audioManager.Enable(false); | |||
CServiceBroker::GetGUI()->GetAudioManager().Enable(false); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/Application.cpp
Outdated
@@ -3218,7 +3220,7 @@ void CApplication::PlaybackCleanup() | |||
{ | |||
if (!m_appPlayer.IsPlaying()) | |||
{ | |||
g_audioManager.Enable(true); | |||
CServiceBroker::GetGUI()->GetAudioManager().Enable(true); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
finally player will not depend on GUI. player can also be used for transcoding |
Done. Thanks for the guidance! 👍 |
Motivation and Context
Kill a global following @FernetMenta's #13724 example.
How Has This Been Tested?
Runtime tested on Ubuntu and Win10 x64.