Diffstat (limited to 'noncore/multimedia/opieplayer2/mediaplayer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index a9c74c4..8acc488 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -26,4 +26,2 @@ -extern VideoWidget *videoUI; -extern PlayListWidget *playList; @@ -32,4 +30,4 @@ extern PlayListWidget *playList; -MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) - : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ) { +MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) + : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { @@ -41,3 +39,3 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, fd=-1;fl=-1; - playList->setCaption( tr( "OpiePlayer: Initializating" ) ); + playList.setCaption( tr( "OpiePlayer: Initializating" ) ); @@ -59,3 +57,3 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); - playList->setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); + playList.setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); } @@ -89,3 +87,3 @@ void MediaPlayer::setPlaying( bool play ) { QString tickerText, time, fileName; - if ( playList->currentTab() != PlayListWidget::CurrentPlayList ) { + if ( playList.currentTab() != PlayListWidget::CurrentPlayList ) { //if playing in file list.. play in a different way @@ -102,3 +100,3 @@ void MediaPlayer::setPlaying( bool play ) { - PlayListWidget::Entry playListEntry = playList->currentEntry(); + PlayListWidget::Entry playListEntry = playList.currentEntry(); fileName = playListEntry.name; @@ -128,7 +126,7 @@ void MediaPlayer::setPlaying( bool play ) { void MediaPlayer::prev() { - if( playList->currentTab() == PlayListWidget::CurrentPlayList ) { //if using the playlist - if ( playList->prev() ) { + if( playList.currentTab() == PlayListWidget::CurrentPlayList ) { //if using the playlist + if ( playList.prev() ) { play(); } else if ( mediaPlayerState.isLooping() ) { - if ( playList->last() ) { + if ( playList.last() ) { play(); @@ -144,7 +142,7 @@ void MediaPlayer::next() { - if(playList->currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist - if ( playList->next() ) { + if(playList.currentTab() == PlayListWidget::CurrentPlayList) { //if using the playlist + if ( playList.next() ) { play(); } else if ( mediaPlayerState.isLooping() ) { - if ( playList->first() ) { + if ( playList.first() ) { play(); @@ -341,3 +339,3 @@ void MediaPlayer::cleanUp() {// this happens on closing mediaPlayerState.writeConfig( cfg ); - playList->writeDefaultPlaylist( ); + playList.writeDefaultPlaylist( ); @@ -352,4 +350,4 @@ void MediaPlayer::recreateAudioAndVideoWidgets() delete videoUI; - audioUI = new AudioWidget( mediaPlayerState, 0, "audioUI" ); - videoUI = new VideoWidget( mediaPlayerState, 0, "videoUI" ); + audioUI = new AudioWidget( playList, mediaPlayerState, 0, "audioUI" ); + videoUI = new VideoWidget( playList, mediaPlayerState, 0, "videoUI" ); |