-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 24 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.h | 3 | ||||
-rw-r--r-- | core/multimedia/opieplayer/inputDialog.cpp | 29 | ||||
-rw-r--r-- | core/multimedia/opieplayer/inputDialog.h | 7 | ||||
-rw-r--r-- | core/multimedia/opieplayer/opieplayer.pro | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 45 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 21 |
8 files changed, 82 insertions, 53 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 94b979f..aa48961 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp | |||
@@ -1,113 +1,121 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
22 | #include <qpe/config.h> | ||
22 | 23 | ||
23 | #include <qwidget.h> | 24 | #include <qwidget.h> |
24 | #include <qpixmap.h> | 25 | #include <qpixmap.h> |
25 | #include <qbutton.h> | 26 | #include <qbutton.h> |
26 | #include <qpainter.h> | 27 | #include <qpainter.h> |
27 | #include <qframe.h> | 28 | #include <qframe.h> |
28 | #include <qlayout.h> | 29 | #include <qlayout.h> |
29 | 30 | ||
30 | #include "audiowidget.h" | 31 | #include "audiowidget.h" |
31 | #include "mediaplayerstate.h" | 32 | #include "mediaplayerstate.h" |
32 | 33 | ||
33 | extern MediaPlayerState *mediaPlayerState; | 34 | extern MediaPlayerState *mediaPlayerState; |
34 | 35 | ||
35 | 36 | ||
36 | static const int xo = -2; // movable x offset | 37 | static const int xo = -2; // movable x offset |
37 | static const int yo = 22; // movable y offset | 38 | static const int yo = 22; // movable y offset |
38 | 39 | ||
39 | 40 | ||
40 | struct MediaButton { | 41 | struct MediaButton { |
41 | int xPos, yPos; | 42 | int xPos, yPos; |
42 | int color; | 43 | int color; |
43 | bool isToggle, isBig, isHeld, isDown; | 44 | bool isToggle, isBig, isHeld, isDown; |
44 | }; | 45 | }; |
45 | 46 | ||
46 | 47 | ||
47 | // Layout information for the audioButtons (and if it is a toggle button or not) | 48 | // Layout information for the audioButtons (and if it is a toggle button or not) |
48 | MediaButton audioButtons[] = { | 49 | MediaButton audioButtons[] = { |
49 | { 3*30-15+xo, 3*30-13+yo, 0, TRUE, TRUE, FALSE, FALSE }, // play | 50 | { 3*30-15+xo, 3*30-13+yo, 0, TRUE, TRUE, FALSE, FALSE }, // play |
50 | { 1*30+xo, 5*30+yo, 2, FALSE, FALSE, FALSE, FALSE }, // stop | 51 | { 1*30+xo, 5*30+yo, 2, FALSE, FALSE, FALSE, FALSE }, // stop |
51 | { 5*30+xo, 5*30+yo, 2, TRUE, FALSE, FALSE, FALSE }, // pause | 52 | { 5*30+xo, 5*30+yo, 2, TRUE, FALSE, FALSE, FALSE }, // pause |
52 | { 6*30-5+xo, 3*30+yo, 1, FALSE, FALSE, FALSE, FALSE }, // next | 53 | { 6*30-5+xo, 3*30+yo, 1, FALSE, FALSE, FALSE, FALSE }, // next |
53 | { 0*30+5+xo, 3*30+yo, 1, FALSE, FALSE, FALSE, FALSE }, // previous | 54 | { 0*30+5+xo, 3*30+yo, 1, FALSE, FALSE, FALSE, FALSE }, // previous |
54 | { 3*30+xo, 0*30+5+yo, 3, FALSE, FALSE, FALSE, FALSE }, // volume up | 55 | { 3*30+xo, 0*30+5+yo, 3, FALSE, FALSE, FALSE, FALSE }, // volume up |
55 | { 3*30+xo, 6*30-5+yo, 3, FALSE, FALSE, FALSE, FALSE }, // volume down | 56 | { 3*30+xo, 6*30-5+yo, 3, FALSE, FALSE, FALSE, FALSE }, // volume down |
56 | { 5*30+xo, 1*30+yo, 0, TRUE, FALSE, FALSE, FALSE }, // repeat/loop | 57 | { 5*30+xo, 1*30+yo, 0, TRUE, FALSE, FALSE, FALSE }, // repeat/loop |
57 | { 1*30+xo, 1*30+yo, 0, FALSE, FALSE, FALSE, FALSE } // playlist | 58 | { 1*30+xo, 1*30+yo, 0, FALSE, FALSE, FALSE, FALSE } // playlist |
58 | }; | 59 | }; |
59 | 60 | ||
60 | 61 | ||
61 | static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); | 62 | static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); |
62 | 63 | ||
63 | 64 | ||
64 | AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | 65 | AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : |
65 | QWidget( parent, name, f ) | 66 | QWidget( parent, name, f ) |
66 | { | 67 | { |
67 | setCaption( tr("OpiePlayer") ); | 68 | setCaption( tr("OpiePlayer") ); |
68 | 69 | Config cfg("OpiePlayer"); | |
70 | cfg.setGroup("AudioWidget"); | ||
69 | // QGridLayout *layout = new QGridLayout( this ); | 71 | // QGridLayout *layout = new QGridLayout( this ); |
70 | // layout->setSpacing( 2); | 72 | // layout->setSpacing( 2); |
71 | // layout->setMargin( 2); | 73 | // layout->setMargin( 2); |
72 | 74 | QString backgroundPix, buttonsAllPix, buttonsBigPix, controlsPix, animatedPix; | |
73 | setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 75 | backgroundPix=cfg.readEntry( " backgroundPix", "opieplayer/metalFinish"); |
74 | pixmaps[0] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsAll" ) ); | 76 | buttonsAllPix=cfg.readEntry( "buttonsAllPix","opieplayer/mediaButtonsAll"); |
75 | pixmaps[1] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsBig" ) ); | 77 | buttonsBigPix=cfg.readEntry( "buttonsBigPix","opieplayer/mediaButtonsBig"); |
76 | pixmaps[2] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaControls" ) ); | 78 | controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls"); |
77 | pixmaps[3] = new QPixmap( Resource::loadPixmap( "opieplayer/animatedButton" ) ); | 79 | animatedPix=cfg.readEntry( "animatedPix", "opieplayer/animatedButton"); |
80 | |||
81 | setBackgroundPixmap( Resource::loadPixmap( backgroundPix) ); | ||
82 | pixmaps[0] = new QPixmap( Resource::loadPixmap( buttonsAllPix ) ); | ||
83 | pixmaps[1] = new QPixmap( Resource::loadPixmap( buttonsBigPix ) ); | ||
84 | pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix ) ); | ||
85 | pixmaps[3] = new QPixmap( Resource::loadPixmap( animatedPix) ); | ||
78 | 86 | ||
79 | songInfo = new Ticker( this ); | 87 | songInfo = new Ticker( this ); |
80 | songInfo->setFocusPolicy( QWidget::NoFocus ); | 88 | songInfo->setFocusPolicy( QWidget::NoFocus ); |
81 | songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); | 89 | songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); |
82 | // layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 ); | 90 | // layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 ); |
83 | 91 | ||
84 | slider = new QSlider( Qt::Horizontal, this ); | 92 | slider = new QSlider( Qt::Horizontal, this ); |
85 | slider->setFixedWidth( 220 ); | 93 | slider->setFixedWidth( 220 ); |
86 | slider->setFixedHeight( 20 ); | 94 | slider->setFixedHeight( 20 ); |
87 | slider->setMinValue( 0 ); | 95 | slider->setMinValue( 0 ); |
88 | slider->setMaxValue( 1 ); | 96 | slider->setMaxValue( 1 ); |
89 | slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 97 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
90 | slider->setFocusPolicy( QWidget::NoFocus ); | 98 | slider->setFocusPolicy( QWidget::NoFocus ); |
91 | slider->setGeometry( QRect( 7, 262, 220, 20 ) ); | 99 | slider->setGeometry( QRect( 7, 262, 220, 20 ) ); |
92 | // layout->addMultiCellWidget( slider, 4, 4, 0, 2 ); | 100 | // layout->addMultiCellWidget( slider, 4, 4, 0, 2 ); |
93 | 101 | ||
94 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 102 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
95 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 103 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
96 | 104 | ||
97 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 105 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
98 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 106 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
99 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 107 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
100 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); | 108 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); |
101 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 109 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
102 | 110 | ||
103 | // Intialise state | 111 | // Intialise state |
104 | setLength( mediaPlayerState->length() ); | 112 | setLength( mediaPlayerState->length() ); |
105 | setPosition( mediaPlayerState->position() ); | 113 | setPosition( mediaPlayerState->position() ); |
106 | setLooping( mediaPlayerState->fullscreen() ); | 114 | setLooping( mediaPlayerState->fullscreen() ); |
107 | setPaused( mediaPlayerState->paused() ); | 115 | setPaused( mediaPlayerState->paused() ); |
108 | setPlaying( mediaPlayerState->playing() ); | 116 | setPlaying( mediaPlayerState->playing() ); |
109 | 117 | ||
110 | } | 118 | } |
111 | 119 | ||
112 | 120 | ||
113 | AudioWidget::~AudioWidget() { | 121 | AudioWidget::~AudioWidget() { |
diff --git a/core/multimedia/opieplayer/audiowidget.h b/core/multimedia/opieplayer/audiowidget.h index 41ae4b6..b3d39bf 100644 --- a/core/multimedia/opieplayer/audiowidget.h +++ b/core/multimedia/opieplayer/audiowidget.h | |||
@@ -101,45 +101,46 @@ class AudioWidget : public QWidget { | |||
101 | public: | 101 | public: |
102 | AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); | 102 | AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); |
103 | ~AudioWidget(); | 103 | ~AudioWidget(); |
104 | void setTickerText( const QString &text ) { songInfo->setText( text ); } | 104 | void setTickerText( const QString &text ) { songInfo->setText( text ); } |
105 | bool isStreaming; | 105 | bool isStreaming; |
106 | public slots: | 106 | public slots: |
107 | void updateSlider( long, long ); | 107 | void updateSlider( long, long ); |
108 | void sliderPressed( ); | 108 | void sliderPressed( ); |
109 | void sliderReleased( ); | 109 | void sliderReleased( ); |
110 | void setPaused( bool b) { setToggleButton( AudioPause, b ); } | 110 | void setPaused( bool b) { setToggleButton( AudioPause, b ); } |
111 | void setLooping( bool b) { setToggleButton( AudioLoop, b ); } | 111 | void setLooping( bool b) { setToggleButton( AudioLoop, b ); } |
112 | void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } | 112 | void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } |
113 | void setPosition( long ); | 113 | void setPosition( long ); |
114 | void setLength( long ); | 114 | void setLength( long ); |
115 | void setView( char ); | 115 | void setView( char ); |
116 | 116 | ||
117 | signals: | 117 | signals: |
118 | void moreClicked(); | 118 | void moreClicked(); |
119 | void lessClicked(); | 119 | void lessClicked(); |
120 | void moreReleased(); | 120 | void moreReleased(); |
121 | void lessReleased(); | 121 | void lessReleased(); |
122 | void sliderMoved(long); | 122 | void sliderMoved(long); |
123 | 123 | ||
124 | protected: | 124 | protected: |
125 | void doBlank(); | ||
126 | void doUnblank(); | ||
125 | void paintEvent( QPaintEvent *pe ); | 127 | void paintEvent( QPaintEvent *pe ); |
126 | void showEvent( QShowEvent *se ); | 128 | void showEvent( QShowEvent *se ); |
127 | void mouseMoveEvent( QMouseEvent *event ); | 129 | void mouseMoveEvent( QMouseEvent *event ); |
128 | void mousePressEvent( QMouseEvent *event ); | 130 | void mousePressEvent( QMouseEvent *event ); |
129 | void mouseReleaseEvent( QMouseEvent *event ); | 131 | void mouseReleaseEvent( QMouseEvent *event ); |
130 | void timerEvent( QTimerEvent *event ); | 132 | void timerEvent( QTimerEvent *event ); |
131 | void closeEvent( QCloseEvent *event ); | 133 | void closeEvent( QCloseEvent *event ); |
132 | void keyReleaseEvent( QKeyEvent *e); | 134 | void keyReleaseEvent( QKeyEvent *e); |
133 | void showMe(); | ||
134 | private: | 135 | private: |
135 | void toggleButton( int ); | 136 | void toggleButton( int ); |
136 | void setToggleButton( int, bool ); | 137 | void setToggleButton( int, bool ); |
137 | void paintButton( QPainter *p, int i ); | 138 | void paintButton( QPainter *p, int i ); |
138 | QPixmap *pixmaps[4]; | 139 | QPixmap *pixmaps[4]; |
139 | Ticker *songInfo; | 140 | Ticker *songInfo; |
140 | QSlider *slider; | 141 | QSlider *slider; |
141 | }; | 142 | }; |
142 | 143 | ||
143 | 144 | ||
144 | #endif // AUDIO_WIDGET_H | 145 | #endif // AUDIO_WIDGET_H |
145 | 146 | ||
diff --git a/core/multimedia/opieplayer/inputDialog.cpp b/core/multimedia/opieplayer/inputDialog.cpp index b443747..b80d129 100644 --- a/core/multimedia/opieplayer/inputDialog.cpp +++ b/core/multimedia/opieplayer/inputDialog.cpp | |||
@@ -1,45 +1,52 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** Form implementation generated from reading ui file 'inputDialog.ui' | 2 | ** Form implementation generated from reading ui file 'inputDialog.ui' |
3 | ** | 3 | ** |
4 | ** Created: Sat Mar 2 07:55:03 2002 | 4 | ** Created: Sat Mar 2 07:55:03 2002 |
5 | ** by: The User Interface Compiler (uic) | 5 | ** by: The User Interface Compiler (uic) |
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | #include "inputDialog.h" | 9 | #include "inputDialog.h" |
10 | 10 | ||
11 | #include <qpe/resource.h> | ||
12 | |||
13 | #include <opie/ofiledialog.h> | ||
14 | |||
11 | #include <qlineedit.h> | 15 | #include <qlineedit.h> |
12 | #include <qlayout.h> | 16 | #include <qlayout.h> |
13 | #include <qvariant.h> | 17 | #include <qvariant.h> |
14 | #include <qtooltip.h> | 18 | #include <qpushbutton.h> |
15 | #include <qwhatsthis.h> | 19 | #include <qwhatsthis.h> |
16 | 20 | ||
17 | /* | ||
18 | * Constructs a InputDialog which is a child of 'parent', with the | ||
19 | * name 'name' and widget flags set to 'f' | ||
20 | * | ||
21 | * The dialog will by default be modeless, unless you set 'modal' to | ||
22 | * TRUE to construct a modal dialog. | ||
23 | */ | ||
24 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 21 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
25 | : QDialog( parent, name, modal, fl ) | 22 | : QDialog( parent, name, modal, fl ) |
26 | { | 23 | { |
27 | if ( !name ) | 24 | if ( !name ) |
28 | setName( "InputDialog" ); | 25 | setName( "InputDialog" ); |
29 | resize( 234, 50 ); | 26 | resize( 234, 115); |
30 | setMaximumSize( QSize( 240, 50 ) ); | 27 | setMaximumSize( QSize( 240, 40)); |
31 | setCaption( tr(name ) ); | 28 | setCaption( tr(name ) ); |
32 | 29 | ||
30 | QPushButton *browserButton; | ||
31 | browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); | ||
32 | browserButton->setGeometry( QRect( 205, 10, 22, 22)); | ||
33 | connect( browserButton, SIGNAL(released()),this,SLOT(browse())); | ||
33 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 34 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
34 | LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); | 35 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); |
35 | } | 36 | } |
36 | 37 | ||
37 | /* | 38 | /* |
38 | * Destroys the object and frees any allocated resources | 39 | * Destroys the object and frees any allocated resources |
39 | */ | 40 | */ |
40 | InputDialog::~InputDialog() | 41 | InputDialog::~InputDialog() |
41 | { | 42 | { |
42 | inputText= LineEdit1->text(); | 43 | inputText= LineEdit1->text(); |
43 | 44 | ||
44 | } | 45 | } |
45 | 46 | ||
47 | void InputDialog::browse() { | ||
48 | |||
49 | QString str = OFileDialog::getOpenFileName( 1,"/","", "playlist/plain", 0 ); | ||
50 | LineEdit1->setText(str); | ||
51 | } | ||
52 | |||
diff --git a/core/multimedia/opieplayer/inputDialog.h b/core/multimedia/opieplayer/inputDialog.h index 26d5cd0..3e3e36f 100644 --- a/core/multimedia/opieplayer/inputDialog.h +++ b/core/multimedia/opieplayer/inputDialog.h | |||
@@ -1,31 +1,30 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** Form interface generated from reading ui file 'inputDialog.ui' | 2 | ** Form interface generated from reading ui file 'inputDialog.ui' |
3 | ** | 3 | ** |
4 | ** Created: Sat Mar 2 07:54:46 2002 | 4 | ** Created: Sat Mar 2 07:54:46 2002 |
5 | ** by: The User Interface Compiler (uic) | 5 | ** by: The User Interface Compiler (uic) |
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | #ifndef INPUTDIALOG_H | 9 | #ifndef INPUTDIALOG_H |
10 | #define INPUTDIALOG_H | 10 | #define INPUTDIALOG_H |
11 | 11 | ||
12 | #include <qvariant.h> | 12 | #include <qvariant.h> |
13 | #include <qdialog.h> | 13 | #include <qdialog.h> |
14 | class QVBoxLayout; | 14 | |
15 | class QHBoxLayout; | ||
16 | class QGridLayout; | ||
17 | class QLineEdit; | 15 | class QLineEdit; |
18 | 16 | ||
19 | class InputDialog : public QDialog | 17 | class InputDialog : public QDialog |
20 | { | 18 | { |
21 | Q_OBJECT | 19 | Q_OBJECT |
22 | 20 | ||
23 | public: | 21 | public: |
24 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 22 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
25 | ~InputDialog(); | 23 | ~InputDialog(); |
26 | QString inputText; | 24 | QString inputText; |
27 | QLineEdit* LineEdit1; | 25 | QLineEdit* LineEdit1; |
28 | 26 | protected slots: | |
27 | void browse(); | ||
29 | }; | 28 | }; |
30 | 29 | ||
31 | #endif // INPUTDIALOG_H | 30 | #endif // INPUTDIALOG_H |
diff --git a/core/multimedia/opieplayer/opieplayer.pro b/core/multimedia/opieplayer/opieplayer.pro index 4cef319..6409bab 100644 --- a/core/multimedia/opieplayer/opieplayer.pro +++ b/core/multimedia/opieplayer/opieplayer.pro | |||
@@ -1,24 +1,24 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | #release | 3 | #release |
4 | DESTDIR = $(OPIEDIR)/bin | 4 | DESTDIR = $(OPIEDIR)/bin |
5 | HEADERS = loopcontrol.h mediaplayerplugininterface.h playlistselection.h mediaplayerstate.h \ | 5 | HEADERS = loopcontrol.h mediaplayerplugininterface.h playlistselection.h mediaplayerstate.h \ |
6 | videowidget.h audiowidget.h playlistwidget.h mediaplayer.h audiodevice.h inputDialog.h | 6 | videowidget.h audiowidget.h playlistwidget.h mediaplayer.h audiodevice.h inputDialog.h |
7 | SOURCES = main.cpp \ | 7 | SOURCES = main.cpp \ |
8 | loopcontrol.cpp playlistselection.cpp mediaplayerstate.cpp \ | 8 | loopcontrol.cpp playlistselection.cpp mediaplayerstate.cpp \ |
9 | videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp audiodevice.cpp inputDialog.cpp | 9 | videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp audiodevice.cpp inputDialog.cpp |
10 | TARGET = opieplayer | 10 | TARGET = opieplayer |
11 | INCLUDEPATH += $(OPIEDIR)/include | 11 | INCLUDEPATH += $(OPIEDIR)/include |
12 | DEPENDPATH += $(OPIEDIR)/include | 12 | DEPENDPATH += $(OPIEDIR)/include |
13 | LIBS += -lqpe -lpthread | 13 | LIBS += -lqpe -lpthread -lopie |
14 | 14 | ||
15 | # INTERFACES = | 15 | # INTERFACES = |
16 | # INCLUDEPATH += $(OPIEDIR)/include | 16 | # INCLUDEPATH += $(OPIEDIR)/include |
17 | # CONFIG+=static | 17 | # CONFIG+=static |
18 | # TMAKE_CXXFLAGS += -DQPIM_STANDALONE | 18 | # TMAKE_CXXFLAGS += -DQPIM_STANDALONE |
19 | # LIBS += libmpeg3/libmpeg3.a -lpthread | 19 | # LIBS += libmpeg3/libmpeg3.a -lpthread |
20 | # LIBS += $(OPIEDIR)/plugins/codecs/liblibmadplugin.so | 20 | # LIBS += $(OPIEDIR)/plugins/codecs/liblibmadplugin.so |
21 | 21 | ||
22 | INCLUDEPATH += $(OPIEDIR)/include | 22 | INCLUDEPATH += $(OPIEDIR)/include |
23 | DEPENDPATH += $(OPIEDIR)/include | 23 | DEPENDPATH += $(OPIEDIR)/include |
24 | 24 | ||
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 70b7cef..2118051 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -606,57 +606,48 @@ bool PlayListWidget::first() { | |||
606 | 606 | ||
607 | 607 | ||
608 | bool PlayListWidget::last() { | 608 | bool PlayListWidget::last() { |
609 | if ( mediaPlayerState->playlist() ) | 609 | if ( mediaPlayerState->playlist() ) |
610 | return d->selectedFiles->last(); | 610 | return d->selectedFiles->last(); |
611 | else | 611 | else |
612 | return mediaPlayerState->looping(); | 612 | return mediaPlayerState->looping(); |
613 | } | 613 | } |
614 | 614 | ||
615 | 615 | ||
616 | void PlayListWidget::saveList() { | 616 | void PlayListWidget::saveList() { |
617 | 617 | ||
618 | QString filename; | 618 | QString filename; |
619 | InputDialog *fileDlg; | 619 | InputDialog *fileDlg; |
620 | fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0); | 620 | fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0); |
621 | fileDlg->exec(); | 621 | fileDlg->exec(); |
622 | if( fileDlg->result() == 1 ) { | 622 | if( fileDlg->result() == 1 ) { |
623 | if ( d->current ) | 623 | if ( d->current ) |
624 | delete d->current; | 624 | delete d->current; |
625 | filename = fileDlg->LineEdit1->text();//+".playlist"; | 625 | filename = fileDlg->LineEdit1->text();//+".playlist"; |
626 | // qDebug("saving playlist "+filename+".playlist"); | 626 | // qDebug("saving playlist "+filename+".playlist"); |
627 | Config cfg( filename +".playlist"); | 627 | Config cfg( filename +".playlist"); |
628 | writeConfig( cfg ); | 628 | writeConfig( cfg ); |
629 | 629 | ||
630 | // qDebug("same name so delete lnk??"); | ||
631 | // if( playLists->selected()->name() == filename) { | ||
632 | |||
633 | // qDebug("same name so delete lnk"); | ||
634 | // QFile().remove(playLists->selected()->file()); | ||
635 | // QFile().remove(playLists->selected()->linkFile()); | ||
636 | // playLists->reread(); | ||
637 | // } | ||
638 | // qDebug("new doclnk"); | ||
639 | DocLnk lnk; | 630 | DocLnk lnk; |
640 | // lnk.setComment( ""); | 631 | // lnk.setComment( ""); |
641 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property | 632 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property |
642 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D | 633 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D |
643 | lnk.setIcon("opieplayer/playlist2"); | 634 | lnk.setIcon("opieplayer/playlist2"); |
644 | lnk.setName( filename); //sets file name | 635 | lnk.setName( filename); //sets file name |
645 | // qDebug(filename); | 636 | // qDebug(filename); |
646 | if(!lnk.writeLink()) | 637 | if(!lnk.writeLink()) |
647 | qDebug("Writing doclink did not work"); | 638 | qDebug("Writing doclink did not work"); |
648 | } | 639 | } |
649 | Config config( "OpiePlayer" ); | 640 | Config config( "OpiePlayer" ); |
650 | config.writeEntry("CurrentPlaylist",filename); | 641 | config.writeEntry("CurrentPlaylist",filename); |
651 | setCaption(tr("OpiePlayer: ")+filename); | 642 | setCaption(tr("OpiePlayer: ")+filename); |
652 | d->selectedFiles->first(); | 643 | d->selectedFiles->first(); |
653 | if(fileDlg) | 644 | if(fileDlg) |
654 | delete fileDlg; | 645 | delete fileDlg; |
655 | } | 646 | } |
656 | 647 | ||
657 | void PlayListWidget::loadList( const DocLnk & lnk) { | 648 | void PlayListWidget::loadList( const DocLnk & lnk) { |
658 | QString name= lnk.name(); | 649 | QString name= lnk.name(); |
659 | // qDebug("currentList is "+name); | 650 | // qDebug("currentList is "+name); |
660 | if( name.length()>1) { | 651 | if( name.length()>1) { |
661 | setCaption("OpiePlayer: "+name); | 652 | setCaption("OpiePlayer: "+name); |
662 | // qDebug("load list "+ name+".playlist"); | 653 | // qDebug("load list "+ name+".playlist"); |
@@ -826,101 +817,103 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
826 | playLists->reread(); | 817 | playLists->reread(); |
827 | } | 818 | } |
828 | break; | 819 | break; |
829 | }; | 820 | }; |
830 | } | 821 | } |
831 | 822 | ||
832 | 823 | ||
833 | 824 | ||
834 | void PlayListWidget::btnPlay(bool b) { | 825 | void PlayListWidget::btnPlay(bool b) { |
835 | 826 | ||
836 | // mediaPlayerState->setPlaying(b); | 827 | // mediaPlayerState->setPlaying(b); |
837 | switch ( tabWidget->currentPageIndex()) { | 828 | switch ( tabWidget->currentPageIndex()) { |
838 | case 0: | 829 | case 0: |
839 | { | 830 | { |
840 | mediaPlayerState->setPlaying(b); | 831 | mediaPlayerState->setPlaying(b); |
841 | } | 832 | } |
842 | break; | 833 | break; |
843 | case 1: | 834 | case 1: |
844 | { | 835 | { |
845 | addToSelection( audioView->selectedItem() ); | 836 | addToSelection( audioView->selectedItem() ); |
846 | mediaPlayerState->setPlaying(b); | 837 | mediaPlayerState->setPlaying(b); |
847 | d->selectedFiles->removeSelected( ); | 838 | d->selectedFiles->removeSelected( ); |
848 | tabWidget->setCurrentPage(1); | 839 | tabWidget->setCurrentPage(1); |
849 | d->selectedFiles->unSelect(); | 840 | d->selectedFiles->unSelect(); |
841 | insanityBool=FALSE; | ||
850 | // audioView->clearSelection(); | 842 | // audioView->clearSelection(); |
851 | } | 843 | } |
852 | break; | 844 | break; |
853 | case 2: | 845 | case 2: |
854 | { | 846 | { |
855 | addToSelection( videoView->selectedItem() ); | 847 | addToSelection( videoView->selectedItem() ); |
856 | mediaPlayerState->setPlaying(b); | 848 | mediaPlayerState->setPlaying(b); |
857 | qApp->processEvents(); | 849 | qApp->processEvents(); |
858 | d->selectedFiles->removeSelected( ); | 850 | d->selectedFiles->removeSelected( ); |
859 | tabWidget->setCurrentPage(2); | 851 | tabWidget->setCurrentPage(2); |
860 | d->selectedFiles->unSelect(); | 852 | d->selectedFiles->unSelect(); |
853 | insanityBool=FALSE; | ||
861 | // videoView->clearSelection(); | 854 | // videoView->clearSelection(); |
862 | } | 855 | } |
863 | break; | 856 | break; |
864 | }; | 857 | }; |
865 | } | 858 | } |
866 | 859 | ||
867 | void PlayListWidget::deletePlaylist() { | 860 | void PlayListWidget::deletePlaylist() { |
868 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), | 861 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), |
869 | (tr("You really want to delete\nthis playlist?")), | 862 | (tr("You really want to delete\nthis playlist?")), |
870 | (tr("Yes")), (tr("No")), 0 )){ | 863 | (tr("Yes")), (tr("No")), 0 )){ |
871 | case 0: // Yes clicked, | 864 | case 0: // Yes clicked, |
872 | QFile().remove(playLists->selected()->file()); | 865 | QFile().remove(playLists->selected()->file()); |
873 | QFile().remove(playLists->selected()->linkFile()); | 866 | QFile().remove(playLists->selected()->linkFile()); |
874 | playLists->reread(); | 867 | playLists->reread(); |
875 | break; | 868 | break; |
876 | case 1: // Cancel | 869 | case 1: // Cancel |
877 | break; | 870 | break; |
878 | }; | 871 | }; |
879 | 872 | ||
880 | } | 873 | } |
881 | 874 | ||
882 | void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) | 875 | void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) |
883 | { | 876 | { |
884 | switch (mouse) { | 877 | switch (mouse) { |
885 | case 1: | 878 | case 1: |
886 | break; | 879 | break; |
887 | case 2:{ | 880 | case 2:{ |
888 | QPopupMenu m; | 881 | QPopupMenu m; |
889 | m.insertItem( tr( "Play" ), this, SLOT( playSelected() )); | 882 | m.insertItem( tr( "Play" ), this, SLOT( playSelected() )); |
890 | m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() )); | 883 | m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() )); |
891 | m.insertSeparator(); | 884 | m.insertSeparator(); |
892 | m.insertItem( tr( "Properties" ), this, SLOT( listDelete() )); | 885 | m.insertItem( tr( "Properties" ), this, SLOT( listDelete() )); |
893 | m.exec( QCursor::pos() ); | 886 | m.exec( QCursor::pos() ); |
894 | } | 887 | } |
895 | break; | 888 | break; |
896 | }; | 889 | }; |
897 | } | 890 | } |
898 | 891 | ||
899 | void PlayListWidget::playSelected() | 892 | void PlayListWidget::playSelected() |
900 | { | 893 | { |
901 | btnPlay( TRUE); | 894 | btnPlay( TRUE); |
902 | d->selectedFiles->unSelect(); | 895 | // d->selectedFiles->unSelect(); |
903 | } | 896 | } |
904 | 897 | ||
905 | void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) | 898 | void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) |
906 | { | 899 | { |
907 | switch (mouse) { | 900 | switch (mouse) { |
908 | case 1: | 901 | case 1: |
909 | 902 | ||
910 | break; | 903 | break; |
911 | case 2:{ | 904 | case 2:{ |
912 | QPopupMenu m; | 905 | QPopupMenu m; |
913 | m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() )); | 906 | m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() )); |
914 | m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() )); | 907 | m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() )); |
915 | // m.insertSeparator(); | 908 | // m.insertSeparator(); |
916 | m.exec( QCursor::pos() ); | 909 | m.exec( QCursor::pos() ); |
917 | } | 910 | } |
918 | break; | 911 | break; |
919 | }; | 912 | }; |
920 | 913 | ||
921 | } | 914 | } |
922 | 915 | ||
923 | void PlayListWidget::listDelete() { | 916 | void PlayListWidget::listDelete() { |
924 | Config cfg( "OpiePlayer" ); | 917 | Config cfg( "OpiePlayer" ); |
925 | cfg.setGroup("PlayList"); | 918 | cfg.setGroup("PlayList"); |
926 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | 919 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); |
@@ -1003,80 +996,74 @@ void PlayListWidget::populateVideoView() { | |||
1003 | videoView->clear(); | 996 | videoView->clear(); |
1004 | QString storage; | 997 | QString storage; |
1005 | for ( ; Vdit.current(); ++Vdit ) { | 998 | for ( ; Vdit.current(); ++Vdit ) { |
1006 | for( ; it.current(); ++it ){ | 999 | for( ; it.current(); ++it ){ |
1007 | const QString name = (*it)->name(); | 1000 | const QString name = (*it)->name(); |
1008 | const QString path = (*it)->path(); | 1001 | const QString path = (*it)->path(); |
1009 | if( Vdit.current()->file().find(path) != -1 ) storage=name; | 1002 | if( Vdit.current()->file().find(path) != -1 ) storage=name; |
1010 | } | 1003 | } |
1011 | 1004 | ||
1012 | QListViewItem * newItem; | 1005 | QListViewItem * newItem; |
1013 | if ( QFile( Vdit.current()->file()).exists() ) { | 1006 | if ( QFile( Vdit.current()->file()).exists() ) { |
1014 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); | 1007 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); |
1015 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" )); | 1008 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" )); |
1016 | } | 1009 | } |
1017 | } | 1010 | } |
1018 | } | 1011 | } |
1019 | 1012 | ||
1020 | void PlayListWidget::openFile() { | 1013 | void PlayListWidget::openFile() { |
1021 | QString filename, name; | 1014 | QString filename, name; |
1022 | InputDialog *fileDlg; | 1015 | InputDialog *fileDlg; |
1023 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 1016 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
1024 | fileDlg->exec(); | 1017 | fileDlg->exec(); |
1025 | if( fileDlg->result() == 1 ) { | 1018 | if( fileDlg->result() == 1 ) { |
1026 | filename = fileDlg->LineEdit1->text(); | 1019 | filename = fileDlg->LineEdit1->text(); |
1027 | |||
1028 | // InputDialog *fileDlg2; | ||
1029 | // fileDlg2 = new InputDialog(this,tr("Name"),TRUE, 0); | ||
1030 | // fileDlg2->exec(); | ||
1031 | // if( fileDlg2->result() == 1 ) { | ||
1032 | // name = fileDlg2->LineEdit1->text(); | ||
1033 | // } | ||
1034 | //http://205.188.234.129:8030 | 1020 | //http://205.188.234.129:8030 |
1035 | // http://66.28.68.70:8000 | 1021 | // http://66.28.68.70:8000 |
1036 | qDebug(filename); | 1022 | qDebug(filename); |
1023 | if(filename.right(3) == "m3u") | ||
1024 | readm3u( filename); | ||
1025 | else if(filename.right(3) == "pls") | ||
1026 | readPls( filename); | ||
1027 | else { | ||
1037 | DocLnk lnk; | 1028 | DocLnk lnk; |
1038 | // if(filename.left(7) == "http://") | 1029 | |
1039 | // name= filename.right(filename.length()-filename.find("http://")-7); | ||
1040 | // else name = filename; | ||
1041 | // qDebug("name is "+name); | ||
1042 | // lnk.setComment(filename); | ||
1043 | lnk.setName(filename); //sets file name | 1030 | lnk.setName(filename); //sets file name |
1044 | if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") | 1031 | if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") |
1045 | filename += "/"; | 1032 | filename += "/"; |
1046 | lnk.setFile(filename); //sets File property | 1033 | lnk.setFile(filename); //sets File property |
1047 | 1034 | ||
1048 | lnk.setType("audio/x-mpegurl"); | 1035 | lnk.setType("audio/x-mpegurl"); |
1049 | lnk.setExec("opieplayer"); | 1036 | lnk.setExec("opieplayer"); |
1050 | lnk.setIcon("opieplayer/MPEGPlayer"); | 1037 | lnk.setIcon("opieplayer/MPEGPlayer"); |
1051 | 1038 | ||
1052 | if(!lnk.writeLink()) | 1039 | if(!lnk.writeLink()) |
1053 | qDebug("Writing doclink did not work"); | 1040 | qDebug("Writing doclink did not work"); |
1054 | d->selectedFiles->addToSelection( lnk); | 1041 | d->selectedFiles->addToSelection( lnk); |
1055 | // if(fileDlg2) | 1042 | // if(fileDlg2) |
1056 | // delete fileDlg2; | 1043 | // delete fileDlg2; |
1057 | } | 1044 | } |
1058 | 1045 | } | |
1059 | if(fileDlg) | 1046 | if(fileDlg) |
1060 | delete fileDlg; | 1047 | delete fileDlg; |
1061 | } | 1048 | } |
1062 | 1049 | ||
1063 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | 1050 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) |
1064 | { | 1051 | { |
1065 | switch ( e->key() ) { | 1052 | switch ( e->key() ) { |
1066 | ////////////////////////////// Zaurus keys | 1053 | ////////////////////////////// Zaurus keys |
1067 | case Key_F9: //activity | 1054 | case Key_F9: //activity |
1068 | // if(audioUI->isHidden()) | 1055 | // if(audioUI->isHidden()) |
1069 | // audioUI->showMaximized(); | 1056 | // audioUI->showMaximized(); |
1070 | break; | 1057 | break; |
1071 | case Key_F10: //contacts | 1058 | case Key_F10: //contacts |
1072 | // if( videoUI->isHidden()) | 1059 | // if( videoUI->isHidden()) |
1073 | // videoUI->showMaximized(); | 1060 | // videoUI->showMaximized(); |
1074 | break; | 1061 | break; |
1075 | case Key_F11: //menu | 1062 | case Key_F11: //menu |
1076 | break; | 1063 | break; |
1077 | case Key_F12: //home | 1064 | case Key_F12: //home |
1078 | // doBlank(); | 1065 | // doBlank(); |
1079 | break; | 1066 | break; |
1080 | case Key_F13: //mail | 1067 | case Key_F13: //mail |
1081 | // doUnblank(); | 1068 | // doUnblank(); |
1082 | break; | 1069 | break; |
@@ -1084,24 +1071,36 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | |||
1084 | } | 1071 | } |
1085 | } | 1072 | } |
1086 | 1073 | ||
1087 | void PlayListWidget::doBlank() { | 1074 | void PlayListWidget::doBlank() { |
1088 | qDebug("do blanking"); | 1075 | qDebug("do blanking"); |
1089 | fd=open("/dev/fb0",O_RDWR); | 1076 | fd=open("/dev/fb0",O_RDWR); |
1090 | if (fd != -1) { | 1077 | if (fd != -1) { |
1091 | ioctl(fd,FBIOBLANK,1); | 1078 | ioctl(fd,FBIOBLANK,1); |
1092 | // close(fd); | 1079 | // close(fd); |
1093 | } | 1080 | } |
1094 | } | 1081 | } |
1095 | 1082 | ||
1096 | void PlayListWidget::doUnblank() { | 1083 | void PlayListWidget::doUnblank() { |
1097 | // this crashes opieplayer with a segfault | 1084 | // this crashes opieplayer with a segfault |
1098 | // int fd; | 1085 | // int fd; |
1099 | // fd=open("/dev/fb0",O_RDWR); | 1086 | // fd=open("/dev/fb0",O_RDWR); |
1100 | qDebug("do unblanking"); | 1087 | qDebug("do unblanking"); |
1101 | if (fd != -1) { | 1088 | if (fd != -1) { |
1102 | ioctl(fd,FBIOBLANK,0); | 1089 | ioctl(fd,FBIOBLANK,0); |
1103 | close(fd); | 1090 | close(fd); |
1104 | } | 1091 | } |
1105 | QCopEnvelope h("QPE/System", "setBacklight(int)"); | 1092 | QCopEnvelope h("QPE/System", "setBacklight(int)"); |
1106 | h <<-3;// v[1]; // -3 Force on | 1093 | h <<-3;// v[1]; // -3 Force on |
1107 | } | 1094 | } |
1095 | |||
1096 | void PlayListWidget::readm3u(const QString &filename) { | ||
1097 | |||
1098 | } | ||
1099 | |||
1100 | void PlayListWidget::writem3u(const QString &filename) { | ||
1101 | |||
1102 | } | ||
1103 | |||
1104 | void PlayListWidget::readPls(const QString &filename) { | ||
1105 | |||
1106 | } | ||
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h index f22770f..c07d4f8 100644 --- a/core/multimedia/opieplayer/playlistwidget.h +++ b/core/multimedia/opieplayer/playlistwidget.h | |||
@@ -51,48 +51,52 @@ public: | |||
51 | bool fromSetDocument; | 51 | bool fromSetDocument; |
52 | bool insanityBool; | 52 | bool insanityBool; |
53 | QString setDocFileRef; | 53 | QString setDocFileRef; |
54 | // retrieve the current playlist entry (media file link) | 54 | // retrieve the current playlist entry (media file link) |
55 | const DocLnk *current(); | 55 | const DocLnk *current(); |
56 | void useSelectedDocument(); | 56 | void useSelectedDocument(); |
57 | /* QTimer * menuTimer; */ | 57 | /* QTimer * menuTimer; */ |
58 | FileSelector* playLists; | 58 | FileSelector* playLists; |
59 | QPushButton *tbDeletePlaylist; | 59 | QPushButton *tbDeletePlaylist; |
60 | int fd; | 60 | int fd; |
61 | public slots: | 61 | public slots: |
62 | bool first(); | 62 | bool first(); |
63 | bool last(); | 63 | bool last(); |
64 | bool next(); | 64 | bool next(); |
65 | bool prev(); | 65 | bool prev(); |
66 | /* void setFullScreen(); */ | 66 | /* void setFullScreen(); */ |
67 | /* void setScaled(); */ | 67 | /* void setScaled(); */ |
68 | protected: | 68 | protected: |
69 | /* void contentsMousePressEvent( QMouseEvent * e ); */ | 69 | /* void contentsMousePressEvent( QMouseEvent * e ); */ |
70 | /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ | 70 | /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ |
71 | void keyReleaseEvent( QKeyEvent *e); | 71 | void keyReleaseEvent( QKeyEvent *e); |
72 | private: | 72 | private: |
73 | void doBlank(); | 73 | void doBlank(); |
74 | void doUnblank(); | 74 | void doUnblank(); |
75 | void readm3u(const QString &); | ||
76 | void writem3u(const QString &); | ||
77 | void readPls(const QString &); | ||
78 | |||
75 | 79 | ||
76 | void initializeStates(); | 80 | void initializeStates(); |
77 | void readConfig( Config& cfg ); | 81 | void readConfig( Config& cfg ); |
78 | void writeConfig( Config& cfg ) const; | 82 | void writeConfig( Config& cfg ) const; |
79 | PlayListWidgetPrivate *d; // Private implementation data | 83 | PlayListWidgetPrivate *d; // Private implementation data |
80 | void populateAudioView(); | 84 | void populateAudioView(); |
81 | void populateVideoView(); | 85 | void populateVideoView(); |
82 | private slots: | 86 | private slots: |
83 | void openFile(); | 87 | void openFile(); |
84 | void setDocument( const QString& fileref ); | 88 | void setDocument( const QString& fileref ); |
85 | void addToSelection( const DocLnk& ); // Add a media file to the playlist | 89 | void addToSelection( const DocLnk& ); // Add a media file to the playlist |
86 | void addToSelection( QListViewItem* ); // Add a media file to the playlist | 90 | void addToSelection( QListViewItem* ); // Add a media file to the playlist |
87 | void setActiveWindow(); // need to handle this to show the right view | 91 | void setActiveWindow(); // need to handle this to show the right view |
88 | void setPlaylist( bool ); // Show/Hide the playlist | 92 | void setPlaylist( bool ); // Show/Hide the playlist |
89 | void setView( char ); | 93 | void setView( char ); |
90 | void clearList(); | 94 | void clearList(); |
91 | void addAllToList(); | 95 | void addAllToList(); |
92 | void addAllMusicToList(); | 96 | void addAllMusicToList(); |
93 | void addAllVideoToList(); | 97 | void addAllVideoToList(); |
94 | void saveList(); // Save the playlist | 98 | void saveList(); // Save the playlist |
95 | void loadList( const DocLnk &); // Load a playlist | 99 | void loadList( const DocLnk &); // Load a playlist |
96 | void playIt( QListViewItem *); | 100 | void playIt( QListViewItem *); |
97 | 101 | ||
98 | void btnPlay(bool); | 102 | void btnPlay(bool); |
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp index 3bce996..97997f9 100644 --- a/core/multimedia/opieplayer/videowidget.cpp +++ b/core/multimedia/opieplayer/videowidget.cpp | |||
@@ -1,103 +1,114 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
21 | #include <qpe/mediaplayerplugininterface.h> | 21 | #include <qpe/mediaplayerplugininterface.h> |
22 | #include <qpe/config.h> | ||
23 | |||
22 | #include <qwidget.h> | 24 | #include <qwidget.h> |
23 | #include <qpainter.h> | 25 | #include <qpainter.h> |
24 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
25 | #include <qslider.h> | 27 | #include <qslider.h> |
26 | #include <qdrawutil.h> | 28 | #include <qdrawutil.h> |
27 | #include "videowidget.h" | 29 | #include "videowidget.h" |
28 | #include "mediaplayerstate.h" | 30 | #include "mediaplayerstate.h" |
29 | 31 | ||
30 | 32 | ||
31 | #ifdef Q_WS_QWS | 33 | #ifdef Q_WS_QWS |
32 | # define USE_DIRECT_PAINTER | 34 | # define USE_DIRECT_PAINTER |
33 | # include <qdirectpainter_qws.h> | 35 | # include <qdirectpainter_qws.h> |
34 | # include <qgfxraster_qws.h> | 36 | # include <qgfxraster_qws.h> |
35 | #endif | 37 | #endif |
36 | 38 | ||
37 | 39 | ||
38 | extern MediaPlayerState *mediaPlayerState; | 40 | extern MediaPlayerState *mediaPlayerState; |
39 | 41 | ||
40 | 42 | ||
41 | static const int xo = 2; // movable x offset | 43 | static const int xo = 2; // movable x offset |
42 | static const int yo = 0; // movable y offset | 44 | static const int yo = 0; // movable y offset |
43 | 45 | ||
44 | 46 | ||
45 | struct MediaButton { | 47 | struct MediaButton { |
46 | int xPos, yPos; | 48 | int xPos, yPos; |
47 | bool isToggle, isHeld, isDown; | 49 | bool isToggle, isHeld, isDown; |
48 | int controlType; | 50 | int controlType; |
49 | }; | 51 | }; |
50 | 52 | ||
51 | 53 | ||
52 | // Layout information for the videoButtons (and if it is a toggle button or not) | 54 | // Layout information for the videoButtons (and if it is a toggle button or not) |
53 | MediaButton videoButtons[] = { | 55 | MediaButton videoButtons[] = { |
54 | { 5+0*32+xo, 200+yo, FALSE, FALSE, FALSE, 4 }, // previous | 56 | { 5+0*32+xo, 200+yo, FALSE, FALSE, FALSE, 4 }, // previous |
55 | { 5+1*32+xo, 200+yo, FALSE, FALSE, FALSE, 1 }, // stop | 57 | { 5+1*32+xo, 200+yo, FALSE, FALSE, FALSE, 1 }, // stop |
56 | { 5+2*32+xo, 200+yo, TRUE, FALSE, FALSE, 0 }, // play | 58 | { 5+2*32+xo, 200+yo, TRUE, FALSE, FALSE, 0 }, // play |
57 | { 5+3*32+xo, 200+yo, TRUE, FALSE, FALSE, 2 }, // pause | 59 | { 5+3*32+xo, 200+yo, TRUE, FALSE, FALSE, 2 }, // pause |
58 | { 5+4*32+xo, 200+yo, FALSE, FALSE, FALSE, 3 }, // next | 60 | { 5+4*32+xo, 200+yo, FALSE, FALSE, FALSE, 3 }, // next |
59 | { 5+5*32+xo, 200+yo, FALSE, FALSE, FALSE, 8 }, // playlist | 61 | { 5+5*32+xo, 200+yo, FALSE, FALSE, FALSE, 8 }, // playlist |
60 | { 5+6*32+xo, 200+yo, TRUE, FALSE, FALSE, 9 } // fullscreen | 62 | { 5+6*32+xo, 200+yo, TRUE, FALSE, FALSE, 9 } // fullscreen |
61 | }; | 63 | }; |
62 | 64 | ||
63 | 65 | ||
64 | static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton)); | 66 | static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton)); |
65 | 67 | ||
66 | 68 | ||
67 | VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | 69 | VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : |
68 | QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | 70 | QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { |
69 | setCaption( tr("OpiePlayer") ); | 71 | setCaption( tr("OpiePlayer") ); |
70 | setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 72 | Config cfg("OpiePlayer"); |
71 | pixmaps[0] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButton0a" ) ); | 73 | cfg.setGroup("VideoWidget"); |
72 | pixmaps[1] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButton0b" ) ); | 74 | |
73 | pixmaps[2] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaControls0" ) ); | 75 | QString backgroundPix, Button0aPix, Button0bPix, controlsPix; |
76 | backgroundPix=cfg.readEntry( "backgroundPix", "opieplayer/metalFinish"); | ||
77 | Button0aPix=cfg.readEntry( "Button0aPix", "opieplayer/mediaButton0a"); | ||
78 | Button0bPix=cfg.readEntry( "Button0bPix","opieplayer/mediaButton0b"); | ||
79 | controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls0" ); | ||
80 | |||
81 | setBackgroundPixmap( Resource::loadPixmap( backgroundPix) ); | ||
82 | pixmaps[0] = new QPixmap( Resource::loadPixmap( Button0aPix ) ); | ||
83 | pixmaps[1] = new QPixmap( Resource::loadPixmap( Button0bPix ) ); | ||
84 | pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix) ); | ||
74 | currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 ); | 85 | currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 ); |
75 | 86 | ||
76 | slider = new QSlider( Qt::Horizontal, this ); | 87 | slider = new QSlider( Qt::Horizontal, this ); |
77 | slider->setMinValue( 0 ); | 88 | slider->setMinValue( 0 ); |
78 | slider->setMaxValue( 1 ); | 89 | slider->setMaxValue( 1 ); |
79 | slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 90 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
80 | slider->setFocusPolicy( QWidget::NoFocus ); | 91 | slider->setFocusPolicy( QWidget::NoFocus ); |
81 | slider->setGeometry( QRect( 7, 250, 220, 20 ) ); | 92 | slider->setGeometry( QRect( 7, 250, 220, 20 ) ); |
82 | 93 | ||
83 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 94 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |
84 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); | 95 | connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); |
85 | 96 | ||
86 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); | 97 | connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) ); |
87 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); | 98 | connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); |
88 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); | 99 | connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); |
89 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); | 100 | connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); |
90 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); | 101 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); |
91 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 102 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
92 | 103 | ||
93 | // Intialise state | 104 | // Intialise state |
94 | setLength( mediaPlayerState->length() ); | 105 | setLength( mediaPlayerState->length() ); |
95 | setPosition( mediaPlayerState->position() ); | 106 | setPosition( mediaPlayerState->position() ); |
96 | setFullscreen( mediaPlayerState->fullscreen() ); | 107 | setFullscreen( mediaPlayerState->fullscreen() ); |
97 | setPaused( mediaPlayerState->paused() ); | 108 | setPaused( mediaPlayerState->paused() ); |
98 | setPlaying( mediaPlayerState->playing() ); | 109 | setPlaying( mediaPlayerState->playing() ); |
99 | } | 110 | } |
100 | 111 | ||
101 | 112 | ||
102 | VideoWidget::~VideoWidget() { | 113 | VideoWidget::~VideoWidget() { |
103 | for ( int i = 0; i < 3; i++ ) | 114 | for ( int i = 0; i < 3; i++ ) |