summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/xinecontrol.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 8f11b2e..94f99f8 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -72,67 +72,67 @@ void XineControl::init()
72 connect( &mediaPlayerState, SIGNAL( videoGammaChanged(int) ), this, SLOT( setGamma(int) ) ); 72 connect( &mediaPlayerState, SIGNAL( videoGammaChanged(int) ), this, SLOT( setGamma(int) ) );
73 connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); 73 connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) );
74 connect( xineVideoWidget, SIGNAL( videoResized(const QSize&) ), this, SLOT( videoResized(const QSize&) ) ); 74 connect( xineVideoWidget, SIGNAL( videoResized(const QSize&) ), this, SLOT( videoResized(const QSize&) ) );
75 75
76 disabledSuspendScreenSaver = FALSE; 76 disabledSuspendScreenSaver = FALSE;
77} 77}
78 78
79XineControl::~XineControl() { 79XineControl::~XineControl() {
80#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 80#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
81 if ( disabledSuspendScreenSaver ) { 81 if ( disabledSuspendScreenSaver ) {
82 disabledSuspendScreenSaver = FALSE; 82 disabledSuspendScreenSaver = FALSE;
83 // Re-enable the suspend mode 83 // Re-enable the suspend mode
84 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; 84 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
85 } 85 }
86#endif 86#endif
87 delete libXine; 87 delete libXine;
88} 88}
89 89
90void XineControl::play( const QString& fileName ) { 90void XineControl::play( const QString& fileName ) {
91 91
92 hasVideoChannel = FALSE; 92 hasVideoChannel = FALSE;
93 hasAudioChannel = FALSE; 93 hasAudioChannel = FALSE;
94 m_fileName = fileName; 94 m_fileName = fileName;
95 95
96 qDebug("<<FILENAME: " + fileName + ">>>>"); 96 odebug << "<<FILENAME: " + fileName + ">>>>" << oendl;
97 97
98 if ( !libXine->play( fileName, 0, 0 ) ) { 98 if ( !libXine->play( fileName, 0, 0 ) ) {
99 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); 99 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
100 // toggle stop so the the play button is reset 100 // toggle stop so the the play button is reset
101 mediaPlayerState.setPlaying( false ); 101 mediaPlayerState.setPlaying( false );
102 return; 102 return;
103 } 103 }
104 mediaPlayerState.setPlaying( true ); 104 mediaPlayerState.setPlaying( true );
105 105
106 MediaPlayerState::DisplayType displayType; 106 MediaPlayerState::DisplayType displayType;
107 if ( !libXine->hasVideo() ) { 107 if ( !libXine->hasVideo() ) {
108 displayType = MediaPlayerState::Audio; 108 displayType = MediaPlayerState::Audio;
109 qDebug("HAS AUDIO"); 109 odebug << "HAS AUDIO" << oendl;
110 libXine->setShowVideo( false ); 110 libXine->setShowVideo( false );
111 hasAudioChannel = TRUE; 111 hasAudioChannel = TRUE;
112 } else { 112 } else {
113 displayType = MediaPlayerState::Video; 113 displayType = MediaPlayerState::Video;
114 qDebug("HAS VIDEO"); 114 odebug << "HAS VIDEO" << oendl;
115 libXine->setShowVideo( true ); 115 libXine->setShowVideo( true );
116 hasVideoChannel = TRUE; 116 hasVideoChannel = TRUE;
117 } 117 }
118 // determine if slider is shown 118 // determine if slider is shown
119 mediaPlayerState.setIsSeekable( libXine->isSeekable() ); 119 mediaPlayerState.setIsSeekable( libXine->isSeekable() );
120 120
121 // which gui (video / audio) 121 // which gui (video / audio)
122 mediaPlayerState.setDisplayType( displayType ); 122 mediaPlayerState.setDisplayType( displayType );
123 123
124#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 124#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
125 if ( !disabledSuspendScreenSaver ) { 125 if ( !disabledSuspendScreenSaver ) {
126 disabledSuspendScreenSaver = TRUE; 126 disabledSuspendScreenSaver = TRUE;
127 // Stop the screen from blanking and power saving state 127 // Stop the screen from blanking and power saving state
128 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) 128 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" )
129 << ( displayType == MediaPlayerState::Video ? QPEApplication::Disable : QPEApplication::DisableSuspend ); 129 << ( displayType == MediaPlayerState::Video ? QPEApplication::Disable : QPEApplication::DisableSuspend );
130 } 130 }
131#endif 131#endif
132 132
133 length(); 133 length();
134 position(); 134 position();
135} 135}
136 136
137void XineControl::nextMedia() { 137void XineControl::nextMedia() {
138 mediaPlayerState.setNext(); 138 mediaPlayerState.setNext();
@@ -222,49 +222,49 @@ QString XineControl::getMetaInfo() {
222 } 222 }
223 223
224 if ( !libXine->metaInfo( 2 ).isEmpty() ) { 224 if ( !libXine->metaInfo( 2 ).isEmpty() ) {
225 returnString += tr( " Artist: " + libXine->metaInfo( 2 ) ); 225 returnString += tr( " Artist: " + libXine->metaInfo( 2 ) );
226 } 226 }
227 227
228 if ( !libXine->metaInfo( 3 ).isEmpty() ) { 228 if ( !libXine->metaInfo( 3 ).isEmpty() ) {
229 returnString += tr( " Genre: " + libXine->metaInfo( 3 ) ); 229 returnString += tr( " Genre: " + libXine->metaInfo( 3 ) );
230 } 230 }
231 231
232 if ( !libXine->metaInfo( 4 ).isEmpty() ) { 232 if ( !libXine->metaInfo( 4 ).isEmpty() ) {
233 returnString += tr( " Album: " + libXine->metaInfo( 4 ) ); 233 returnString += tr( " Album: " + libXine->metaInfo( 4 ) );
234 } 234 }
235 235
236 if ( !libXine->metaInfo( 5 ).isEmpty() ) { 236 if ( !libXine->metaInfo( 5 ).isEmpty() ) {
237 returnString += tr( " Year: " + libXine->metaInfo( 5 ) ); 237 returnString += tr( " Year: " + libXine->metaInfo( 5 ) );
238 } 238 }
239 return returnString; 239 return returnString;
240} 240}
241 241
242QString XineControl::getErrorCode() { 242QString XineControl::getErrorCode() {
243 243
244 int errorCode = libXine->error(); 244 int errorCode = libXine->error();
245 245
246 qDebug( QString("ERRORCODE: %1 ").arg(errorCode) ); 246 odebug << QString("ERRORCODE: %1 ").arg(errorCode) << oendl;
247 247
248 if ( errorCode == 1 ) { 248 if ( errorCode == 1 ) {
249 return tr( "No input plugin found for this media type" ); 249 return tr( "No input plugin found for this media type" );
250 } else if ( errorCode == 2 ) { 250 } else if ( errorCode == 2 ) {
251 return tr( "No demux plugin found for this media type" ); 251 return tr( "No demux plugin found for this media type" );
252 } else if ( errorCode == 3 ) { 252 } else if ( errorCode == 3 ) {
253 return tr( "Demuxing failed for this media type" ); 253 return tr( "Demuxing failed for this media type" );
254 } else if ( errorCode == 4 ) { 254 } else if ( errorCode == 4 ) {
255 return tr( "Malformed MRL" ); 255 return tr( "Malformed MRL" );
256 } else { 256 } else {
257 return tr( "Some other error" ); 257 return tr( "Some other error" );
258 } 258 }
259} 259}
260 260
261/** 261/**
262 * Seek to a position in the track 262 * Seek to a position in the track
263 * @param second the second to jump to 263 * @param second the second to jump to
264 */ 264 */
265void XineControl::seekTo( long second ) { 265void XineControl::seekTo( long second ) {
266 libXine->seekTo( (int)second ); 266 libXine->seekTo( (int)second );
267} 267}
268 268
269void XineControl::videoResized ( const QSize &s ) { 269void XineControl::videoResized ( const QSize &s ) {
270 libXine->resize( s ); 270 libXine->resize( s );