diff options
| author | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-10-24 18:04:35 +0000 |
|---|---|---|
| committer | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-10-24 18:04:35 +0000 |
| commit | 8ea2d3a70af5ca6c1e060f3e9bb91b0630e0dce9 (patch) | |
| tree | 96bd3086dba1e6969191500d576fecbe59bcf37d | |
| parent | 379307489d4dad99a273ab687e471235ce6e3259 (diff) | |
| download | vdr-plugin-muggle-8ea2d3a70af5ca6c1e060f3e9bb91b0630e0dce9.tar.gz vdr-plugin-muggle-8ea2d3a70af5ca6c1e060f3e9bb91b0630e0dce9.tar.bz2 | |
Using an unsigned integer for playlist position
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@232 e10066b5-e1e2-0310-b819-94efdf66514b
| -rw-r--r-- | TODO | 7 | ||||
| -rw-r--r-- | mg_playlist.c | 17 | ||||
| -rw-r--r-- | mg_playlist.h | 8 | ||||
| -rw-r--r-- | vdr_player.c | 2 |
4 files changed, 18 insertions, 16 deletions
@@ -66,11 +66,12 @@ - if n < playcount / max. playcount - add the file to the end of the list - \subsection urgentplayer Player extensions - + \subsection urgentplayer Player extensions - Display covers + - Import filename + - Show image during replay - Add FLAC decoder - - Determine max. framecount (needed for rewinding)? + - Determine max. framecount (needed for rewinding?) - Init scale/level/normalize? - The max. level should be recognized during play - Store max. level in the database diff --git a/mg_playlist.c b/mg_playlist.c index 8e81c16..0b38925 100644 --- a/mg_playlist.c +++ b/mg_playlist.c @@ -22,7 +22,7 @@ mgPlaylist::mgPlaylist() { - m_current_idx = -1; + m_current_idx = 0; char *buffer; asprintf( &buffer, "Playlist-%ld", random() ); @@ -32,7 +32,7 @@ mgPlaylist::mgPlaylist() mgPlaylist::mgPlaylist(std::string listname) { - m_current_idx = -1; + m_current_idx = 0; m_listname = listname; } @@ -136,7 +136,7 @@ void mgPlaylist::insert( mgContentItem* item, unsigned int position ) } } -bool mgPlaylist::remove( int pos ) +bool mgPlaylist::remove( unsigned pos ) { bool result = false; @@ -171,7 +171,7 @@ void mgPlaylist::clear() m_current_idx = 0; } -void mgPlaylist::move( int from, int to ) +void mgPlaylist::move( unsigned from, unsigned to ) { std::vector<mgContentItem*>::iterator from_iter = m_list.begin() + from; std::vector<mgContentItem*>::iterator to_iter = m_list.begin() + to; @@ -200,7 +200,7 @@ void mgPlaylist::setListname(std::string name) } // returns current index in the playlist -int mgPlaylist::getIndex() const +unsigned mgPlaylist::getIndex() const { return m_current_idx; } @@ -223,7 +223,7 @@ mgContentItem* mgPlaylist::getCurrent() { mgContentItem *result; - if( 0 <= m_current_idx && m_current_idx < (int) m_list.size() ) + if( 0 <= m_current_idx && m_current_idx < m_list.size() ) { result = *( m_list.begin() + m_current_idx ); } @@ -260,7 +260,7 @@ bool mgPlaylist::skipFwd() } else { - if( m_current_idx + 1 < (int) m_list.size() ) // unless loop mode + if( m_current_idx + 1 < m_list.size() ) // unless loop mode { m_current_idx ++; } @@ -311,7 +311,8 @@ mgContentItem* mgPlaylist::sneakNext() { mgContentItem* result; - if( m_current_idx + 1 <= (int) m_list.size() ) // unless loop mode + // TODO: a bug? + if( m_current_idx + 1 <= m_list.size() ) // unless loop mode { result = *(m_list.begin() + m_current_idx + 1); } diff --git a/mg_playlist.h b/mg_playlist.h index 0c32297..bdffd0c 100644 --- a/mg_playlist.h +++ b/mg_playlist.h @@ -114,13 +114,13 @@ public: * \param from - the item of the index to be moved * \param to - the target index of the item */ - void move( int from, int to ); + void move( unsigned from, unsigned to ); /*! \brief remove a track from the playlist * * \param pos - the index of the track to be removed */ - bool remove( int pos ); + bool remove( unsigned pos ); //@} @@ -137,7 +137,7 @@ public: //@{ //! \brief returns current index in the playlist - int getIndex() const; + unsigned getIndex() const; //! \brief make playlist persistent virtual bool storePlaylist() = 0; @@ -186,7 +186,7 @@ private: //! \brief current index in the playlist // TODO: should be a property of the player? - int m_current_idx; + unsigned m_current_idx; //! \brief the current loop mode LoopMode m_loop_mode; diff --git a/vdr_player.c b/vdr_player.c index 4f16d66..bd05767 100644 --- a/vdr_player.c +++ b/vdr_player.c @@ -917,7 +917,7 @@ char *cMP3Player::LoadImage(const char *fullname) { size_t i, j = strlen (MP3Sources.GetSource()->BaseDir()) + 1; char imageFile[1024]; -+ static char mpgFile[1024]; + static char mpgFile[1024]; char *p, *q = NULL; char *imageSuffixes[] = { "png", "gif", "jpg" }; |
