-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 69ff492..3f2eea6 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -1,121 +1,122 @@ #include <stdio.h> #include <stdlib.h> //#include <qpe/qpeapplication.h> #include <qfile.h> +#include "xinevideowidget.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() { +Lib::Lib(XineVideoWidget* /*widget*/) { 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 // and fb for framebuffer m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; if (m_audioOutput == NULL ) printf("Failure\n"); else printf("Success\n"); // test code m_videoOutput = xine_load_video_output_plugin(m_config, "fb", VISUAL_TYPE_FB, 0 ); char** files = xine_list_video_output_plugins(3); char* out; 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() { return xine_get_major_version(); } int Lib::minorVersion() { return xine_get_minor_version(); }; int Lib::subVersion() { return xine_get_sub_version(); } int Lib::play( const QString& fileName, int startPos, int start_time ) { QString str = fileName; return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), startPos, start_time); } void Lib::stop() { xine_stop(m_xine ); } void Lib::pause(){ xine_set_speed( m_xine, SPEED_PAUSE ); } int Lib::speed() { return xine_get_speed( m_xine ); } void Lib::setSpeed( int speed ) { xine_set_speed( m_xine, speed ); } int Lib::status(){ return xine_get_status( m_xine ); } int Lib::currentPosition(){ return xine_get_current_position( m_xine ); } int Lib::currentTime() { return xine_get_current_time( m_xine ); }; int Lib::length() { return xine_get_stream_length( m_xine ); } bool Lib::isSeekable() { return xine_is_stream_seekable(m_xine); } diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index 00a1248..1d0d3af 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h @@ -1,105 +1,107 @@ #ifndef ZECKEXINELIB_H #define ZECKEXINELIB_H #include <qcstring.h> #include <qstring.h> #include <qobject.h> #include <xine.h> +class XineVideoWidget; + namespace XINE { /** * Lib wrapps the simple interface * of libxine for easy every day use * This will become a full C++ Wrapper * It supports playing, pausing, info, * stooping, seeking. */ class Frame; class Lib : public QObject { Q_OBJECT public: - Lib(); + Lib(XineVideoWidget* = 0); ~Lib(); QCString version(); int majorVersion()/*const*/; int minorVersion()/*const*/; int subVersion()/*const*/; int play( const QString& fileName, int startPos = 0, int start_time = 0 ); void stop() /*const*/; void pause()/*const*/; int speed() /*const*/; void setSpeed( int speed = SPEED_PAUSE ); int status() /*const*/; int currentPosition()/*const*/; //in seconds int currentTime()/*const*/; int length() /*const*/; bool isSeekable()/*const*/; /** * Whether or not to show video output */ void setShowVideo(bool video); /** * is we show video */ bool isShowingVideo() /*const*/; /** * */ void showVideoFullScreen( bool fullScreen ); /** * */ bool isVideoFullScreen()/*const*/ ; /** * */ bool isScaling(); /** * */ void setScaling( bool ); /** * test */ Frame currentFrame()/*const*/; /** * Returns the error code */ int error() /*const*/; signals: void stopped(); private: xine_t *m_xine; config_values_t *m_config; vo_driver_t *m_videoOutput; ao_driver_t* m_audioOutput; void handleXineEvent( xine_event_t* t ); // C -> C++ bridge for the event system static void xine_event_handler( void* user_data, xine_event_t* t); }; }; #endif |