Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 9f944d7..e1816c8 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -78,13 +78,13 @@ void XineControl::init() | |||
78 | connect( xineVideoWidget, SIGNAL( videoResized(const QSize&) ), this, SLOT( videoResized(const QSize&) ) ); | 78 | connect( xineVideoWidget, SIGNAL( videoResized(const QSize&) ), this, SLOT( videoResized(const QSize&) ) ); |
79 | 79 | ||
80 | disabledSuspendScreenSaver = FALSE; | 80 | disabledSuspendScreenSaver = FALSE; |
81 | } | 81 | } |
82 | 82 | ||
83 | XineControl::~XineControl() { | 83 | XineControl::~XineControl() { |
84 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 84 | #if !defined(QT_NO_COP) |
85 | if ( disabledSuspendScreenSaver ) { | 85 | if ( disabledSuspendScreenSaver ) { |
86 | disabledSuspendScreenSaver = FALSE; | 86 | disabledSuspendScreenSaver = FALSE; |
87 | // Re-enable the suspend mode | 87 | // Re-enable the suspend mode |
88 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 88 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
89 | } | 89 | } |
90 | #endif | 90 | #endif |
@@ -94,31 +94,29 @@ XineControl::~XineControl() { | |||
94 | void XineControl::play( const QString& fileName ) { | 94 | void XineControl::play( const QString& fileName ) { |
95 | 95 | ||
96 | hasVideoChannel = FALSE; | 96 | hasVideoChannel = FALSE; |
97 | hasAudioChannel = FALSE; | 97 | hasAudioChannel = FALSE; |
98 | m_fileName = fileName; | 98 | m_fileName = fileName; |
99 | 99 | ||
100 | odebug << "<<FILENAME: " + fileName + ">>>>" << oendl; | 100 | odebug << "<<FILENAME: " + fileName + ">>>>" << oendl; |
101 | 101 | ||
102 | if ( !libXine->play( fileName, 0, 0 ) ) { | 102 | if ( !libXine->play( fileName, 0, 0 ) ) { |
103 | QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); | 103 | QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); |
104 | // toggle stop so the the play button is reset | 104 | // toggle stop so the the play button is reset |
105 | mediaPlayerState.setPlaying( false ); | 105 | mediaPlayerState.setPlaying( false ); |
106 | return; | 106 | return; |
107 | } | 107 | } |
108 | mediaPlayerState.setPlaying( true ); | 108 | mediaPlayerState.setPlaying( true ); |
109 | 109 | ||
110 | MediaPlayerState::DisplayType displayType; | 110 | MediaPlayerState::DisplayType displayType; |
111 | if ( !libXine->hasVideo() ) { | 111 | if ( !libXine->hasVideo() ) { |
112 | displayType = MediaPlayerState::Audio; | 112 | displayType = MediaPlayerState::Audio; |
113 | odebug << "HAS AUDIO" << oendl; | ||
114 | libXine->setShowVideo( false ); | 113 | libXine->setShowVideo( false ); |
115 | hasAudioChannel = TRUE; | 114 | hasAudioChannel = TRUE; |
116 | } else { | 115 | } else { |
117 | displayType = MediaPlayerState::Video; | 116 | displayType = MediaPlayerState::Video; |
118 | odebug << "HAS VIDEO" << oendl; | ||
119 | libXine->setShowVideo( true ); | 117 | libXine->setShowVideo( true ); |
120 | hasVideoChannel = TRUE; | 118 | hasVideoChannel = TRUE; |
121 | } | 119 | } |
122 | // determine if slider is shown | 120 | // determine if slider is shown |
123 | mediaPlayerState.setIsSeekable( libXine->isSeekable() ); | 121 | mediaPlayerState.setIsSeekable( libXine->isSeekable() ); |
124 | 122 | ||
@@ -147,13 +145,13 @@ void XineControl::setGamma( int value ) { | |||
147 | } | 145 | } |
148 | 146 | ||
149 | void XineControl::stop( bool isSet ) { | 147 | void XineControl::stop( bool isSet ) { |
150 | if ( !isSet ) { | 148 | if ( !isSet ) { |
151 | libXine->stop(); | 149 | libXine->stop(); |
152 | 150 | ||
153 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 151 | #if !defined(QT_NO_COP) |
154 | if ( disabledSuspendScreenSaver ) { | 152 | if ( disabledSuspendScreenSaver ) { |
155 | disabledSuspendScreenSaver = FALSE; | 153 | disabledSuspendScreenSaver = FALSE; |
156 | // Re-enable the suspend mode | 154 | // Re-enable the suspend mode |
157 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 155 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
158 | } | 156 | } |
159 | #endif | 157 | #endif |
@@ -173,13 +171,12 @@ void XineControl::pause( bool isSet) { | |||
173 | * get current time in playback | 171 | * get current time in playback |
174 | */ | 172 | */ |
175 | long XineControl::currentTime() { | 173 | long XineControl::currentTime() { |
176 | // todo: jede sekunde überprüfen | 174 | // todo: jede sekunde überprüfen |
177 | m_currentTime = libXine->currentTime(); | 175 | m_currentTime = libXine->currentTime(); |
178 | return m_currentTime; | 176 | return m_currentTime; |
179 | QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); | ||
180 | } | 177 | } |
181 | 178 | ||
182 | /** | 179 | /** |
183 | * Set the length of the media file | 180 | * Set the length of the media file |
184 | */ | 181 | */ |
185 | void XineControl::length() { | 182 | void XineControl::length() { |
@@ -244,22 +241,24 @@ QString XineControl::getMetaInfo() { | |||
244 | } | 241 | } |
245 | 242 | ||
246 | QString XineControl::getErrorCode() { | 243 | QString XineControl::getErrorCode() { |
247 | 244 | ||
248 | int errorCode = libXine->error(); | 245 | int errorCode = libXine->error(); |
249 | 246 | ||
250 | odebug << QString("ERRORCODE: %1 ").arg(errorCode) << oendl; | 247 | odebug << QString("ERRORCODE: %1 ").arg(errorCode) << oendl; |
251 | 248 | ||
252 | if ( errorCode == 1 ) { | 249 | if ( errorCode == 1 ) { |
253 | return tr( "No input plugin found for this media type" ); | 250 | return tr( "No input plugin found for this media type" ); |
254 | } else if ( errorCode == 2 ) { | 251 | } else if ( errorCode == 2 ) { |
255 | return tr( "No demux plugin found for this media type" ); | 252 | return tr( "No demux plugin found for this media type" ); |
256 | } else if ( errorCode == 3 ) { | 253 | } else if ( errorCode == 3 ) { |
257 | return tr( "Demuxing failed for this media type" ); | 254 | return tr( "Demuxing failed for this media type" ); |
258 | } else if ( errorCode == 4 ) { | 255 | } else if ( errorCode == 4 ) { |
259 | return tr( "Malformed MRL" ); | 256 | return tr( "Malformed MRL" ); |
257 | } else if ( errorCode == 5 ) { | ||
258 | return tr( "Input failed" ); | ||
260 | } else { | 259 | } else { |
261 | return tr( "Some other error" ); | 260 | return tr( "Some other error" ); |
262 | } | 261 | } |
263 | } | 262 | } |
264 | 263 | ||
265 | /** | 264 | /** |