summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp22
-rw-r--r--noncore/multimedia/opieplayer2/mediawidget.h4
-rw-r--r--noncore/multimedia/opieplayer2/videowidget.cpp14
3 files changed, 1 insertions, 39 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 4172da0..7fb3781 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -35,82 +35,60 @@
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36#include <qpe/config.h> 36#include <qpe/config.h>
37#include <opie/oticker.h> 37#include <opie/oticker.h>
38 38
39#include <qwidget.h> 39#include <qwidget.h>
40#include <qpixmap.h> 40#include <qpixmap.h>
41#include <qbutton.h> 41#include <qbutton.h>
42#include <qpainter.h> 42#include <qpainter.h>
43#include <qframe.h> 43#include <qframe.h>
44#include <qlayout.h> 44#include <qlayout.h>
45#include <qdir.h> 45#include <qdir.h>
46#include <stdlib.h> 46#include <stdlib.h>
47#include <stdio.h> 47#include <stdio.h>
48 48
49#include "audiowidget.h" 49#include "audiowidget.h"
50#include "mediaplayerstate.h" 50#include "mediaplayerstate.h"
51#include "playlistwidget.h" 51#include "playlistwidget.h"
52 52
53namespace 53namespace
54{ 54{
55 55
56const int xo = -2; // movable x offset 56const int xo = -2; // movable x offset
57const int yo = 22; // movable y offset 57const int yo = 22; // movable y offset
58 58
59struct MediaButton {
60 bool isToggle, isHeld, isDown;
61};
62
63//Layout information for the audioButtons (and if it is a toggle button or not)
64/*
65MediaWidget::Button audioButtons[] = {
66 { TRUE, FALSE, FALSE }, // play
67 { FALSE, FALSE, FALSE }, // stop
68 { FALSE, FALSE, FALSE }, // next
69 { FALSE, FALSE, FALSE }, // previous
70 { FALSE, FALSE, FALSE }, // volume up
71 { FALSE, FALSE, FALSE }, // volume down
72 { TRUE, FALSE, FALSE }, // repeat/loop
73 { FALSE, FALSE, FALSE }, // playlist
74 { FALSE, FALSE, FALSE }, // forward
75 { FALSE, FALSE, FALSE } // back
76};
77*/
78
79const char * const skin_mask_file_names[10] = { 59const char * const skin_mask_file_names[10] = {
80 "play", "stop", "next", "prev", "up", 60 "play", "stop", "next", "prev", "up",
81 "down", "loop", "playlist", "forward", "back" 61 "down", "loop", "playlist", "forward", "back"
82}; 62};
83 63
84void changeTextColor( QWidget * w) { 64void changeTextColor( QWidget * w) {
85 QPalette p = w->palette(); 65 QPalette p = w->palette();
86 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); 66 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) );
87 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); 67 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) );
88 w->setPalette( p ); 68 w->setPalette( p );
89} 69}
90 70
91//const int numButtons = (sizeof(audioButtons)/sizeof(MediaWidget::Button));
92
93} 71}
94 72
95AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : 73AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) :
96 74
97 MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { 75 MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) {
98 76
99 Button defaultButton; 77 Button defaultButton;
100 defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false; 78 defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false;
101 Button toggleButton; 79 Button toggleButton;
102 toggleButton.isToggle = true; 80 toggleButton.isToggle = true;
103 toggleButton.isHeld = toggleButton.isDown = false; 81 toggleButton.isHeld = toggleButton.isDown = false;
104 82
105 audioButtons.reserve( 10 ); 83 audioButtons.reserve( 10 );
106 audioButtons.push_back( toggleButton ); // play 84 audioButtons.push_back( toggleButton ); // play
107 audioButtons.push_back( defaultButton ); // stop 85 audioButtons.push_back( defaultButton ); // stop
108 audioButtons.push_back( defaultButton ); // next 86 audioButtons.push_back( defaultButton ); // next
109 audioButtons.push_back( defaultButton ); // previous 87 audioButtons.push_back( defaultButton ); // previous
110 audioButtons.push_back( defaultButton ); // volume up 88 audioButtons.push_back( defaultButton ); // volume up
111 audioButtons.push_back( defaultButton ); // volume down 89 audioButtons.push_back( defaultButton ); // volume down
112 audioButtons.push_back( toggleButton ); // repeat/loop 90 audioButtons.push_back( toggleButton ); // repeat/loop
113 audioButtons.push_back( defaultButton ); // playlist 91 audioButtons.push_back( defaultButton ); // playlist
114 audioButtons.push_back( defaultButton ); // forward 92 audioButtons.push_back( defaultButton ); // forward
115 audioButtons.push_back( defaultButton ); // back 93 audioButtons.push_back( defaultButton ); // back
116 94
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h
index 9cb75ae..8b0d48c 100644
--- a/noncore/multimedia/opieplayer2/mediawidget.h
+++ b/noncore/multimedia/opieplayer2/mediawidget.h
@@ -14,51 +14,49 @@
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#ifndef MEDIAWIDGET_H 20#ifndef MEDIAWIDGET_H
21#define MEDIAWIDGET_H 21#define MEDIAWIDGET_H
22 22
23#include <qwidget.h> 23#include <qwidget.h>
24 24
25#include "mediaplayerstate.h" 25#include "mediaplayerstate.h"
26#include "playlistwidget.h" 26#include "playlistwidget.h"
27 27
28#include <vector> 28#include <vector>
29 29
30class MediaWidget : public QWidget 30class MediaWidget : public QWidget
31{ 31{
32 Q_OBJECT 32 Q_OBJECT
33public: 33public:
34 enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; 34 enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back };
35 35
36 struct Button 36 struct Button
37 { 37 {
38 //Button() : isToggle( false ), isHeld( false ), isDown( false ) {} 38 Button() : isToggle( false ), isHeld( false ), isDown( false ) {}
39// Button( bool toggle, bool held, bool down )
40// : isToggle( toggle ), isHeld( held ), isDown( down ) {}
41 39
42 bool isToggle : 1; 40 bool isToggle : 1;
43 bool isHeld : 1; 41 bool isHeld : 1;
44 bool isDown : 1; 42 bool isDown : 1;
45 }; 43 };
46 typedef std::vector<Button> ButtonVector; 44 typedef std::vector<Button> ButtonVector;
47 45
48 MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); 46 MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 );
49 virtual ~MediaWidget(); 47 virtual ~MediaWidget();
50 48
51public slots: 49public slots:
52 virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; 50 virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0;
53 virtual void setLength( long length ) = 0; 51 virtual void setLength( long length ) = 0;
54 virtual void setPlaying( bool playing ) = 0; 52 virtual void setPlaying( bool playing ) = 0;
55 53
56signals: 54signals:
57 void moreReleased(); 55 void moreReleased();
58 void lessReleased(); 56 void lessReleased();
59 void forwardReleased(); 57 void forwardReleased();
60 void backReleased(); 58 void backReleased();
61 59
62protected: 60protected:
63 virtual void closeEvent( QCloseEvent * ); 61 virtual void closeEvent( QCloseEvent * );
64 62
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp
index efd756c..6e2e03e 100644
--- a/noncore/multimedia/opieplayer2/videowidget.cpp
+++ b/noncore/multimedia/opieplayer2/videowidget.cpp
@@ -38,66 +38,52 @@
38 38
39#include <qwidget.h> 39#include <qwidget.h>
40#include <qpainter.h> 40#include <qpainter.h>
41#include <qpixmap.h> 41#include <qpixmap.h>
42#include <qslider.h> 42#include <qslider.h>
43#include <qdrawutil.h> 43#include <qdrawutil.h>
44#include "videowidget.h" 44#include "videowidget.h"
45#include "mediaplayerstate.h" 45#include "mediaplayerstate.h"
46#include "playlistwidget.h" 46#include "playlistwidget.h"
47 47
48 48
49#ifdef Q_WS_QWS 49#ifdef Q_WS_QWS
50# define USE_DIRECT_PAINTER 50# define USE_DIRECT_PAINTER
51# include <qdirectpainter_qws.h> 51# include <qdirectpainter_qws.h>
52# include <qgfxraster_qws.h> 52# include <qgfxraster_qws.h>
53#endif 53#endif
54 54
55 55
56namespace 56namespace
57{ 57{
58 58
59const int xo = 2; // movable x offset 59const int xo = 2; // movable x offset
60const int yo = 0; // movable y offset 60const int yo = 0; // movable y offset
61 61
62/*
63MediaWidget::Button videoButtons[] = {
64 { FALSE, FALSE, FALSE }, // stop
65 { TRUE, FALSE, FALSE }, // play
66 { FALSE, FALSE, FALSE }, // previous
67 { FALSE, FALSE, FALSE }, // next
68 { FALSE, FALSE, FALSE }, // volUp
69 { FALSE, FALSE, FALSE }, // volDown
70 { TRUE, FALSE, FALSE } // fullscreen
71};
72*/
73
74const char * const skinV_mask_file_names[7] = { 62const char * const skinV_mask_file_names[7] = {
75"stop","play","back","fwd","up","down","full" 63"stop","play","back","fwd","up","down","full"
76}; 64};
77 65
78//const int numVButtons = (sizeof(videoButtons)/sizeof(MediaWidget::Button));
79
80} 66}
81 67
82VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) 68VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name )
83 : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ) 69 : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 )
84{ 70{
85 setCaption( tr("OpiePlayer - Video") ); 71 setCaption( tr("OpiePlayer - Video") );
86 72
87 Button defaultButton; 73 Button defaultButton;
88 defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false; 74 defaultButton.isToggle = defaultButton.isHeld = defaultButton.isDown = false;
89 Button toggleButton; 75 Button toggleButton;
90 toggleButton.isToggle = true; 76 toggleButton.isToggle = true;
91 toggleButton.isHeld = toggleButton.isDown = false; 77 toggleButton.isHeld = toggleButton.isDown = false;
92 78
93 videoButtons.reserve( 7 ); 79 videoButtons.reserve( 7 );
94 videoButtons.push_back( defaultButton ); // stop 80 videoButtons.push_back( defaultButton ); // stop
95 videoButtons.push_back( toggleButton ); // play 81 videoButtons.push_back( toggleButton ); // play
96 videoButtons.push_back( defaultButton ); // previous 82 videoButtons.push_back( defaultButton ); // previous
97 videoButtons.push_back( defaultButton ); // next 83 videoButtons.push_back( defaultButton ); // next
98 videoButtons.push_back( defaultButton ); // volUp 84 videoButtons.push_back( defaultButton ); // volUp
99 videoButtons.push_back( defaultButton ); // volDown 85 videoButtons.push_back( defaultButton ); // volDown
100 videoButtons.push_back( toggleButton ); //fullscreen 86 videoButtons.push_back( toggleButton ); //fullscreen
101 87
102 videoFrame = new XineVideoWidget ( this, "Video frame" ); 88 videoFrame = new XineVideoWidget ( this, "Video frame" );
103 89