[adsp] cleanup system start way
authorAlwin Esch <alwin.esch@web.de>
Fri, 16 Oct 2015 14:45:54 +0000 (16:45 +0200)
committerAlwin Esch <alwin.esch@web.de>
Sat, 28 Nov 2015 12:01:23 +0000 (13:01 +0100)
xbmc/Application.cpp
xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.cpp
xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.h
xbmc/messaging/ApplicationMessenger.h

index 09a45e4..bf7932e 100644 (file)
@@ -443,7 +443,6 @@ bool CApplication::Create()
   CApplicationMessenger::GetInstance().RegisterReceiver(this);
   CApplicationMessenger::GetInstance().RegisterReceiver(&g_playlistPlayer);
   CApplicationMessenger::GetInstance().RegisterReceiver(&g_infoManager);
-  CApplicationMessenger::GetInstance().RegisterReceiver(&g_AEDSPManager);
 
   for (int i = RES_HDTV_1080i; i <= RES_PAL60_16x9; i++)
   {
@@ -2569,6 +2568,13 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg)
       StopPVRManager();
     break;
 
+  case TMSG_SETAUDIODSPSTATE:
+    if(pMsg->param1 == ACTIVE_AE_DSP_STATE_ON)
+      ActiveAE::CActiveAEDSP::GetInstance().Activate(pMsg->param2 == ACTIVE_AE_DSP_ASYNC_ACTIVATE);
+    else if(pMsg->param1 == ACTIVE_AE_DSP_STATE_OFF)
+      ActiveAE::CActiveAEDSP::GetInstance().Deactivate();
+    break;
+
   case TMSG_START_ANDROID_ACTIVITY:
   {
 #if defined(TARGET_ANDROID)
index 37c4c7d..70d17bf 100644 (file)
@@ -86,42 +86,6 @@ CActiveAEDSP &CActiveAEDSP::GetInstance()
 }
 //@}
 
-/*! @name message handling methods */
-//@{
-void CActiveAEDSP::OnApplicationMessage(KODI::MESSAGING::ThreadMessage* pMsg)
-{
-  switch(pMsg->dwMessage)
-  {
-    case TMSG_SETAUDIODSPSTATE:
-      if(pMsg->param1 == ACTIVE_AE_DSP_STATE_ON)
-      {
-        if(pMsg->param2 == ACTIVE_AE_DSP_ASYNC_ACTIVATE)
-        {
-          Activate(true);
-        }
-        else
-        {
-          Activate();
-        }
-      }
-      else if(pMsg->param1 == ACTIVE_AE_DSP_STATE_OFF)
-      {
-        Deactivate();
-      }
-    break;
-
-    default:
-      CLog::Log(LOGERROR, "CActiveAEDSP received a invalid message! Nothing is processed.");
-    break;
-  }
-}
-
-int CActiveAEDSP::GetMessageMask()
-{
-  return TMSG_MASK_AUDIO_DSP;
-}
-//@}
-
 /*! @name initialization and configuration methods */
 //@{
 class CActiveAEDSPStartJob : public CJob
index 74f7ab6..a9ad8f6 100644 (file)
 #include "ActiveAEDSPDatabase.h"
 #include "ActiveAEDSPMode.h"
 
-#define ACTIVE_AE_DSP_STATE_ON  0
-#define ACTIVE_AE_DSP_STATE_OFF 1
-#define ACTIVE_AE_DSP_SYNC_ACTIVATE  0
+#define ACTIVE_AE_DSP_STATE_OFF       0
+#define ACTIVE_AE_DSP_STATE_ON        1
+
+#define ACTIVE_AE_DSP_SYNC_ACTIVATE   0
 #define ACTIVE_AE_DSP_ASYNC_ACTIVATE  1
 
 extern "C" {
@@ -61,7 +62,6 @@ namespace ActiveAE
   class CActiveAEDSP : public ADDON::IAddonMgrCallback,
                        public ISettingCallback,
                        public Observer,
-                       public KODI::MESSAGING::IMessageTarget,
                        private CThread
   {
   /*! @name Master audio dsp control class */
@@ -85,12 +85,6 @@ namespace ActiveAE
     static CActiveAEDSP &GetInstance();
   //@}
 
-  /*! @name message handling methods */
-  //@{
-    virtual void OnApplicationMessage(KODI::MESSAGING::ThreadMessage* pMsg) override;
-    virtual int  GetMessageMask() override;
-  //@}
-
   /*! @name initialization and configuration methods */
   //@{
     /*!
index 4db94b7..b54b1c8 100644 (file)
@@ -36,7 +36,6 @@
 #define TMSG_MASK_GUIINFOMANAGER          (1<<28)
 #define TMSG_MASK_WINDOWMANAGER           (1<<27)
 #define TMSG_MASK_PERIPHERALS             (1<<26)
-#define TMSG_MASK_AUDIO_DSP               (1<<25)
 
 // defines here
 #define TMSG_PLAYLISTPLAYER_PLAY          TMSG_MASK_PLAYLISTPLAYER + 0
@@ -90,8 +89,7 @@
 #define TMSG_PICTURE_SLIDESHOW            TMSG_MASK_APPLICATION + 26
 #define TMSG_LOADPROFILE                  TMSG_MASK_APPLICATION + 27
 #define TMSG_VIDEORESIZE                  TMSG_MASK_APPLICATION + 28
-
-#define TMSG_SETAUDIODSPSTATE             TMSG_MASK_AUDIO_DSP   + 0
+#define TMSG_SETAUDIODSPSTATE             TMSG_MASK_APPLICATION + 29
 
 #define TMSG_GUI_INFOLABEL                TMSG_MASK_GUIINFOMANAGER + 0
 #define TMSG_GUI_INFOBOOL                 TMSG_MASK_GUIINFOMANAGER + 1