summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/lib.h2
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp6
3 files changed, 4 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index 1b5fd51..9e818eb 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -150,50 +150,50 @@ int Lib::minorVersion() {
int major, minor, sub;
xine_get_version ( &major, &minor, &sub );
return minor;
}
int Lib::subVersion() {
int major, minor, sub;
xine_get_version ( &major, &minor, &sub );
return sub;
}
int Lib::play( const QString& fileName, int startPos, int start_time ) {
QString str = fileName.stripWhiteSpace();
if ( !xine_open( m_stream, QFile::encodeName(str.utf8() ).data() ) ) {
return 0;
}
return xine_play( m_stream, startPos, start_time);
}
void Lib::stop() {
qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>");
xine_stop( m_stream );
}
-void Lib::pause() {
- xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE );
+void Lib::pause( bool toggle ) {
+ xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL );
}
int Lib::speed() const {
return xine_get_param ( m_stream, XINE_PARAM_SPEED );
}
void Lib::setSpeed( int speed ) {
xine_set_param ( m_stream, XINE_PARAM_SPEED, speed );
}
int Lib::status() const {
return xine_get_status( m_stream );
}
int Lib::currentPosition() const {
int pos, time, length;
xine_get_pos_length( m_stream, &pos, &time, &length );
return pos;
}
int Lib::currentTime() const {
int pos, time, length;
xine_get_pos_length( m_stream, &pos, &time, &length );
return time/1000;
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h
index 3224cb9..37a4f9a 100644
--- a/noncore/multimedia/opieplayer2/lib.h
+++ b/noncore/multimedia/opieplayer2/lib.h
@@ -50,49 +50,49 @@ 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 ThreadUtil::Channel {
Q_OBJECT
public:
Lib(XineVideoWidget* = 0);
~Lib();
static int majorVersion();
static int minorVersion();
static int subVersion();
void resize ( const QSize &s );
int play( const QString& fileName,
int startPos = 0,
int start_time = 0 );
void stop();
- void pause();
+ void pause( bool toggle );
int speed() const;
/**
* Set the speed of the stream, if codec supports it
* XINE_SPEED_PAUSE 0
* XINE_SPEED_SLOW_4 1
* XINE_SPEED_SLOW_2 2
* XINE_SPEED_NORMAL 4
* XINE_SPEED_FAST_2 8
*XINE_SPEED_FAST_4 16
*/
void setSpeed( int speed = XINE_SPEED_PAUSE );
int status() const;
int currentPosition()const;
//in seconds
int currentTime()const;
int length() const;
bool isSeekable()const;
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 6f1cd9c..0e81fa2 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -123,53 +123,49 @@ void XineControl::nextMedia() {
void XineControl::setGamma( int value ) {
libXine->setGamma( value );
}
void XineControl::stop( bool isSet ) {
if ( !isSet ) {
libXine->stop();
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
if ( disabledSuspendScreenSaver ) {
disabledSuspendScreenSaver = FALSE;
// Re-enable the suspend mode
QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
}
#endif
}
}
/**
* Pause playback
* @isSet
*/
void XineControl::pause( bool isSet) {
- if ( isSet ) {
- libXine->pause();
- } else {
- libXine->play( m_fileName, 0, m_currentTime );
- }
+ libXine->pause( isSet );
}
/**
* get current time in playback
*/
long XineControl::currentTime() {
// todo: jede sekunde überprüfen
m_currentTime = libXine->currentTime();
return m_currentTime;
QTimer::singleShot( 1000, this, SLOT( currentTime() ) );
}
/**
* Set the length of the media file
*/
void XineControl::length() {
m_length = libXine->length();
mediaPlayerState.setLength( m_length );
}
/**
* Reports the position the xine backend is at right now