diff options
author | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-09-12 22:34:41 +0000 |
---|---|---|
committer | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-09-12 22:34:41 +0000 |
commit | 61f932e7c8eb73927e2673a1dbdb8bd88d2e69dd (patch) | |
tree | 5ef6dc808393d957d4031853702a37a80fddeea0 | |
parent | 0281b129e7bdde83400eaa9cb26d5dbe0635591a (diff) | |
download | vdr-plugin-muggle-61f932e7c8eb73927e2673a1dbdb8bd88d2e69dd.tar.gz vdr-plugin-muggle-61f932e7c8eb73927e2673a1dbdb8bd88d2e69dd.tar.bz2 |
Integrated patch from eloy for use with VDR >= 1.3.7
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@160 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r-- | vdr_menu.c | 44 | ||||
-rw-r--r-- | vdr_player.c | 24 | ||||
-rw-r--r-- | vdr_player.h | 13 |
3 files changed, 77 insertions, 4 deletions
@@ -20,6 +20,11 @@ #include <config.h> #include <plugin.h> +#if VDRVERSNUM >= 10307 +#include <vdr/interface.h> +#include <vdr/skins.h> +#endif + #include "vdr_menu.h" #include "vdr_player.h" #include "i18n.h" @@ -158,9 +163,14 @@ eOSState mgMainMenu::ProcessKey(eKeys key) char *buffer = 0; asprintf( &buffer, "%d tracks sent to current playlist", (int) tracks->size() ); m_current_playlist->appendList(tracks); +#if VDRVERSNUM >= 10307 + Skins.Message(mtInfo,buffer); + Skins.Flush(); +#else Interface->Status( buffer ); Interface->Flush(); - +#endif + free( buffer ); } else @@ -699,14 +709,22 @@ eOSState mgMainMenu::ExecutePlaylistCommand( int current ) if( command->Confirm() ) { asprintf( &buffer, "%s?", command->Title() ); +//#if VDRVERSNUM < 10307 confirmed = Interface->Confirm( buffer ); +//#else +//#endif free( buffer ); } if( confirmed ) { asprintf( &buffer, "%s...", command->Title() ); +#if VDRVERSNUM >= 10307 + Skins.Message(mtInfo,buffer); + Skins.Flush(); +#else Interface->Status( buffer ); Interface->Flush(); +#endif free( buffer ); string tmp_m3u_file = (char *) AddDirectory( cPlugin::ConfigDirectory("muggle"), "current.m3u" ); @@ -739,22 +757,36 @@ eOSState mgMainMenu::PlaylistSubmenuAction( int n ) case 0: { LoadPlaylist(); +#if VDRVERSNUM < 10307 Interface->Flush(); +#else + Skins.Flush(); +#endif // jump to playlist view from here? } break; case 1: { SavePlaylist(); +#if VDRVERSNUM >= 10307 + Skins.Message(mtInfo,"Playlist saved"); + Skins.Flush(); +#else Interface->Status( "Playlist saved"); Interface->Flush(); +#endif } break; case 2: { // renamer playlist RenamePlaylist(); // confirmation +#if VDRVERSNUM >= 10307 + Skins.Message(mtInfo,"Playlist renamed (dummy)"); + Skins.Flush(); +#else Interface->Status( "Playlist renamed (dummy)" ); Interface->Flush(); +#endif state = osContinue; } break; @@ -763,8 +795,13 @@ eOSState mgMainMenu::PlaylistSubmenuAction( int n ) m_current_playlist->clear(); // confirmation +#if VDRVERSNUM >= 10307 + Skins.Message(mtInfo,"Playlist cleared"); + Skins.Flush(); +#else Interface->Status( "Playlist cleared" ); Interface->Flush(); +#endif state = osContinue; } break; @@ -778,8 +815,13 @@ eOSState mgMainMenu::PlaylistSubmenuAction( int n ) DisplayPlaylist( m_last_osd_index ); // confirmation +#if VDRVERSNUM >= 10307 + Skins.Message(mtInfo,"Entry removed"); + Skins.Flush(); +#else Interface->Status( "Entry removed" ); Interface->Flush(); +#endif } break; case 5: { diff --git a/vdr_player.c b/vdr_player.c index 5cde3fe..6161dd9 100644 --- a/vdr_player.c +++ b/vdr_player.c @@ -196,6 +196,7 @@ public: virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame=false); // bool GetPlayInfo(cMP3PlayInfo *rm); // LVW void NewPlaylist(mgPlaylist *plist); + mgContentItem *GetCurrent () { return m_current; } }; mgPCMPlayer::mgPCMPlayer(mgPlaylist *plist) @@ -924,12 +925,29 @@ void mgPlayerControl::ShowProgress() if( !m_has_osd ) { // open the osd if its not already there... +#if VDRVERSNUM >= 10307 + osd = cOsdProvider::NewOsd (Setup.OSDLeft, Setup.OSDTop); + tArea Areas[] = { { 0, 0, Setup.OSDWidth, Setup.OSDHeight, 2 } }; + osd->SetAreas(Areas,sizeof(Areas)/sizeof(tArea)); + font = cFont::GetFont (fontOsd); +#else Interface->Open(); +#endif m_has_osd = true; } // now an osd is open, go on +#if VDRVERSNUM >= 10307 + int w = Setup.OSDWidth; + int h = Setup.OSDHeight; + osd->DrawRectangle (0, 0, w - 1, h - 1, clrGray50); + mgContentItem *item = m_player->GetCurrent (); + string msg = item->getGenre () + " " + item->getTitle (); + osd->DrawText (0, h - font->Height () - 2, msg.c_str (), clrBlack, clrCyan, + cFont::GetFont (fontOsd), w, font->Height () + 2, taCenter); + osd->Flush(); +#else int w = Interface->Width(); int h = Interface->Height(); @@ -939,6 +957,7 @@ void mgPlayerControl::ShowProgress() // Add: progress bar Interface->Flush(); +#endif } else { @@ -950,7 +969,12 @@ void mgPlayerControl::Hide() { if( m_has_osd ) { +#if VDRVERSNUM >= 10307 + osd->Flush(); + delete osd; +#else Interface->Close(); +#endif m_has_osd = false; } } diff --git a/vdr_player.h b/vdr_player.h index 6ce2f1b..b7ec374 100644 --- a/vdr_player.h +++ b/vdr_player.h @@ -3,11 +3,11 @@ * \brief A player/control combination to let VDR play music * * \version $Revision: 1.2 $ - * \date $Date: 2004/05/28 15:29:19 $ + * \date $Date$ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author Responsible author: $Author: lvw $ + * \author Responsible author: $Author$ * - * $Id: vdr_player.h,v 1.2 2004/05/28 15:29:19 lvw Exp $ + * $Id$ * * Adapted from * MP3/MPlayer plugin to VDR (C++) @@ -19,6 +19,9 @@ #define ___DVB_MP3_H #include <player.h> +#if VDRVERSNUM >= 10307 +class cOsd; +#endif // ------------------------------------------------------------------- @@ -45,6 +48,10 @@ private: //! \brief indicates, whether an osd is currently displayed bool m_has_osd; +#if VDRVERSNUM >= 10307 + cOsd *osd; + const cFont *font; +#endif public: |