summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/xinecontrol.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 31ac9dc..03176b3 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -70,24 +70,26 @@ XineControl::~XineControl() {
70 delete libXine; 70 delete libXine;
71} 71}
72 72
73void XineControl::play( const QString& fileName ) { 73void XineControl::play( const QString& fileName ) {
74 hasVideoChannel = FALSE; 74 hasVideoChannel = FALSE;
75 hasAudioChannel = FALSE; 75 hasAudioChannel = FALSE;
76 m_fileName = fileName; 76 m_fileName = fileName;
77 77
78 //qDebug("<<FILENAME: " + fileName + ">>>>"); 78 //qDebug("<<FILENAME: " + fileName + ">>>>");
79 79
80 if ( !libXine->play( fileName ) ) { 80 if ( !libXine->play( fileName ) ) {
81 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); 81 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
82 // toggle stop so the the play button is reset
83 mediaPlayerState->setPlaying( false );
82 return; 84 return;
83 } 85 }
84 mediaPlayerState->setPlaying( true ); 86 mediaPlayerState->setPlaying( true );
85 87
86 char whichGui; 88 char whichGui;
87 // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) ); 89 // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) );
88 if ( !libXine->hasVideo() ) { 90 if ( !libXine->hasVideo() ) {
89 whichGui = 'a'; 91 whichGui = 'a';
90 qDebug("HAS AUDIO"); 92 qDebug("HAS AUDIO");
91 libXine->setShowVideo( false ); 93 libXine->setShowVideo( false );
92 hasAudioChannel = TRUE; 94 hasAudioChannel = TRUE;
93 } else { 95 } else {
@@ -216,28 +218,37 @@ QString XineControl::getMetaInfo() {
216 218
217 if ( !libXine->metaInfo( 4 ).isEmpty() ) { 219 if ( !libXine->metaInfo( 4 ).isEmpty() ) {
218 returnString += tr( " Album: " + libXine->metaInfo( 4 ) ); 220 returnString += tr( " Album: " + libXine->metaInfo( 4 ) );
219 } 221 }
220 222
221 if ( !libXine->metaInfo( 5 ).isEmpty() ) { 223 if ( !libXine->metaInfo( 5 ).isEmpty() ) {
222 returnString += tr( " Year: " + libXine->metaInfo( 5 ) ); 224 returnString += tr( " Year: " + libXine->metaInfo( 5 ) );
223 } 225 }
224 return returnString; 226 return returnString;
225} 227}
226 228
227QString XineControl::getErrorCode() { 229QString XineControl::getErrorCode() {
230
228 int errorCode = libXine->error(); 231 int errorCode = libXine->error();
229 232
233 qDebug( QString("ERRORCODE: %1 ").arg(errorCode) );
234
230 if ( errorCode == 1 ) { 235 if ( errorCode == 1 ) {
231 return tr( "No input plugin found for this media type" ); 236 return tr( "No input plugin found for this media type" );
237 } else if ( errorCode == 2 ) {
238 return tr( "No demux plugin found for this media type" );
239 } else if ( errorCode == 3 ) {
240 return tr( "Demuxing failed for this media type" );
241 } else if ( errorCode == 4 ) {
242 return tr( "Malformed MRL" );
232 } else { 243 } else {
233 return tr( "Some other error" ); 244 return tr( "Some other error" );
234 } 245 }
235} 246}
236 247
237/** 248/**
238 * Seek to a position in the track 249 * Seek to a position in the track
239 * @param second the second to jump to 250 * @param second the second to jump to
240 */ 251 */
241void XineControl::seekTo( long second ) { 252void XineControl::seekTo( long second ) {
242 libXine->seekTo( (int)second ); 253 libXine->seekTo( (int)second );
243} 254}