author | harlekin <harlekin> | 2002-10-01 15:36:31 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-01 15:36:31 (UTC) |
commit | 657eeb18141838eeb0d18351a6755d7fa686f9d9 (patch) (unidiff) | |
tree | 049c19f776543aee296ce0cd3a1fde8c37ec374b /noncore/multimedia/opieplayer2/lib.cpp | |
parent | bba0335bbea81519beafb7fec1979a0abbd8a7ea (diff) | |
download | opie-657eeb18141838eeb0d18351a6755d7fa686f9d9.zip opie-657eeb18141838eeb0d18351a6755d7fa686f9d9.tar.gz opie-657eeb18141838eeb0d18351a6755d7fa686f9d9.tar.bz2 |
mediadetect no longer needed, also beginning of id3 etc tag info support along with some other small fixes
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 4021d4a..85030de 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -150,7 +150,9 @@ int Lib::subVersion() { | |||
150 | 150 | ||
151 | int Lib::play( const QString& fileName, int startPos, int start_time ) { | 151 | int Lib::play( const QString& fileName, int startPos, int start_time ) { |
152 | QString str = fileName.stripWhiteSpace(); | 152 | QString str = fileName.stripWhiteSpace(); |
153 | xine_open( m_xine, QFile::encodeName(str.utf8() ).data() ); | 153 | if ( !xine_open( m_xine, QFile::encodeName(str.utf8() ).data() ) ) { |
154 | return 0; | ||
155 | } | ||
154 | return xine_play( m_xine, startPos, start_time); | 156 | return xine_play( m_xine, startPos, start_time); |
155 | } | 157 | } |
156 | 158 | ||
@@ -191,16 +193,22 @@ int Lib::length() { | |||
191 | } | 193 | } |
192 | 194 | ||
193 | bool Lib::isSeekable() { | 195 | bool Lib::isSeekable() { |
194 | return xine_get_stream_info ( m_xine, XINE_STREAM_INFO_SEEKABLE ); | 196 | return xine_get_stream_info( m_xine, XINE_STREAM_INFO_SEEKABLE ); |
197 | } | ||
198 | |||
199 | void Lib::seekTo( int time ) { | ||
200 | // xine_trick_mode ( m_xine, XINE_TRICK_MODE_SEEK_TO_TIME, time ); NOT IMPLEMENTED YET IN XINE :_( | ||
201 | xine_play( m_xine, 0, time ); | ||
195 | } | 202 | } |
196 | 203 | ||
204 | |||
197 | Frame Lib::currentFrame() { | 205 | Frame Lib::currentFrame() { |
198 | Frame frame; | 206 | Frame frame; |
199 | return frame; | 207 | return frame; |
200 | }; | 208 | }; |
201 | 209 | ||
202 | QString Lib::metaInfo() { | 210 | QString Lib::metaInfo( int number) { |
203 | xine_get_meta_info( m_xine, 0 ); | 211 | return xine_get_meta_info( m_xine, number ); |
204 | } | 212 | } |
205 | 213 | ||
206 | int Lib::error() { | 214 | int Lib::error() { |
@@ -216,13 +224,27 @@ void Lib::handleXineEvent( xine_event_t* t ) { | |||
216 | 224 | ||
217 | void Lib::setShowVideo( bool video ) { | 225 | void Lib::setShowVideo( bool video ) { |
218 | m_video = video; | 226 | m_video = video; |
219 | ::null_set_show_video( m_videoOutput, video ); | 227 | ::null_set_show_video( m_videoOutput, video ); |
220 | } | 228 | } |
221 | 229 | ||
222 | bool Lib::isShowingVideo() { | 230 | bool Lib::isShowingVideo() { |
223 | return ::null_is_showing_video( m_videoOutput ); | 231 | return ::null_is_showing_video( m_videoOutput ); |
224 | } | 232 | } |
225 | 233 | ||
234 | bool Lib::hasVideo() { | ||
235 | //looks like it is not implemented yet | ||
236 | //return xine_get_stream_info( m_xine, XINE_STREAM_INFO_VIDEO_CHANNELS ); | ||
237 | // ugly hack until xine is ready, look for the width of the video | ||
238 | int test = xine_get_stream_info( m_xine, 2 ); | ||
239 | if( test > 0 ) { | ||
240 | // qDebug( QString(" has video: %1").arg( test ) ); | ||
241 | return true; | ||
242 | } else { | ||
243 | //qDebug ( "does not have video "); | ||
244 | return false; | ||
245 | } | ||
246 | } | ||
247 | |||
226 | void Lib::showVideoFullScreen( bool fullScreen ) { | 248 | void Lib::showVideoFullScreen( bool fullScreen ) { |
227 | ::null_set_fullscreen( m_videoOutput, fullScreen ); | 249 | ::null_set_fullscreen( m_videoOutput, fullScreen ); |
228 | } | 250 | } |
@@ -232,7 +254,7 @@ bool Lib::isVideoFullScreen() { | |||
232 | } | 254 | } |
233 | 255 | ||
234 | void Lib::setScaling( bool scale ) { | 256 | void Lib::setScaling( bool scale ) { |
235 | ::null_set_scaling( m_videoOutput, scale ); | 257 | ::null_set_scaling( m_videoOutput, scale ); |
236 | } | 258 | } |
237 | 259 | ||
238 | void Lib::setGamma( int value ) { | 260 | void Lib::setGamma( int value ) { |
@@ -250,7 +272,7 @@ void Lib::xine_event_handler( void* user_data, xine_event_t* t ) { | |||
250 | 272 | ||
251 | void Lib::xine_display_frame( void* user_data, uint8_t *frame, | 273 | void Lib::xine_display_frame( void* user_data, uint8_t *frame, |
252 | int width, int height, int bytes ) { | 274 | int width, int height, int bytes ) { |
253 | ( (Lib*)user_data)->drawFrame( frame, width, height, bytes ); | 275 | ( (Lib*)user_data)->drawFrame( frame, width, height, bytes ); |
254 | } | 276 | } |
255 | 277 | ||
256 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | 278 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { |
@@ -258,8 +280,5 @@ void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | |||
258 | qWarning("not showing video now"); | 280 | qWarning("not showing video now"); |
259 | return; | 281 | return; |
260 | } | 282 | } |
261 | |||
262 | // qWarning( "called draw frame %d %d", width, height ); | ||
263 | |||
264 | m_wid-> setVideoFrame ( frame, width, height, bytes ); | 283 | m_wid-> setVideoFrame ( frame, width, height, bytes ); |
265 | } | 284 | } |