summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp1
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.h4
-rw-r--r--noncore/multimedia/opieplayer2/main.cpp4
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp3
4 files changed, 8 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 452117c..28a42eb 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -15,48 +15,49 @@
15     ._= =}       : or (at your option) any later version. 15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_. 16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34 34
35#include "audiowidget.h" 35#include "audiowidget.h"
36 36
37#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
38 38
39using namespace Opie::Ui;
39namespace 40namespace
40{ 41{
41 42
42const int xo = -2; // movable x offset 43const int xo = -2; // movable x offset
43const int yo = 22; // movable y offset 44const int yo = 22; // movable y offset
44 45
45const MediaWidget::SkinButtonInfo skinInfo[] = 46const MediaWidget::SkinButtonInfo skinInfo[] =
46{ 47{
47 { MediaWidget::Play, "play", MediaWidget::ToggleButton }, 48 { MediaWidget::Play, "play", MediaWidget::ToggleButton },
48 { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, 49 { MediaWidget::Stop, "stop", MediaWidget::NormalButton },
49 { MediaWidget::Next, "next", MediaWidget::NormalButton }, 50 { MediaWidget::Next, "next", MediaWidget::NormalButton },
50 { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, 51 { MediaWidget::Previous, "prev", MediaWidget::NormalButton },
51 { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, 52 { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton },
52 { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, 53 { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton },
53 { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, 54 { MediaWidget::Loop, "loop", MediaWidget::ToggleButton },
54 { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, 55 { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton },
55 { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, 56 { MediaWidget::Forward, "forward", MediaWidget::NormalButton },
56 { MediaWidget::Back, "back", MediaWidget::NormalButton } 57 { MediaWidget::Back, "back", MediaWidget::NormalButton }
57}; 58};
58 59
59const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); 60const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] );
60 61
61void changeTextColor( QWidget * w) { 62void changeTextColor( QWidget * w) {
62 QPalette p = w->palette(); 63 QPalette p = w->palette();
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h
index b436239..aea4146 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.h
+++ b/noncore/multimedia/opieplayer2/audiowidget.h
@@ -15,81 +15,81 @@
15     ._= =}       : or (at your option) any later version. 15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_. 16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34#ifndef AUDIO_WIDGET_H 34#ifndef AUDIO_WIDGET_H
35#define AUDIO_WIDGET_H 35#define AUDIO_WIDGET_H
36 36
37#include <qlineedit.h> 37#include <qlineedit.h>
38 38
39#include <opie/oticker.h> 39#include <opie2/oticker.h>
40 40
41#include "mediawidget.h" 41#include "mediawidget.h"
42 42
43class QPixmap; 43class QPixmap;
44 44
45class AudioWidget : public MediaWidget { 45class AudioWidget : public MediaWidget {
46 Q_OBJECT 46 Q_OBJECT
47public: 47public:
48 AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); 48 AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 );
49 ~AudioWidget(); 49 ~AudioWidget();
50 void setTickerText( const QString &text ) { songInfo.setText( text ); } 50 void setTickerText( const QString &text ) { songInfo.setText( text ); }
51 51
52 static MediaWidget::GUIInfo guiInfo(); 52 static MediaWidget::GUIInfo guiInfo();
53 53
54public slots: 54public slots:
55 void updateSlider( long, long ); 55 void updateSlider( long, long );
56 void sliderPressed( ); 56 void sliderPressed( );
57 void sliderReleased( ); 57 void sliderReleased( );
58 void setLooping( bool b) { setToggleButton( Loop, b ); } 58 void setLooping( bool b) { setToggleButton( Loop, b ); }
59 void setPosition( long ); 59 void setPosition( long );
60 void setSeekable( bool ); 60 void setSeekable( bool );
61 61
62public: 62public:
63 virtual void setLength( long ); 63 virtual void setLength( long );
64 virtual void setPlaying( bool b) { setToggleButton( Play, b ); } 64 virtual void setPlaying( bool b) { setToggleButton( Play, b ); }
65 virtual void setDisplayType( MediaPlayerState::DisplayType displayType ); 65 virtual void setDisplayType( MediaPlayerState::DisplayType displayType );
66 66
67 virtual void loadSkin(); 67 virtual void loadSkin();
68 68
69signals: 69signals:
70 void sliderMoved(long); 70 void sliderMoved(long);
71 71
72protected: 72protected:
73 void doBlank(); 73 void doBlank();
74 void doUnblank(); 74 void doUnblank();
75 void resizeEvent( QResizeEvent *re ); 75 void resizeEvent( QResizeEvent *re );
76 void timerEvent( QTimerEvent *event ); 76 void timerEvent( QTimerEvent *event );
77 void keyReleaseEvent( QKeyEvent *e); 77 void keyReleaseEvent( QKeyEvent *e);
78private slots: 78private slots:
79 void skipFor(); 79 void skipFor();
80 void skipBack(); 80 void skipBack();
81 void stopSkip(); 81 void stopSkip();
82private: 82private:
83 int skipDirection; 83 int skipDirection;
84 QString skin; 84 QString skin;
85 85
86 OTicker songInfo; 86 Opie::Ui::OTicker songInfo;
87 QSlider slider; 87 QSlider slider;
88 QLineEdit time; 88 QLineEdit time;
89 bool isStreaming : 1; 89 bool isStreaming : 1;
90 bool audioSliderBeingMoved : 1; 90 bool audioSliderBeingMoved : 1;
91}; 91};
92 92
93 93
94#endif // AUDIO_WIDGET_H 94#endif // AUDIO_WIDGET_H
95 95
diff --git a/noncore/multimedia/opieplayer2/main.cpp b/noncore/multimedia/opieplayer2/main.cpp
index 00f72d1..6283ae3 100644
--- a/noncore/multimedia/opieplayer2/main.cpp
+++ b/noncore/multimedia/opieplayer2/main.cpp
@@ -1,26 +1,28 @@
1 1
2#include "mediaplayer.h" 2#include "mediaplayer.h"
3 3
4 4
5 5
6#include <opie/oapplicationfactory.h> 6#include <opie2/oapplicationfactory.h>
7 7
8using namespace Opie::Core;
8OPIE_EXPORT_APP( OApplicationFactory<PlayListWidget> ) 9OPIE_EXPORT_APP( OApplicationFactory<PlayListWidget> )
9 10
10#if 0 11#if 0
12using namespace Opie::Core;
11int main(int argc, char **argv) { 13int main(int argc, char **argv) {
12 QPEApplication a(argc,argv); 14 QPEApplication a(argc,argv);
13 15
14 MediaPlayerState st( 0, "mediaPlayerState" ); 16 MediaPlayerState st( 0, "mediaPlayerState" );
15 PlayListWidget pl( st, 0, "playList" ); 17 PlayListWidget pl( st, 0, "playList" );
16 pl.showMaximized(); 18 pl.showMaximized();
17 MediaPlayer mp( pl, st, 0, "mediaPlayer" ); 19 MediaPlayer mp( pl, st, 0, "mediaPlayer" );
18 QObject::connect( &pl, SIGNAL( skinSelected() ), 20 QObject::connect( &pl, SIGNAL( skinSelected() ),
19 &mp, SLOT( reloadSkins() ) ); 21 &mp, SLOT( reloadSkins() ) );
20 22
21 a.showMainDocumentWidget(&pl); 23 a.showMainDocumentWidget(&pl);
22 24
23 return a.exec(); 25 return a.exec();
24} 26}
25#endif 27#endif
26 28
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 84aba55..1a5e474 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -12,62 +12,63 @@
12:`=1 )Y*s>-.--   : the terms of the GNU General Public 12:`=1 )Y*s>-.--   : the terms of the GNU General Public
13.="- .-=="i,     .._ License as published by the Free Software 13.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License, 14 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version. 15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_. 16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; General Public License for more 22..}^=.=       =       ; General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = General Public License along with 26  -_. . .   )=.  = General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34#include <qtoolbar.h> 34#include <qtoolbar.h>
35 35
36#include <opie/ofiledialog.h> 36#include <opie2/ofiledialog.h>
37 37
38#include <qmessagebox.h> 38#include <qmessagebox.h>
39 39
40#include "playlistselection.h" 40#include "playlistselection.h"
41#include "playlistwidget.h" 41#include "playlistwidget.h"
42#include "mediaplayer.h" 42#include "mediaplayer.h"
43#include "inputDialog.h" 43#include "inputDialog.h"
44#include "om3u.h" 44#include "om3u.h"
45#include "playlistfileview.h" 45#include "playlistfileview.h"
46 46
47//only needed for the random play 47//only needed for the random play
48#include <assert.h> 48#include <assert.h>
49 49
50using namespace Opie::Ui;
50PlayListWidget::PlayListWidget(QWidget* parent, const char* name, WFlags fl ) 51PlayListWidget::PlayListWidget(QWidget* parent, const char* name, WFlags fl )
51 : PlayListWidgetGui( parent, "playList" ) , currentFileListView( 0 ) 52 : PlayListWidgetGui( parent, "playList" ) , currentFileListView( 0 )
52{ 53{
53 mediaPlayerState = new MediaPlayerState(0, "mediaPlayerState" ); 54 mediaPlayerState = new MediaPlayerState(0, "mediaPlayerState" );
54 m_mp = new MediaPlayer(*this, *mediaPlayerState, 0, "mediaPlayer"); 55 m_mp = new MediaPlayer(*this, *mediaPlayerState, 0, "mediaPlayer");
55 56
56 57
57 58
58 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), 59 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ),
59 "opieplayer2/add_to_playlist", 60 "opieplayer2/add_to_playlist",
60 this , SLOT(addSelected() ) ); 61 this , SLOT(addSelected() ) );
61 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), 62 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ),
62 "opieplayer2/remove_from_playlist", 63 "opieplayer2/remove_from_playlist",
63 this , SLOT(removeSelected() ) ); 64 this , SLOT(removeSelected() ) );
64 d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", 65 d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play",
65 this , SLOT( btnPlay(bool) ), TRUE ); 66 this , SLOT( btnPlay(bool) ), TRUE );
66 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", 67 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle",
67 mediaPlayerState, SLOT( setShuffled(bool) ), TRUE ); 68 mediaPlayerState, SLOT( setShuffled(bool) ), TRUE );
68 d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", 69 d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop",
69 mediaPlayerState, SLOT( setLooping(bool) ), TRUE ); 70 mediaPlayerState, SLOT( setLooping(bool) ), TRUE );
70 71
71 (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); 72 (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) );
72 (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), 73 (void)new MenuItem( pmPlayList, tr( "Add all audio files" ),
73 this, SLOT( addAllMusicToList() ) ); 74 this, SLOT( addAllMusicToList() ) );