summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/lib.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp92
1 files changed, 2 insertions, 90 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 20fd1e2..1e0dc21 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -74,4 +74,2 @@ Lib::Lib( XineVideoWidget* widget )
{
- ThreadUtil::AutoLock lock( m_initGuard );
- m_initialized = false;
m_video = false;
@@ -91,15 +89,4 @@ Lib::Lib( XineVideoWidget* widget )
- start();
-}
-
-void Lib::run()
-{
- initialize();
-}
-
-void Lib::initialize()
-{
m_xine = xine_new( );
- QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf";
xine_config_load( m_xine, QFile::encodeName( configPath ) );
@@ -132,7 +119,2 @@ void Lib::initialize()
xine_event_create_listener_thread (m_queue, xine_event_handler, this);
-
- ThreadUtil::AutoLock lock( m_initGuard );
- m_initialized = true;
-
- send( new ThreadUtil::ChannelMessage( InitializationMessageType ), OneWay );
}
@@ -140,6 +122,2 @@ void Lib::initialize()
Lib::~Lib() {
- ThreadUtil::AutoLock lock( m_initGuard );
-
- assert( m_initialized );
-
// free( m_config );
@@ -158,13 +136,2 @@ Lib::~Lib() {
-void Lib::assertInitialized() const
-{
- ThreadUtil::AutoLock lock( m_initGuard );
-
- if ( m_initialized )
- return;
-
- qDebug( "LibXine: xine function called while not being initialized, yet! Fix the caller!" );
- assert( m_initialized );
-}
-
void Lib::resize ( const QSize &s ) {
@@ -195,4 +162,2 @@ int Lib::subVersion() {
int Lib::play( const QString& fileName, int startPos, int start_time ) {
- assertInitialized();
-
QString str = fileName.stripWhiteSpace();
@@ -205,4 +170,2 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) {
void Lib::stop() {
- assertInitialized();
-
qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>");
@@ -212,4 +175,2 @@ void Lib::stop() {
void Lib::pause( bool toggle ) {
- assertInitialized();
-
xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL );
@@ -218,4 +179,2 @@ void Lib::pause( bool toggle ) {
int Lib::speed() const {
- assertInitialized();
-
return xine_get_param ( m_stream, XINE_PARAM_SPEED );
@@ -224,4 +183,2 @@ int Lib::speed() const {
void Lib::setSpeed( int speed ) {
- assertInitialized();
-
xine_set_param ( m_stream, XINE_PARAM_SPEED, speed );
@@ -230,4 +187,2 @@ void Lib::setSpeed( int speed ) {
int Lib::status() const {
- assertInitialized();
-
return xine_get_status( m_stream );
@@ -236,4 +191,2 @@ int Lib::status() const {
int Lib::currentPosition() const {
- assertInitialized();
-
int pos, time, length;
@@ -244,4 +197,2 @@ int Lib::currentPosition() const {
int Lib::currentTime() const {
- assertInitialized();
-
int pos, time, length;
@@ -252,4 +203,2 @@ int Lib::currentTime() const {
int Lib::length() const {
- assertInitialized();
-
int pos, time, length;
@@ -260,4 +209,2 @@ int Lib::length() const {
bool Lib::isSeekable() const {
- assertInitialized();
-
return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE );
@@ -266,4 +213,2 @@ bool Lib::isSeekable() const {
void Lib::seekTo( int time ) {
- assertInitialized();
-
//xine_trick_mode ( m_stream, XINE_TRICK_MODE_SEEK_TO_TIME, time ); NOT IMPLEMENTED YET IN XINE :_(
@@ -275,4 +220,2 @@ void Lib::seekTo( int time ) {
Frame Lib::currentFrame() const {
- assertInitialized();
-
Frame frame;
@@ -282,4 +225,2 @@ Frame Lib::currentFrame() const {
QString Lib::metaInfo( int number) const {
- assertInitialized();
-
return xine_get_meta_info( m_stream, number );
@@ -288,4 +229,2 @@ QString Lib::metaInfo( int number) const {
int Lib::error() const {
- assertInitialized();
-
return xine_get_error( m_stream );
@@ -296,10 +235,3 @@ void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType )
assert( sendType == ThreadUtil::Channel::OneWay );
- switch ( msg->type() ) {
- case XineMessageType:
- handleXineEvent( static_cast<XineMessage *>( msg )->xineEvent );
- break;
- case InitializationMessageType:
- emit initialized();
- break;
- }
+ handleXineEvent( msg->type() );
delete msg;
@@ -308,3 +240,3 @@ void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType )
void Lib::handleXineEvent( const xine_event_t* t ) {
- send( new XineMessage( t->type ), OneWay );
+ send( new ThreadUtil::ChannelMessage( t->type ), OneWay );
}
@@ -312,4 +244,2 @@ void Lib::handleXineEvent( const xine_event_t* t ) {
void Lib::handleXineEvent( int type ) {
- assertInitialized();
-
if ( type == XINE_EVENT_UI_PLAYBACK_FINISHED ) {
@@ -321,4 +251,2 @@ void Lib::handleXineEvent( int type ) {
void Lib::setShowVideo( bool video ) {
- assertInitialized();
-
m_video = video;
@@ -328,4 +256,2 @@ void Lib::setShowVideo( bool video ) {
bool Lib::isShowingVideo() const {
- assertInitialized();
-
return ::null_is_showing_video( m_videoOutput );
@@ -334,4 +260,2 @@ bool Lib::isShowingVideo() const {
bool Lib::hasVideo() const {
- assertInitialized();
-
return xine_get_stream_info( m_stream, 18 );
@@ -340,4 +264,2 @@ bool Lib::hasVideo() const {
void Lib::showVideoFullScreen( bool fullScreen ) {
- assertInitialized();
-
::null_set_fullscreen( m_videoOutput, fullScreen );
@@ -346,4 +268,2 @@ void Lib::showVideoFullScreen( bool fullScreen ) {
bool Lib::isVideoFullScreen() const {
- assertInitialized();
-
return ::null_is_fullscreen( m_videoOutput );
@@ -352,4 +272,2 @@ bool Lib::isVideoFullScreen() const {
void Lib::setScaling( bool scale ) {
- assertInitialized();
-
::null_set_scaling( m_videoOutput, scale );
@@ -358,4 +276,2 @@ void Lib::setScaling( bool scale ) {
void Lib::setGamma( int value ) {
- assertInitialized();
-
//qDebug( QString( "%1").arg(value) );
@@ -366,4 +282,2 @@ void Lib::setGamma( int value ) {
bool Lib::isScaling() const {
- assertInitialized();
-
return ::null_is_scaling( m_videoOutput );
@@ -381,4 +295,2 @@ void Lib::xine_display_frame( void* user_data, uint8_t *frame,
void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
- assertInitialized();
-
if ( !m_video ) {