summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp10
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp12
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp120
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.h40
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp36
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp20
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp2
7 files changed, 120 insertions, 120 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index a52319b..7c2b007 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -164,27 +164,27 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) );
connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
connect( mediaPlayerState, SIGNAL( isSeekableToggled( bool ) ), this, SLOT( setSeekable( bool ) ) );
connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) );
connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) );
connect( this, SIGNAL( forwardReleased() ), this, SLOT( stopSkip() ) );
connect( this, SIGNAL( backReleased() ), this, SLOT( stopSkip() ) );
// Intialise state
setLength( mediaPlayerState->length() );
setPosition( mediaPlayerState->position() );
- setLooping( mediaPlayerState->fullscreen() );
+ setLooping( mediaPlayerState->isFullscreen() );
// setPaused( mediaPlayerState->paused() );
- setPlaying( mediaPlayerState->playing() );
+ setPlaying( mediaPlayerState->isPlaying() );
}
AudioWidget::~AudioWidget() {
for ( int i = 0; i < 10; i++ ) {
delete buttonPixUp[i];
delete buttonPixDown[i];
}
delete pixBg;
delete imgUp;
delete imgDn;
@@ -422,28 +422,28 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) {
audioButtons[i].isHeld = FALSE;
toggleButton(i);
}
} else {
if ( audioButtons[i].isHeld ) {
audioButtons[i].isHeld = FALSE;
if ( !audioButtons[i].isToggle ) {
setToggleButton( i, FALSE );
}
qDebug("mouseEvent %d", i);
switch (i) {
case AudioPlay:
- if( mediaPlayerState->paused() ) {
+ if( mediaPlayerState->isPaused() ) {
mediaPlayerState->setPaused( FALSE );
return;
- } else if( !mediaPlayerState->paused() ) {
+ } else if( !mediaPlayerState->isPaused() ) {
mediaPlayerState->setPaused( TRUE );
return;
}
case AudioStop: mediaPlayerState->setPlaying(FALSE); return;
case AudioNext: if( playList->whichList() ==0 ) mediaPlayerState->setNext(); return;
case AudioPrevious: if( playList->whichList() ==0 ) mediaPlayerState->setPrev(); return;
case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return;
case AudioVolumeUp: emit moreReleased(); return;
case AudioVolumeDown: emit lessReleased(); return;
case AudioPlayList: mediaPlayerState->setList(); return;
case AudioForward: emit forwardReleased(); return;
case AudioBack: emit backReleased(); return;
@@ -504,25 +504,25 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) {
break;
case Key_F10: //contacts
break;
case Key_F11: //menu
mediaPlayerState->toggleBlank();
break;
case Key_F12: //home
break;
case Key_F13: //mail
mediaPlayerState->toggleBlank();
break;
case Key_Space: {
- if(mediaPlayerState->playing()) {
+ if(mediaPlayerState->isPlaying()) {
// toggleButton(1);
mediaPlayerState->setPlaying(FALSE);
// toggleButton(1);
} else {
// toggleButton(0);
mediaPlayerState->setPlaying(TRUE);
// toggleButton(0);
}
}
break;
case Key_Down:
// toggleButton(6);
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 1f19b30..8136ff1 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -65,66 +65,66 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name )
Config cfg( "OpiePlayer" );
cfg.setGroup("PlayList");
QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default");
playList->setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() );
}
MediaPlayer::~MediaPlayer() {
delete xineControl;
delete volControl;
}
void MediaPlayer::pauseCheck( bool b ) {
- if ( b && !mediaPlayerState->playing() ) {
+ if ( b && !mediaPlayerState->isPlaying() ) {
mediaPlayerState->setPaused( FALSE );
}
}
void MediaPlayer::play() {
mediaPlayerState->setPlaying( FALSE );
mediaPlayerState->setPlaying( TRUE );
}
void MediaPlayer::setPlaying( bool play ) {
if ( !play ) {
return;
}
- if ( mediaPlayerState->paused() ) {
+ if ( mediaPlayerState->isPaused() ) {
mediaPlayerState->setPaused( FALSE );
return;
}
QString tickerText, time, fileName;
if( playList->whichList() == 0 ) { //check for filelist
const DocLnk *playListCurrent = playList->current();
if ( playListCurrent != NULL ) {
currentFile = playListCurrent;
}
xineControl->play( currentFile->file() );
fileName = currentFile->name();
long seconds = mediaPlayerState->length();//
time.sprintf("%li:%02i", seconds/60, (int)seconds%60 );
//qDebug(time);
} else {
//if playing in file list.. play in a different way
// random and looping settings enabled causes problems here,
// since there is no selected file in the playlist, but a selected file in the file list,
// so we remember and shutoff
- l = mediaPlayerState->looping();
+ l = mediaPlayerState->isLooping();
if(l) {
mediaPlayerState->setLooping( false );
}
- r = mediaPlayerState->shuffled();
+ r = mediaPlayerState->isShuffled();
mediaPlayerState->setShuffled( false );
fileName = playList->currentFileListPathName();
xineControl->play( fileName );
long seconds = mediaPlayerState->length();
time.sprintf("%li:%02i", seconds/60, (int)seconds%60 );
//qDebug(time);
if( fileName.left(4) != "http" ) {
fileName = QFileInfo( fileName ).baseName();
}
}
@@ -141,41 +141,41 @@ void MediaPlayer::setPlaying( bool play ) {
} else {
tickerText = xineControl->getMetaInfo() + " Length: " + time + " ";
}
}
audioUI->setTickerText( tickerText );
}
void MediaPlayer::prev() {
if( playList->whichList() == 0 ) { //if using the playlist
if ( playList->prev() ) {
play();
- } else if ( mediaPlayerState->looping() ) {
+ } else if ( mediaPlayerState->isLooping() ) {
if ( playList->last() ) {
play();
}
} else {
mediaPlayerState->setList();
}
}
}
void MediaPlayer::next() {
if(playList->whichList() == 0) { //if using the playlist
if ( playList->next() ) {
play();
- } else if ( mediaPlayerState->looping() ) {
+ } else if ( mediaPlayerState->isLooping() ) {
if ( playList->first() ) {
play();
}
} else {
mediaPlayerState->setList();
}
} else { //if playing from file list, let's just stop
qDebug("<<<<<<<<<<<<<<<<<stop for filelists");
mediaPlayerState->setPlaying(false);
mediaPlayerState->setView('l');
if(l) mediaPlayerState->setLooping(l);
if(r) mediaPlayerState->setShuffled(r);
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
index a80d8fd..85d9bac 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
@@ -42,211 +42,211 @@
#include "mediaplayerstate.h"
//#define MediaPlayerDebug(x) qDebug x
#define MediaPlayerDebug(x)
MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
: QObject( parent, name ) {
Config cfg( "OpiePlayer" );
readConfig( cfg );
- isStreaming = false;
- isSeekable = true;
+ streaming = false;
+ seekable = true;
}
MediaPlayerState::~MediaPlayerState() {
}
void MediaPlayerState::readConfig( Config& cfg ) {
cfg.setGroup("Options");
- isFullscreen = cfg.readBoolEntry( "FullScreen" );
- isScaled = cfg.readBoolEntry( "Scaling" );
- isLooping = cfg.readBoolEntry( "Looping" );
- isShuffled = cfg.readBoolEntry( "Shuffle" );
+ fullscreen = cfg.readBoolEntry( "FullScreen" );
+ scaled = cfg.readBoolEntry( "Scaling" );
+ looping = cfg.readBoolEntry( "Looping" );
+ shuffled = cfg.readBoolEntry( "Shuffle" );
usePlaylist = cfg.readBoolEntry( "UsePlayList" );
videoGamma = cfg.readNumEntry( "VideoGamma" );
usePlaylist = TRUE;
- isPlaying = FALSE;
- isStreaming = FALSE;
- isPaused = FALSE;
+ playing = FALSE;
+ streaming = FALSE;
+ paused = FALSE;
curPosition = 0;
curLength = 0;
curView = 'l';
}
void MediaPlayerState::writeConfig( Config& cfg ) const {
cfg.setGroup( "Options" );
- cfg.writeEntry( "FullScreen", isFullscreen );
- cfg.writeEntry( "Scaling", isScaled );
- cfg.writeEntry( "Looping", isLooping );
- cfg.writeEntry( "Shuffle", isShuffled );
+ cfg.writeEntry( "FullScreen", fullscreen );
+ cfg.writeEntry( "Scaling", scaled );
+ cfg.writeEntry( "Looping", looping );
+ cfg.writeEntry( "Shuffle", shuffled );
cfg.writeEntry( "UsePlayList", usePlaylist );
cfg.writeEntry( "VideoGamma", videoGamma );
}
// public stuff
-bool MediaPlayerState::streaming() const {
- return isStreaming;
+bool MediaPlayerState::isStreaming() const {
+ return streaming;
}
-bool MediaPlayerState::seekable() const {
- return isSeekable;
+bool MediaPlayerState::isSeekable() const {
+ return seekable;
}
-bool MediaPlayerState::fullscreen() const {
- return isFullscreen;
+bool MediaPlayerState::isFullscreen() const {
+ return fullscreen;
}
-bool MediaPlayerState::scaled() const {
- return isScaled;
+bool MediaPlayerState::isScaled() const {
+ return scaled;
}
-bool MediaPlayerState::looping() const {
- return isLooping;
+bool MediaPlayerState::isLooping() const {
+ return looping;
}
-bool MediaPlayerState::shuffled() const {
- return isShuffled;
+bool MediaPlayerState::isShuffled() const {
+ return shuffled;
}
-bool MediaPlayerState::playlist() const {
+bool MediaPlayerState::isUsingPlaylist() const {
return usePlaylist;
}
-bool MediaPlayerState::paused() const {
- return isPaused;
+bool MediaPlayerState::isPaused() const {
+ return paused;
}
-bool MediaPlayerState::playing() const {
- return isPlaying;
+bool MediaPlayerState::isPlaying() const {
+ return playing;
}
-bool MediaPlayerState::stop() const {
- return isStoped;
+bool MediaPlayerState::isStop() const {
+ return stoped;
}
long MediaPlayerState::position() const {
return curPosition;
}
long MediaPlayerState::length() const {
return curLength;
}
char MediaPlayerState::view() const {
return curView;
}
// slots
void MediaPlayerState::setIsStreaming( bool b ) {
- if ( isStreaming == b ) {
+ if ( streaming == b ) {
return;
}
- isStreaming = b;
+ streaming = b;
}
void MediaPlayerState::setIsSeekable( bool b ) {
//if ( isSeekable == b ) {
// return;
// }
- isSeekable = b;
+ seekable = b;
emit isSeekableToggled(b);
}
void MediaPlayerState::setFullscreen( bool b ) {
- if ( isFullscreen == b ) {
+ if ( fullscreen == b ) {
return;
}
- isFullscreen = b;
+ fullscreen = b;
emit fullscreenToggled(b);
}
void MediaPlayerState::setBlanked( bool b ) {
- if ( isBlanked == b ) {
+ if ( blanked == b ) {
return;
}
- isBlanked = b;
+ blanked = b;
emit blankToggled(b);
}
void MediaPlayerState::setScaled( bool b ) {
- if ( isScaled == b ) {
+ if ( scaled == b ) {
return;
}
- isScaled = b;
+ scaled = b;
emit scaledToggled(b);
}
void MediaPlayerState::setLooping( bool b ) {
- if ( isLooping == b ) {
+ if ( looping == b ) {
return;
}
- isLooping = b;
+ looping = b;
emit loopingToggled(b);
}
void MediaPlayerState::setShuffled( bool b ) {
- if ( isShuffled == b ) {
+ if ( shuffled == b ) {
return;
}
- isShuffled = b;
+ shuffled = b;
emit shuffledToggled(b);
}
void MediaPlayerState::setPlaylist( bool b ) {
if ( usePlaylist == b ) {
return;
}
usePlaylist = b;
emit playlistToggled(b);
}
void MediaPlayerState::setPaused( bool b ) {
- if ( isPaused == b ) {
- isPaused = FALSE;
+ if ( paused == b ) {
+ paused = FALSE;
emit pausedToggled(FALSE);
return;
}
- isPaused = b;
+ paused = b;
emit pausedToggled(b);
}
void MediaPlayerState::setPlaying( bool b ) {
- if ( isPlaying == b ) {
+ if ( playing == b ) {
return;
}
- isPlaying = b;
- isStoped = !b;
+ playing = b;
+ stoped = !b;
emit playingToggled(b);
}
void MediaPlayerState::setStop( bool b ) {
- if ( isStoped == b ) {
+ if ( stoped == b ) {
return;
}
- isStoped = b;
+ stoped = b;
emit stopToggled(b);
}
void MediaPlayerState::setPosition( long p ) {
if ( curPosition == p ) {
return;
}
curPosition = p;
emit positionChanged(p);
}
void MediaPlayerState::updatePosition( long p ){
@@ -294,45 +294,45 @@ void MediaPlayerState::setList() {
setView('l');
}
void MediaPlayerState::setVideo() {
setView('v');
}
void MediaPlayerState::setAudio() {
setView('a');
}
void MediaPlayerState::toggleFullscreen() {
- setFullscreen( !isFullscreen );
+ setFullscreen( !fullscreen );
}
void MediaPlayerState::toggleScaled() {
- setScaled( !isScaled);
+ setScaled( !scaled);
}
void MediaPlayerState::toggleLooping() {
- setLooping( !isLooping);
+ setLooping( !looping);
}
void MediaPlayerState::toggleShuffled() {
- setShuffled( !isShuffled);
+ setShuffled( !shuffled);
}
void MediaPlayerState::togglePlaylist() {
setPlaylist( !usePlaylist);
}
void MediaPlayerState::togglePaused() {
- setPaused( !isPaused);
+ setPaused( !paused);
}
void MediaPlayerState::togglePlaying() {
- setPlaying( !isPlaying);
+ setPlaying( !playing);
}
void MediaPlayerState::toggleBlank() {
- setBlanked( !isBlanked);
+ setBlanked( !blanked);
}
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h
index f9c1eeb..4e837e3 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.h
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h
@@ -41,34 +41,34 @@
class MediaPlayerDecoder;
class Config;
class MediaPlayerState : public QObject {
Q_OBJECT
public:
MediaPlayerState( QObject *parent, const char *name );
~MediaPlayerState();
- bool streaming() const;
- bool seekable() const;
- bool fullscreen() const;
- bool scaled() const;
- bool looping() const;
- bool shuffled() const;
- bool playlist() const;
- bool paused() const;
- bool playing() const;
- bool stop() const;
+ bool isStreaming() const;
+ bool isSeekable() const;
+ bool isFullscreen() const;
+ bool isScaled() const;
+ bool isLooping() const;
+ bool isShuffled() const;
+ bool isUsingPlaylist() const;
+ bool isPaused() const;
+ bool isPlaying() const;
+ bool isStop() const;
long position() const;
long length() const;
char view() const;
public slots:
void setIsStreaming( bool b );
void setIsSeekable( bool b );
void setFullscreen( bool b );
void setScaled( bool b );
void setLooping( bool b );
void setShuffled( bool b );
void setPlaylist( bool b );
@@ -110,34 +110,34 @@ signals:
void stopToggled( bool );
void positionChanged( long ); // When the slider is moved
void positionUpdated( long ); // When the media file progresses
void lengthChanged( long );
void viewChanged( char );
void isSeekableToggled( bool );
void blankToggled( bool );
void videoGammaChanged( int );
void prev();
void next();
private:
- bool isStreaming;
- bool isSeekable;
- bool isFullscreen;
- bool isScaled;
- bool isBlanked;
- bool isLooping;
- bool isShuffled;
+ bool streaming;
+ bool seekable;
+ bool fullscreen;
+ bool scaled;
+ bool blanked;
+ bool looping;
+ bool shuffled;
bool usePlaylist;
- bool isPaused;
- bool isPlaying;
- bool isStoped;
+ bool paused;
+ bool playing;
+ bool stoped;
long curPosition;
long curLength;
char curView;
int videoGamma;
void readConfig( Config& cfg );
};
#endif // MEDIA_PLAYER_STATE_H
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 593f072..d1506db 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -167,27 +167,27 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
}
PlayListWidget::~PlayListWidget() {
if ( d->current ) {
delete d->current;
}
delete d;
}
void PlayListWidget::initializeStates() {
- d->tbPlay->setOn( mediaPlayerState->playing() );
- d->tbLoop->setOn( mediaPlayerState->looping() );
- d->tbShuffle->setOn( mediaPlayerState->shuffled() );
+ d->tbPlay->setOn( mediaPlayerState->isPlaying() );
+ d->tbLoop->setOn( mediaPlayerState->isLooping() );
+ d->tbShuffle->setOn( mediaPlayerState->isShuffled() );
setPlaylist( true );
}
void PlayListWidget::writeDefaultPlaylist() {
Config config( "OpiePlayer" );
config.setGroup( "PlayList" );
QString filename=QPEApplication::documentDir() + "/default.m3u";
QString currentString = config.readEntry( "CurrentPlaylist", filename);
if( currentString == filename) {
Om3u *m3uList;
// qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>");
@@ -200,25 +200,25 @@ void PlayListWidget::writeDefaultPlaylist() {
while ( d->selectedFiles->next() );
m3uList->write();
m3uList->close();
if(m3uList) delete m3uList;
}
}
}
void PlayListWidget::addToSelection( const DocLnk& lnk ) {
d->setDocumentUsed = FALSE;
- if ( mediaPlayerState->playlist() ) {
+ if ( mediaPlayerState->isUsingPlaylist() ) {
if( QFileInfo( lnk.file() ).exists() ||
lnk.file().left(4) == "http" ) {
d->selectedFiles->addToSelection( lnk );
}
// writeCurrentM3u();
}
else
mediaPlayerState->setPlaying( TRUE );
}
void PlayListWidget::clearList() {
@@ -419,102 +419,102 @@ void PlayListWidget::setDocument( const QString& fileref ) {
void PlayListWidget::useSelectedDocument() {
d->setDocumentUsed = FALSE;
}
const DocLnk *PlayListWidget::current() { // this is fugly
switch ( whichList() ) {
case 0: //playlist
{
// qDebug("playlist");
- if ( mediaPlayerState->playlist() ) {
+ if ( mediaPlayerState->isUsingPlaylist() ) {
return d->selectedFiles->current();
} else if ( d->setDocumentUsed && d->current ) {
return d->current;
} else {
return &(d->files->selectedDocument());
}
}
break;
};
return 0;
}
bool PlayListWidget::prev() {
- if ( mediaPlayerState->playlist() ) {
- if ( mediaPlayerState->shuffled() ) {
+ if ( mediaPlayerState->isUsingPlaylist() ) {
+ if ( mediaPlayerState->isShuffled() ) {
const DocLnk *cur = current();
int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0));
for ( int i = 0; i < j; i++ ) {
if ( !d->selectedFiles->next() )
d->selectedFiles->first();
}
if ( cur == current() )
if ( !d->selectedFiles->next() ) {
d->selectedFiles->first();
}
return TRUE;
} else {
if ( !d->selectedFiles->prev() ) {
- if ( mediaPlayerState->looping() ) {
+ if ( mediaPlayerState->isLooping() ) {
return d->selectedFiles->last();
} else {
return FALSE;
}
}
return TRUE;
}
} else {
- return mediaPlayerState->looping();
+ return mediaPlayerState->isLooping();
}
}
bool PlayListWidget::next() {
//qDebug("<<<<<<<<<<<<next()");
- if ( mediaPlayerState->playlist() ) {
- if ( mediaPlayerState->shuffled() ) {
+ if ( mediaPlayerState->isUsingPlaylist() ) {
+ if ( mediaPlayerState->isShuffled() ) {
return prev();
} else {
if ( !d->selectedFiles->next() ) {
- if ( mediaPlayerState->looping() ) {
+ if ( mediaPlayerState->isLooping() ) {
return d->selectedFiles->first();
} else {
return FALSE;
}
}
return TRUE;
}
} else {
- return mediaPlayerState->looping();
+ return mediaPlayerState->isLooping();
}
}
bool PlayListWidget::first() {
- if ( mediaPlayerState->playlist() )
+ if ( mediaPlayerState->isUsingPlaylist() )
return d->selectedFiles->first();
else
- return mediaPlayerState->looping();
+ return mediaPlayerState->isLooping();
}
bool PlayListWidget::last() {
- if ( mediaPlayerState->playlist() )
+ if ( mediaPlayerState->isUsingPlaylist() )
return d->selectedFiles->last();
else
- return mediaPlayerState->looping();
+ return mediaPlayerState->isLooping();
}
void PlayListWidget::saveList() {
writem3u();
}
void PlayListWidget::loadList( const DocLnk & lnk) {
QString name = lnk.name();
// qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name);
@@ -1080,25 +1080,25 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) {
if ( !d->selectedFiles->prev() )
// d->selectedFiles->last();
break;
}
}
void PlayListWidget::pmViewActivated(int index) {
// qDebug("%d", index);
switch(index) {
case -16:
{
mediaPlayerState->toggleFullscreen();
- bool b=mediaPlayerState->fullscreen();
+ bool b=mediaPlayerState->isFullscreen();
pmView->setItemChecked( index, b);
Config cfg( "OpiePlayer" );
cfg.writeEntry( "FullScreen", b );
}
break;
};
}
void PlayListWidget::populateSkinsMenu() {
int item = 0;
defaultSkinIndex = 0;
QString skinName;
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index 3a757f0..c435241 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -135,26 +135,26 @@ QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) {
slider->setMaxValue( 1 );
slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) );
//slider->setFocusPolicy( QWidget::NoFocus );
resizeEvent( NULL );
connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
setLength( mediaPlayerState->length() );
setPosition( mediaPlayerState->position() );
- setFullscreen( mediaPlayerState->fullscreen() );
- setPlaying( mediaPlayerState->playing() );
+ setFullscreen( mediaPlayerState->isFullscreen() );
+ setPlaying( mediaPlayerState->isPlaying() );
}
VideoWidget::~VideoWidget() {
for ( int i = 0; i < 7; i++ ) {
delete buttonPixUp[i];
delete buttonPixDown[i];
}
delete pixBg;
delete imgUp;
@@ -249,25 +249,25 @@ void VideoWidget::setView( char view ) {
scaledHeight = 0;
hide();
}
}
void VideoWidget::updateSlider( long i, long max ) {
// Will flicker too much if we don't do this
if ( max == 0 ) {
return;
}
int width = slider->width();
int val = int((double)i * width / max);
- if ( !mediaPlayerState->fullscreen() && !videoSliderBeingMoved ) {
+ if ( !mediaPlayerState->isFullscreen() && !videoSliderBeingMoved ) {
if ( slider->value() != val ) {
slider->setValue( val );
}
if ( slider->maxValue() != width ) {
slider->setMaxValue( width );
}
}
}
void VideoWidget::setToggleButton( int i, bool down ) {
if ( down != videoButtons[i].isDown ) {
toggleButton( i );
@@ -318,29 +318,29 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
}
} else {
if ( videoButtons[i].isHeld ) {
videoButtons[i].isHeld = FALSE;
if ( !videoButtons[i].isToggle ) {
setToggleButton( i, FALSE );
}
switch(i) {
case VideoPlay: {
- if( mediaPlayerState->paused() ) {
+ if( mediaPlayerState->isPaused() ) {
setToggleButton( i, FALSE );
mediaPlayerState->setPaused( FALSE );
return;
- } else if( !mediaPlayerState->paused() ) {
+ } else if( !mediaPlayerState->isPaused() ) {
setToggleButton( i, TRUE );
mediaPlayerState->setPaused( TRUE );
return;
} else {
return;
}
}
case VideoStop: mediaPlayerState->setPlaying( FALSE ); return;
case VideoNext: if(playList->whichList() ==0) mediaPlayerState->setNext(); return;
case VideoPrevious: if(playList->whichList() ==0) mediaPlayerState->setPrev(); return;
case VideoVolUp: emit moreReleased(); return;
@@ -348,44 +348,44 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) {
case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return;
}
}
}
}
}
void VideoWidget::mousePressEvent( QMouseEvent *event ) {
mouseMoveEvent( event );
}
void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) {
- if ( mediaPlayerState->fullscreen() ) {
+ if ( mediaPlayerState->isFullscreen() ) {
mediaPlayerState->setFullscreen( FALSE );
makeVisible();
}
mouseMoveEvent( event );
}
void VideoWidget::showEvent( QShowEvent* ) {
QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 );
mouseMoveEvent( &event );
}
void VideoWidget::backToNormal() {
mediaPlayerState->setFullscreen( FALSE );
makeVisible();
}
void VideoWidget::makeVisible() {
- if ( mediaPlayerState->fullscreen() ) {
+ if ( mediaPlayerState->isFullscreen() ) {
setBackgroundMode( QWidget::NoBackground );
showFullScreen();
resize( qApp->desktop()->size() );
videoFrame-> setGeometry ( 0, 0, width ( ), height ( ));
slider->hide();
disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
} else {
@@ -394,49 +394,49 @@ void VideoWidget::makeVisible() {
setBackgroundPixmap( *pixBg );
QWidget *d = QApplication::desktop();
int w = d->width();
int h = d->height();
if(w>h) {
int newW=(w/2)-(246/2); //this will only work with 320x240
videoFrame->setGeometry( QRect( newW, 4, 240, 170 ) );
} else {
videoFrame->setGeometry( QRect( 0, 30, 240, 170 ) );
}
- if ( !mediaPlayerState->seekable() ) {
+ if ( !mediaPlayerState->isSeekable() ) {
if( !slider->isHidden()) {
slider->hide();
}
disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
disconnect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
disconnect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
} else {
slider->show();
connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
}
}
}
void VideoWidget::paintEvent( QPaintEvent * pe) {
QPainter p( this );
- if ( mediaPlayerState->fullscreen() ) {
+ if ( mediaPlayerState->isFullscreen() ) {
// Clear the background
p.setBrush( QBrush( Qt::black ) );
} else {
if ( !pe->erased() ) {
// Combine with background and double buffer
QPixmap pix( pe->rect().size() );
QPainter p( &pix );
p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() );
p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() );
for ( int i = 0; i < numVButtons; i++ ) {
paintButton( &p, i );
}
@@ -465,25 +465,25 @@ void VideoWidget::keyReleaseEvent( QKeyEvent *e) {
case Key_F9: //activity
break;
case Key_F10: //contacts
// hide();
break;
case Key_F11: //menu
break;
case Key_F12: //home
break;
case Key_F13: //mail
break;
case Key_Space: {
- if(mediaPlayerState->playing()) {
+ if(mediaPlayerState->isPlaying()) {
mediaPlayerState->setPlaying(FALSE);
} else {
mediaPlayerState->setPlaying(TRUE);
}
}
break;
case Key_Down:
// toggleButton(6);
emit lessClicked();
emit lessReleased();
// toggleButton(6);
break;
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index f6289d7..71e08a6 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -171,25 +171,25 @@ void XineControl::length() {
}
/**
* Reports the position the xine backend is at right now
* @return long the postion in seconds
*/
long XineControl::position() {
m_position = ( currentTime() );
mediaPlayerState->updatePosition( m_position );
long emitPos = (long)m_position;
emit positionChanged( emitPos );
- if( mediaPlayerState->playing() ) {
+ if( mediaPlayerState->isPlaying() ) {
// needs to be stopped the media is stopped
QTimer::singleShot( 1000, this, SLOT( position() ) );
}
// qDebug("POSITION : %d", m_position);
return m_position;
}
/**
* Set videoplayback to fullscreen
* @param isSet
*/
void XineControl::setFullscreen( bool isSet ) {