author | zecke <zecke> | 2002-07-09 13:49:34 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-07-09 13:49:34 (UTC) |
commit | 87bb55055c826b6c75d4a66a7ff6e21058cf6361 (patch) (side-by-side diff) | |
tree | 000f68448ce3b903da00a3e5a2ad24140a18f85b /noncore/multimedia/opieplayer2/lib.cpp | |
parent | e99adc2029808f6276474c95e8587607a4bd8091 (diff) | |
download | opie-87bb55055c826b6c75d4a66a7ff6e21058cf6361.zip opie-87bb55055c826b6c75d4a66a7ff6e21058cf6361.tar.gz opie-87bb55055c826b6c75d4a66a7ff6e21058cf6361.tar.bz2 |
Update the lib
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 0ea85dd..69ff492 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -2,24 +2,31 @@ #include <stdio.h> #include <stdlib.h> //#include <qpe/qpeapplication.h> #include <qfile.h> #include "frame.h" #include "lib.h" extern "C" { vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video); + int null_is_showing_video( vo_driver_t* self ); + void null_set_show_video( vo_driver_t* self, int show ); + int null_is_fullscreen( vo_driver_t* self ); + void null_set_fullscreen( vo_driver_t* self, int screen ); + int null_is_scaling( vo_driver_t* self ); + void null_set_scaling( vo_driver_t* self, int scale ); + } using namespace XINE; Lib::Lib() { printf("Lib"); QCString str( getenv("HOME") ); str += "/Settings/opiexine.cf"; // get the configuration m_config = xine_config_file_init( str.data() ); // allocate oss for sound @@ -41,28 +48,31 @@ Lib::Lib() { int i = 0; while ( ( out = files[i] ) != 0 ) { printf("Audio %s\n", out ); i++; } // m_xine = xine_init( m_videoOutput, // m_audioOutput, // m_config ); // test loading m_videoOutput = ::init_video_out_plugin( m_config, NULL ); m_xine = xine_init( m_videoOutput, m_audioOutput, m_config ); + // install the event handler + xine_register_event_listener( m_xine, xine_event_handler, this ); } Lib::~Lib() { delete m_config; + xine_remove_event_listener( m_xine, xine_event_handler ); xine_exit( m_xine ); delete m_videoOutput; //delete m_audioOutput; } QCString Lib::version() { QCString str( xine_get_str_version() ); return str; }; int Lib::majorVersion() { @@ -107,13 +117,37 @@ int Lib::length() { return xine_get_stream_length( m_xine ); } bool Lib::isSeekable() { return xine_is_stream_seekable(m_xine); } Frame Lib::currentFrame() { Frame frame; return frame; }; int Lib::error() { return xine_get_error( m_xine ); }; - +void Lib::handleXineEvent( xine_event_t* t ) { + if ( t->type == XINE_EVENT_PLAYBACK_FINISHED ) + emit stopped(); +} +void Lib::setShowVideo( bool video ) { + ::null_set_show_video( m_videoOutput, video ); +} +bool Lib::isShowingVideo() { + return ::null_is_showing_video( m_videoOutput ); +} +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 ); +} +bool Lib::isScaling() { + return ::null_is_scaling( m_videoOutput ); +} +void Lib::xine_event_handler( void* user_data, xine_event_t* t ) { + ((Lib*)user_data)->handleXineEvent( t ); +} |