diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-07-28 01:45:41 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-07-28 01:45:41 +0000 |
commit | 1e349540f6dfab22cac0b7bda6a7914c9de8adf5 (patch) | |
tree | 416dd0fe8f3b4885c70886804bac51f38a2fefc8 /guilib | |
parent | c8a70d982eda13181aee783f9f56c9db7404726e (diff) |
changed: Get rid of the visualisation member in GUIWindowVisualisation as it fails to track the actual visualisation held in GUIVisualisationControl. Fixes #9761.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@32238 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r-- | guilib/GUIVisualisationControl.cpp | 46 | ||||
-rw-r--r-- | guilib/GUIVisualisationControl.h | 2 |
2 files changed, 48 insertions, 0 deletions
diff --git a/guilib/GUIVisualisationControl.cpp b/guilib/GUIVisualisationControl.cpp index bcbf83361c..74b29700d5 100644 --- a/guilib/GUIVisualisationControl.cpp +++ b/guilib/GUIVisualisationControl.cpp @@ -24,6 +24,7 @@ #include "GUIUserMessages.h" #include "Application.h" #include "addons/AddonManager.h" +#include "addons/Visualisation.h" #include "utils/log.h" using namespace std; @@ -45,6 +46,51 @@ CGUIVisualisationControl::CGUIVisualisationControl(const CGUIVisualisationContro ControlType = GUICONTROL_VISUALISATION; } +bool CGUIVisualisationControl::OnMessage(CGUIMessage &message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_GET_VISUALISATION: + message.SetPointer(m_addon.get()); + return m_addon; + case GUI_MSG_VISUALISATION_RELOAD: + FreeResources(true); + return true; + case GUI_MSG_PLAYBACK_STARTED: + if (m_addon) + { + m_addon->UpdateTrack(); + return true; + } + break; + } + return CGUIRenderingControl::OnMessage(message); +} + +bool CGUIVisualisationControl::OnAction(const CAction &action) +{ + if (!m_addon) + return false; + + switch (action.GetID()) + { + case ACTION_VIS_PRESET_NEXT: + return m_addon->OnAction(VIS_ACTION_NEXT_PRESET); + case ACTION_VIS_PRESET_PREV: + return m_addon->OnAction(VIS_ACTION_PREV_PRESET); + case ACTION_VIS_PRESET_RANDOM: + return m_addon->OnAction(VIS_ACTION_RANDOM_PRESET); + case ACTION_VIS_RATE_PRESET_PLUS: + return m_addon->OnAction(VIS_ACTION_RATE_PRESET_PLUS); + case ACTION_VIS_RATE_PRESET_MINUS: + return m_addon->OnAction(VIS_ACTION_RATE_PRESET_MINUS); + case ACTION_VIS_PRESET_LOCK: + return m_addon->OnAction(VIS_ACTION_LOCK_PRESET); + default: + return CGUIRenderingControl::OnAction(action); + } +} + void CGUIVisualisationControl::Render() { if (!m_addon && g_application.IsPlayingAudio() && !m_bAttemptedLoad) diff --git a/guilib/GUIVisualisationControl.h b/guilib/GUIVisualisationControl.h index 7b5fa931b4..3d355a1bc5 100644 --- a/guilib/GUIVisualisationControl.h +++ b/guilib/GUIVisualisationControl.h @@ -30,6 +30,8 @@ public: virtual CGUIVisualisationControl *Clone() const { return new CGUIVisualisationControl(*this); }; //TODO check for naughties virtual void FreeResources(bool immediately = false); virtual void Render(); + virtual bool OnAction(const CAction &action); + virtual bool OnMessage(CGUIMessage &message); private: bool m_bAttemptedLoad; }; |