summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b>2004-10-10 13:19:29 +0000
committerlvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b>2004-10-10 13:19:29 +0000
commit72d3dbcc1ae7d3423d65a3ce0464e1995a91da25 (patch)
tree9d796d0d5ab5053b6b45e7216f5b0a5df29cce3a
parent9775819bdc8d469e0d386612f7062140870f1496 (diff)
downloadvdr-plugin-muggle-72d3dbcc1ae7d3423d65a3ce0464e1995a91da25.tar.gz
vdr-plugin-muggle-72d3dbcc1ae7d3423d65a3ce0464e1995a91da25.tar.bz2
Greatly improved progress/info display during play
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@218 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r--TODO132
-rwxr-xr-xmg_content_interface.c14
-rwxr-xr-xmg_content_interface.h18
-rw-r--r--mg_playlist.c21
-rw-r--r--mg_playlist.h6
-rw-r--r--vdr_decoder_mp3.c24
-rw-r--r--vdr_player.c273
-rw-r--r--vdr_player.h9
8 files changed, 320 insertions, 177 deletions
diff --git a/TODO b/TODO
index 0c2ef61..764986f 100644
--- a/TODO
+++ b/TODO
@@ -7,13 +7,11 @@
If you feel, something is really urgent, go ahead. We'll help you.
- \section urgent Urgent issues
+ \section urgent Urgent/Short-term issues
\subsection bugs Bugs and testing needed
- - Test execution of playlist commands
- - Playlist view: start at selected on Ok
-
+ - Test execution of playlist commands
- Crashes in filter selections?
- Keep this? Test mgPCMPlayer::getSourceFile() for GD case (find)
@@ -47,7 +45,7 @@
\subsection urgentcontent Content handling
- Think, whether type (mp3, ogg, flac) should be stored in database
- could be used in searching/structuring as well
- - Handle loop mode in mgPlaylist (already done?)
+ - Handle loop mode in mgPlaylist
- Handle shuffle mode in mgPlaylist
- shuffle mode on
- for next file:
@@ -69,12 +67,6 @@
\subsection urgentplayer Player extensions
- - Toggle Track view/playlist view (red)
- - For playlist view show playlist name, total time
- - For track view show name, artist, time
- - Toggle detail/progress view (green)
- - Track view: all metadata
- - Playlist view: all tracks, skip/jump
- Determine max. framecount (needed for rewinding)?
- Init scale/level/normalize?
- The max. level should be recognized during play
@@ -139,8 +131,8 @@
- really abstract from specific queries etc.
- mgDatabase should completely abstract database (mySQL) stuff!?
- - read/write queries
- - return results (needs a homogeneous representation of results?)
+ - read/write queries
+ - return results (needs a homogeneous representation of results?)
\subsection midosd OSD-related issues
@@ -149,7 +141,6 @@
- Check whether submenus (as implemented in VDR) are more suitable
- do not permit jumping to arbitrary menus though
- Add play indicators
- - mgPCMPlayer::GetIndex: obtain total length from database (DONE)
- Toggle display with Ok (off -> track info -> album info -> playlist info -> off)
- Display track info (use vdr 1.3.12 progress display)
- Song title
@@ -204,60 +195,67 @@
\section done Done
- - Check play speed (was XINE related)
- - Playlists starts with 2nd song (DONE)
- - Export playlists
- - Delete selected item
- - Add command line option for top level directory
- - prepended to filename in non-GD-mode
- - searched in GD-mode
- - Edit playlist (move tracks like channels in VDR channel list)
+ - BUG: Check play speed (was XINE related)
+ - BUG: Playlists starts with 2nd song (DONE)
+ - Export playlists
+ - Delete selected item
+ - Add command line option for top level directory
+ - Prepend top level dir to filename in non-GD-mode
+ - Edit playlist (move tracks like channels in VDR channel list)
(OK in playlist view)
- - Instant play = empty current playlist, append tracks of current node and play
+ - Instant play = empty current playlist, append tracks of current node and play
(easy, in submenu of browser)
- - Clear playlist (submenu action)
- - Find files from database entry based on GD compatibility flag
- - Handle Next/PrevFile in mgPlaylist (vdr_player.c)
- - Add plugin parameters for database name/host/user/pass
- - Add plugin parameter for GD filename compatibility
- - handle filters:
- - create tracklist from filter
- - create tree from filter
- - i18n (english and german)
- - Album import
- - Various artists
- - Ogg/Vorbis decoder integration
- - cOggFile kept
- - cOggInfo dismissed in favor of obtaining info from DB
- - coding conventions adapted
- - Schema extended to keep audio properties
- - Import (mugglei) extended to store audio properties in DB
- (most notably samplerate, no. channels)
- - Extended mgContentItem with audio properties
- - Extended mgGdTrack with audio properties (bitrate, samplerate, channels)
- - in mgPCMPlayer/vdr_player.c:
- - pass m_playing to mp3/ogg decoder (instead of filename)
- - mgOggDecoder: obtain audio properties from DB (channels, sampling rate via mgContentItem)
- - mgPCMPlayer::getSourceFile moved to abstract data layer (mgContentItem)
- and made concrete in subclasses (mgGdTrack)
- - mgDecoders::findDecoder: extend decoder detection
- - Check compatibility for 1.3.12 (DONE)
- - Test Save/Rename/Load of playlist (DONE)
- - Plugin crashes when deleting playlist while playing
- - should stop playing immediately
- - Check deletion of entries while playing
- - only allowed, if item is not currently played
- - adapt index in playlist
- - Playlist indexing not correct
- - Player jumps e.g. from track 1 to track 3
- - Make sure jumping beyond the end of the list is not permitted
- - Plugin crashes when selecting entries with special characters
- - Escape query strings correctly
- - should go into gd_content_interface.c (row[] in lines 1175,1179,1882)?
- - Simple progress indicator for 1.3.12
- - Attach to graphlcd plugin via replay string
- - Test Instant play from browser view
- - Menu while progress display is active
- - Check int/unsigned stuff in mg_playlist
+ - Clear playlist (submenu action)
+ - Find files from database entry based on GD compatibility flag
+ - Handle Next/PrevFile in mgPlaylist (vdr_player.c)
+ - Add plugin parameters for database name/host/user/pass
+ - Add plugin parameter for GD filename compatibility
+ - handle filters:
+ - create tracklist from filter
+ - create tree from filter
+ - i18n (english and german)
+ - Album import
+ - Various artists import (assorted)
+ - Ogg/Vorbis decoder integration
+ - cOggFile kept
+ - cOggInfo dismissed in favor of obtaining info from DB
+ - coding conventions adapted
+ - Schema extended to keep audio properties
+ - Import (mugglei) extended to store audio properties in DB
+ (most notably samplerate, no. channels)
+ - Extended mgContentItem with audio properties
+ - Extended mgGdTrack with audio properties (bitrate, samplerate, channels)
+ - in mgPCMPlayer/vdr_player.c:
+ - pass m_playing to mp3/ogg decoder (instead of filename)
+ - mgOggDecoder: obtain audio properties from DB (channels, sampling rate via mgContentItem)
+ - mgPCMPlayer::getSourceFile moved to abstract data layer (mgContentItem)
+ and made concrete in subclasses (mgGdTrack)
+ - mgDecoders::findDecoder: extend decoder detection
+ - BUG: Check compatibility for 1.3.12 (DONE)
+ - BUG: Plugin crashes when deleting playlist while playing
+ - should stop playing immediately or not permit this
+ - BUG: Check deletion of entries while playing
+ - only allowed, if item is not currently played
+ - adapt index in playlist
+ - BUG: Playlist indexing not correct
+ - Player jumps e.g. from track 1 to track 3
+ - Make sure jumping beyond the end of the list is not permitted
+ - BUG: Plugin crashes when selecting entries with special characters
+ - Escape query strings correctly
+ - should go into gd_content_interface.c (row[] in lines 1175,1179,1882)?
+ - Simple progress indicator for 1.3.12
+ - Attach to graphlcd plugin via replay string
+ - Test Instant play from browser view
+ - Displaying the menu while progress display is shown makes VDR crash (DONE)
+ - Check int/unsigned stuff in mg_playlist
+ - mgPCMPlayer::GetIndex: obtain track length from database (DONE)
+ - Import (mugglei) now checks for duplicate entries based on filenames
+ - Playlist view: start at selected on Ok
+ - Toggle Track view/playlist view (red)
+ - For playlist view show playlist name, total time
+ - For track view show name, artist, time
+ - Toggle detail/progress view (green)
+ - Track view: all metadata
+ - Playlist view: all tracks (past three, upcoming ones)
*/ \ No newline at end of file
diff --git a/mg_content_interface.c b/mg_content_interface.c
index defa0ac..d017997 100755
--- a/mg_content_interface.c
+++ b/mg_content_interface.c
@@ -9,7 +9,6 @@
* Implements main classes of for content items and abstract interfaces to media access
*
* This file implements the following classes
- * - mgContentItem
* - mgTracklist
* - mgSelectionTreeNode
*/
@@ -51,6 +50,19 @@ unsigned int mgTracklist::getNumItems()
return m_list.size();
}
+unsigned long mgTracklist::getLength()
+{
+ unsigned long result = 0;
+ std::vector<mgContentItem*>::iterator iter;
+
+ for( iter = m_list.begin(); iter != m_list.end (); iter++ )
+ {
+ result += (*iter)->getLength();
+ }
+
+ return result;
+}
+
void mgTracklist::shuffle()
{
random_shuffle( m_list.begin(), m_list.end () );
diff --git a/mg_content_interface.h b/mg_content_interface.h
index b0a27eb..c127d03 100755
--- a/mg_content_interface.h
+++ b/mg_content_interface.h
@@ -1,5 +1,5 @@
/*! \file mg_content_interface.h
- * \brief data Objects for content (e.g. mp3 files, movies) for the vdr muggle plugin
+ * \brief Data objects for content (e.g. mp3 files, movies) for the vdr muggle plugin
*
* \version $Revision: 1.4 $
* \date $Date$
@@ -27,7 +27,6 @@
#define ILLEGAL_ID -1
class mgFilter;
-class mgPlaylist;
/*!
* \brief dummy player class
@@ -63,9 +62,9 @@ class mgContentItem
*/
typedef enum contentType
{
- ABSTRACT =0, //< an abstract item which cannot be used
- GD_AUDIO, //< a GiantDisc audio track
- EPG //< an EPG item (i.e. a TV show)
+ ABSTRACT = 0, //< an abstract item which cannot be used
+ GD_AUDIO, //< a GiantDisc audio track
+ EPG //< an EPG item (i.e. a TV show)
};
protected:
@@ -274,6 +273,11 @@ class mgTracklist
unsigned int getNumItems();
/*!
+ * \brief returns the complete length of the playlist in seconds
+ */
+ unsigned long getLength();
+
+ /*!
* \brief randomizes the order of the elements in the list
*/
virtual void shuffle();
@@ -311,12 +315,10 @@ class mgTracklist
/*!
* \brief returns an item from the list at the specified position
*/
- virtual mgContentItem* mgTracklist::getItem(unsigned int position);
+ virtual mgContentItem* getItem(unsigned int position);
/*!
* \brief remove item at position
- *
- * \todo needed? if so, it hides bool remove(int)
*/
virtual int removeItem(mgContentItem* item); // remove all occurences of item
diff --git a/mg_playlist.c b/mg_playlist.c
index 7480563..8e81c16 100644
--- a/mg_playlist.c
+++ b/mg_playlist.c
@@ -199,18 +199,25 @@ void mgPlaylist::setListname(std::string name)
m_listname = name;
}
-// returns the count of items in the list
-int mgPlaylist::getCount()
-{
- return m_list.size();
-}
-
// returns current index in the playlist
int mgPlaylist::getIndex() const
{
return m_current_idx;
}
+unsigned long mgPlaylist::getCompletedLength()
+{
+ unsigned long result = 0;
+
+ std::vector<mgContentItem*>::iterator iter;
+ for( iter = m_list.begin(); iter != m_list.begin() + m_current_idx; iter++ )
+ { // each item in the list
+ result += (*iter)->getLength();
+ }
+
+ return result;
+}
+
// returns the current item of the list
mgContentItem* mgPlaylist::getCurrent()
{
@@ -228,7 +235,7 @@ mgContentItem* mgPlaylist::getCurrent()
return result;
}
-// returns the nth track from the playlist
+// skip to the nth track from the playlist
bool mgPlaylist::gotoPosition(unsigned int position)
{
bool result = false;
diff --git a/mg_playlist.h b/mg_playlist.h
index 975458a..c5dd5fc 100644
--- a/mg_playlist.h
+++ b/mg_playlist.h
@@ -128,9 +128,6 @@ public:
*/
virtual void setListname(std::string name);
- //! \brief returns the count of items in the list
- int getCount();
-
//! \brief access playlist items
//@{
@@ -140,6 +137,9 @@ public:
//! \brief make playlist persistent
virtual bool storePlaylist() = 0;
+ //! \brief obtain length of content already played
+ unsigned long getCompletedLength();
+
//! \brief export the playlist in m3u format
virtual bool exportM3U( std::string m3u_file );
diff --git a/vdr_decoder_mp3.c b/vdr_decoder_mp3.c
index eb5cb42..6f2d7f6 100644
--- a/vdr_decoder_mp3.c
+++ b/vdr_decoder_mp3.c
@@ -73,16 +73,12 @@ mgMP3Decoder::mgMP3Decoder( mgContentItem *item, bool preinit)
mgMP3Decoder::~mgMP3Decoder()
{
- MGLOG( "mgMP3Decoder::~mgMP3Decoder" );
-
clean();
delete m_stream;
}
void mgMP3Decoder::init()
{
- MGLOG( "mgMP3Decoder::init" );
-
clean();
mad_stream_init( &m_madstream );
@@ -102,8 +98,6 @@ void mgMP3Decoder::init()
void mgMP3Decoder::clean()
{
- MGLOG( "mgMP3Decoder::clean" );
-
m_playing = false;
if( m_madsynth )
{
@@ -119,22 +113,10 @@ void mgMP3Decoder::clean()
m_madframe = 0;
}
mad_stream_finish( &m_madstream );
-
- /*
- if( m_frameinfo )
- {
- cout << "mgMP3Decoder::clean: m_frameinfo deleted." << endl << flush;
- delete m_frameinfo;
- cout << "mgMP3Decoder::clean: m_frameinfo deleted." << endl << flush;
- m_frameinfo = 0;
- }
- */
}
bool mgMP3Decoder::valid(void)
{
- MGLOG( "mgMP3Decoder::valid" );
-
bool res = false;
if( tryLock() )
{
@@ -167,11 +149,9 @@ bool mgMP3Decoder::valid(void)
mgPlayInfo *mgMP3Decoder::playInfo()
{
- MGLOG( "mgMP3Decoder::playInfo" );
if( m_playing )
{
m_playinfo.m_index = mad_timer_count( m_playtime, MAD_UNITS_SECONDS );
- // m_playinfo.Total = m_scan->Total; // TODO
return &m_playinfo;
}
@@ -239,8 +219,6 @@ struct mgDecode *mgMP3Decoder::done(eDecodeStatus status)
eDecodeStatus mgMP3Decoder::decodeError(bool hdr)
{
- MGLOG( "mgMP3Decoder::decodeError" );
-
if( m_madstream.error == MAD_ERROR_BUFLEN || m_madstream.error == MAD_ERROR_BUFPTR )
{
int s = mgMadStream( &m_madstream, m_stream );
@@ -274,8 +252,6 @@ eDecodeStatus mgMP3Decoder::decodeError(bool hdr)
struct mgDecode *mgMP3Decoder::decode()
{
- // MGLOG( "mgMP3Decoder::decode" );
-
lock(); // this is released in Done()
eDecodeStatus r;
diff --git a/vdr_player.c b/vdr_player.c
index f30a53d..d69897f 100644
--- a/vdr_player.c
+++ b/vdr_player.c
@@ -199,12 +199,12 @@ public:
void ToggleShuffle(void);
void ToggleLoop(void);
- virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame=false);
+ virtual bool getIndex(int &Current, int &Total, bool SnapToIFrame=false);
// bool GetPlayInfo(cMP3PlayInfo *rm); // LVW
void NewPlaylist( mgPlaylist *plist, int first );
- mgContentItem *GetCurrent () { return m_current; }
- mgPlaylist *GetPlaylist () { return m_playlist; }
+ mgContentItem *getCurrent () { return m_current; }
+ mgPlaylist *getPlaylist () { return m_playlist; }
};
mgPCMPlayer::mgPCMPlayer(mgPlaylist *plist, int first)
@@ -868,13 +868,14 @@ void mgPCMPlayer::SkipSeconds(int secs)
}
}
-bool mgPCMPlayer::GetIndex( int &current, int &total, bool snaptoiframe )
+bool mgPCMPlayer::getIndex( int &current, int &total, bool snaptoiframe )
{
- if(m_current) {
- current = SecondsToFrames( m_index );
- total = SecondsToFrames( m_current->getLength() );
- return true;
- }
+ if( m_current )
+ {
+ current = SecondsToFrames( m_index );
+ total = SecondsToFrames( m_current->getLength() );
+ return true;
+ }
return false;
}
@@ -887,9 +888,12 @@ mgPlayerControl::mgPlayerControl( mgPlaylist *plist, int start )
#if VDRVERSNUM >= 10307
m_display = NULL;
+ m_menu = NULL;
#endif
m_visible = false;
m_has_osd = false;
+ m_track_view = true;
+ m_progress_view = true;
m_szLastShowStatusMsg = NULL;
@@ -913,8 +917,6 @@ mgPlayerControl::~mgPlayerControl()
bool mgPlayerControl::Active(void)
{
- MGLOG( "mgPlayerControl::Active" );
-
return m_player && m_player->Active();
}
@@ -999,53 +1001,149 @@ void mgPlayerControl::NewPlaylist(mgPlaylist *plist, int start)
}
}
-void mgPlayerControl::ShowProgress()
+void mgPlayerControl::ShowContents()
{
- StatusMsgReplaying();
+#if VDRVERSNUM >= 10307
+ if( !m_menu )
+ {
+ m_menu = Skins.Current()->DisplayMenu();
+ }
- if( m_visible )
+ if( m_player && m_menu )
{
- if( !m_has_osd )
+ int num_items = m_menu->MaxItems();
+
+ if( m_track_view )
{
- // 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;
+ m_menu->Clear();
+ m_menu->SetTitle( "Track info view" );
+
+ m_menu->SetTabs( 15 );
+
+ char *buf;
+ if( num_items > 0 )
+ {
+ asprintf( &buf, "Title:\t%s", m_player->getCurrent()->getLabel(0).c_str() );
+ m_menu->SetItem( buf, 0, false, false );
+ free( buf );
+ }
+ if( num_items > 1 )
+ {
+ asprintf( &buf, "Artist:\t%s", m_player->getCurrent()->getLabel(1).c_str() );
+ m_menu->SetItem( buf, 1, false, false );
+ free( buf );
+ }
+ if( num_items > 2 )
+ {
+ asprintf( &buf, "Album:\t%s", m_player->getCurrent()->getLabel(2).c_str() );
+ m_menu->SetItem( buf, 2, false, false );
+ free( buf );
+ }
+ if( num_items > 3 )
+ {
+ asprintf( &buf, "Genre:\t%s", m_player->getCurrent()->getLabel(3).c_str() );
+ m_menu->SetItem( buf, 3, false, false );
+ free( buf );
+ }
+ if( num_items > 4 )
+ {
+ int len = m_player->getCurrent()->getLength();
+ asprintf( &buf, "Length:\t%s", IndexToHMSF( SecondsToFrames( len ) ) );
+ m_menu->SetItem( buf, 4, false, false );
+ free( buf );
+ }
+ if( num_items > 5 )
+ {
+ asprintf( &buf, "Bit rate:\t%s", m_player->getCurrent()->getBitrate().c_str() );
+ m_menu->SetItem( buf, 5, false, false );
+ free( buf );
+ }
+ if( num_items > 6 )
+ {
+ int sr = m_player->getCurrent()->getSampleRate();
+
+ asprintf( &buf, "Sampling rate:\t%d", sr );
+ m_menu->SetItem( buf, 6, false, false );
+ free( buf );
+ }
}
+ else
+ {
+ mgPlaylist *list = m_player->getPlaylist();
+ if( list )
+ {
+ // use items for playlist tag display
+ m_menu->Clear();
+ m_menu->SetTitle( "Playlist info view" );
+
+ int cur = list->getIndex();
+
+ char *buf;
+ for( int i=0; i < num_items; i ++ )
+ {
+ mgContentItem *item = list->getItem( cur-3+i );
+ if( item->isValid() )
+ {
+ asprintf( &buf, "%s\t%s", item->getLabel(0).c_str(), item->getLabel(1).c_str() );
+ if( i < 3 )
+ { // already played
+ m_menu->SetItem( buf, i, false, false );
+ }
+ if( i > 3 )
+ { // to be played
+ m_menu->SetItem( buf, i, false, true );
+ }
+ if( i == 3 )
+ {
+ m_menu->SetItem( buf, i, true, true );
+ }
+ free( buf );
+ }
+ }
+ }
+ }
+ }
+#endif
+}
+
+void mgPlayerControl::ShowProgress()
+{
+ if( m_player )
+ {
+ char *buf;
+ bool play = true, forward = true;
+ int speed = -1;
+
+ int current_frame, total_frames;
+ m_player->getIndex( current_frame, total_frames );
- // now an osd is open, go on
-
+ if( !m_track_view )
+ { // playlist stuff
+ mgPlaylist *list = m_player->getPlaylist();
+ if( list )
+ {
+ total_frames = SecondsToFrames( list->getLength() );
+ current_frame += SecondsToFrames( list->getCompletedLength() );
+ asprintf( &buf, "Playlist %s (%d/%d)", list->getListname().c_str(), list->getIndex()+1, list->getNumItems() );
+ }
+ }
+ else
+ { // track view
+ asprintf( &buf, "%s: %s", m_player->getCurrent()->getLabel(1).c_str(), m_player->getCurrent()->getTitle().c_str() );
+ }
+
#if VDRVERSNUM >= 10307
if( !m_display )
{
m_display = Skins.Current()->DisplayReplay(false);
}
- if( m_player && m_display )
+ if( m_display )
{
- int current_frame, total_frames;
- m_player->GetIndex( current_frame, total_frames );
-
m_display->SetProgress( current_frame, total_frames );
m_display->SetCurrent( IndexToHMSF( current_frame ) );
- m_display->SetTotal( IndexToHMSF( total_frames ) );
-
- char *buf;
- asprintf( &buf, "%s", m_player->GetCurrent()->getTitle().c_str() );
+ m_display->SetTotal( IndexToHMSF( total_frames ) );
m_display->SetTitle( buf );
- // free( buf );
-
- bool play = true, forward = true;
- int speed = -1;
m_display->SetMode( play, forward, speed );
-
m_display->Flush();
}
#else
@@ -1053,12 +1151,48 @@ void mgPlayerControl::ShowProgress()
int h = Interface->Height();
Interface->WriteText( w/2, h/2, "Muggle is active!" );
-
- // Add: song info (name, artist, pos in playlist, time, ...)
- // Add: progress bar
-
Interface->Flush();
#endif
+ free( buf );
+ }
+}
+
+void mgPlayerControl::Display()
+{
+ StatusMsgReplaying();
+
+ if( m_visible )
+ {
+ if( !m_has_osd )
+ {
+ // open the osd if its not already there...
+#if VDRVERSNUM >= 10307
+#else
+ Interface->Open();
+#endif
+ m_has_osd = true;
+ }
+
+ // now an osd is open, go on
+
+ if( m_progress_view )
+ {
+ if( m_menu )
+ {
+ delete m_menu;
+ m_menu = NULL;
+ }
+ ShowProgress();
+ }
+ else
+ {
+ if( m_display )
+ {
+ delete m_display;
+ m_display = NULL;
+ }
+ ShowContents();
+ }
}
else
{
@@ -1079,15 +1213,16 @@ void mgPlayerControl::InternalHide()
if( m_has_osd )
{
#if VDRVERSNUM >= 10307
- /*
- osd->Flush();
- delete osd;
- */
if( m_display )
{
delete m_display;
m_display = NULL;
}
+ if( m_menu )
+ {
+ delete m_menu;
+ m_menu = NULL;
+ }
#else
Interface->Close();
#endif
@@ -1102,7 +1237,7 @@ eOSState mgPlayerControl::ProcessKey(eKeys key)
return osEnd;
}
- ShowProgress();
+ Display();
eOSState state = cControl::ProcessKey(key);
@@ -1122,7 +1257,7 @@ eOSState mgPlayerControl::ProcessKey(eKeys key)
{
if( !m_visible && m_player )
{
- mgPlaylist *pl = m_player->GetPlaylist();
+ mgPlaylist *pl = m_player->getPlaylist();
std::string s;
switch( pl->toggleLoopMode() )
@@ -1155,13 +1290,15 @@ eOSState mgPlayerControl::ProcessKey(eKeys key)
else
{
// toggle progress display between simple and detail
+ m_progress_view = !m_progress_view;
+ Display();
}
} break;
case kGreen:
{
if( !m_visible && m_player )
{
- mgPlaylist *pl = m_player->GetPlaylist();
+ mgPlaylist *pl = m_player->getPlaylist();
std::string s;
switch( pl->toggleShuffleMode() )
@@ -1193,7 +1330,9 @@ eOSState mgPlayerControl::ProcessKey(eKeys key)
}
else
{
- // toggle progress display between playlist and single track
+ // toggle progress display between playlist and track
+ m_track_view = !m_track_view;
+ Display();
}
} break;
case kPause:
@@ -1212,7 +1351,7 @@ eOSState mgPlayerControl::ProcessKey(eKeys key)
case kOk:
{
m_visible = !m_visible;
- ShowProgress();
+ Display();
return osContinue;
} break;
@@ -1236,28 +1375,28 @@ void mgPlayerControl::StatusMsgReplaying()
{
char *szBuf=NULL;
if(m_player
- && m_player->GetCurrent()
- && m_player->GetCurrent()->isValid()
- && m_player->GetCurrent()->getContentType() == mgContentItem::GD_AUDIO
- && m_player->GetPlaylist())
+ && m_player->getCurrent()
+ && m_player->getCurrent()->isValid()
+ && m_player->getCurrent()->getContentType() == mgContentItem::GD_AUDIO
+ && m_player->getPlaylist())
{
/*
- if(m_player->GetCurrent()->getAlbum().length() > 0)
+ if(m_player->getCurrent()->getAlbum().length() > 0)
{
asprintf(&szBuf,"[%c%c] (%d/%d) %s - %s",
- m_player->GetPlaylist()->isLoop()?'L':'.',
- m_player->GetPlaylist()->isShuffle()'S':'.',
- m_player->GetPlaylist()->getIndex() + 1,m_player->GetPlaylist()->getCount(),
- m_player->GetCurrent()->getTitle().c_str(),
- m_player->GetCurrent()->getAlbum().c_str());
+ m_player->getPlaylist()->isLoop()?'L':'.',
+ m_player->getPlaylist()->isShuffle()'S':'.',
+ m_player->getPlaylist()->getIndex() + 1,m_player->getPlaylist()->getCount(),
+ m_player->getCurrent()->getTitle().c_str(),
+ m_player->getCurrent()->getAlbum().c_str());
}
else */
{
asprintf(&szBuf,"[%c%c] (%d/%d) %s",
/* TODO m_player->GetPlaylist()->isLoop()?'L':*/'.',
/* TODO m_player->GetPlaylist()->isShuffle()'S':*/'.',
- m_player->GetPlaylist()->getIndex() + 1,m_player->GetPlaylist()->getCount(),
- m_player->GetCurrent()->getTitle().c_str());
+ m_player->getPlaylist()->getIndex() + 1,m_player->getPlaylist()->getNumItems(),
+ m_player->getCurrent()->getTitle().c_str());
}
}
else
diff --git a/vdr_player.h b/vdr_player.h
index 3731b9d..d39d9d8 100644
--- a/vdr_player.h
+++ b/vdr_player.h
@@ -48,9 +48,14 @@ private:
//! \brief indicates, whether an osd is currently displayed
bool m_has_osd;
+
+ bool m_track_view;
+ bool m_progress_view;
+
#if VDRVERSNUM >= 10307
//! \brief a replay display to show the progress during playback
cSkinDisplayReplay *m_display;
+ cSkinDisplayMenu *m_menu;
cOsd *osd;
const cFont *font;
@@ -121,6 +126,10 @@ public:
//! \brief a progress display
void ShowProgress();
+ void Display();
+
+ void ShowContents();
+
//! \brief hide the osd, if present
void Hide();