diff options
author | phintuka <phintuka> | 2008-07-14 16:15:19 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2008-07-14 16:15:19 +0000 |
commit | 9fe3d777c2230c4ae6a8d9d09a326d39af5eece1 (patch) | |
tree | 4943ffb85872850c12d189bb6f09310e89835c83 | |
parent | 9242bf032d49f7d4e57e8e9df6096fde2cd28ad8 (diff) | |
download | xineliboutput-9fe3d777c2230c4ae6a8d9d09a326d39af5eece1.tar.gz xineliboutput-9fe3d777c2230c4ae6a8d9d09a326d39af5eece1.tar.bz2 |
m_Replaying --> m_Error
Changed semantics:
- initial state is no errors (was not replaying)
- clear error state when replay is stopped (was -> not replaying)
-> Replaying() returns true when playback has not yet been started or playback has ended
-rw-r--r-- | media_player.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/media_player.c b/media_player.c index 1f3ea114..482ef7e1 100644 --- a/media_player.c +++ b/media_player.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: media_player.c,v 1.55 2008-07-14 16:01:45 phintuka Exp $ + * $Id: media_player.c,v 1.56 2008-07-14 16:15:19 phintuka Exp $ * */ @@ -45,7 +45,7 @@ class cXinelibPlayer : public cPlayer cPlaylist m_Playlist; - bool m_Replaying; + bool m_Error; bool m_UseResumeFile; int m_Speed; @@ -72,7 +72,7 @@ class cXinelibPlayer : public cPlayer int Speed(void) { return m_Speed; }; bool NextFile(int step); - bool Replaying(void) { return m_Replaying; } + bool Replaying(void) { return !m_Error; } void UseResumeFile(bool Val) { m_UseResumeFile = Val; } /* Playlist access */ @@ -86,7 +86,7 @@ cXinelibPlayer::cXinelibPlayer(const char *File, bool Queue, const char *SubFile { m_ResumeFile = NULL; m_UseResumeFile = true; - m_Replaying = false; + m_Error = false; m_Speed = 1; if(File) { @@ -194,9 +194,7 @@ bool cXinelibPlayer::NextFile(int step) m_SubFile = NULL; Activate(true); - if(!m_Replaying) - return false; - return true; + return !m_Error; } return false; @@ -228,10 +226,10 @@ void cXinelibPlayer::Activate(bool On) *cPlaylist::EscapeMrl(m_File)); else mrl = cPlaylist::EscapeMrl(m_File); - m_Replaying = cXinelibDevice::Instance().PlayFile(mrl, pos); - LOGDBG("cXinelibPlayer playing %s (%s)", *m_File, m_Replaying?"OK":"FAIL"); + m_Error = !cXinelibDevice::Instance().PlayFile(mrl, pos); + LOGDBG("cXinelibPlayer playing %s (%s)", *m_File, m_Error ? "FAIL" : "OK"); - if(m_Replaying) { + if(!m_Error) { // update playlist metainfo const char *ti = cXinelibDevice::Instance().GetMetaInfo(miTitle); const char *tr = cXinelibDevice::Instance().GetMetaInfo(miTracknumber); @@ -277,7 +275,7 @@ void cXinelibPlayer::Activate(bool On) m_ResumeFile = NULL; } cXinelibDevice::Instance().PlayFile(NULL,0); - m_Replaying = false; + m_Error = false; } } |