summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/main.cpp11
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp39
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.h9
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp14
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h3
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp5
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.h6
7 files changed, 56 insertions, 31 deletions
diff --git a/noncore/multimedia/opieplayer2/main.cpp b/noncore/multimedia/opieplayer2/main.cpp
index 7d11ca0..7fc7b94 100644
--- a/noncore/multimedia/opieplayer2/main.cpp
+++ b/noncore/multimedia/opieplayer2/main.cpp
@@ -2,13 +2,9 @@
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include "mediaplayerstate.h" 3#include "mediaplayerstate.h"
4#include "playlistwidget.h" 4#include "playlistwidget.h"
5#include "audiowidget.h"
6#include "videowidget.h"
7#include "mediaplayer.h" 5#include "mediaplayer.h"
8 6
9PlayListWidget *playList; 7PlayListWidget *playList;
10AudioWidget *audioUI;
11VideoWidget *videoUI;
12 8
13int main(int argc, char **argv) { 9int main(int argc, char **argv) {
14 QPEApplication a(argc,argv); 10 QPEApplication a(argc,argv);
@@ -17,12 +13,9 @@ int main(int argc, char **argv) {
17 PlayListWidget pl( st, 0, "playList" ); 13 PlayListWidget pl( st, 0, "playList" );
18 playList = &pl; 14 playList = &pl;
19 pl.showMaximized(); 15 pl.showMaximized();
20 AudioWidget aw( st, 0, "audioUI" );
21 audioUI = &aw;
22 VideoWidget vw( st, 0, "videoUI" );
23 videoUI = &vw;
24 a.processEvents();
25 MediaPlayer mp( st, 0, "mediaPlayer" ); 16 MediaPlayer mp( st, 0, "mediaPlayer" );
17 QObject::connect( &pl, SIGNAL( skinSelected() ),
18 &mp, SLOT( recreateAudioAndVideoWidgets() ) );
26 19
27 a.showMainDocumentWidget(&pl); 20 a.showMainDocumentWidget(&pl);
28 21
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index eccb5d9..a9c74c4 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -24,7 +24,6 @@
24#include <sys/ioctl.h> 24#include <sys/ioctl.h>
25 25
26 26
27extern AudioWidget *audioUI;
28extern VideoWidget *videoUI; 27extern VideoWidget *videoUI;
29extern PlayListWidget *playList; 28extern PlayListWidget *playList;
30 29
@@ -34,6 +33,11 @@ extern PlayListWidget *playList;
34MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) 33MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name )
35 : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ) { 34 : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ) {
36 35
36 audioUI = 0;
37 videoUI = 0;
38 xineControl = 0;
39 recreateAudioAndVideoWidgets();
40
37 fd=-1;fl=-1; 41 fd=-1;fl=-1;
38 playList->setCaption( tr( "OpiePlayer: Initializating" ) ); 42 playList->setCaption( tr( "OpiePlayer: Initializating" ) );
39 43
@@ -49,18 +53,7 @@ MediaPlayer::MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent,
49 connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); 53 connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
50 connect( &mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) ); 54 connect( &mediaPlayerState, SIGNAL( blankToggled( bool ) ), this, SLOT ( blank( bool ) ) );
51 55
52 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
53 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
54 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
55 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
56
57 connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
58 connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
59 connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
60 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
61
62 volControl = new VolumeControl; 56 volControl = new VolumeControl;
63 xineControl = new XineControl( mediaPlayerState );
64 Config cfg( "OpiePlayer" ); 57 Config cfg( "OpiePlayer" );
65 cfg.setGroup("PlayList"); 58 cfg.setGroup("PlayList");
66 QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); 59 QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default");
@@ -351,3 +344,25 @@ void MediaPlayer::cleanUp() {// this happens on closing
351// QPEApplication::grabKeyboard(); 344// QPEApplication::grabKeyboard();
352// QPEApplication::ungrabKeyboard(); 345// QPEApplication::ungrabKeyboard();
353} 346}
347
348void MediaPlayer::recreateAudioAndVideoWidgets()
349{
350 delete xineControl;
351 delete audioUI;
352 delete videoUI;
353 audioUI = new AudioWidget( mediaPlayerState, 0, "audioUI" );
354 videoUI = new VideoWidget( mediaPlayerState, 0, "videoUI" );
355
356 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
357 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
358 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
359 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
360
361 connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
362 connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
363 connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
364 connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
365
366 xineControl = new XineControl( videoUI, mediaPlayerState );
367}
368
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.h b/noncore/multimedia/opieplayer2/mediaplayer.h
index 6aeac7c..0d6f722 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.h
+++ b/noncore/multimedia/opieplayer2/mediaplayer.h
@@ -42,12 +42,18 @@
42class DocLnk; 42class DocLnk;
43class VolumeControl; 43class VolumeControl;
44class MediaPlayerState; 44class MediaPlayerState;
45class AudioWidget;
46class VideoWidget;
45 47
46class MediaPlayer : public QObject { 48class MediaPlayer : public QObject {
47 Q_OBJECT 49 Q_OBJECT
48public: 50public:
49 MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ); 51 MediaPlayer( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name );
50 ~MediaPlayer(); 52 ~MediaPlayer();
53
54public slots:
55 void recreateAudioAndVideoWidgets();
56
51private slots: 57private slots:
52 void setPlaying( bool ); 58 void setPlaying( bool );
53 void pauseCheck( bool ); 59 void pauseCheck( bool );
@@ -64,12 +70,15 @@ protected:
64 void timerEvent( QTimerEvent *e ); 70 void timerEvent( QTimerEvent *e );
65 void keyReleaseEvent( QKeyEvent *e); 71 void keyReleaseEvent( QKeyEvent *e);
66private: 72private:
73
67 bool isBlanked, l, r; 74 bool isBlanked, l, r;
68 int fd, fl; 75 int fd, fl;
69 int volumeDirection; 76 int volumeDirection;
70 XineControl *xineControl; 77 XineControl *xineControl;
71 VolumeControl *volControl; 78 VolumeControl *volControl;
72 MediaPlayerState &mediaPlayerState; 79 MediaPlayerState &mediaPlayerState;
80 AudioWidget *audioUI;
81 VideoWidget *videoUI;
73}; 82};
74 83
75 84
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 7ba342b..6bda71e 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -1095,12 +1095,14 @@ void PlayListWidget::skinsMenuActivated( int item ) {
1095 } 1095 }
1096 skinsMenu->setItemChecked( item, TRUE ); 1096 skinsMenu->setItemChecked( item, TRUE );
1097 1097
1098 Config cfg( "OpiePlayer" ); 1098 {
1099 cfg.setGroup("Options"); 1099 Config cfg( "OpiePlayer" );
1100 cfg.writeEntry("Skin", skinsMenu->text( item ) ); 1100 cfg.setGroup("Options");
1101 QMessageBox::warning( this, tr( "OpiePlayer" ), 1101 cfg.writeEntry("Skin", skinsMenu->text( item ) );
1102 tr( "You must <b>restart</b> Opieplayer<br>to see your changes." ) ); 1102 }
1103} 1103
1104 emit skinSelected();
1105}
1104 1106
1105PlayListWidget::TabType PlayListWidget::currentTab() const 1107PlayListWidget::TabType PlayListWidget::currentTab() const
1106{ 1108{
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index 3f52e63..ad5c9a3 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -94,6 +94,9 @@ public slots:
94protected: 94protected:
95 void keyReleaseEvent( QKeyEvent *e); 95 void keyReleaseEvent( QKeyEvent *e);
96 96
97signals:
98 void skinSelected();
99
97private: 100private:
98 int defaultSkinIndex; 101 int defaultSkinIndex;
99 bool audioScan, videoScan, audioPopulated, videoPopulated; 102 bool audioScan, videoScan, audioPopulated, videoPopulated;
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 071ef7c..b4ae783 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -40,9 +40,8 @@
40#include "mediaplayerstate.h" 40#include "mediaplayerstate.h"
41#include "videowidget.h" 41#include "videowidget.h"
42 42
43extern VideoWidget *videoUI; 43XineControl::XineControl( VideoWidget *videoWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name )
44XineControl::XineControl( MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) 44 : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), videoUI( videoWidget ) {
45 : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ) {
46 45
47 libXine = new XINE::Lib( videoUI->vidWidget() ); 46 libXine = new XINE::Lib( videoUI->vidWidget() );
48 47
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h
index 00486f2..24e966b 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.h
+++ b/noncore/multimedia/opieplayer2/xinecontrol.h
@@ -39,10 +39,12 @@
39 39
40#include "mediaplayerstate.h" 40#include "mediaplayerstate.h"
41 41
42class VideoWidget;
43
42class XineControl : public QObject { 44class XineControl : public QObject {
43 Q_OBJECT 45 Q_OBJECT
44public: 46public:
45 XineControl( MediaPlayerState &_mediaPlayerState, QObject *parent = 0, const char *name =0 ); 47 XineControl( VideoWidget *videoWidget, MediaPlayerState &_mediaPlayerState, QObject *parent = 0, const char *name =0 );
46 ~XineControl(); 48 ~XineControl();
47 49
48 bool hasVideo() const { return hasVideoChannel; } 50 bool hasVideo() const { return hasVideoChannel; }
@@ -113,6 +115,8 @@ private:
113signals: 115signals:
114 void positionChanged( long ); 116 void positionChanged( long );
115 117
118private:
119 VideoWidget *videoUI;
116}; 120};
117 121
118 122