Skip to content

Commit

Permalink
Renamed GetInstance to Get
Browse files Browse the repository at this point in the history
  • Loading branch information
Paxxi committed Mar 2, 2015
1 parent 5a7ab40 commit 821575a
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 17 deletions.
13 changes: 7 additions & 6 deletions xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ bool CApplication::OnEvent(XBMC_Event& newEvent)
case XBMC_MOUSEBUTTONUP:
case XBMC_MOUSEMOTION:
g_Mouse.HandleEvent(newEvent);
CInputManager::GetInstance().ProcessMouse(g_windowManager.GetActiveWindowID());
CInputManager::Get().ProcessMouse(g_windowManager.GetActiveWindowID());
break;
case XBMC_VIDEORESIZE:
if (!g_application.m_bInitializing &&
Expand Down Expand Up @@ -913,6 +913,7 @@ bool CApplication::CreateGUI()
if (!CButtonTranslator::GetInstance().Load())
return false;


RESOLUTION_INFO info = g_graphicsContext.GetResInfo();
CLog::Log(LOGINFO, "GUI format %ix%i, Display %s",
info.iWidth,
Expand Down Expand Up @@ -1318,7 +1319,7 @@ bool CApplication::Initialize()
ResetScreenSaver();

#ifdef HAS_SDL_JOYSTICK
CInputManager::GetInstance().SetEnabledJoystick(CSettings::Get().GetBool("input.enablejoystick") &&
CInputManager::Get().SetEnabledJoystick(CSettings::Get().GetBool("input.enablejoystick") &&
CPeripheralImon::GetCountOfImonsConflictWithDInput() == 0 );
#endif

Expand Down Expand Up @@ -2670,10 +2671,10 @@ void CApplication::FrameMove(bool processEvents, bool processGUI)
#endif

// process input actions
CInputManager::GetInstance().ProcessRemote(g_windowManager.GetActiveWindowID());
CInputManager::GetInstance().ProcessGamepad(g_windowManager.GetActiveWindowID());
CInputManager::GetInstance().ProcessEventServer(g_windowManager.GetActiveWindowID(), frameTime);
CInputManager::GetInstance().ProcessPeripherals(frameTime);
CInputManager::Get().ProcessRemote(g_windowManager.GetActiveWindowID());
CInputManager::Get().ProcessGamepad(g_windowManager.GetActiveWindowID());
CInputManager::Get().ProcessEventServer(g_windowManager.GetActiveWindowID(), frameTime);
CInputManager::Get().ProcessPeripherals(frameTime);
if (processGUI && m_renderGUI)
{
m_pInertialScrollingHandler->ProcessInertialScroll(frameTime);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/input/InputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ using namespace EVENTSERVER;

using namespace PERIPHERALS;

CInputManager& CInputManager::GetInstance()
CInputManager& CInputManager::Get()
{
static CInputManager inputManager;
return inputManager;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/input/InputManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CInputManager
public:
/*! \brief static method to get the current instance of the class. Creates a new instance the first time it's called.
*/
static CInputManager& GetInstance();
static CInputManager& Get();

/*! \brief decode an input event from remote controls.
Expand Down
2 changes: 1 addition & 1 deletion xbmc/peripherals/devices/PeripheralImon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void CPeripheralImon::ActionOnImonConflict(bool deviceInserted /*= true*/)
bool enableJoystickNow = !deviceInserted && CSettings::Get().GetBool("input.enablejoystick");
CLog::Log(LOGNOTICE, "Problematic iMON hardware %s. Joystick usage: %s", (deviceInserted ? "detected" : "was removed"),
(enableJoystickNow) ? "enabled." : "disabled." );
CInputManager::GetInstance().SetEnabledJoystick(enableJoystickNow);
CInputManager::Get().SetEnabledJoystick(enableJoystickNow);
#endif
}
}
Expand Down
4 changes: 2 additions & 2 deletions xbmc/settings/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void CSettings::Uninitialize()
m_settingsManager->UnregisterCallback(&g_graphicsContext);
m_settingsManager->UnregisterCallback(&g_langInfo);
#if defined(TARGET_WINDOWS) || defined(HAS_SDL_JOYSTICK)
m_settingsManager->UnregisterCallback(&CInputManager::GetInstance().m_Joystick);
m_settingsManager->UnregisterCallback(&CInputManager::Get().m_Joystick);
#endif
m_settingsManager->UnregisterCallback(&g_Mouse);
m_settingsManager->UnregisterCallback(&CNetworkServices::Get());
Expand Down Expand Up @@ -762,7 +762,7 @@ void CSettings::InitializeISettingCallbacks()
#if defined(HAS_SDL_JOYSTICK)
settingSet.clear();
settingSet.insert("input.enablejoystick");
m_settingsManager->RegisterCallback(&CInputManager::GetInstance().m_Joystick, settingSet);
m_settingsManager->RegisterCallback(&CInputManager::Get().m_Joystick, settingSet);
#endif

settingSet.clear();
Expand Down
2 changes: 1 addition & 1 deletion xbmc/windowing/WinEventsSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ bool CWinEventsSDL::MessagePump()
case SDL_JOYHATMOTION:
case SDL_JOYDEVICEADDED:
case SDL_JOYDEVICEREMOVED:
CInputManager::GetInstance().UpdateJoystick(event);
CInputManager::Get().UpdateJoystick(event);
ret = true;
break;
#endif
Expand Down
2 changes: 1 addition & 1 deletion xbmc/windowing/WinEventsX11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ bool CWinEventsX11Imp::MessagePump()
case SDL_JOYHATMOTION:
case SDL_JOYDEVICEADDED:
case SDL_JOYDEVICEREMOVED:
CInputManager::GetInstance().UpdateJoystick(event);
CInputManager::Get().UpdateJoystick(event);
ret = true;
break;

Expand Down
2 changes: 1 addition & 1 deletion xbmc/windowing/android/WinEventsAndroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ bool CWinEventsAndroid::MessagePump()

if (fabs(amount) >= ALMOST_ZERO)
{
ret |= CInputManager::GetInstance().ProcessJoystickEvent(g_windowManager.GetActiveWindowID(),
ret |= CInputManager::Get().ProcessJoystickEvent(g_windowManager.GetActiveWindowID(),
input_device.name, item, input_type, amount, holdTime);
}
}
Expand Down
2 changes: 1 addition & 1 deletion xbmc/windowing/osx/WinEventsIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
unsigned int holdTime = pumpEvent.jbutton.holdTime;

CLog::Log(LOGDEBUG,"CWinEventsIOS: Button press keyID = %i", wKeyID);
ret |= CInputManager::GetInstance().ProcessJoystickEvent(g_windowManager.GetActiveWindowID(), joystickName, wKeyID, JACTIVE_BUTTON, fAmount, holdTime);
ret |= CInputManager::Get().ProcessJoystickEvent(g_windowManager.GetActiveWindowID(), joystickName, wKeyID, JACTIVE_BUTTON, fAmount, holdTime);
}
else
ret |= g_application.OnEvent(pumpEvent);
Expand Down
4 changes: 2 additions & 2 deletions xbmc/windowing/windows/WinEventsWin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
case WM_ACTIVATE:
{
if( WA_INACTIVE != wParam )
CInputManager::GetInstance().ReInitializeJoystick();
CInputManager::Get().ReInitializeJoystick();

bool active = g_application.GetRenderGUI();
if (HIWORD(wParam))
Expand Down Expand Up @@ -761,7 +761,7 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
if (((_DEV_BROADCAST_HEADER*) lParam)->dbcd_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
{
g_peripherals.TriggerDeviceScan(PERIPHERAL_BUS_USB);
CInputManager::GetInstance().ReInitializeJoystick();
CInputManager::Get().ReInitializeJoystick();
}
// check if an usb or optical media was inserted or removed
if (((_DEV_BROADCAST_HEADER*) lParam)->dbcd_devicetype == DBT_DEVTYP_VOLUME)
Expand Down

0 comments on commit 821575a

Please sign in to comment.