Ticket #4222: 072-musichide.patch

File 072-musichide.patch, 4.2 KB (added by Bill <cizek@…>, 13 years ago)
  • mythplugins/mythmusic/mythmusic/main.cpp

    diff -r -u -X diff.exclude myth.14972.1127a/mythplugins/mythmusic/mythmusic/main.cpp myth.14972.1127b/mythplugins/mythmusic/mythmusic/main.cpp
     
    512512    return 0;
    513513}
    514514
     515int mythplugin_pause(void)
     516{
     517    if (gPlayer)
     518       gPlayer->stop(true);
     519    return 0;
     520}
     521
     522int mythplugin_resume(void)
     523{
     524    showMiniPlayer();
     525    return 0;
     526}
     527
     528
     529
    515530int mythplugin_config(void)
    516531{
    517532    MusicData *mdata = new MusicData();
  • mythtv/libs/libmyth/mythplugin.cpp

    diff -r -u -X diff.exclude myth.14972.1127a/mythtv/libs/libmyth/mythplugin.cpp myth.14972.1127b/mythtv/libs/libmyth/mythplugin.cpp
     
    4747        rfunc();
    4848}
    4949
     50void MythPlugin::pause(void)
     51{
     52    typedef int (*PluginPauseFunc)();
     53    PluginPauseFunc rfunc = (PluginPauseFunc)QLibrary::resolve("mythplugin_pause");
     54
     55    if (rfunc)
     56        rfunc();
     57}
     58
     59void MythPlugin::resume(void)
     60{
     61    typedef int (*PluginResumeFunc)();
     62    PluginResumeFunc rfunc = (PluginResumeFunc)QLibrary::resolve("mythplugin_resume");
     63
     64    if (rfunc)
     65        rfunc();
     66}
     67
    5068void MythPlugin::config(void)
    5169{
    5270    typedef int (*PluginConfigFunc)();
     
    283301    menuPluginList.clear();
    284302}
    285303
     304void MythPluginManager::PauseAllPlugins(void)
     305{
     306    QDictIterator<MythPlugin> it(m_dict);
     307    for (; it.current(); ++it)
     308    {
     309        MythPlugin *plugin = it.current();
     310        plugin->pause();
     311    }
     312}
     313
     314void MythPluginManager::ResumeAllPlugins(void)
     315{
     316    QDictIterator<MythPlugin> it(m_dict);
     317    for (; it.current(); ++it)
     318    {
     319        MythPlugin *plugin = it.current();
     320        plugin->resume();
     321    }
     322}
     323
  • mythtv/libs/libmyth/mythplugin.h

    diff -r -u -X diff.exclude myth.14972.1127a/mythtv/libs/libmyth/mythplugin.h myth.14972.1127b/mythtv/libs/libmyth/mythplugin.h
     
    2828
    2929    // This method will call the mythplugin_run() function of the library.
    3030    void run(void);
     31
     32    // This method will call the mythplugin_pause() function of the library.
     33    void pause(void);
     34
     35    // This method will call the mythplugin_resume() function of the library.
     36    void resume(void);
    3137 
    3238    // This method will call the mythplugin_config() function of the library.
    3339    void config(void);
     
    7682    MythPlugin *GetMenuPluginAt(int pos);
    7783
    7884    void DestroyAllPlugins();
     85    void PauseAllPlugins();
     86    void ResumeAllPlugins();
    7987     
    8088  private:
    8189    QDict<MythPlugin> m_dict;
  • mythtv/libs/libmyth/mythpluginapi.h

    diff -r -u -X diff.exclude myth.14972.1127a/mythtv/libs/libmyth/mythpluginapi.h myth.14972.1127b/mythtv/libs/libmyth/mythpluginapi.h
     
    77extern "C" {
    88    MPUBLIC int mythplugin_init(const char *);
    99    MPUBLIC int mythplugin_run();
     10    MPUBLIC int mythplugin_pause();
     11    MPUBLIC int mythplugin_resume();
    1012    MPUBLIC int mythplugin_config();
    1113    MPUBLIC MythPluginType mythplugin_type();
    1214    MPUBLIC void mythplugin_destroy();
  • mythtv/libs/libmythtv/tv_play.cpp

    diff -r -u -X diff.exclude myth.14972.1127a/mythtv/libs/libmythtv/tv_play.cpp myth.14972.1127b/mythtv/libs/libmythtv/tv_play.cpp
     
    4141#include "datadirect.h"
    4242#include "sourceutil.h"
    4343#include "util-osx-cocoa.h"
     44#include "mythplugin.h"
    4445
    4546#ifndef HAVE_ROUND
    4647#define round(x) ((int) ((x) + 0.5))
     
    11611162        }
    11621163
    11631164        gContext->DisableScreensaver();
     1165        gContext->getPluginManager()->PauseAllPlugins();
    11641166
    11651167        bool ok = false;
    11661168        if (playbackinfo && StartRecorder(recorder,-1))
     
    12171219        if (prbuffer->IsOpen())
    12181220        {
    12191221            gContext->DisableScreensaver();
     1222            gContext->getPluginManager()->PauseAllPlugins();
    12201223   
    12211224            if (desiredNextState == kState_WatchingRecording)
    12221225            {