summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/lib.cpp
authorharlekin <harlekin>2002-10-01 15:36:31 (UTC)
committer harlekin <harlekin>2002-10-01 15:36:31 (UTC)
commit657eeb18141838eeb0d18351a6755d7fa686f9d9 (patch) (side-by-side diff)
tree049c19f776543aee296ce0cd3a1fde8c37ec374b /noncore/multimedia/opieplayer2/lib.cpp
parentbba0335bbea81519beafb7fec1979a0abbd8a7ea (diff)
downloadopie-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.cpp39
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
@@ -147,13 +147,15 @@ int Lib::subVersion() {
xine_get_version ( &m_major_version, &m_minor_version, &m_sub_version );
return m_sub_version;
}
int Lib::play( const QString& fileName, int startPos, int start_time ) {
QString str = fileName.stripWhiteSpace();
- xine_open( m_xine, QFile::encodeName(str.utf8() ).data() );
+ if ( !xine_open( m_xine, QFile::encodeName(str.utf8() ).data() ) ) {
+ return 0;
+ }
return xine_play( m_xine, startPos, start_time);
}
void Lib::stop() {
qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>");
xine_stop( m_xine );
@@ -188,22 +190,28 @@ int Lib::currentTime() {
int Lib::length() {
xine_get_pos_length( m_xine, &m_pos, &m_time, &m_length );
return m_length/1000;
}
bool Lib::isSeekable() {
- return xine_get_stream_info ( m_xine, XINE_STREAM_INFO_SEEKABLE );
+ return xine_get_stream_info( m_xine, XINE_STREAM_INFO_SEEKABLE );
+}
+
+void Lib::seekTo( int time ) {
+// xine_trick_mode ( m_xine, XINE_TRICK_MODE_SEEK_TO_TIME, time ); NOT IMPLEMENTED YET IN XINE :_(
+ xine_play( m_xine, 0, time );
}
+
Frame Lib::currentFrame() {
Frame frame;
return frame;
};
-QString Lib::metaInfo() {
- xine_get_meta_info( m_xine, 0 );
+QString Lib::metaInfo( int number) {
+ return xine_get_meta_info( m_xine, number );
}
int Lib::error() {
return xine_get_error( m_xine );
};
@@ -213,29 +221,43 @@ void Lib::handleXineEvent( xine_event_t* t ) {
}
}
void Lib::setShowVideo( bool video ) {
m_video = video;
- ::null_set_show_video( m_videoOutput, video );
+ ::null_set_show_video( m_videoOutput, video );
}
bool Lib::isShowingVideo() {
return ::null_is_showing_video( m_videoOutput );
}
+bool Lib::hasVideo() {
+ //looks like it is not implemented yet
+ //return xine_get_stream_info( m_xine, XINE_STREAM_INFO_VIDEO_CHANNELS );
+ // ugly hack until xine is ready, look for the width of the video
+ int test = xine_get_stream_info( m_xine, 2 );
+ if( test > 0 ) {
+ // qDebug( QString(" has video: %1").arg( test ) );
+ return true;
+ } else {
+ //qDebug ( "does not have video ");
+ return false;
+ }
+}
+
void Lib::showVideoFullScreen( bool fullScreen ) {
::null_set_fullscreen( m_videoOutput, fullScreen );
}
bool Lib::isVideoFullScreen() {
return ::null_is_fullscreen( m_videoOutput );
}
void Lib::setScaling( bool scale ) {
- ::null_set_scaling( m_videoOutput, scale );
+ ::null_set_scaling( m_videoOutput, scale );
}
void Lib::setGamma( int value ) {
//qDebug( QString( "%1").arg(value) );
::null_set_videoGamma( m_videoOutput, value );
}
@@ -247,19 +269,16 @@ bool Lib::isScaling() {
void Lib::xine_event_handler( void* user_data, xine_event_t* t ) {
( (Lib*)user_data)->handleXineEvent( t );
}
void Lib::xine_display_frame( void* user_data, uint8_t *frame,
int width, int height, int bytes ) {
- ( (Lib*)user_data)->drawFrame( frame, width, height, bytes );
+ ( (Lib*)user_data)->drawFrame( frame, width, height, bytes );
}
void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
if ( !m_video ) {
qWarning("not showing video now");
return;
}
-
-// qWarning( "called draw frame %d %d", width, height );
-
m_wid-> setVideoFrame ( frame, width, height, bytes );
}