---
 libs/libmyth/mythplugin.cpp          |   35 	35 +	0 -	0 !
 libs/libmyth/mythplugin.h            |   18 	13 +	5 -	0 !
 libs/libmyth/mythpluginapi.h         |    2 	2 +	0 -	0 !
 libs/libmythbase/mythcorecontext.cpp |    7 	0 +	7 -	0 !
 libs/libmythbase/mythcorecontext.h   |    1 	0 +	1 -	0 !
 libs/libmythbase/mythobservable.cpp  |   21 	1 +	20 -	0 !
 libs/libmythbase/mythobservable.h    |    1 	0 +	1 -	0 !
 libs/libmythbase/mythversion.h       |    2 	1 +	1 -	0 !
 libs/libmythbase/util.cpp            |    8 	4 +	4 -	0 !
 9 files changed, 56 insertions(+), 39 deletions(-)

Index: mythtv/libs/libmythbase/mythcorecontext.cpp
===================================================================
--- mythtv.orig/libs/libmythbase/mythcorecontext.cpp	2011-12-05 19:10:21.000000000 -0500
+++ mythtv/libs/libmythbase/mythcorecontext.cpp	2011-12-05 19:10:54.000000000 -0500
@@ -1112,13 +1112,6 @@ void MythCoreContext::dispatch(const Myt
     MythObservable::dispatch(event);
 }
 
-void MythCoreContext::dispatchNow(const MythEvent &event)
-{
-    LOG(VB_NETWORK, LOG_INFO, QString("MythEvent: %1").arg(event.Message()));
-
-    MythObservable::dispatchNow(event);
-}
-
 void MythCoreContext::SetLocalHostname(const QString &hostname)
 {
     QMutexLocker locker(&d->m_hostnameLock);
Index: mythtv/libs/libmythbase/mythcorecontext.h
===================================================================
--- mythtv.orig/libs/libmythbase/mythcorecontext.h	2011-12-05 19:10:21.000000000 -0500
+++ mythtv/libs/libmythbase/mythcorecontext.h	2011-12-05 19:10:54.000000000 -0500
@@ -151,7 +151,6 @@ class MBASE_PUBLIC MythCoreContext : pub
     void OverrideSettingForSession(const QString &key, const QString &value);
 
     void dispatch(const MythEvent &event);
-    void dispatchNow(const MythEvent &event) MDEPRECATED;
 
     void InitLocale(void);
     const MythLocale *GetLocale(void) const;
Index: mythtv/libs/libmythbase/mythobservable.cpp
===================================================================
--- mythtv.orig/libs/libmythbase/mythobservable.cpp	2011-12-05 19:10:21.000000000 -0500
+++ mythtv/libs/libmythbase/mythobservable.cpp	2011-12-05 19:10:54.000000000 -0500
@@ -12,9 +12,7 @@
  *  events to listening QObjects.
  *
  *  MythEvents can be dispatched to all listeners by calling dispatch
- *  or dispatchNow. The former is much preferred as it uses
- *  QCoreApplication::postEvent() while the latter uses the blocking
- *  QCoreApplication::sendEvent().
+ *  which uses QCoreApplication::postEvent()
  *
  *  The name MythObservable is 'wrong', since all the methods refer to
  *  the observers as listeners (ie. addListener), however,
@@ -85,20 +83,3 @@ void MythObservable::dispatch(const Myth
     for (; it != m_listeners.end() ; ++it)
         QCoreApplication::postEvent(*it, event.clone());
 }
-
-/** \brief Dispatch an event to all listeners
- *
- *  This sends an event using the current thread, this is
- *  almost always unsafe.
- *
- *  \param event a MythEvent to dispatch.
- */
-void MythObservable::dispatchNow(const MythEvent &event)
-{
-    QMutexLocker locker(m_lock);
-
-    QSet<QObject*>::const_iterator it = m_listeners.begin();
-    for (; it != m_listeners.end() ; ++it)
-        QCoreApplication::sendEvent(*it, event.clone());
-}
-
Index: mythtv/libs/libmythbase/mythobservable.h
===================================================================
--- mythtv.orig/libs/libmythbase/mythobservable.h	2011-12-05 19:10:21.000000000 -0500
+++ mythtv/libs/libmythbase/mythobservable.h	2011-12-05 19:10:54.000000000 -0500
@@ -18,7 +18,6 @@ class MBASE_PUBLIC MythObservable
     void removeListener(QObject *listener);
 
     void dispatch(const MythEvent &event);
-    void dispatchNow(const MythEvent &event) MDEPRECATED;
 
     bool hasListeners(void) { return !m_listeners.isEmpty(); }
 
Index: mythtv/libs/libmythbase/util.cpp
===================================================================
--- mythtv.orig/libs/libmythbase/util.cpp	2011-12-05 19:10:21.000000000 -0500
+++ mythtv/libs/libmythbase/util.cpp	2011-12-05 19:12:40.000000000 -0500
@@ -43,6 +43,8 @@ using namespace std;
 
 // Myth headers
 #include "mythcorecontext.h"
+#include "mythcontext.h"
+#include "mythplugin.h"
 #include "exitcodes.h"
 #include "mythlogging.h"
 #include "msocketdevice.h"
@@ -1118,14 +1120,12 @@ QString getSymlinkTarget(const QString &
 
 void sendPlaybackStart(void)
 {
-    MythEvent me(QString("PLAYBACK_START %1").arg(gCoreContext->GetHostName()));
-    gCoreContext->dispatchNow(me);
+    gContext->getPluginManager()->PauseAllPlugins();
 }
 
 void sendPlaybackEnd(void)
 {
-    MythEvent me(QString("PLAYBACK_END %1").arg(gCoreContext->GetHostName()));
-    gCoreContext->dispatchNow(me);
+    gContext->getPluginManager()->ResumeAllPlugins();
 }
 
 bool IsMACAddress(QString MAC)
Index: mythtv/libs/libmyth/mythpluginapi.h
===================================================================
--- mythtv.orig/libs/libmyth/mythpluginapi.h	2011-12-05 19:10:21.000000000 -0500
+++ mythtv/libs/libmyth/mythpluginapi.h	2011-12-05 19:10:54.000000000 -0500
@@ -7,6 +7,8 @@
 extern "C" {
     MPUBLIC int mythplugin_init(const char *);
     MPUBLIC int mythplugin_run();
+    MPUBLIC void mythplugin_pause();
+    MPUBLIC void mythplugin_resume();
     MPUBLIC int mythplugin_config();
     MPUBLIC MythPluginType mythplugin_type();
     MPUBLIC void mythplugin_destroy();
Index: mythtv/libs/libmyth/mythplugin.cpp
===================================================================
--- mythtv.orig/libs/libmyth/mythplugin.cpp	2011-12-05 19:10:21.000000000 -0500
+++ mythtv/libs/libmyth/mythplugin.cpp	2011-12-05 19:10:54.000000000 -0500
@@ -68,6 +68,24 @@ int MythPlugin::run(void)
     return rVal;
 }
 
+void MythPlugin::pause(void)
+{
+    typedef int (*PluginPauseFunc)();
+    PluginPauseFunc rfunc = (PluginPauseFunc)QLibrary::resolve("mythplugin_pause");
+
+    if (rfunc)
+        rfunc();
+}
+
+void MythPlugin::resume(void)
+{
+    typedef int (*PluginResumeFunc)();
+    PluginResumeFunc rfunc = (PluginResumeFunc)QLibrary::resolve("mythplugin_resume");
+
+    if (rfunc)
+        rfunc();
+}
+
 int MythPlugin::config(void)
 {
     typedef int (*PluginConfigFunc)();
@@ -327,3 +345,20 @@ QStringList MythPluginManager::Enumerate
     return ret;
 }
 
+void MythPluginManager::PauseAllPlugins(void)
+{
+    QHash<QString, MythPlugin*>::iterator it = m_dict.begin();
+    for (; it != m_dict.end(); ++it)
+    {
+        (*it)->pause();
+    }
+}
+
+void MythPluginManager::ResumeAllPlugins(void)
+{
+    QHash<QString, MythPlugin*>::iterator it = m_dict.begin();
+    for (; it != m_dict.end(); ++it)
+    {
+        (*it)->resume();
+    }
+}
Index: mythtv/libs/libmyth/mythplugin.h
===================================================================
--- mythtv.orig/libs/libmyth/mythplugin.h	2011-12-05 19:10:21.000000000 -0500
+++ mythtv/libs/libmyth/mythplugin.h	2011-12-05 19:10:54.000000000 -0500
@@ -30,7 +30,13 @@ class MythPlugin : public QLibrary
 
     // This method will call the mythplugin_run() function of the library.
     int run(void);
- 
+
+    // This method will call the mythplugin_pause() function of the library.
+    void pause(void);
+
+    // This method will call the mythplugin_resume() function of the library.
+    void resume(void);
+
     // This method will call the mythplugin_config() function of the library.
     int config(void);
 
@@ -67,10 +73,10 @@ class MythPlugin : public QLibrary
 // this should only be instantiated through MythContext.
 class MPUBLIC MythPluginManager
 {
-  public:   
+  public:
     MythPluginManager();
    ~MythPluginManager();
-   
+
     bool init_plugin(const QString &plugname);
     bool run_plugin(const QString &plugname);
     bool config_plugin(const QString &plugname);
@@ -82,10 +88,12 @@ class MPUBLIC MythPluginManager
 
     QStringList EnumeratePlugins(void);
     void DestroyAllPlugins();
-     
+    void PauseAllPlugins();
+    void ResumeAllPlugins();
+
   private:
     QHash<QString,MythPlugin*> m_dict;
-   
+
     QMap<QString, MythPlugin *> moduleMap;
     QMap<QString, MythPlugin *> menuPluginMap;
     vector<MythPlugin*> menuPluginList;
Index: mythtv/libs/libmythbase/mythversion.h
===================================================================
--- mythtv.orig/libs/libmythbase/mythversion.h	2011-12-05 19:10:21.000000000 -0500
+++ mythtv/libs/libmythbase/mythversion.h	2011-12-05 19:10:54.000000000 -0500
@@ -12,7 +12,7 @@
 /// Update this whenever the plug-in API changes.
 /// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
 /// libmythui class methods used by plug-ins.
-#define MYTH_BINARY_VERSION "0.25.20111201-1"
+#define MYTH_BINARY_VERSION "0.25.20111205-1"
 
 /** \brief Increment this whenever the MythTV network protocol changes.
  *
