-rw-r--r-- | core/multimedia/opieplayer/config.in | 3 | ||||
-rw-r--r-- | core/multimedia/opieplayer/inputDialog.cpp | 3 | ||||
-rw-r--r-- | core/multimedia/opieplayer/libmad/config.in | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/libmad/libmadplugin.h | 1 | ||||
-rw-r--r-- | core/multimedia/opieplayer/libmpeg3/config.in | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/main.cpp | 1 | ||||
-rw-r--r-- | core/multimedia/opieplayer/modplug/config.in | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/modplug/load_j2b.cpp | 1 | ||||
-rw-r--r-- | core/multimedia/opieplayer/modplug/tables.cpp | 1 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/vorbis/config.in | 3 | ||||
-rw-r--r-- | core/multimedia/opieplayer/vorbis/libtremorplugin.cpp | 1 | ||||
-rw-r--r-- | core/multimedia/opieplayer/vorbis/tremor/config.in | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/vorbis/vorbis.pro | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/wavplugin/config.in | 2 |
15 files changed, 12 insertions, 18 deletions
diff --git a/core/multimedia/opieplayer/config.in b/core/multimedia/opieplayer/config.in index dc1b79a..a7ac444 100644 --- a/core/multimedia/opieplayer/config.in +++ b/core/multimedia/opieplayer/config.in | |||
@@ -1,12 +1,13 @@ | |||
1 | config OPIEPLAYER | 1 | config OPIEPLAYER |
2 | boolean "opie-mediaplayer (mediaplayer that plays mp3, mpeg, and wav)" | 2 | boolean "Opieplayer" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE |
5 | 5 | ||
6 | source core/multimedia/opieplayer/libflash/config.in | 6 | source core/multimedia/opieplayer/libflash/config.in |
7 | source core/multimedia/opieplayer/libmad/config.in | 7 | source core/multimedia/opieplayer/libmad/config.in |
8 | source core/multimedia/opieplayer/libmpeg3/config.in | 8 | source core/multimedia/opieplayer/libmpeg3/config.in |
9 | source core/multimedia/opieplayer/modplug/config.in | 9 | source core/multimedia/opieplayer/modplug/config.in |
10 | source core/multimedia/opieplayer/wavplugin/config.in | 10 | source core/multimedia/opieplayer/wavplugin/config.in |
11 | source core/multimedia/opieplayer/vorbis/tremor/config.in | 11 | source core/multimedia/opieplayer/vorbis/tremor/config.in |
12 | source core/multimedia/opieplayer/vorbis/config.in | 12 | source core/multimedia/opieplayer/vorbis/config.in |
13 | \ No newline at end of file | ||
diff --git a/core/multimedia/opieplayer/inputDialog.cpp b/core/multimedia/opieplayer/inputDialog.cpp index 62240b2..38b8f53 100644 --- a/core/multimedia/opieplayer/inputDialog.cpp +++ b/core/multimedia/opieplayer/inputDialog.cpp | |||
@@ -1,62 +1,59 @@ | |||
1 | #include "inputDialog.h" | 1 | #include "inputDialog.h" |
2 | 2 | ||
3 | #include <qpe/resource.h> | 3 | #include <qpe/resource.h> |
4 | 4 | ||
5 | #include <opie/ofiledialog.h> | 5 | #include <opie/ofiledialog.h> |
6 | 6 | ||
7 | #include <qlineedit.h> | 7 | #include <qlineedit.h> |
8 | #include <qlayout.h> | ||
9 | #include <qvariant.h> | ||
10 | #include <qpushbutton.h> | 8 | #include <qpushbutton.h> |
11 | #include <qwhatsthis.h> | ||
12 | 9 | ||
13 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 10 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
14 | : QDialog( parent, name, modal, fl ) { | 11 | : QDialog( parent, name, modal, fl ) { |
15 | if ( !name ) { | 12 | if ( !name ) { |
16 | setName( "InputDialog" ); | 13 | setName( "InputDialog" ); |
17 | } | 14 | } |
18 | resize( 234, 115); | 15 | resize( 234, 115); |
19 | setMaximumSize( QSize( 240, 40)); | 16 | setMaximumSize( QSize( 240, 40)); |
20 | setCaption( tr( name ) ); | 17 | setCaption( tr( name ) ); |
21 | 18 | ||
22 | QPushButton *browserButton; | 19 | QPushButton *browserButton; |
23 | browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); | 20 | browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); |
24 | browserButton->setGeometry( QRect( 205, 10, 22, 22)); | 21 | browserButton->setGeometry( QRect( 205, 10, 22, 22)); |
25 | connect( browserButton, SIGNAL(released()),this,SLOT(browse())); | 22 | connect( browserButton, SIGNAL(released()),this,SLOT(browse())); |
26 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 23 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
27 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); | 24 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); |
28 | LineEdit1->setFocus(); | 25 | LineEdit1->setFocus(); |
29 | } | 26 | } |
30 | /* | 27 | /* |
31 | * return the current text(input) | 28 | * return the current text(input) |
32 | */ | 29 | */ |
33 | QString InputDialog::text() const { | 30 | QString InputDialog::text() const { |
34 | return LineEdit1->text(); | 31 | return LineEdit1->text(); |
35 | } | 32 | } |
36 | /* | 33 | /* |
37 | * Destroys the object and frees any allocated resources | 34 | * Destroys the object and frees any allocated resources |
38 | */ | 35 | */ |
39 | InputDialog::~InputDialog() { | 36 | InputDialog::~InputDialog() { |
40 | } | 37 | } |
41 | 38 | ||
42 | void InputDialog::browse() { | 39 | void InputDialog::browse() { |
43 | 40 | ||
44 | MimeTypes types; | 41 | MimeTypes types; |
45 | QStringList audio, video, all; | 42 | QStringList audio, video, all; |
46 | audio << "audio/*"; | 43 | audio << "audio/*"; |
47 | audio << "playlist/plain"; | 44 | audio << "playlist/plain"; |
48 | audio << "audio/x-mpegurl"; | 45 | audio << "audio/x-mpegurl"; |
49 | 46 | ||
50 | video << "video/*"; | 47 | video << "video/*"; |
51 | video << "playlist/plain"; | 48 | video << "playlist/plain"; |
52 | 49 | ||
53 | all += audio; | 50 | all += audio; |
54 | all += video; | 51 | all += video; |
55 | types.insert("All Media Files", all ); | 52 | types.insert("All Media Files", all ); |
56 | types.insert("Audio", audio ); | 53 | types.insert("Audio", audio ); |
57 | types.insert("Video", video ); | 54 | types.insert("Video", video ); |
58 | 55 | ||
59 | QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 ); | 56 | QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 ); |
60 | LineEdit1->setText(str); | 57 | LineEdit1->setText(str); |
61 | } | 58 | } |
62 | 59 | ||
diff --git a/core/multimedia/opieplayer/libmad/config.in b/core/multimedia/opieplayer/libmad/config.in index 72249dc..1239166 100644 --- a/core/multimedia/opieplayer/libmad/config.in +++ b/core/multimedia/opieplayer/libmad/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config LIBMAD | 1 | config LIBMAD |
2 | boolean "opieplayer1-libmadplugin (plugin with shoutcast/icecast support to play MP3 files)" | 2 | boolean "libmadplugin" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && OPIEPLAYER | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && OPIEPLAYER |
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.h b/core/multimedia/opieplayer/libmad/libmadplugin.h index 6747712..b05ba15 100644 --- a/core/multimedia/opieplayer/libmad/libmadplugin.h +++ b/core/multimedia/opieplayer/libmad/libmadplugin.h | |||
@@ -1,117 +1,116 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2001 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2001 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 | #ifndef LIBMAD_PLUGIN_H | 20 | #ifndef LIBMAD_PLUGIN_H |
21 | #define LIBMAD_PLUGIN_H | 21 | #define LIBMAD_PLUGIN_H |
22 | 22 | ||
23 | #include <qstring.h> | 23 | #include <qstring.h> |
24 | #include <qpe/mediaplayerplugininterface.h> | 24 | #include <qpe/mediaplayerplugininterface.h> |
25 | /* #include "../mediaplayerplugininterface.h" */ | 25 | /* #include "../mediaplayerplugininterface.h" */ |
26 | 26 | ||
27 | 27 | ||
28 | // #define OLD_MEDIAPLAYER_API | 28 | // #define OLD_MEDIAPLAYER_API |
29 | 29 | ||
30 | 30 | ||
31 | class LibMadPluginData; | 31 | class LibMadPluginData; |
32 | 32 | ||
33 | 33 | ||
34 | class LibMadPlugin : public MediaPlayerDecoder { | 34 | class LibMadPlugin : public MediaPlayerDecoder { |
35 | |||
36 | public: | 35 | public: |
37 | LibMadPlugin(); | 36 | LibMadPlugin(); |
38 | ~LibMadPlugin(); | 37 | ~LibMadPlugin(); |
39 | 38 | ||
40 | const char *pluginName() { return "LibMadPlugin"; } | 39 | const char *pluginName() { return "LibMadPlugin"; } |
41 | const char *pluginComment() { return "This is the libmad library that has been wrapped as a plugin"; } | 40 | const char *pluginComment() { return "This is the libmad library that has been wrapped as a plugin"; } |
42 | double pluginVersion() { return 1.0; } | 41 | double pluginVersion() { return 1.0; } |
43 | 42 | ||
44 | bool isFileSupported( const QString& ); | 43 | bool isFileSupported( const QString& ); |
45 | bool open( const QString& ); | 44 | bool open( const QString& ); |
46 | 45 | ||
47 | bool close(); | 46 | bool close(); |
48 | bool isOpen(); | 47 | bool isOpen(); |
49 | const QString &fileInfo() { return info; } | 48 | const QString &fileInfo() { return info; } |
50 | 49 | ||
51 | // If decoder doesn't support audio then return 0 here | 50 | // If decoder doesn't support audio then return 0 here |
52 | int audioStreams(); | 51 | int audioStreams(); |
53 | int audioChannels( int stream ); | 52 | int audioChannels( int stream ); |
54 | int audioFrequency( int stream ); | 53 | int audioFrequency( int stream ); |
55 | int audioSamples( int stream ); | 54 | int audioSamples( int stream ); |
56 | bool audioSetSample( long sample, int stream ); | 55 | bool audioSetSample( long sample, int stream ); |
57 | /* int audioBitsPerSample(int) {return 0;} */ | 56 | /* int audioBitsPerSample(int) {return 0;} */ |
58 | long audioGetSample( int stream ); | 57 | long audioGetSample( int stream ); |
59 | #ifdef OLD_MEDIAPLAYER_API | 58 | #ifdef OLD_MEDIAPLAYER_API |
60 | bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); | 59 | bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); |
61 | bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); | 60 | bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); |
62 | bool audioReadSamples( short *output, int channel, long samples, int stream ); | 61 | bool audioReadSamples( short *output, int channel, long samples, int stream ); |
63 | bool audioReReadSamples( short *output, int channel, long samples, int stream ); | 62 | bool audioReReadSamples( short *output, int channel, long samples, int stream ); |
64 | #else | 63 | #else |
65 | bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); | 64 | bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); |
66 | #endif | 65 | #endif |
67 | 66 | ||
68 | 67 | ||
69 | bool read(); | 68 | bool read(); |
70 | bool decode( short *output, long samples, long& samplesRead ); | 69 | bool decode( short *output, long samples, long& samplesRead ); |
71 | void printID3Tags(); | 70 | void printID3Tags(); |
72 | 71 | ||
73 | 72 | ||
74 | // If decoder doesn't support video then return 0 here | 73 | // If decoder doesn't support video then return 0 here |
75 | int videoStreams() { return 0; } | 74 | int videoStreams() { return 0; } |
76 | int videoWidth( int ) { return 0; } | 75 | int videoWidth( int ) { return 0; } |
77 | int videoHeight( int ) { return 0; } | 76 | int videoHeight( int ) { return 0; } |
78 | double videoFrameRate( int ) { return 0.0; } | 77 | double videoFrameRate( int ) { return 0.0; } |
79 | int videoFrames( int ) { return 0; } | 78 | int videoFrames( int ) { return 0; } |
80 | bool videoSetFrame( long, int ) { return FALSE; } | 79 | bool videoSetFrame( long, int ) { return FALSE; } |
81 | long videoGetFrame( int ) { return 0; } | 80 | long videoGetFrame( int ) { return 0; } |
82 | bool videoReadFrame( unsigned char **, int, int, int, int, ColorFormat, int ) { return FALSE; } | 81 | bool videoReadFrame( unsigned char **, int, int, int, int, ColorFormat, int ) { return FALSE; } |
83 | bool videoReadScaledFrame( unsigned char **, int, int, int, int, int, int, ColorFormat, int ) { return FALSE; } | 82 | bool videoReadScaledFrame( unsigned char **, int, int, int, int, int, int, ColorFormat, int ) { return FALSE; } |
84 | bool videoReadYUVFrame( char *, char *, char *, int, int, int, int, int ) { return FALSE; } | 83 | bool videoReadYUVFrame( char *, char *, char *, int, int, int, int, int ) { return FALSE; } |
85 | 84 | ||
86 | // Profiling | 85 | // Profiling |
87 | double getTime(); | 86 | double getTime(); |
88 | 87 | ||
89 | // Ignore if these aren't supported | 88 | // Ignore if these aren't supported |
90 | bool setSMP( int ) { return FALSE; } | 89 | bool setSMP( int ) { return FALSE; } |
91 | bool setMMX( bool ) { return FALSE; } | 90 | bool setMMX( bool ) { return FALSE; } |
92 | 91 | ||
93 | // Capabilities | 92 | // Capabilities |
94 | bool supportsAudio() { return TRUE; } | 93 | bool supportsAudio() { return TRUE; } |
95 | bool supportsVideo() { return FALSE; } | 94 | bool supportsVideo() { return FALSE; } |
96 | bool supportsYUV() { return FALSE; } | 95 | bool supportsYUV() { return FALSE; } |
97 | bool supportsMMX() { return TRUE; } | 96 | bool supportsMMX() { return TRUE; } |
98 | bool supportsSMP() { return FALSE; } | 97 | bool supportsSMP() { return FALSE; } |
99 | bool supportsStereo() { return TRUE; } | 98 | bool supportsStereo() { return TRUE; } |
100 | bool supportsScaling() { return FALSE; } | 99 | bool supportsScaling() { return FALSE; } |
101 | 100 | ||
102 | long getPlayTime() { return -1; } | 101 | long getPlayTime() { return -1; } |
103 | 102 | ||
104 | private: | 103 | private: |
105 | int is_address_multicast(unsigned long address); | 104 | int is_address_multicast(unsigned long address); |
106 | int udp_open(char *address, int port); | 105 | int udp_open(char *address, int port); |
107 | int tcp_open(char *address, int port); | 106 | int tcp_open(char *address, int port); |
108 | int http_read_line(int tcp_sock, char *buf, int size) ; | 107 | int http_read_line(int tcp_sock, char *buf, int size) ; |
109 | int http_open(const QString& path ); | 108 | int http_open(const QString& path ); |
110 | 109 | ||
111 | LibMadPluginData *d; | 110 | LibMadPluginData *d; |
112 | QString info; | 111 | QString info; |
113 | int bufferSize; | 112 | int bufferSize; |
114 | }; | 113 | }; |
115 | 114 | ||
116 | 115 | ||
117 | #endif | 116 | #endif |
diff --git a/core/multimedia/opieplayer/libmpeg3/config.in b/core/multimedia/opieplayer/libmpeg3/config.in index b965a40..b634594 100644 --- a/core/multimedia/opieplayer/libmpeg3/config.in +++ b/core/multimedia/opieplayer/libmpeg3/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config LIBMPEG3 | 1 | config LIBMPEG3 |
2 | boolean "opieplayer1-libmpeg3plugin (play MPEG3 video files)" | 2 | boolean "libmpeg3plugin" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && OPIEPLAYER | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && OPIEPLAYER |
diff --git a/core/multimedia/opieplayer/main.cpp b/core/multimedia/opieplayer/main.cpp index 18cd7a6..32dc1d5 100644 --- a/core/multimedia/opieplayer/main.cpp +++ b/core/multimedia/opieplayer/main.cpp | |||
@@ -1,56 +1,55 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the 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> | ||
21 | #include "mediaplayerstate.h" | 20 | #include "mediaplayerstate.h" |
22 | #include "playlistwidget.h" | 21 | #include "playlistwidget.h" |
23 | #include "audiowidget.h" | 22 | #include "audiowidget.h" |
24 | #include "videowidget.h" | 23 | #include "videowidget.h" |
25 | #include "loopcontrol.h" | 24 | #include "loopcontrol.h" |
26 | #include "mediaplayer.h" | 25 | #include "mediaplayer.h" |
27 | 26 | ||
28 | MediaPlayerState *mediaPlayerState; | 27 | MediaPlayerState *mediaPlayerState; |
29 | PlayListWidget *playList; | 28 | PlayListWidget *playList; |
30 | AudioWidget *audioUI; | 29 | AudioWidget *audioUI; |
31 | VideoWidget *videoUI; | 30 | VideoWidget *videoUI; |
32 | LoopControl *loopControl; | 31 | LoopControl *loopControl; |
33 | 32 | ||
34 | 33 | ||
35 | int main(int argc, char **argv) { | 34 | int main(int argc, char **argv) { |
36 | QPEApplication a(argc,argv); | 35 | QPEApplication a(argc,argv); |
37 | 36 | ||
38 | MediaPlayerState st( 0, "mediaPlayerState" ); | 37 | MediaPlayerState st( 0, "mediaPlayerState" ); |
39 | mediaPlayerState = &st; | 38 | mediaPlayerState = &st; |
40 | PlayListWidget pl( 0, "playList" ); | 39 | PlayListWidget pl( 0, "playList" ); |
41 | playList = &pl; | 40 | playList = &pl; |
42 | AudioWidget aw( 0, "audioUI" ); | 41 | AudioWidget aw( 0, "audioUI" ); |
43 | audioUI = &aw; | 42 | audioUI = &aw; |
44 | VideoWidget vw( 0, "videoUI" ); | 43 | VideoWidget vw( 0, "videoUI" ); |
45 | videoUI = &vw; | 44 | videoUI = &vw; |
46 | LoopControl lc( 0, "loopControl" ); | 45 | LoopControl lc( 0, "loopControl" ); |
47 | loopControl = &lc; | 46 | loopControl = &lc; |
48 | MediaPlayer mp( 0, "mediaPlayer" ); | 47 | MediaPlayer mp( 0, "mediaPlayer" ); |
49 | 48 | ||
50 | // pl.setCaption( MediaPlayer::tr("OpiePlayer") ); | 49 | // pl.setCaption( MediaPlayer::tr("OpiePlayer") ); |
51 | a.showMainDocumentWidget(&pl); | 50 | a.showMainDocumentWidget(&pl); |
52 | 51 | ||
53 | return a.exec(); | 52 | return a.exec(); |
54 | } | 53 | } |
55 | 54 | ||
56 | 55 | ||
diff --git a/core/multimedia/opieplayer/modplug/config.in b/core/multimedia/opieplayer/modplug/config.in index 86e4725..769db1b 100644 --- a/core/multimedia/opieplayer/modplug/config.in +++ b/core/multimedia/opieplayer/modplug/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config MODPLUG | 1 | config MODPLUG |
2 | boolean "opieplayer1-modplugin (play MOD/XM/S3M/IT amiga tracker modules)" | 2 | boolean "modplugin" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && OPIEPLAYER | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && OPIEPLAYER |
diff --git a/core/multimedia/opieplayer/modplug/load_j2b.cpp b/core/multimedia/opieplayer/modplug/load_j2b.cpp index 5f60bbb..4f0b85c 100644 --- a/core/multimedia/opieplayer/modplug/load_j2b.cpp +++ b/core/multimedia/opieplayer/modplug/load_j2b.cpp | |||
@@ -1,18 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * This program is free software; you can redistribute it and modify it | 2 | * This program is free software; you can redistribute it and modify it |
3 | * under the terms of the GNU General Public License as published by the | 3 | * under the terms of the GNU General Public License as published by the |
4 | * Free Software Foundation; either version 2 of the license or (at your | 4 | * Free Software Foundation; either version 2 of the license or (at your |
5 | * option) any later version. | 5 | * option) any later version. |
6 | * | 6 | * |
7 | * Authors: Olivier Lapicque <olivierl@jps.net> | 7 | * Authors: Olivier Lapicque <olivierl@jps.net> |
8 | */ | 8 | */ |
9 | 9 | ||
10 | 10 | ||
11 | /////////////////////////////////////////////////// | 11 | /////////////////////////////////////////////////// |
12 | // | 12 | // |
13 | // J2B module loader | 13 | // J2B module loader |
14 | // | 14 | // |
15 | /////////////////////////////////////////////////// | 15 | /////////////////////////////////////////////////// |
16 | #include "stdafx.h" | 16 | #include "stdafx.h" |
17 | #include "sndfile.h" | ||
18 | 17 | ||
diff --git a/core/multimedia/opieplayer/modplug/tables.cpp b/core/multimedia/opieplayer/modplug/tables.cpp index e7198b2..baf4517 100644 --- a/core/multimedia/opieplayer/modplug/tables.cpp +++ b/core/multimedia/opieplayer/modplug/tables.cpp | |||
@@ -1,267 +1,266 @@ | |||
1 | /* | 1 | /* |
2 | * This program is free software; you can redistribute it and modify it | 2 | * This program is free software; you can redistribute it and modify it |
3 | * under the terms of the GNU General Public License as published by the | 3 | * under the terms of the GNU General Public License as published by the |
4 | * Free Software Foundation; either version 2 of the license or (at your | 4 | * Free Software Foundation; either version 2 of the license or (at your |
5 | * option) any later version. | 5 | * option) any later version. |
6 | * | 6 | * |
7 | * Authors: Olivier Lapicque <olivierl@jps.net> | 7 | * Authors: Olivier Lapicque <olivierl@jps.net> |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "stdafx.h" | 10 | #include "stdafx.h" |
11 | #include "sndfile.h" | ||
12 | 11 | ||
13 | #ifndef FASTSOUNDLIB | 12 | #ifndef FASTSOUNDLIB |
14 | //#pragma data_seg(".tables") | 13 | //#pragma data_seg(".tables") |
15 | #endif | 14 | #endif |
16 | 15 | ||
17 | extern const BYTE ImpulseTrackerPortaVolCmd[16]; | 16 | extern const BYTE ImpulseTrackerPortaVolCmd[16]; |
18 | const BYTE ImpulseTrackerPortaVolCmd[16] = | 17 | const BYTE ImpulseTrackerPortaVolCmd[16] = |
19 | { | 18 | { |
20 | 0x00, 0x01, 0x04, 0x08, 0x10, 0x20, 0x40, 0x60, | 19 | 0x00, 0x01, 0x04, 0x08, 0x10, 0x20, 0x40, 0x60, |
21 | 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF | 20 | 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF |
22 | }; | 21 | }; |
23 | 22 | ||
24 | // Period table for Protracker octaves 0-5: | 23 | // Period table for Protracker octaves 0-5: |
25 | extern const WORD ProTrackerPeriodTable[6*12]; | 24 | extern const WORD ProTrackerPeriodTable[6*12]; |
26 | const WORD ProTrackerPeriodTable[6*12] = | 25 | const WORD ProTrackerPeriodTable[6*12] = |
27 | { | 26 | { |
28 | 1712,1616,1524,1440,1356,1280,1208,1140,1076,1016,960,907, | 27 | 1712,1616,1524,1440,1356,1280,1208,1140,1076,1016,960,907, |
29 | 856,808,762,720,678,640,604,570,538,508,480,453, | 28 | 856,808,762,720,678,640,604,570,538,508,480,453, |
30 | 428,404,381,360,339,320,302,285,269,254,240,226, | 29 | 428,404,381,360,339,320,302,285,269,254,240,226, |
31 | 214,202,190,180,170,160,151,143,135,127,120,113, | 30 | 214,202,190,180,170,160,151,143,135,127,120,113, |
32 | 107,101,95,90,85,80,75,71,67,63,60,56, | 31 | 107,101,95,90,85,80,75,71,67,63,60,56, |
33 | 53,50,47,45,42,40,37,35,33,31,30,28 | 32 | 53,50,47,45,42,40,37,35,33,31,30,28 |
34 | }; | 33 | }; |
35 | 34 | ||
36 | 35 | ||
37 | extern const WORD ProTrackerTunedPeriods[16*12]; | 36 | extern const WORD ProTrackerTunedPeriods[16*12]; |
38 | const WORD ProTrackerTunedPeriods[16*12] = | 37 | const WORD ProTrackerTunedPeriods[16*12] = |
39 | { | 38 | { |
40 | 1712,1616,1524,1440,1356,1280,1208,1140,1076,1016,960,907, | 39 | 1712,1616,1524,1440,1356,1280,1208,1140,1076,1016,960,907, |
41 | 1700,1604,1514,1430,1348,1274,1202,1134,1070,1010,954,900, | 40 | 1700,1604,1514,1430,1348,1274,1202,1134,1070,1010,954,900, |
42 | 1688,1592,1504,1418,1340,1264,1194,1126,1064,1004,948,894, | 41 | 1688,1592,1504,1418,1340,1264,1194,1126,1064,1004,948,894, |
43 | 1676,1582,1492,1408,1330,1256,1184,1118,1056,996,940,888, | 42 | 1676,1582,1492,1408,1330,1256,1184,1118,1056,996,940,888, |
44 | 1664,1570,1482,1398,1320,1246,1176,1110,1048,990,934,882, | 43 | 1664,1570,1482,1398,1320,1246,1176,1110,1048,990,934,882, |
45 | 1652,1558,1472,1388,1310,1238,1168,1102,1040,982,926,874, | 44 | 1652,1558,1472,1388,1310,1238,1168,1102,1040,982,926,874, |
46 | 1640,1548,1460,1378,1302,1228,1160,1094,1032,974,920,868, | 45 | 1640,1548,1460,1378,1302,1228,1160,1094,1032,974,920,868, |
47 | 1628,1536,1450,1368,1292,1220,1150,1086,1026,968,914,862, | 46 | 1628,1536,1450,1368,1292,1220,1150,1086,1026,968,914,862, |
48 | 1814,1712,1616,1524,1440,1356,1280,1208,1140,1076,1016,960, | 47 | 1814,1712,1616,1524,1440,1356,1280,1208,1140,1076,1016,960, |
49 | 1800,1700,1604,1514,1430,1350,1272,1202,1134,1070,1010,954, | 48 | 1800,1700,1604,1514,1430,1350,1272,1202,1134,1070,1010,954, |
50 | 1788,1688,1592,1504,1418,1340,1264,1194,1126,1064,1004,948, | 49 | 1788,1688,1592,1504,1418,1340,1264,1194,1126,1064,1004,948, |
51 | 1774,1676,1582,1492,1408,1330,1256,1184,1118,1056,996,940, | 50 | 1774,1676,1582,1492,1408,1330,1256,1184,1118,1056,996,940, |
52 | 1762,1664,1570,1482,1398,1320,1246,1176,1110,1048,988,934, | 51 | 1762,1664,1570,1482,1398,1320,1246,1176,1110,1048,988,934, |
53 | 1750,1652,1558,1472,1388,1310,1238,1168,1102,1040,982,926, | 52 | 1750,1652,1558,1472,1388,1310,1238,1168,1102,1040,982,926, |
54 | 1736,1640,1548,1460,1378,1302,1228,1160,1094,1032,974,920, | 53 | 1736,1640,1548,1460,1378,1302,1228,1160,1094,1032,974,920, |
55 | 1724,1628,1536,1450,1368,1292,1220,1150,1086,1026,968,914 | 54 | 1724,1628,1536,1450,1368,1292,1220,1150,1086,1026,968,914 |
56 | }; | 55 | }; |
57 | 56 | ||
58 | 57 | ||
59 | // S3M C-4 periods | 58 | // S3M C-4 periods |
60 | extern const WORD FreqS3MTable[16]; | 59 | extern const WORD FreqS3MTable[16]; |
61 | const WORD FreqS3MTable[16] = | 60 | const WORD FreqS3MTable[16] = |
62 | { | 61 | { |
63 | 1712,1616,1524,1440,1356,1280, | 62 | 1712,1616,1524,1440,1356,1280, |
64 | 1208,1140,1076,1016,960,907, | 63 | 1208,1140,1076,1016,960,907, |
65 | 0,0,0,0 | 64 | 0,0,0,0 |
66 | }; | 65 | }; |
67 | 66 | ||
68 | 67 | ||
69 | // S3M FineTune frequencies | 68 | // S3M FineTune frequencies |
70 | extern const WORD S3MFineTuneTable[16]; | 69 | extern const WORD S3MFineTuneTable[16]; |
71 | const WORD S3MFineTuneTable[16] = | 70 | const WORD S3MFineTuneTable[16] = |
72 | { | 71 | { |
73 | 7895,7941,7985,8046,8107,8169,8232,8280, | 72 | 7895,7941,7985,8046,8107,8169,8232,8280, |
74 | 8363,8413,8463,8529,8581,8651,8723,8757,// 8363*2^((i-8)/(12*8)) | 73 | 8363,8413,8463,8529,8581,8651,8723,8757,// 8363*2^((i-8)/(12*8)) |
75 | }; | 74 | }; |
76 | 75 | ||
77 | 76 | ||
78 | // Sinus table | 77 | // Sinus table |
79 | extern const short int ModSinusTable[64]; | 78 | extern const short int ModSinusTable[64]; |
80 | const short int ModSinusTable[64] = | 79 | const short int ModSinusTable[64] = |
81 | { | 80 | { |
82 | 0,12,25,37,49,60,71,81,90,98,106,112,117,122,125,126, | 81 | 0,12,25,37,49,60,71,81,90,98,106,112,117,122,125,126, |
83 | 127,126,125,122,117,112,106,98,90,81,71,60,49,37,25,12, | 82 | 127,126,125,122,117,112,106,98,90,81,71,60,49,37,25,12, |
84 | 0,-12,-25,-37,-49,-60,-71,-81,-90,-98,-106,-112,-117,-122,-125,-126, | 83 | 0,-12,-25,-37,-49,-60,-71,-81,-90,-98,-106,-112,-117,-122,-125,-126, |
85 | -127,-126,-125,-122,-117,-112,-106,-98,-90,-81,-71,-60,-49,-37,-25,-12 | 84 | -127,-126,-125,-122,-117,-112,-106,-98,-90,-81,-71,-60,-49,-37,-25,-12 |
86 | }; | 85 | }; |
87 | 86 | ||
88 | // Triangle wave table (ramp down) | 87 | // Triangle wave table (ramp down) |
89 | extern const short int ModRampDownTable[64]; | 88 | extern const short int ModRampDownTable[64]; |
90 | const short int ModRampDownTable[64] = | 89 | const short int ModRampDownTable[64] = |
91 | { | 90 | { |
92 | 0,-4,-8,-12,-16,-20,-24,-28,-32,-36,-40,-44,-48,-52,-56,-60, | 91 | 0,-4,-8,-12,-16,-20,-24,-28,-32,-36,-40,-44,-48,-52,-56,-60, |
93 | -64,-68,-72,-76,-80,-84,-88,-92,-96,-100,-104,-108,-112,-116,-120,-124, | 92 | -64,-68,-72,-76,-80,-84,-88,-92,-96,-100,-104,-108,-112,-116,-120,-124, |
94 | 127,123,119,115,111,107,103,99,95,91,87,83,79,75,71,67, | 93 | 127,123,119,115,111,107,103,99,95,91,87,83,79,75,71,67, |
95 | 63,59,55,51,47,43,39,35,31,27,23,19,15,11,7,3 | 94 | 63,59,55,51,47,43,39,35,31,27,23,19,15,11,7,3 |
96 | }; | 95 | }; |
97 | 96 | ||
98 | // Square wave table | 97 | // Square wave table |
99 | extern const short int ModSquareTable[64]; | 98 | extern const short int ModSquareTable[64]; |
100 | const short int ModSquareTable[64] = | 99 | const short int ModSquareTable[64] = |
101 | { | 100 | { |
102 | 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, | 101 | 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, |
103 | 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, | 102 | 127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127, |
104 | -127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127, | 103 | -127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127, |
105 | -127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127 | 104 | -127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127,-127 |
106 | }; | 105 | }; |
107 | 106 | ||
108 | // Random wave table | 107 | // Random wave table |
109 | extern const short int ModRandomTable[64]; | 108 | extern const short int ModRandomTable[64]; |
110 | const short int ModRandomTable[64] = | 109 | const short int ModRandomTable[64] = |
111 | { | 110 | { |
112 | 98,-127,-43,88,102,41,-65,-94,125,20,-71,-86,-70,-32,-16,-96, | 111 | 98,-127,-43,88,102,41,-65,-94,125,20,-71,-86,-70,-32,-16,-96, |
113 | 17,72,107,-5,116,-69,-62,-40,10,-61,65,109,-18,-38,-13,-76, | 112 | 17,72,107,-5,116,-69,-62,-40,10,-61,65,109,-18,-38,-13,-76, |
114 | -23,88,21,-94,8,106,21,-112,6,109,20,-88,-30,9,-127,118, | 113 | -23,88,21,-94,8,106,21,-112,6,109,20,-88,-30,9,-127,118, |
115 | 42,-34,89,-4,-51,-72,21,-29,112,123,84,-101,-92,98,-54,-95 | 114 | 42,-34,89,-4,-51,-72,21,-29,112,123,84,-101,-92,98,-54,-95 |
116 | }; | 115 | }; |
117 | 116 | ||
118 | 117 | ||
119 | // volume fade tables for Retrig Note: | 118 | // volume fade tables for Retrig Note: |
120 | extern const signed char retrigTable1[16]; | 119 | extern const signed char retrigTable1[16]; |
121 | const signed char retrigTable1[16] = | 120 | const signed char retrigTable1[16] = |
122 | { 0, 0, 0, 0, 0, 0, 10, 8, 0, 0, 0, 0, 0, 0, 24, 32 }; | 121 | { 0, 0, 0, 0, 0, 0, 10, 8, 0, 0, 0, 0, 0, 0, 24, 32 }; |
123 | 122 | ||
124 | extern const signed char retrigTable2[16]; | 123 | extern const signed char retrigTable2[16]; |
125 | const signed char retrigTable2[16] = | 124 | const signed char retrigTable2[16] = |
126 | { 0, -1, -2, -4, -8, -16, 0, 0, 0, 1, 2, 4, 8, 16, 0, 0 }; | 125 | { 0, -1, -2, -4, -8, -16, 0, 0, 0, 1, 2, 4, 8, 16, 0, 0 }; |
127 | 126 | ||
128 | 127 | ||
129 | 128 | ||
130 | 129 | ||
131 | extern const WORD XMPeriodTable[104]; | 130 | extern const WORD XMPeriodTable[104]; |
132 | const WORD XMPeriodTable[104] = | 131 | const WORD XMPeriodTable[104] = |
133 | { | 132 | { |
134 | 907,900,894,887,881,875,868,862,856,850,844,838,832,826,820,814, | 133 | 907,900,894,887,881,875,868,862,856,850,844,838,832,826,820,814, |
135 | 808,802,796,791,785,779,774,768,762,757,752,746,741,736,730,725, | 134 | 808,802,796,791,785,779,774,768,762,757,752,746,741,736,730,725, |
136 | 720,715,709,704,699,694,689,684,678,675,670,665,660,655,651,646, | 135 | 720,715,709,704,699,694,689,684,678,675,670,665,660,655,651,646, |
137 | 640,636,632,628,623,619,614,610,604,601,597,592,588,584,580,575, | 136 | 640,636,632,628,623,619,614,610,604,601,597,592,588,584,580,575, |
138 | 570,567,563,559,555,551,547,543,538,535,532,528,524,520,516,513, | 137 | 570,567,563,559,555,551,547,543,538,535,532,528,524,520,516,513, |
139 | 508,505,502,498,494,491,487,484,480,477,474,470,467,463,460,457, | 138 | 508,505,502,498,494,491,487,484,480,477,474,470,467,463,460,457, |
140 | 453,450,447,443,440,437,434,431 | 139 | 453,450,447,443,440,437,434,431 |
141 | }; | 140 | }; |
142 | 141 | ||
143 | 142 | ||
144 | extern const UINT XMLinearTable[768]; | 143 | extern const UINT XMLinearTable[768]; |
145 | const UINT XMLinearTable[768] = | 144 | const UINT XMLinearTable[768] = |
146 | { | 145 | { |
147 | 535232,534749,534266,533784,533303,532822,532341,531861, | 146 | 535232,534749,534266,533784,533303,532822,532341,531861, |
148 | 531381,530902,530423,529944,529466,528988,528511,528034, | 147 | 531381,530902,530423,529944,529466,528988,528511,528034, |
149 | 527558,527082,526607,526131,525657,525183,524709,524236, | 148 | 527558,527082,526607,526131,525657,525183,524709,524236, |
150 | 523763,523290,522818,522346,521875,521404,520934,520464, | 149 | 523763,523290,522818,522346,521875,521404,520934,520464, |
151 | 519994,519525,519057,518588,518121,517653,517186,516720, | 150 | 519994,519525,519057,518588,518121,517653,517186,516720, |
152 | 516253,515788,515322,514858,514393,513929,513465,513002, | 151 | 516253,515788,515322,514858,514393,513929,513465,513002, |
153 | 512539,512077,511615,511154,510692,510232,509771,509312, | 152 | 512539,512077,511615,511154,510692,510232,509771,509312, |
154 | 508852,508393,507934,507476,507018,506561,506104,505647, | 153 | 508852,508393,507934,507476,507018,506561,506104,505647, |
155 | 505191,504735,504280,503825,503371,502917,502463,502010, | 154 | 505191,504735,504280,503825,503371,502917,502463,502010, |
156 | 501557,501104,500652,500201,499749,499298,498848,498398, | 155 | 501557,501104,500652,500201,499749,499298,498848,498398, |
157 | 497948,497499,497050,496602,496154,495706,495259,494812, | 156 | 497948,497499,497050,496602,496154,495706,495259,494812, |
158 | 494366,493920,493474,493029,492585,492140,491696,491253, | 157 | 494366,493920,493474,493029,492585,492140,491696,491253, |
159 | 490809,490367,489924,489482,489041,488600,488159,487718, | 158 | 490809,490367,489924,489482,489041,488600,488159,487718, |
160 | 487278,486839,486400,485961,485522,485084,484647,484210, | 159 | 487278,486839,486400,485961,485522,485084,484647,484210, |
161 | 483773,483336,482900,482465,482029,481595,481160,480726, | 160 | 483773,483336,482900,482465,482029,481595,481160,480726, |
162 | 480292,479859,479426,478994,478562,478130,477699,477268, | 161 | 480292,479859,479426,478994,478562,478130,477699,477268, |
163 | 476837,476407,475977,475548,475119,474690,474262,473834, | 162 | 476837,476407,475977,475548,475119,474690,474262,473834, |
164 | 473407,472979,472553,472126,471701,471275,470850,470425, | 163 | 473407,472979,472553,472126,471701,471275,470850,470425, |
165 | 470001,469577,469153,468730,468307,467884,467462,467041, | 164 | 470001,469577,469153,468730,468307,467884,467462,467041, |
166 | 466619,466198,465778,465358,464938,464518,464099,463681, | 165 | 466619,466198,465778,465358,464938,464518,464099,463681, |
167 | 463262,462844,462427,462010,461593,461177,460760,460345, | 166 | 463262,462844,462427,462010,461593,461177,460760,460345, |
168 | 459930,459515,459100,458686,458272,457859,457446,457033, | 167 | 459930,459515,459100,458686,458272,457859,457446,457033, |
169 | 456621,456209,455797,455386,454975,454565,454155,453745, | 168 | 456621,456209,455797,455386,454975,454565,454155,453745, |
170 | 453336,452927,452518,452110,451702,451294,450887,450481, | 169 | 453336,452927,452518,452110,451702,451294,450887,450481, |
171 | 450074,449668,449262,448857,448452,448048,447644,447240, | 170 | 450074,449668,449262,448857,448452,448048,447644,447240, |
172 | 446836,446433,446030,445628,445226,444824,444423,444022, | 171 | 446836,446433,446030,445628,445226,444824,444423,444022, |
173 | 443622,443221,442821,442422,442023,441624,441226,440828, | 172 | 443622,443221,442821,442422,442023,441624,441226,440828, |
174 | 440430,440033,439636,439239,438843,438447,438051,437656, | 173 | 440430,440033,439636,439239,438843,438447,438051,437656, |
175 | 437261,436867,436473,436079,435686,435293,434900,434508, | 174 | 437261,436867,436473,436079,435686,435293,434900,434508, |
176 | 434116,433724,433333,432942,432551,432161,431771,431382, | 175 | 434116,433724,433333,432942,432551,432161,431771,431382, |
177 | 430992,430604,430215,429827,429439,429052,428665,428278, | 176 | 430992,430604,430215,429827,429439,429052,428665,428278, |
178 | 427892,427506,427120,426735,426350,425965,425581,425197, | 177 | 427892,427506,427120,426735,426350,425965,425581,425197, |
179 | 424813,424430,424047,423665,423283,422901,422519,422138, | 178 | 424813,424430,424047,423665,423283,422901,422519,422138, |
180 | 421757,421377,420997,420617,420237,419858,419479,419101, | 179 | 421757,421377,420997,420617,420237,419858,419479,419101, |
181 | 418723,418345,417968,417591,417214,416838,416462,416086, | 180 | 418723,418345,417968,417591,417214,416838,416462,416086, |
182 | 415711,415336,414961,414586,414212,413839,413465,413092, | 181 | 415711,415336,414961,414586,414212,413839,413465,413092, |
183 | 412720,412347,411975,411604,411232,410862,410491,410121, | 182 | 412720,412347,411975,411604,411232,410862,410491,410121, |
184 | 409751,409381,409012,408643,408274,407906,407538,407170, | 183 | 409751,409381,409012,408643,408274,407906,407538,407170, |
185 | 406803,406436,406069,405703,405337,404971,404606,404241, | 184 | 406803,406436,406069,405703,405337,404971,404606,404241, |
186 | 403876,403512,403148,402784,402421,402058,401695,401333, | 185 | 403876,403512,403148,402784,402421,402058,401695,401333, |
187 | 400970,400609,400247,399886,399525,399165,398805,398445, | 186 | 400970,400609,400247,399886,399525,399165,398805,398445, |
188 | 398086,397727,397368,397009,396651,396293,395936,395579, | 187 | 398086,397727,397368,397009,396651,396293,395936,395579, |
189 | 395222,394865,394509,394153,393798,393442,393087,392733, | 188 | 395222,394865,394509,394153,393798,393442,393087,392733, |
190 | 392378,392024,391671,391317,390964,390612,390259,389907, | 189 | 392378,392024,391671,391317,390964,390612,390259,389907, |
191 | 389556,389204,388853,388502,388152,387802,387452,387102, | 190 | 389556,389204,388853,388502,388152,387802,387452,387102, |
192 | 386753,386404,386056,385707,385359,385012,384664,384317, | 191 | 386753,386404,386056,385707,385359,385012,384664,384317, |
193 | 383971,383624,383278,382932,382587,382242,381897,381552, | 192 | 383971,383624,383278,382932,382587,382242,381897,381552, |
194 | 381208,380864,380521,380177,379834,379492,379149,378807, | 193 | 381208,380864,380521,380177,379834,379492,379149,378807, |
195 | 194 | ||
196 | 378466,378124,377783,377442,377102,376762,376422,376082, | 195 | 378466,378124,377783,377442,377102,376762,376422,376082, |
197 | 375743,375404,375065,374727,374389,374051,373714,373377, | 196 | 375743,375404,375065,374727,374389,374051,373714,373377, |
198 | 373040,372703,372367,372031,371695,371360,371025,370690, | 197 | 373040,372703,372367,372031,371695,371360,371025,370690, |
199 | 370356,370022,369688,369355,369021,368688,368356,368023, | 198 | 370356,370022,369688,369355,369021,368688,368356,368023, |
200 | 367691,367360,367028,366697,366366,366036,365706,365376, | 199 | 367691,367360,367028,366697,366366,366036,365706,365376, |
201 | 365046,364717,364388,364059,363731,363403,363075,362747, | 200 | 365046,364717,364388,364059,363731,363403,363075,362747, |
202 | 362420,362093,361766,361440,361114,360788,360463,360137, | 201 | 362420,362093,361766,361440,361114,360788,360463,360137, |
203 | 359813,359488,359164,358840,358516,358193,357869,357547, | 202 | 359813,359488,359164,358840,358516,358193,357869,357547, |
204 | 357224,356902,356580,356258,355937,355616,355295,354974, | 203 | 357224,356902,356580,356258,355937,355616,355295,354974, |
205 | 354654,354334,354014,353695,353376,353057,352739,352420, | 204 | 354654,354334,354014,353695,353376,353057,352739,352420, |
206 | 352103,351785,351468,351150,350834,350517,350201,349885, | 205 | 352103,351785,351468,351150,350834,350517,350201,349885, |
207 | 349569,349254,348939,348624,348310,347995,347682,347368, | 206 | 349569,349254,348939,348624,348310,347995,347682,347368, |
208 | 347055,346741,346429,346116,345804,345492,345180,344869, | 207 | 347055,346741,346429,346116,345804,345492,345180,344869, |
209 | 344558,344247,343936,343626,343316,343006,342697,342388, | 208 | 344558,344247,343936,343626,343316,343006,342697,342388, |
210 | 342079,341770,341462,341154,340846,340539,340231,339924, | 209 | 342079,341770,341462,341154,340846,340539,340231,339924, |
211 | 339618,339311,339005,338700,338394,338089,337784,337479, | 210 | 339618,339311,339005,338700,338394,338089,337784,337479, |
212 | 337175,336870,336566,336263,335959,335656,335354,335051, | 211 | 337175,336870,336566,336263,335959,335656,335354,335051, |
213 | 334749,334447,334145,333844,333542,333242,332941,332641, | 212 | 334749,334447,334145,333844,333542,333242,332941,332641, |
214 | 332341,332041,331741,331442,331143,330844,330546,330247, | 213 | 332341,332041,331741,331442,331143,330844,330546,330247, |
215 | 329950,329652,329355,329057,328761,328464,328168,327872, | 214 | 329950,329652,329355,329057,328761,328464,328168,327872, |
216 | 327576,327280,326985,326690,326395,326101,325807,325513, | 215 | 327576,327280,326985,326690,326395,326101,325807,325513, |
217 | 325219,324926,324633,324340,324047,323755,323463,323171, | 216 | 325219,324926,324633,324340,324047,323755,323463,323171, |
218 | 322879,322588,322297,322006,321716,321426,321136,320846, | 217 | 322879,322588,322297,322006,321716,321426,321136,320846, |
219 | 320557,320267,319978,319690,319401,319113,318825,318538, | 218 | 320557,320267,319978,319690,319401,319113,318825,318538, |
220 | 318250,317963,317676,317390,317103,316817,316532,316246, | 219 | 318250,317963,317676,317390,317103,316817,316532,316246, |
221 | 315961,315676,315391,315106,314822,314538,314254,313971, | 220 | 315961,315676,315391,315106,314822,314538,314254,313971, |
222 | 313688,313405,313122,312839,312557,312275,311994,311712, | 221 | 313688,313405,313122,312839,312557,312275,311994,311712, |
223 | 311431,311150,310869,310589,310309,310029,309749,309470, | 222 | 311431,311150,310869,310589,310309,310029,309749,309470, |
224 | 309190,308911,308633,308354,308076,307798,307521,307243, | 223 | 309190,308911,308633,308354,308076,307798,307521,307243, |
225 | 306966,306689,306412,306136,305860,305584,305308,305033, | 224 | 306966,306689,306412,306136,305860,305584,305308,305033, |
226 | 304758,304483,304208,303934,303659,303385,303112,302838, | 225 | 304758,304483,304208,303934,303659,303385,303112,302838, |
227 | 302565,302292,302019,301747,301475,301203,300931,300660, | 226 | 302565,302292,302019,301747,301475,301203,300931,300660, |
228 | 300388,300117,299847,299576,299306,299036,298766,298497, | 227 | 300388,300117,299847,299576,299306,299036,298766,298497, |
229 | 298227,297958,297689,297421,297153,296884,296617,296349, | 228 | 298227,297958,297689,297421,297153,296884,296617,296349, |
230 | 296082,295815,295548,295281,295015,294749,294483,294217, | 229 | 296082,295815,295548,295281,295015,294749,294483,294217, |
231 | 293952,293686,293421,293157,292892,292628,292364,292100, | 230 | 293952,293686,293421,293157,292892,292628,292364,292100, |
232 | 291837,291574,291311,291048,290785,290523,290261,289999, | 231 | 291837,291574,291311,291048,290785,290523,290261,289999, |
233 | 289737,289476,289215,288954,288693,288433,288173,287913, | 232 | 289737,289476,289215,288954,288693,288433,288173,287913, |
234 | 287653,287393,287134,286875,286616,286358,286099,285841, | 233 | 287653,287393,287134,286875,286616,286358,286099,285841, |
235 | 285583,285326,285068,284811,284554,284298,284041,283785, | 234 | 285583,285326,285068,284811,284554,284298,284041,283785, |
236 | 283529,283273,283017,282762,282507,282252,281998,281743, | 235 | 283529,283273,283017,282762,282507,282252,281998,281743, |
237 | 281489,281235,280981,280728,280475,280222,279969,279716, | 236 | 281489,281235,280981,280728,280475,280222,279969,279716, |
238 | 279464,279212,278960,278708,278457,278206,277955,277704, | 237 | 279464,279212,278960,278708,278457,278206,277955,277704, |
239 | 277453,277203,276953,276703,276453,276204,275955,275706, | 238 | 277453,277203,276953,276703,276453,276204,275955,275706, |
240 | 275457,275209,274960,274712,274465,274217,273970,273722, | 239 | 275457,275209,274960,274712,274465,274217,273970,273722, |
241 | 273476,273229,272982,272736,272490,272244,271999,271753, | 240 | 273476,273229,272982,272736,272490,272244,271999,271753, |
242 | 271508,271263,271018,270774,270530,270286,270042,269798, | 241 | 271508,271263,271018,270774,270530,270286,270042,269798, |
243 | 269555,269312,269069,268826,268583,268341,268099,267857 | 242 | 269555,269312,269069,268826,268583,268341,268099,267857 |
244 | }; | 243 | }; |
245 | 244 | ||
246 | 245 | ||
247 | extern const signed char ft2VibratoTable[256]; | 246 | extern const signed char ft2VibratoTable[256]; |
248 | const signed char ft2VibratoTable[256] = | 247 | const signed char ft2VibratoTable[256] = |
249 | { | 248 | { |
250 | 0,-2,-3,-5,-6,-8,-9,-11,-12,-14,-16,-17,-19,-20,-22,-23, | 249 | 0,-2,-3,-5,-6,-8,-9,-11,-12,-14,-16,-17,-19,-20,-22,-23, |
251 | -24,-26,-27,-29,-30,-32,-33,-34,-36,-37,-38,-39,-41,-42, | 250 | -24,-26,-27,-29,-30,-32,-33,-34,-36,-37,-38,-39,-41,-42, |
252 | -43,-44,-45,-46,-47,-48,-49,-50,-51,-52,-53,-54,-55,-56, | 251 | -43,-44,-45,-46,-47,-48,-49,-50,-51,-52,-53,-54,-55,-56, |
253 | -56,-57,-58,-59,-59,-60,-60,-61,-61,-62,-62,-62,-63,-63, | 252 | -56,-57,-58,-59,-59,-60,-60,-61,-61,-62,-62,-62,-63,-63, |
254 | -63,-64,-64,-64,-64,-64,-64,-64,-64,-64,-64,-64,-63,-63, | 253 | -63,-64,-64,-64,-64,-64,-64,-64,-64,-64,-64,-64,-63,-63, |
255 | -63,-62,-62,-62,-61,-61,-60,-60,-59,-59,-58,-57,-56,-56, | 254 | -63,-62,-62,-62,-61,-61,-60,-60,-59,-59,-58,-57,-56,-56, |
256 | -55,-54,-53,-52,-51,-50,-49,-48,-47,-46,-45,-44,-43,-42, | 255 | -55,-54,-53,-52,-51,-50,-49,-48,-47,-46,-45,-44,-43,-42, |
257 | -41,-39,-38,-37,-36,-34,-33,-32,-30,-29,-27,-26,-24,-23, | 256 | -41,-39,-38,-37,-36,-34,-33,-32,-30,-29,-27,-26,-24,-23, |
258 | -22,-20,-19,-17,-16,-14,-12,-11,-9,-8,-6,-5,-3,-2,0, | 257 | -22,-20,-19,-17,-16,-14,-12,-11,-9,-8,-6,-5,-3,-2,0, |
259 | 2,3,5,6,8,9,11,12,14,16,17,19,20,22,23,24,26,27,29,30, | 258 | 2,3,5,6,8,9,11,12,14,16,17,19,20,22,23,24,26,27,29,30, |
260 | 32,33,34,36,37,38,39,41,42,43,44,45,46,47,48,49,50,51, | 259 | 32,33,34,36,37,38,39,41,42,43,44,45,46,47,48,49,50,51, |
261 | 52,53,54,55,56,56,57,58,59,59,60,60,61,61,62,62,62,63, | 260 | 52,53,54,55,56,56,57,58,59,59,60,60,61,61,62,62,62,63, |
262 | 63,63,64,64,64,64,64,64,64,64,64,64,64,63,63,63,62,62, | 261 | 63,63,64,64,64,64,64,64,64,64,64,64,64,63,63,63,62,62, |
263 | 62,61,61,60,60,59,59,58,57,56,56,55,54,53,52,51,50,49, | 262 | 62,61,61,60,60,59,59,58,57,56,56,55,54,53,52,51,50,49, |
264 | 48,47,46,45,44,43,42,41,39,38,37,36,34,33,32,30,29,27, | 263 | 48,47,46,45,44,43,42,41,39,38,37,36,34,33,32,30,29,27, |
265 | 26,24,23,22,20,19,17,16,14,12,11,9,8,6,5,3,2 | 264 | 26,24,23,22,20,19,17,16,14,12,11,9,8,6,5,3,2 |
266 | }; | 265 | }; |
267 | 266 | ||
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index b393230..8016d8e 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -1,349 +1,349 @@ | |||
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 | // code added by L. J. Potter Sat 03-02-2002 06:17:54 | 20 | // code added by L. J. Potter Sat 03-02-2002 06:17:54 |
21 | #define QTOPIA_INTERNAL_FSLP | 21 | #define QTOPIA_INTERNAL_FSLP |
22 | #include <qpe/qcopenvelope_qws.h> | 22 | #include <qpe/qcopenvelope_qws.h> |
23 | 23 | ||
24 | #include <qpe/qpemenubar.h> | 24 | #include <qpe/qpemenubar.h> |
25 | #include <qpe/qpetoolbar.h> | 25 | #include <qpe/qpetoolbar.h> |
26 | #include <qpe/fileselector.h> | 26 | #include <qpe/fileselector.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qpe/lnkproperties.h> | 28 | #include <qpe/lnkproperties.h> |
29 | #include <qpe/storage.h> | 29 | #include <qpe/storage.h> |
30 | 30 | ||
31 | #include <qpe/applnk.h> | 31 | #include <qpe/applnk.h> |
32 | #include <qpe/config.h> | 32 | #include <qpe/config.h> |
33 | #include <qpe/global.h> | 33 | #include <qpe/global.h> |
34 | #include <qpe/resource.h> | 34 | #include <qpe/resource.h> |
35 | #include <qaction.h> | 35 | #include <qaction.h> |
36 | #include <qcursor.h> | 36 | #include <qcursor.h> |
37 | #include <qimage.h> | 37 | #include <qimage.h> |
38 | #include <qfile.h> | 38 | #include <qfile.h> |
39 | #include <qdir.h> | 39 | #include <qdir.h> |
40 | #include <qlayout.h> | 40 | #include <qlayout.h> |
41 | #include <qlabel.h> | 41 | #include <qlabel.h> |
42 | #include <qlist.h> | 42 | #include <qlist.h> |
43 | #include <qlistbox.h> | 43 | #include <qlistbox.h> |
44 | #include <qmainwindow.h> | 44 | #include <qmainwindow.h> |
45 | #include <qmessagebox.h> | 45 | #include <qmessagebox.h> |
46 | #include <qtoolbutton.h> | 46 | #include <qtoolbutton.h> |
47 | #include <qtabwidget.h> | 47 | #include <qtabwidget.h> |
48 | #include <qlistview.h> | 48 | #include <qlistview.h> |
49 | #include <qpoint.h> | 49 | #include <qpoint.h> |
50 | #include <qlineedit.h> | 50 | #include <qlineedit.h> |
51 | #include <qpushbutton.h> | 51 | #include <qpushbutton.h> |
52 | #include <qregexp.h> | 52 | #include <qregexp.h> |
53 | #include <qtextstream.h> | 53 | #include <qtextstream.h> |
54 | 54 | ||
55 | //#include <qtimer.h> | 55 | //#include <qtimer.h> |
56 | 56 | ||
57 | #include "playlistselection.h" | 57 | #include "playlistselection.h" |
58 | #include "playlistwidget.h" | 58 | #include "playlistwidget.h" |
59 | #include "mediaplayerstate.h" | 59 | #include "mediaplayerstate.h" |
60 | 60 | ||
61 | #include "inputDialog.h" | 61 | #include "inputDialog.h" |
62 | 62 | ||
63 | #include <stdlib.h> | 63 | #include <stdlib.h> |
64 | #include "audiowidget.h" | 64 | #include "audiowidget.h" |
65 | #include "videowidget.h" | 65 | #include "videowidget.h" |
66 | 66 | ||
67 | #include <unistd.h> | 67 | #include <unistd.h> |
68 | #include <sys/file.h> | 68 | #include <sys/file.h> |
69 | #include <sys/ioctl.h> | 69 | #include <sys/ioctl.h> |
70 | #include <sys/soundcard.h> | 70 | #include <sys/soundcard.h> |
71 | 71 | ||
72 | // for setBacklight() | 72 | // for setBacklight() |
73 | #include <linux/fb.h> | 73 | #include <linux/fb.h> |
74 | #include <sys/types.h> | 74 | #include <sys/types.h> |
75 | #include <sys/stat.h> | 75 | #include <sys/stat.h> |
76 | #include <stdlib.h> | 76 | #include <stdlib.h> |
77 | 77 | ||
78 | #define BUTTONS_ON_TOOLBAR | 78 | #define BUTTONS_ON_TOOLBAR |
79 | #define SIDE_BUTTONS | 79 | #define SIDE_BUTTONS |
80 | #define CAN_SAVE_LOAD_PLAYLISTS | 80 | #define CAN_SAVE_LOAD_PLAYLISTS |
81 | 81 | ||
82 | extern AudioWidget *audioUI; | 82 | extern AudioWidget *audioUI; |
83 | extern VideoWidget *videoUI; | 83 | extern VideoWidget *videoUI; |
84 | extern MediaPlayerState *mediaPlayerState; | 84 | extern MediaPlayerState *mediaPlayerState; |
85 | 85 | ||
86 | static inline QString fullBaseName ( const QFileInfo &fi ) | 86 | static inline QString fullBaseName ( const QFileInfo &fi ) |
87 | { | 87 | { |
88 | QString str = fi. fileName ( ); | 88 | QString str = fi. fileName ( ); |
89 | return str. left ( str. findRev ( '.' )); | 89 | return str. left ( str. findRev ( '.' )); |
90 | } | 90 | } |
91 | 91 | ||
92 | 92 | ||
93 | QString audioMimes ="audio/mpeg;audio/x-wav;audio/x-ogg;audio/x-mod;audio/x-ogg"; | 93 | QString audioMimes ="audio/mpeg;audio/x-wav;application/ogg;audio/x-mod"; |
94 | // class myFileSelector { | 94 | // class myFileSelector { |
95 | 95 | ||
96 | // }; | 96 | // }; |
97 | class PlayListWidgetPrivate { | 97 | class PlayListWidgetPrivate { |
98 | public: | 98 | public: |
99 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; | 99 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; |
100 | QFrame *playListFrame; | 100 | QFrame *playListFrame; |
101 | FileSelector *files; | 101 | FileSelector *files; |
102 | PlayListSelection *selectedFiles; | 102 | PlayListSelection *selectedFiles; |
103 | bool setDocumentUsed; | 103 | bool setDocumentUsed; |
104 | DocLnk *current; | 104 | DocLnk *current; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | 107 | ||
108 | class ToolButton : public QToolButton { | 108 | class ToolButton : public QToolButton { |
109 | public: | 109 | public: |
110 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) | 110 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) |
111 | : QToolButton( parent, name ) { | 111 | : QToolButton( parent, name ) { |
112 | setTextLabel( name ); | 112 | setTextLabel( name ); |
113 | setPixmap( Resource::loadPixmap( icon ) ); | 113 | setPixmap( Resource::loadPixmap( icon ) ); |
114 | setAutoRaise( TRUE ); | 114 | setAutoRaise( TRUE ); |
115 | setFocusPolicy( QWidget::NoFocus ); | 115 | setFocusPolicy( QWidget::NoFocus ); |
116 | setToggleButton( t ); | 116 | setToggleButton( t ); |
117 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); | 117 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); |
118 | QPEMenuToolFocusManager::manager()->addWidget( this ); | 118 | QPEMenuToolFocusManager::manager()->addWidget( this ); |
119 | } | 119 | } |
120 | }; | 120 | }; |
121 | 121 | ||
122 | 122 | ||
123 | class MenuItem : public QAction { | 123 | class MenuItem : public QAction { |
124 | public: | 124 | public: |
125 | MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) | 125 | MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) |
126 | : QAction( text, QString::null, 0, 0 ) { | 126 | : QAction( text, QString::null, 0, 0 ) { |
127 | connect( this, SIGNAL( activated() ), handler, slot ); | 127 | connect( this, SIGNAL( activated() ), handler, slot ); |
128 | addTo( parent ); | 128 | addTo( parent ); |
129 | } | 129 | } |
130 | }; | 130 | }; |
131 | 131 | ||
132 | 132 | ||
133 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | 133 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) |
134 | : QMainWindow( parent, name, fl ) { | 134 | : QMainWindow( parent, name, fl ) { |
135 | 135 | ||
136 | d = new PlayListWidgetPrivate; | 136 | d = new PlayListWidgetPrivate; |
137 | d->setDocumentUsed = FALSE; | 137 | d->setDocumentUsed = FALSE; |
138 | d->current = NULL; | 138 | d->current = NULL; |
139 | fromSetDocument = FALSE; | 139 | fromSetDocument = FALSE; |
140 | insanityBool=FALSE; | 140 | insanityBool=FALSE; |
141 | audioScan = FALSE; | 141 | audioScan = FALSE; |
142 | videoScan = FALSE; | 142 | videoScan = FALSE; |
143 | // menuTimer = new QTimer( this ,"menu timer"), | 143 | // menuTimer = new QTimer( this ,"menu timer"), |
144 | // connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); | 144 | // connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); |
145 | channel = new QCopChannel( "QPE/Application/opieplayer", this ); | 145 | channel = new QCopChannel( "QPE/Application/opieplayer", this ); |
146 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 146 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
147 | this, SLOT( qcopReceive(const QCString&, const QByteArray&)) ); | 147 | this, SLOT( qcopReceive(const QCString&, const QByteArray&)) ); |
148 | 148 | ||
149 | setBackgroundMode( PaletteButton ); | 149 | setBackgroundMode( PaletteButton ); |
150 | 150 | ||
151 | setCaption( tr("OpiePlayer") ); | 151 | setCaption( tr("OpiePlayer") ); |
152 | setIcon( Resource::loadPixmap( "opieplayer/MPEGPlayer" ) ); | 152 | setIcon( Resource::loadPixmap( "opieplayer/MPEGPlayer" ) ); |
153 | 153 | ||
154 | setToolBarsMovable( FALSE ); | 154 | setToolBarsMovable( FALSE ); |
155 | 155 | ||
156 | // Create Toolbar | 156 | // Create Toolbar |
157 | QPEToolBar *toolbar = new QPEToolBar( this ); | 157 | QPEToolBar *toolbar = new QPEToolBar( this ); |
158 | toolbar->setHorizontalStretchable( TRUE ); | 158 | toolbar->setHorizontalStretchable( TRUE ); |
159 | 159 | ||
160 | // Create Menubar | 160 | // Create Menubar |
161 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); | 161 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); |
162 | menu->setMargin( 0 ); | 162 | menu->setMargin( 0 ); |
163 | 163 | ||
164 | QPEToolBar *bar = new QPEToolBar( this ); | 164 | QPEToolBar *bar = new QPEToolBar( this ); |
165 | bar->setLabel( tr( "Play Operations" ) ); | 165 | bar->setLabel( tr( "Play Operations" ) ); |
166 | // d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "opieplayer/play_current_list", | 166 | // d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "opieplayer/play_current_list", |
167 | // this , SLOT( addSelected()) ); | 167 | // this , SLOT( addSelected()) ); |
168 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); | 168 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); |
169 | tbDeletePlaylist->setFlat(TRUE); | 169 | tbDeletePlaylist->setFlat(TRUE); |
170 | 170 | ||
171 | tbDeletePlaylist->setFixedSize(20,20); | 171 | tbDeletePlaylist->setFixedSize(20,20); |
172 | 172 | ||
173 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer/add_to_playlist", | 173 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer/add_to_playlist", |
174 | this , SLOT(addSelected()) ); | 174 | this , SLOT(addSelected()) ); |
175 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer/remove_from_playlist", | 175 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer/remove_from_playlist", |
176 | this , SLOT(removeSelected()) ); | 176 | this , SLOT(removeSelected()) ); |
177 | // d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE ); | 177 | // d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE ); |
178 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", | 178 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", |
179 | this , SLOT( btnPlay(bool) ), TRUE ); | 179 | this , SLOT( btnPlay(bool) ), TRUE ); |
180 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer/shuffle", | 180 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer/shuffle", |
181 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); | 181 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); |
182 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer/loop", | 182 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer/loop", |
183 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); | 183 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); |
184 | tbDeletePlaylist->hide(); | 184 | tbDeletePlaylist->hide(); |
185 | 185 | ||
186 | QPopupMenu *pmPlayList = new QPopupMenu( this ); | 186 | QPopupMenu *pmPlayList = new QPopupMenu( this ); |
187 | menu->insertItem( tr( "File" ), pmPlayList ); | 187 | menu->insertItem( tr( "File" ), pmPlayList ); |
188 | new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); | 188 | new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); |
189 | new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); | 189 | new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); |
190 | new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); | 190 | new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); |
191 | new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); | 191 | new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); |
192 | pmPlayList->insertSeparator(-1); | 192 | pmPlayList->insertSeparator(-1); |
193 | new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); | 193 | new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); |
194 | new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); | 194 | new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); |
195 | pmPlayList->insertSeparator(-1); | 195 | pmPlayList->insertSeparator(-1); |
196 | new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); | 196 | new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); |
197 | new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); | 197 | new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); |
198 | 198 | ||
199 | QPopupMenu *pmView = new QPopupMenu( this ); | 199 | QPopupMenu *pmView = new QPopupMenu( this ); |
200 | menu->insertItem( tr( "View" ), pmView ); | 200 | menu->insertItem( tr( "View" ), pmView ); |
201 | 201 | ||
202 | fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0); | 202 | fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0); |
203 | fullScreenButton->addTo(pmView); | 203 | fullScreenButton->addTo(pmView); |
204 | scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("opieplayer/scale"), QString::null, 0, this, 0); | 204 | scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("opieplayer/scale"), QString::null, 0, this, 0); |
205 | scaleButton->addTo(pmView); | 205 | scaleButton->addTo(pmView); |
206 | 206 | ||
207 | 207 | ||
208 | skinsMenu = new QPopupMenu( this ); | 208 | skinsMenu = new QPopupMenu( this ); |
209 | menu->insertItem( tr( "Skins" ), skinsMenu ); | 209 | menu->insertItem( tr( "Skins" ), skinsMenu ); |
210 | skinsMenu->isCheckable(); | 210 | skinsMenu->isCheckable(); |
211 | connect( skinsMenu, SIGNAL( activated( int ) ) , | 211 | connect( skinsMenu, SIGNAL( activated( int ) ) , |
212 | this, SLOT( skinsMenuActivated( int ) ) ); | 212 | this, SLOT( skinsMenuActivated( int ) ) ); |
213 | populateSkinsMenu(); | 213 | populateSkinsMenu(); |
214 | 214 | ||
215 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); | 215 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); |
216 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); | 216 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); |
217 | 217 | ||
218 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); | 218 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); |
219 | 219 | ||
220 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 220 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
221 | // tabWidget->setTabShape(QTabWidget::Triangular); | 221 | // tabWidget->setTabShape(QTabWidget::Triangular); |
222 | 222 | ||
223 | QWidget *pTab; | 223 | QWidget *pTab; |
224 | pTab = new QWidget( tabWidget, "pTab" ); | 224 | pTab = new QWidget( tabWidget, "pTab" ); |
225 | // playlistView = new QListView( pTab, "playlistview" ); | 225 | // playlistView = new QListView( pTab, "playlistview" ); |
226 | // playlistView->setMinimumSize(236,260); | 226 | // playlistView->setMinimumSize(236,260); |
227 | tabWidget->insertTab( pTab,"Playlist"); | 227 | tabWidget->insertTab( pTab,"Playlist"); |
228 | 228 | ||
229 | 229 | ||
230 | // Add the playlist area | 230 | // Add the playlist area |
231 | 231 | ||
232 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); | 232 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); |
233 | d->playListFrame = vbox3; | 233 | d->playListFrame = vbox3; |
234 | 234 | ||
235 | QGridLayout *layoutF = new QGridLayout( pTab ); | 235 | QGridLayout *layoutF = new QGridLayout( pTab ); |
236 | layoutF->setSpacing( 2); | 236 | layoutF->setSpacing( 2); |
237 | layoutF->setMargin( 2); | 237 | layoutF->setMargin( 2); |
238 | layoutF->addMultiCellWidget( d->playListFrame , 0, 0, 0, 1 ); | 238 | layoutF->addMultiCellWidget( d->playListFrame , 0, 0, 0, 1 ); |
239 | 239 | ||
240 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); | 240 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); |
241 | 241 | ||
242 | d->selectedFiles = new PlayListSelection( hbox2); | 242 | d->selectedFiles = new PlayListSelection( hbox2); |
243 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); | 243 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); |
244 | 244 | ||
245 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); | 245 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); |
246 | 246 | ||
247 | 247 | ||
248 | 248 | ||
249 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch | 249 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch |
250 | new ToolButton( vbox1, tr( "Move Up" ), "opieplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) ); | 250 | new ToolButton( vbox1, tr( "Move Up" ), "opieplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) ); |
251 | new ToolButton( vbox1, tr( "Remove" ), "opieplayer/cut", d->selectedFiles, SLOT(removeSelected()) ); | 251 | new ToolButton( vbox1, tr( "Remove" ), "opieplayer/cut", d->selectedFiles, SLOT(removeSelected()) ); |
252 | new ToolButton( vbox1, tr( "Move Down" ), "opieplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) ); | 252 | new ToolButton( vbox1, tr( "Move Down" ), "opieplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) ); |
253 | QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch | 253 | QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch |
254 | 254 | ||
255 | QWidget *aTab; | 255 | QWidget *aTab; |
256 | aTab = new QWidget( tabWidget, "aTab" ); | 256 | aTab = new QWidget( tabWidget, "aTab" ); |
257 | audioView = new QListView( aTab, "Audioview" ); | 257 | audioView = new QListView( aTab, "Audioview" ); |
258 | 258 | ||
259 | QGridLayout *layoutA = new QGridLayout( aTab ); | 259 | QGridLayout *layoutA = new QGridLayout( aTab ); |
260 | layoutA->setSpacing( 2); | 260 | layoutA->setSpacing( 2); |
261 | layoutA->setMargin( 2); | 261 | layoutA->setMargin( 2); |
262 | layoutA->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | 262 | layoutA->addMultiCellWidget( audioView, 0, 0, 0, 1 ); |
263 | 263 | ||
264 | audioView->addColumn( tr("Title"),-1); | 264 | audioView->addColumn( tr("Title"),-1); |
265 | audioView->addColumn(tr("Size"), -1); | 265 | audioView->addColumn(tr("Size"), -1); |
266 | audioView->addColumn(tr("Media"),-1); | 266 | audioView->addColumn(tr("Media"),-1); |
267 | audioView->addColumn( tr( "Path" ), -1 ); | 267 | audioView->addColumn( tr( "Path" ), -1 ); |
268 | 268 | ||
269 | audioView->setColumnAlignment(1, Qt::AlignRight); | 269 | audioView->setColumnAlignment(1, Qt::AlignRight); |
270 | audioView->setColumnAlignment(2, Qt::AlignRight); | 270 | audioView->setColumnAlignment(2, Qt::AlignRight); |
271 | audioView->setAllColumnsShowFocus(TRUE); | 271 | audioView->setAllColumnsShowFocus(TRUE); |
272 | 272 | ||
273 | audioView->setMultiSelection( TRUE ); | 273 | audioView->setMultiSelection( TRUE ); |
274 | audioView->setSelectionMode( QListView::Extended); | 274 | audioView->setSelectionMode( QListView::Extended); |
275 | audioView->setSorting( 3, TRUE ); | 275 | audioView->setSorting( 3, TRUE ); |
276 | 276 | ||
277 | tabWidget->insertTab(aTab,tr("Audio")); | 277 | tabWidget->insertTab(aTab,tr("Audio")); |
278 | 278 | ||
279 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); | 279 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); |
280 | 280 | ||
281 | // audioView | 281 | // audioView |
282 | // populateAudioView(); | 282 | // populateAudioView(); |
283 | // videowidget | 283 | // videowidget |
284 | 284 | ||
285 | QWidget *vTab; | 285 | QWidget *vTab; |
286 | vTab = new QWidget( tabWidget, "vTab" ); | 286 | vTab = new QWidget( tabWidget, "vTab" ); |
287 | videoView = new QListView( vTab, "Videoview" ); | 287 | videoView = new QListView( vTab, "Videoview" ); |
288 | 288 | ||
289 | QGridLayout *layoutV = new QGridLayout( vTab ); | 289 | QGridLayout *layoutV = new QGridLayout( vTab ); |
290 | layoutV->setSpacing( 2); | 290 | layoutV->setSpacing( 2); |
291 | layoutV->setMargin( 2); | 291 | layoutV->setMargin( 2); |
292 | layoutV->addMultiCellWidget( videoView, 0, 0, 0, 1 ); | 292 | layoutV->addMultiCellWidget( videoView, 0, 0, 0, 1 ); |
293 | 293 | ||
294 | videoView->addColumn(tr("Title"),-1); | 294 | videoView->addColumn(tr("Title"),-1); |
295 | videoView->addColumn(tr("Size"),-1); | 295 | videoView->addColumn(tr("Size"),-1); |
296 | videoView->addColumn(tr("Media"),-1); | 296 | videoView->addColumn(tr("Media"),-1); |
297 | videoView->addColumn(tr( "Path" ), -1 ); | 297 | videoView->addColumn(tr( "Path" ), -1 ); |
298 | videoView->setColumnAlignment(1, Qt::AlignRight); | 298 | videoView->setColumnAlignment(1, Qt::AlignRight); |
299 | videoView->setColumnAlignment(2, Qt::AlignRight); | 299 | videoView->setColumnAlignment(2, Qt::AlignRight); |
300 | videoView->setAllColumnsShowFocus(TRUE); | 300 | videoView->setAllColumnsShowFocus(TRUE); |
301 | videoView->setMultiSelection( TRUE ); | 301 | videoView->setMultiSelection( TRUE ); |
302 | videoView->setSelectionMode( QListView::Extended); | 302 | videoView->setSelectionMode( QListView::Extended); |
303 | 303 | ||
304 | QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold); | 304 | QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold); |
305 | 305 | ||
306 | tabWidget->insertTab( vTab,tr("Video")); | 306 | tabWidget->insertTab( vTab,tr("Video")); |
307 | 307 | ||
308 | QWidget *LTab; | 308 | QWidget *LTab; |
309 | LTab = new QWidget( tabWidget, "LTab" ); | 309 | LTab = new QWidget( tabWidget, "LTab" ); |
310 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE); | 310 | playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE); |
311 | 311 | ||
312 | QGridLayout *layoutL = new QGridLayout( LTab ); | 312 | QGridLayout *layoutL = new QGridLayout( LTab ); |
313 | layoutL->setSpacing( 2); | 313 | layoutL->setSpacing( 2); |
314 | layoutL->setMargin( 2); | 314 | layoutL->setMargin( 2); |
315 | layoutL->addMultiCellWidget( playLists, 0, 0, 0, 1 ); | 315 | layoutL->addMultiCellWidget( playLists, 0, 0, 0, 1 ); |
316 | 316 | ||
317 | tabWidget->insertTab(LTab,tr("Lists")); | 317 | tabWidget->insertTab(LTab,tr("Lists")); |
318 | 318 | ||
319 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); | 319 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); |
320 | connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) ); | 320 | connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) ); |
321 | connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) ); | 321 | connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) ); |
322 | 322 | ||
323 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 323 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
324 | this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); | 324 | this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); |
325 | 325 | ||
326 | 326 | ||
327 | ///audioView | 327 | ///audioView |
328 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 328 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
329 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); | 329 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); |
330 | 330 | ||
331 | connect( audioView, SIGNAL( returnPressed( QListViewItem *)), | 331 | connect( audioView, SIGNAL( returnPressed( QListViewItem *)), |
332 | this,SLOT( playIt( QListViewItem *)) ); | 332 | this,SLOT( playIt( QListViewItem *)) ); |
333 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); | 333 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); |
334 | 334 | ||
335 | 335 | ||
336 | //videoView | 336 | //videoView |
337 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 337 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
338 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); | 338 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); |
339 | connect( videoView, SIGNAL( returnPressed( QListViewItem *)), | 339 | connect( videoView, SIGNAL( returnPressed( QListViewItem *)), |
340 | this,SLOT( playIt( QListViewItem *)) ); | 340 | this,SLOT( playIt( QListViewItem *)) ); |
341 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); | 341 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); |
342 | 342 | ||
343 | //playlists | 343 | //playlists |
344 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); | 344 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); |
345 | 345 | ||
346 | connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); | 346 | connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); |
347 | 347 | ||
348 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); | 348 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); |
349 | 349 | ||
@@ -1119,364 +1119,364 @@ void PlayListWidget::readm3u( const QString &filename ) { | |||
1119 | DocLnk lnk; | 1119 | DocLnk lnk; |
1120 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { | 1120 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { |
1121 | s = *it; | 1121 | s = *it; |
1122 | // qDebug("reading "+ s); | 1122 | // qDebug("reading "+ s); |
1123 | if(s.left(4)=="http") { | 1123 | if(s.left(4)=="http") { |
1124 | lnk.setName( s ); //sets file name | 1124 | lnk.setName( s ); //sets file name |
1125 | lnk.setIcon("opieplayer2/musicfile"); | 1125 | lnk.setIcon("opieplayer2/musicfile"); |
1126 | 1126 | ||
1127 | // if(s.right(4) != '.' || s.right(5) != '.') | 1127 | // if(s.right(4) != '.' || s.right(5) != '.') |
1128 | if(s.right(4) != '.' || s.right(5) != '.' ) | 1128 | if(s.right(4) != '.' || s.right(5) != '.' ) |
1129 | if( s.right(1) != "/") | 1129 | if( s.right(1) != "/") |
1130 | lnk.setFile( s+"/"); //if url with no extension | 1130 | lnk.setFile( s+"/"); //if url with no extension |
1131 | else | 1131 | else |
1132 | lnk.setFile( s ); //sets file name | 1132 | lnk.setFile( s ); //sets file name |
1133 | 1133 | ||
1134 | } else { | 1134 | } else { |
1135 | // if( QFileInfo( s ).exists() ) { | 1135 | // if( QFileInfo( s ).exists() ) { |
1136 | lnk.setName( fullBaseName ( QFileInfo(s))); | 1136 | lnk.setName( fullBaseName ( QFileInfo(s))); |
1137 | // if(s.right(4) == '.') {//if regular file | 1137 | // if(s.right(4) == '.') {//if regular file |
1138 | if(s.left(1) != "/") { | 1138 | if(s.left(1) != "/") { |
1139 | // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s); | 1139 | // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s); |
1140 | lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); | 1140 | lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); |
1141 | lnk.setIcon("SoundPlayer"); | 1141 | lnk.setIcon("SoundPlayer"); |
1142 | } else { | 1142 | } else { |
1143 | // qDebug("set link2 "+s); | 1143 | // qDebug("set link2 "+s); |
1144 | lnk.setFile( s); | 1144 | lnk.setFile( s); |
1145 | lnk.setIcon("SoundPlayer"); | 1145 | lnk.setIcon("SoundPlayer"); |
1146 | } | 1146 | } |
1147 | } | 1147 | } |
1148 | d->selectedFiles->addToSelection( lnk ); | 1148 | d->selectedFiles->addToSelection( lnk ); |
1149 | } | 1149 | } |
1150 | Config config( "OpiePlayer" ); | 1150 | Config config( "OpiePlayer" ); |
1151 | config.setGroup( "PlayList" ); | 1151 | config.setGroup( "PlayList" ); |
1152 | 1152 | ||
1153 | config.writeEntry("CurrentPlaylist",filename); | 1153 | config.writeEntry("CurrentPlaylist",filename); |
1154 | config.write(); | 1154 | config.write(); |
1155 | currentPlayList=filename; | 1155 | currentPlayList=filename; |
1156 | 1156 | ||
1157 | // m3uList->write(); | 1157 | // m3uList->write(); |
1158 | m3uList->close(); | 1158 | m3uList->close(); |
1159 | if(m3uList) delete m3uList; | 1159 | if(m3uList) delete m3uList; |
1160 | 1160 | ||
1161 | d->selectedFiles->setSelectedItem( s); | 1161 | d->selectedFiles->setSelectedItem( s); |
1162 | setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(filename))); | 1162 | setCaption(tr("OpiePlayer: ")+ fullBaseName ( QFileInfo(filename))); |
1163 | 1163 | ||
1164 | } | 1164 | } |
1165 | 1165 | ||
1166 | /* | 1166 | /* |
1167 | reads pls and adds files/urls to playlist */ | 1167 | reads pls and adds files/urls to playlist */ |
1168 | void PlayListWidget::readPls( const QString &filename ) { | 1168 | void PlayListWidget::readPls( const QString &filename ) { |
1169 | 1169 | ||
1170 | // qDebug( "pls filename is " + filename ); | 1170 | // qDebug( "pls filename is " + filename ); |
1171 | Om3u *m3uList; | 1171 | Om3u *m3uList; |
1172 | QString s, name; | 1172 | QString s, name; |
1173 | m3uList = new Om3u( filename, IO_ReadOnly ); | 1173 | m3uList = new Om3u( filename, IO_ReadOnly ); |
1174 | m3uList->readPls(); | 1174 | m3uList->readPls(); |
1175 | 1175 | ||
1176 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { | 1176 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { |
1177 | s = *it; | 1177 | s = *it; |
1178 | // s.replace( QRegExp( "%20" )," " ); | 1178 | // s.replace( QRegExp( "%20" )," " ); |
1179 | DocLnk lnk( s ); | 1179 | DocLnk lnk( s ); |
1180 | QFileInfo f( s ); | 1180 | QFileInfo f( s ); |
1181 | QString name = fullBaseName ( f); | 1181 | QString name = fullBaseName ( f); |
1182 | 1182 | ||
1183 | if( name.left( 4 ) == "http" ) { | 1183 | if( name.left( 4 ) == "http" ) { |
1184 | name = s.right( s.length() - 7); | 1184 | name = s.right( s.length() - 7); |
1185 | } else { | 1185 | } else { |
1186 | name = s; | 1186 | name = s; |
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 ); | 1189 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 ); |
1190 | 1190 | ||
1191 | lnk.setName( name ); | 1191 | lnk.setName( name ); |
1192 | if( s.at( s.length() - 4) == '.') {// if this is probably a file | 1192 | if( s.at( s.length() - 4) == '.') {// if this is probably a file |
1193 | lnk.setFile( s ); | 1193 | lnk.setFile( s ); |
1194 | } else { //if its a url | 1194 | } else { //if its a url |
1195 | if( name.right( 1 ).find( '/' ) == -1) { | 1195 | if( name.right( 1 ).find( '/' ) == -1) { |
1196 | s += "/"; | 1196 | s += "/"; |
1197 | } | 1197 | } |
1198 | lnk.setFile( s ); | 1198 | lnk.setFile( s ); |
1199 | } | 1199 | } |
1200 | lnk.setType( "audio/x-mpegurl" ); | 1200 | lnk.setType( "audio/x-mpegurl" ); |
1201 | 1201 | ||
1202 | lnk.writeLink(); | 1202 | lnk.writeLink(); |
1203 | d->selectedFiles->addToSelection( lnk ); | 1203 | d->selectedFiles->addToSelection( lnk ); |
1204 | } | 1204 | } |
1205 | 1205 | ||
1206 | m3uList->close(); | 1206 | m3uList->close(); |
1207 | if(m3uList) delete m3uList; | 1207 | if(m3uList) delete m3uList; |
1208 | } | 1208 | } |
1209 | 1209 | ||
1210 | /* | 1210 | /* |
1211 | writes current playlist to current m3u file */ | 1211 | writes current playlist to current m3u file */ |
1212 | void PlayListWidget::writeCurrentM3u() { | 1212 | void PlayListWidget::writeCurrentM3u() { |
1213 | // qDebug("writing to current m3u"); | 1213 | // qDebug("writing to current m3u"); |
1214 | Config cfg( "OpiePlayer" ); | 1214 | Config cfg( "OpiePlayer" ); |
1215 | cfg.setGroup("PlayList"); | 1215 | cfg.setGroup("PlayList"); |
1216 | currentPlayList = cfg.readEntry("CurrentPlaylist",""); | 1216 | currentPlayList = cfg.readEntry("CurrentPlaylist",""); |
1217 | Om3u *m3uList; | 1217 | Om3u *m3uList; |
1218 | m3uList = new Om3u( currentPlayList, IO_ReadWrite | IO_Truncate ); | 1218 | m3uList = new Om3u( currentPlayList, IO_ReadWrite | IO_Truncate ); |
1219 | 1219 | ||
1220 | if( d->selectedFiles->first()) { | 1220 | if( d->selectedFiles->first()) { |
1221 | do { | 1221 | do { |
1222 | // qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); | 1222 | // qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); |
1223 | m3uList->add( d->selectedFiles->current()->file() ); | 1223 | m3uList->add( d->selectedFiles->current()->file() ); |
1224 | } | 1224 | } |
1225 | while ( d->selectedFiles->next() ); | 1225 | while ( d->selectedFiles->next() ); |
1226 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); | 1226 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); |
1227 | m3uList->write(); | 1227 | m3uList->write(); |
1228 | m3uList->close(); | 1228 | m3uList->close(); |
1229 | 1229 | ||
1230 | if(m3uList) delete m3uList; | 1230 | if(m3uList) delete m3uList; |
1231 | } | 1231 | } |
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | /* | 1234 | /* |
1235 | writes current playlist to m3u file */ | 1235 | writes current playlist to m3u file */ |
1236 | void PlayListWidget::writem3u() { | 1236 | void PlayListWidget::writem3u() { |
1237 | InputDialog *fileDlg; | 1237 | InputDialog *fileDlg; |
1238 | fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); | 1238 | fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); |
1239 | fileDlg->exec(); | 1239 | fileDlg->exec(); |
1240 | QString name, filename, list; | 1240 | QString name, filename, list; |
1241 | Om3u *m3uList; | 1241 | Om3u *m3uList; |
1242 | 1242 | ||
1243 | if( fileDlg->result() == 1 ) { | 1243 | if( fileDlg->result() == 1 ) { |
1244 | name = fileDlg->text(); | 1244 | name = fileDlg->text(); |
1245 | // qDebug( filename ); | 1245 | // qDebug( filename ); |
1246 | if( name.find("/",0,true) != -1) {// assume they specify a file path | 1246 | if( name.find("/",0,true) != -1) {// assume they specify a file path |
1247 | filename = name; | 1247 | filename = name; |
1248 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); | 1248 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); |
1249 | } | 1249 | } |
1250 | else //otherwise dump it somewhere noticable | 1250 | else //otherwise dump it somewhere noticable |
1251 | filename = QPEApplication::documentDir() + "/" + name; | 1251 | filename = QPEApplication::documentDir() + "/" + name; |
1252 | 1252 | ||
1253 | if( filename.right( 3 ) != "m3u" ) //needs filename extension | 1253 | if( filename.right( 3 ) != "m3u" ) //needs filename extension |
1254 | filename += ".m3u"; | 1254 | filename += ".m3u"; |
1255 | 1255 | ||
1256 | if( d->selectedFiles->first()) { | 1256 | if( d->selectedFiles->first()) { |
1257 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); | 1257 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); |
1258 | 1258 | ||
1259 | do { | 1259 | do { |
1260 | m3uList->add( d->selectedFiles->current()->file()); | 1260 | m3uList->add( d->selectedFiles->current()->file()); |
1261 | } | 1261 | } |
1262 | while ( d->selectedFiles->next() ); | 1262 | while ( d->selectedFiles->next() ); |
1263 | // qDebug( list ); | 1263 | // qDebug( list ); |
1264 | m3uList->write(); | 1264 | m3uList->write(); |
1265 | m3uList->close(); | 1265 | m3uList->close(); |
1266 | if(m3uList) delete m3uList; | 1266 | if(m3uList) delete m3uList; |
1267 | 1267 | ||
1268 | if(fileDlg) delete fileDlg; | 1268 | if(fileDlg) delete fileDlg; |
1269 | 1269 | ||
1270 | DocLnk lnk; | 1270 | DocLnk lnk; |
1271 | lnk.setFile( filename); | 1271 | lnk.setFile( filename); |
1272 | lnk.setIcon("opieplayer2/playlist2"); | 1272 | lnk.setIcon("opieplayer2/playlist2"); |
1273 | lnk.setName( name); //sets file name | 1273 | lnk.setName( name); //sets file name |
1274 | 1274 | ||
1275 | // qDebug(filename); | 1275 | // qDebug(filename); |
1276 | Config config( "OpiePlayer" ); | 1276 | Config config( "OpiePlayer" ); |
1277 | config.setGroup( "PlayList" ); | 1277 | config.setGroup( "PlayList" ); |
1278 | 1278 | ||
1279 | config.writeEntry("CurrentPlaylist",filename); | 1279 | config.writeEntry("CurrentPlaylist",filename); |
1280 | currentPlayList=filename; | 1280 | currentPlayList=filename; |
1281 | 1281 | ||
1282 | if(!lnk.writeLink()) { | 1282 | if(!lnk.writeLink()) { |
1283 | // qDebug("Writing doclink did not work"); | 1283 | // qDebug("Writing doclink did not work"); |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | setCaption(tr("OpiePlayer: ") + name); | 1286 | setCaption(tr("OpiePlayer: ") + name); |
1287 | } | 1287 | } |
1288 | } | 1288 | } |
1289 | } | 1289 | } |
1290 | 1290 | ||
1291 | 1291 | ||
1292 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | 1292 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) |
1293 | { | 1293 | { |
1294 | switch ( e->key() ) { | 1294 | switch ( e->key() ) { |
1295 | ////////////////////////////// Zaurus keys | 1295 | ////////////////////////////// Zaurus keys |
1296 | case Key_F9: //activity | 1296 | case Key_F9: //activity |
1297 | // if(audioUI->isHidden()) | 1297 | // if(audioUI->isHidden()) |
1298 | // audioUI->showMaximized(); | 1298 | // audioUI->showMaximized(); |
1299 | break; | 1299 | break; |
1300 | case Key_F10: //contacts | 1300 | case Key_F10: //contacts |
1301 | // if( videoUI->isHidden()) | 1301 | // if( videoUI->isHidden()) |
1302 | // videoUI->showMaximized(); | 1302 | // videoUI->showMaximized(); |
1303 | break; | 1303 | break; |
1304 | case Key_F11: //menu | 1304 | case Key_F11: //menu |
1305 | break; | 1305 | break; |
1306 | case Key_F12: //home | 1306 | case Key_F12: //home |
1307 | // doBlank(); | 1307 | // doBlank(); |
1308 | break; | 1308 | break; |
1309 | case Key_F13: //mail | 1309 | case Key_F13: //mail |
1310 | // doUnblank(); | 1310 | // doUnblank(); |
1311 | break; | 1311 | break; |
1312 | case Key_Q: //add to playlist | 1312 | case Key_Q: //add to playlist |
1313 | addSelected(); | 1313 | addSelected(); |
1314 | break; | 1314 | break; |
1315 | case Key_R: //remove from playlist | 1315 | case Key_R: //remove from playlist |
1316 | removeSelected(); | 1316 | removeSelected(); |
1317 | break; | 1317 | break; |
1318 | // case Key_P: //play | 1318 | // case Key_P: //play |
1319 | // qDebug("Play"); | 1319 | // qDebug("Play"); |
1320 | // playSelected(); | 1320 | // playSelected(); |
1321 | // break; | 1321 | // break; |
1322 | case Key_Space: | 1322 | case Key_Space: |
1323 | // playSelected(); puh | 1323 | // playSelected(); puh |
1324 | break; | 1324 | break; |
1325 | case Key_1: | 1325 | case Key_1: |
1326 | tabWidget->setCurrentPage(0); | 1326 | tabWidget->setCurrentPage(0); |
1327 | break; | 1327 | break; |
1328 | case Key_2: | 1328 | case Key_2: |
1329 | tabWidget->setCurrentPage(1); | 1329 | tabWidget->setCurrentPage(1); |
1330 | break; | 1330 | break; |
1331 | case Key_3: | 1331 | case Key_3: |
1332 | tabWidget->setCurrentPage(2); | 1332 | tabWidget->setCurrentPage(2); |
1333 | break; | 1333 | break; |
1334 | case Key_4: | 1334 | case Key_4: |
1335 | tabWidget->setCurrentPage(3); | 1335 | tabWidget->setCurrentPage(3); |
1336 | break; | 1336 | break; |
1337 | case Key_Down: | 1337 | case Key_Down: |
1338 | if ( !d->selectedFiles->next() ) | 1338 | if ( !d->selectedFiles->next() ) |
1339 | d->selectedFiles->first(); | 1339 | d->selectedFiles->first(); |
1340 | 1340 | ||
1341 | break; | 1341 | break; |
1342 | case Key_Up: | 1342 | case Key_Up: |
1343 | if ( !d->selectedFiles->prev() ) | 1343 | if ( !d->selectedFiles->prev() ) |
1344 | // d->selectedFiles->last(); | 1344 | // d->selectedFiles->last(); |
1345 | 1345 | ||
1346 | break; | 1346 | break; |
1347 | 1347 | ||
1348 | } | 1348 | } |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | void PlayListWidget::keyPressEvent( QKeyEvent *) | 1351 | void PlayListWidget::keyPressEvent( QKeyEvent *) |
1352 | { | 1352 | { |
1353 | // qDebug("Key press"); | 1353 | // qDebug("Key press"); |
1354 | // switch ( e->key() ) { | 1354 | // switch ( e->key() ) { |
1355 | // ////////////////////////////// Zaurus keys | 1355 | // ////////////////////////////// Zaurus keys |
1356 | // case Key_A: //add to playlist | 1356 | // case Key_A: //add to playlist |
1357 | // qDebug("Add"); | 1357 | // qDebug("Add"); |
1358 | // addSelected(); | 1358 | // addSelected(); |
1359 | // break; | 1359 | // break; |
1360 | // case Key_R: //remove from playlist | 1360 | // case Key_R: //remove from playlist |
1361 | // removeSelected(); | 1361 | // removeSelected(); |
1362 | // break; | 1362 | // break; |
1363 | // case Key_P: //play | 1363 | // case Key_P: //play |
1364 | // qDebug("Play"); | 1364 | // qDebug("Play"); |
1365 | // playSelected(); | 1365 | // playSelected(); |
1366 | // break; | 1366 | // break; |
1367 | // case Key_Space: | 1367 | // case Key_Space: |
1368 | // qDebug("Play"); | 1368 | // qDebug("Play"); |
1369 | // playSelected(); | 1369 | // playSelected(); |
1370 | // break; | 1370 | // break; |
1371 | // } | 1371 | // } |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | void PlayListWidget::doBlank() { | 1374 | void PlayListWidget::doBlank() { |
1375 | // TODO: why do we blank this way, why don't we use ODevice or ScreenSaver? | 1375 | // qDebug("do blanking"); |
1376 | #ifdef QT_QWS_DEVFS | 1376 | #ifdef QT_QWS_DEVFS |
1377 | fd=open("/dev/fb/0",O_RDWR); | 1377 | fd=open("/dev/fb/0",O_RDWR); |
1378 | #else | 1378 | #else |
1379 | fd=open("/dev/fb0",O_RDWR); | 1379 | fd=open("/dev/fb0",O_RDWR); |
1380 | #endif | 1380 | #endif |
1381 | if (fd != -1) { | 1381 | if (fd != -1) { |
1382 | ioctl(fd,FBIOBLANK,1); | 1382 | ioctl(fd,FBIOBLANK,1); |
1383 | // close(fd); | 1383 | // close(fd); |
1384 | } | 1384 | } |
1385 | } | 1385 | } |
1386 | 1386 | ||
1387 | void PlayListWidget::doUnblank() { | 1387 | void PlayListWidget::doUnblank() { |
1388 | // this crashes opieplayer with a segfault | 1388 | // this crashes opieplayer with a segfault |
1389 | // int fd; | 1389 | // int fd; |
1390 | // fd=open("/dev/fb0",O_RDWR); | 1390 | // fd=open("/dev/fb0",O_RDWR); |
1391 | // qDebug("do unblanking"); | 1391 | // qDebug("do unblanking"); |
1392 | if (fd != -1) { | 1392 | if (fd != -1) { |
1393 | ioctl(fd,FBIOBLANK,0); | 1393 | ioctl(fd,FBIOBLANK,0); |
1394 | close(fd); | 1394 | close(fd); |
1395 | } | 1395 | } |
1396 | QCopEnvelope h("QPE/System", "setBacklight(int)"); | 1396 | QCopEnvelope h("QPE/System", "setBacklight(int)"); |
1397 | h <<-3;// v[1]; // -3 Force on | 1397 | h <<-3;// v[1]; // -3 Force on |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | void PlayListWidget::populateSkinsMenu() { | 1400 | void PlayListWidget::populateSkinsMenu() { |
1401 | int item = 0; | 1401 | int item = 0; |
1402 | defaultSkinIndex = 0; | 1402 | defaultSkinIndex = 0; |
1403 | QString skinName; | 1403 | QString skinName; |
1404 | Config cfg( "OpiePlayer" ); | 1404 | Config cfg( "OpiePlayer" ); |
1405 | cfg.setGroup("Options" ); | 1405 | cfg.setGroup("Options" ); |
1406 | QString skin = cfg.readEntry( "Skin", "default" ); | 1406 | QString skin = cfg.readEntry( "Skin", "default" ); |
1407 | 1407 | ||
1408 | QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); | 1408 | QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); |
1409 | skinsDir.setFilter( QDir::Dirs ); | 1409 | skinsDir.setFilter( QDir::Dirs ); |
1410 | skinsDir.setSorting(QDir::Name ); | 1410 | skinsDir.setSorting(QDir::Name ); |
1411 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); | 1411 | const QFileInfoList *skinslist = skinsDir.entryInfoList(); |
1412 | QFileInfoListIterator it( *skinslist ); | 1412 | QFileInfoListIterator it( *skinslist ); |
1413 | QFileInfo *fi; | 1413 | QFileInfo *fi; |
1414 | while ( ( fi = it.current() ) ) { | 1414 | while ( ( fi = it.current() ) ) { |
1415 | skinName = fi->fileName(); | 1415 | skinName = fi->fileName(); |
1416 | // qDebug( fi->fileName() ); | 1416 | // qDebug( fi->fileName() ); |
1417 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { | 1417 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { |
1418 | item = skinsMenu->insertItem( fi->fileName() ) ; | 1418 | item = skinsMenu->insertItem( fi->fileName() ) ; |
1419 | } | 1419 | } |
1420 | if( skinName == "default" ) { | 1420 | if( skinName == "default" ) { |
1421 | defaultSkinIndex = item; | 1421 | defaultSkinIndex = item; |
1422 | } | 1422 | } |
1423 | if( skinName == skin ) { | 1423 | if( skinName == skin ) { |
1424 | skinsMenu->setItemChecked( item, TRUE ); | 1424 | skinsMenu->setItemChecked( item, TRUE ); |
1425 | } | 1425 | } |
1426 | ++it; | 1426 | ++it; |
1427 | } | 1427 | } |
1428 | } | 1428 | } |
1429 | 1429 | ||
1430 | void PlayListWidget::skinsMenuActivated( int item ) { | 1430 | void PlayListWidget::skinsMenuActivated( int item ) { |
1431 | for( int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) { | 1431 | for( int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) { |
1432 | skinsMenu->setItemChecked( i, FALSE ); | 1432 | skinsMenu->setItemChecked( i, FALSE ); |
1433 | } | 1433 | } |
1434 | skinsMenu->setItemChecked( item, TRUE ); | 1434 | skinsMenu->setItemChecked( item, TRUE ); |
1435 | 1435 | ||
1436 | Config cfg( "OpiePlayer" ); | 1436 | Config cfg( "OpiePlayer" ); |
1437 | cfg.setGroup("Options"); | 1437 | cfg.setGroup("Options"); |
1438 | cfg.writeEntry("Skin", skinsMenu->text( item ) ); | 1438 | cfg.writeEntry("Skin", skinsMenu->text( item ) ); |
1439 | } | 1439 | } |
1440 | 1440 | ||
1441 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | 1441 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { |
1442 | // qDebug("qcop message "+msg ); | 1442 | // qDebug("qcop message "+msg ); |
1443 | QDataStream stream ( data, IO_ReadOnly ); | 1443 | QDataStream stream ( data, IO_ReadOnly ); |
1444 | if ( msg == "play()" ) { //plays current selection | 1444 | if ( msg == "play()" ) { //plays current selection |
1445 | btnPlay( true); | 1445 | btnPlay( true); |
1446 | } else if ( msg == "stop()" ) { | 1446 | } else if ( msg == "stop()" ) { |
1447 | mediaPlayerState->setPlaying( false); | 1447 | mediaPlayerState->setPlaying( false); |
1448 | } else if ( msg == "togglePause()" ) { | 1448 | } else if ( msg == "togglePause()" ) { |
1449 | mediaPlayerState->togglePaused(); | 1449 | mediaPlayerState->togglePaused(); |
1450 | } else if ( msg == "next()" ) { //select next in lis | 1450 | } else if ( msg == "next()" ) { //select next in lis |
1451 | mediaPlayerState->setNext(); | 1451 | mediaPlayerState->setNext(); |
1452 | } else if ( msg == "prev()" ) { //select previous in list | 1452 | } else if ( msg == "prev()" ) { //select previous in list |
1453 | mediaPlayerState->setPrev(); | 1453 | mediaPlayerState->setPrev(); |
1454 | } else if ( msg == "toggleLooping()" ) { //loop or not loop | 1454 | } else if ( msg == "toggleLooping()" ) { //loop or not loop |
1455 | mediaPlayerState->toggleLooping(); | 1455 | mediaPlayerState->toggleLooping(); |
1456 | } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled | 1456 | } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled |
1457 | mediaPlayerState->toggleShuffled(); | 1457 | mediaPlayerState->toggleShuffled(); |
1458 | } else if ( msg == "volUp()" ) { //volume more | 1458 | } else if ( msg == "volUp()" ) { //volume more |
1459 | // emit moreClicked(); | 1459 | // emit moreClicked(); |
1460 | // emit moreReleased(); | 1460 | // emit moreReleased(); |
1461 | } else if ( msg == "volDown()" ) { //volume less | 1461 | } else if ( msg == "volDown()" ) { //volume less |
1462 | // emit lessClicked(); | 1462 | // emit lessClicked(); |
1463 | // emit lessReleased(); | 1463 | // emit lessReleased(); |
1464 | } else if ( msg == "play(QString)" ) { //play this now | 1464 | } else if ( msg == "play(QString)" ) { //play this now |
1465 | QString file; | 1465 | QString file; |
1466 | stream >> file; | 1466 | stream >> file; |
1467 | setDocumentEx( (const QString &) file); | 1467 | setDocumentEx( (const QString &) file); |
1468 | } else if ( msg == "add(QString)" ) { //add to playlist | 1468 | } else if ( msg == "add(QString)" ) { //add to playlist |
1469 | QString file; | 1469 | QString file; |
1470 | stream >> file; | 1470 | stream >> file; |
1471 | QFileInfo fileInfo(file); | 1471 | QFileInfo fileInfo(file); |
1472 | DocLnk lnk; | 1472 | DocLnk lnk; |
1473 | lnk.setName( fileInfo.baseName() ); //sets name | 1473 | lnk.setName( fileInfo.baseName() ); //sets name |
1474 | lnk.setFile( file ); //sets file name | 1474 | lnk.setFile( file ); //sets file name |
1475 | addToSelection( lnk ); | 1475 | addToSelection( lnk ); |
1476 | } else if ( msg == "rem(QString)" ) { //remove from playlist | 1476 | } else if ( msg == "rem(QString)" ) { //remove from playlist |
1477 | QString file; | 1477 | QString file; |
1478 | stream >> file; | 1478 | stream >> file; |
1479 | } else if ( msg == "setDocument(QString)" ) { //loop or not loop | 1479 | } else if ( msg == "setDocument(QString)" ) { //loop or not loop |
1480 | QCopEnvelope h("QPE/Application/opieplayer", "raise()"); | 1480 | QCopEnvelope h("QPE/Application/opieplayer", "raise()"); |
1481 | } | 1481 | } |
1482 | } | 1482 | } |
diff --git a/core/multimedia/opieplayer/vorbis/config.in b/core/multimedia/opieplayer/vorbis/config.in index bad9922..d66ec88 100644 --- a/core/multimedia/opieplayer/vorbis/config.in +++ b/core/multimedia/opieplayer/vorbis/config.in | |||
@@ -1,5 +1,6 @@ | |||
1 | config LIBTREMORPLUGIN | 1 | config LIBTREMORPLUGIN |
2 | boolean "opieplayer1-libtremorplugin (play OGG vorbis files)" | 2 | boolean "libtremorplugin" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && OPIEPLAYER | 4 | depends ( LIBQPE || LIBQPE-X11 ) && OPIEPLAYER |
5 | comment "tremor is ogg vorbis!!" | ||
5 | \ No newline at end of file | 6 | \ No newline at end of file |
diff --git a/core/multimedia/opieplayer/vorbis/libtremorplugin.cpp b/core/multimedia/opieplayer/vorbis/libtremorplugin.cpp index c1e1a23..53c4b2b 100644 --- a/core/multimedia/opieplayer/vorbis/libtremorplugin.cpp +++ b/core/multimedia/opieplayer/vorbis/libtremorplugin.cpp | |||
@@ -1,274 +1,273 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * libtremorplugin.cpp | 2 | * libtremorplugin.cpp |
3 | * | 3 | * |
4 | * Copyright (C) 2002 Latchesar Ionkov <lucho@ionkov.net> | 4 | * Copyright (C) 2002 Latchesar Ionkov <lucho@ionkov.net> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2 of the License, or | 8 | * the Free Software Foundation; either version 2 of the License, or |
9 | * (at your option) any later version. | 9 | * (at your option) any later version. |
10 | * | 10 | * |
11 | * This program is distributed in the hope that it will be useful, | 11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | * | 15 | * |
16 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | ****************************************************************************/ | 19 | ****************************************************************************/ |
20 | // fixed and adapted for opieplayer 2003 ljp <llornkcor@handhelds.org> | 20 | // fixed and adapted for opieplayer 2003 ljp <llornkcor@handhelds.org> |
21 | 21 | ||
22 | #include <stdio.h> | 22 | #include <stdio.h> |
23 | #include <stdarg.h> | 23 | #include <stdarg.h> |
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | #include <sys/types.h> | 25 | #include <sys/types.h> |
26 | #include <sys/stat.h> | 26 | #include <sys/stat.h> |
27 | #include <fcntl.h> | 27 | #include <fcntl.h> |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <string.h> | 29 | #include <string.h> |
30 | #include <errno.h> | 30 | #include <errno.h> |
31 | #include <time.h> | 31 | #include <time.h> |
32 | #include <locale.h> | 32 | #include <locale.h> |
33 | #include <math.h> | 33 | #include <math.h> |
34 | #include <assert.h> | 34 | #include <assert.h> |
35 | 35 | ||
36 | #include <qmap.h> | 36 | #include <qmap.h> |
37 | 37 | ||
38 | #include "libtremorplugin.h" | 38 | #include "libtremorplugin.h" |
39 | 39 | ||
40 | 40 | ||
41 | extern "C" { | 41 | extern "C" { |
42 | #include "tremor/ivorbiscodec.h" | ||
43 | #include "tremor/ivorbisfile.h" | 42 | #include "tremor/ivorbisfile.h" |
44 | } | 43 | } |
45 | 44 | ||
46 | 45 | ||
47 | #define MPEG_BUFFER_SIZE 65536 | 46 | #define MPEG_BUFFER_SIZE 65536 |
48 | //#define debugMsg(a) qDebug(a) | 47 | //#define debugMsg(a) qDebug(a) |
49 | #define debugMsg(a) | 48 | #define debugMsg(a) |
50 | 49 | ||
51 | 50 | ||
52 | class LibTremorPluginData { | 51 | class LibTremorPluginData { |
53 | public: | 52 | public: |
54 | char* filename; | 53 | char* filename; |
55 | FILE* f; | 54 | FILE* f; |
56 | OggVorbis_File vf; | 55 | OggVorbis_File vf; |
57 | vorbis_info* vi; | 56 | vorbis_info* vi; |
58 | vorbis_comment* vc; | 57 | vorbis_comment* vc; |
59 | bool bos; | 58 | bool bos; |
60 | int csection; | 59 | int csection; |
61 | QString finfo; | 60 | QString finfo; |
62 | }; | 61 | }; |
63 | 62 | ||
64 | 63 | ||
65 | LibTremorPlugin::LibTremorPlugin() { | 64 | LibTremorPlugin::LibTremorPlugin() { |
66 | qDebug("<<<<<<<<<<<<<TREMOR!!!!!>>>>>>>>>>>>>>>>>>"); | 65 | qDebug("<<<<<<<<<<<<<TREMOR!!!!!>>>>>>>>>>>>>>>>>>"); |
67 | d = new LibTremorPluginData; | 66 | d = new LibTremorPluginData; |
68 | d->f = 0; | 67 | d->f = 0; |
69 | d->vi = 0; | 68 | d->vi = 0; |
70 | d->vc = 0; | 69 | d->vc = 0; |
71 | d->bos = 0; | 70 | d->bos = 0; |
72 | d->csection = 0; | 71 | d->csection = 0; |
73 | d->finfo = ""; | 72 | d->finfo = ""; |
74 | } | 73 | } |
75 | 74 | ||
76 | 75 | ||
77 | LibTremorPlugin::~LibTremorPlugin() { | 76 | LibTremorPlugin::~LibTremorPlugin() { |
78 | close(); | 77 | close(); |
79 | delete d; | 78 | delete d; |
80 | } | 79 | } |
81 | 80 | ||
82 | 81 | ||
83 | bool LibTremorPlugin::isFileSupported( const QString& path ) { | 82 | bool LibTremorPlugin::isFileSupported( const QString& path ) { |
84 | debugMsg( "LibTremorPlugin::isFileSupported" ); | 83 | debugMsg( "LibTremorPlugin::isFileSupported" ); |
85 | 84 | ||
86 | // Mpeg file extensions | 85 | // Mpeg file extensions |
87 | // "mp2","mp3","m1v","m2v","m2s","mpg","vob","mpeg",ac3" | 86 | // "mp2","mp3","m1v","m2v","m2s","mpg","vob","mpeg",ac3" |
88 | // Other media extensions | 87 | // Other media extensions |
89 | // "wav","mid","mod","s3m","ogg","avi","mov","sid" | 88 | // "wav","mid","mod","s3m","ogg","avi","mov","sid" |
90 | 89 | ||
91 | char *ext = strrchr( path.latin1(), '.' ); | 90 | char *ext = strrchr( path.latin1(), '.' ); |
92 | 91 | ||
93 | // Test file extension | 92 | // Test file extension |
94 | if ( ext ) { | 93 | if ( ext ) { |
95 | if ( strncasecmp(ext, ".ogg", 4) == 0 ) | 94 | if ( strncasecmp(ext, ".ogg", 4) == 0 ) |
96 | return TRUE; | 95 | return TRUE; |
97 | } | 96 | } |
98 | 97 | ||
99 | return FALSE; | 98 | return FALSE; |
100 | } | 99 | } |
101 | 100 | ||
102 | 101 | ||
103 | bool LibTremorPlugin::open( const QString& path ) { | 102 | bool LibTremorPlugin::open( const QString& path ) { |
104 | debugMsg( "LibTremorPlugin::open" ); | 103 | debugMsg( "LibTremorPlugin::open" ); |
105 | 104 | ||
106 | d->filename = (char*) path.latin1(); | 105 | d->filename = (char*) path.latin1(); |
107 | d->f = fopen( d->filename, "r" ); | 106 | d->f = fopen( d->filename, "r" ); |
108 | if (d->f == 0) { | 107 | if (d->f == 0) { |
109 | qDebug("error opening %s", d->filename ); | 108 | qDebug("error opening %s", d->filename ); |
110 | return FALSE; | 109 | return FALSE; |
111 | } | 110 | } |
112 | 111 | ||
113 | if (ov_open(d->f, &d->vf, NULL, 0) < 0) { | 112 | if (ov_open(d->f, &d->vf, NULL, 0) < 0) { |
114 | qDebug("error opening %s", d->filename); | 113 | qDebug("error opening %s", d->filename); |
115 | return FALSE; | 114 | return FALSE; |
116 | } | 115 | } |
117 | 116 | ||
118 | d->vc = ov_comment(&d->vf, -1); | 117 | d->vc = ov_comment(&d->vf, -1); |
119 | d->vi = ov_info(&d->vf, -1); | 118 | d->vi = ov_info(&d->vf, -1); |
120 | d->bos = false; | 119 | d->bos = false; |
121 | 120 | ||
122 | QString comments[] = { "title", "artist", "album", "year", "tracknumber", "" }; | 121 | QString comments[] = { "title", "artist", "album", "year", "tracknumber", "" }; |
123 | QString cdescr[] = { "Title", "Artist", "Album", "Year", "Track", "" }; | 122 | QString cdescr[] = { "Title", "Artist", "Album", "Year", "Track", "" }; |
124 | 123 | ||
125 | 124 | ||
126 | QMap<QString, QString> cmap; | 125 | QMap<QString, QString> cmap; |
127 | char** cptr = d->vc->user_comments; | 126 | char** cptr = d->vc->user_comments; |
128 | 127 | ||
129 | while (*cptr != 0) { | 128 | while (*cptr != 0) { |
130 | QString s(*cptr); | 129 | QString s(*cptr); |
131 | int n = s.find('='); | 130 | int n = s.find('='); |
132 | 131 | ||
133 | if (n < 0) { | 132 | if (n < 0) { |
134 | continue; | 133 | continue; |
135 | } | 134 | } |
136 | 135 | ||
137 | QString key = s.left(n).lower(); | 136 | QString key = s.left(n).lower(); |
138 | QString value = s.mid(n+1); | 137 | QString value = s.mid(n+1); |
139 | 138 | ||
140 | cmap[key] = value; | 139 | cmap[key] = value; |
141 | cptr++; | 140 | cptr++; |
142 | } | 141 | } |
143 | 142 | ||
144 | d->finfo = ""; | 143 | d->finfo = ""; |
145 | for(int i = 0; !comments[i].isEmpty(); i++) { | 144 | for(int i = 0; !comments[i].isEmpty(); i++) { |
146 | QString v = cmap[comments[i].lower()]; | 145 | QString v = cmap[comments[i].lower()]; |
147 | 146 | ||
148 | if (!v.isEmpty()) { | 147 | if (!v.isEmpty()) { |
149 | if (!d->finfo.isEmpty()) { | 148 | if (!d->finfo.isEmpty()) { |
150 | d->finfo += ", "; | 149 | d->finfo += ", "; |
151 | } | 150 | } |
152 | 151 | ||
153 | d->finfo += cdescr[i] + ": " + v; | 152 | d->finfo += cdescr[i] + ": " + v; |
154 | } | 153 | } |
155 | } | 154 | } |
156 | 155 | ||
157 | qDebug("finfo: " + d->finfo); | 156 | qDebug("finfo: " + d->finfo); |
158 | 157 | ||
159 | return TRUE; | 158 | return TRUE; |
160 | } | 159 | } |
161 | 160 | ||
162 | 161 | ||
163 | bool LibTremorPlugin::close() { | 162 | bool LibTremorPlugin::close() { |
164 | debugMsg( "LibTremorPlugin::close" ); | 163 | debugMsg( "LibTremorPlugin::close" ); |
165 | 164 | ||
166 | int result = TRUE; | 165 | int result = TRUE; |
167 | 166 | ||
168 | if (fclose(d->f) == -1) { | 167 | if (fclose(d->f) == -1) { |
169 | qDebug("error closing file %s", d->filename); | 168 | qDebug("error closing file %s", d->filename); |
170 | result = FALSE; | 169 | result = FALSE; |
171 | } | 170 | } |
172 | 171 | ||
173 | d->f = 0; | 172 | d->f = 0; |
174 | d->finfo = ""; | 173 | d->finfo = ""; |
175 | 174 | ||
176 | return result; | 175 | return result; |
177 | } | 176 | } |
178 | 177 | ||
179 | 178 | ||
180 | bool LibTremorPlugin::isOpen() { | 179 | bool LibTremorPlugin::isOpen() { |
181 | debugMsg( "LibTremorPlugin::isOpen" ); | 180 | debugMsg( "LibTremorPlugin::isOpen" ); |
182 | return ( d->f != 0 ); | 181 | return ( d->f != 0 ); |
183 | } | 182 | } |
184 | 183 | ||
185 | 184 | ||
186 | const QString &LibTremorPlugin::fileInfo() { | 185 | const QString &LibTremorPlugin::fileInfo() { |
187 | return d->finfo; | 186 | return d->finfo; |
188 | } | 187 | } |
189 | 188 | ||
190 | int LibTremorPlugin::audioStreams() { | 189 | int LibTremorPlugin::audioStreams() { |
191 | debugMsg( "LibTremorPlugin::audioStreams" ); | 190 | debugMsg( "LibTremorPlugin::audioStreams" ); |
192 | return 1; | 191 | return 1; |
193 | } | 192 | } |
194 | 193 | ||
195 | 194 | ||
196 | int LibTremorPlugin::audioChannels( int ) { | 195 | int LibTremorPlugin::audioChannels( int ) { |
197 | qDebug( "LibTremorPlugin::audioChannels: %i", d->vi->channels ); | 196 | qDebug( "LibTremorPlugin::audioChannels: %i", d->vi->channels ); |
198 | return d->vi->channels; | 197 | return d->vi->channels; |
199 | } | 198 | } |
200 | 199 | ||
201 | 200 | ||
202 | int LibTremorPlugin::audioFrequency( int ) { | 201 | int LibTremorPlugin::audioFrequency( int ) { |
203 | qDebug( "LibTremorPlugin::audioFrequency: %ld", d->vi->rate ); | 202 | qDebug( "LibTremorPlugin::audioFrequency: %ld", d->vi->rate ); |
204 | return d->vi->rate; | 203 | return d->vi->rate; |
205 | } | 204 | } |
206 | 205 | ||
207 | 206 | ||
208 | int LibTremorPlugin::audioSamples( int ) { | 207 | int LibTremorPlugin::audioSamples( int ) { |
209 | debugMsg( "LibTremorPlugin::audioSamples" ); | 208 | debugMsg( "LibTremorPlugin::audioSamples" ); |
210 | return (int) ov_pcm_total(&d->vf,-1); | 209 | return (int) ov_pcm_total(&d->vf,-1); |
211 | } | 210 | } |
212 | 211 | ||
213 | 212 | ||
214 | bool LibTremorPlugin::audioSetSample( long, int ) { | 213 | bool LibTremorPlugin::audioSetSample( long, int ) { |
215 | debugMsg( "LibTremorPlugin::audioSetSample" ); | 214 | debugMsg( "LibTremorPlugin::audioSetSample" ); |
216 | return FALSE; | 215 | return FALSE; |
217 | } | 216 | } |
218 | 217 | ||
219 | 218 | ||
220 | long LibTremorPlugin::audioGetSample( int ) { | 219 | long LibTremorPlugin::audioGetSample( int ) { |
221 | debugMsg( "LibTremorPlugin::audioGetSample" ); | 220 | debugMsg( "LibTremorPlugin::audioGetSample" ); |
222 | return 0; | 221 | return 0; |
223 | } | 222 | } |
224 | 223 | ||
225 | 224 | ||
226 | bool LibTremorPlugin::audioReadSamples( short *output, int, long samples, long& samplesMade, int ) { | 225 | bool LibTremorPlugin::audioReadSamples( short *output, int, long samples, long& samplesMade, int ) { |
227 | // qDebug( "<<<<<<<<<<<<LibTremorPlugin::audioReadStereoSamples %d", samples ); | 226 | // qDebug( "<<<<<<<<<<<<LibTremorPlugin::audioReadStereoSamples %d", samples ); |
228 | 227 | ||
229 | int old_section = d->csection; | 228 | int old_section = d->csection; |
230 | 229 | ||
231 | char* buf = (char*) output; | 230 | char* buf = (char*) output; |
232 | int length = samples * 4; | 231 | int length = samples * 4; |
233 | 232 | ||
234 | if ( samples == 0 ) | 233 | if ( samples == 0 ) |
235 | return false; | 234 | return false; |
236 | 235 | ||
237 | while (length > 0) { | 236 | while (length > 0) { |
238 | if (d->bos) { | 237 | if (d->bos) { |
239 | d->vi = ov_info(&d->vf, -1); | 238 | d->vi = ov_info(&d->vf, -1); |
240 | d->vc = ov_comment(&d->vf, -1); | 239 | d->vc = ov_comment(&d->vf, -1); |
241 | } | 240 | } |
242 | 241 | ||
243 | int n = 4096; | 242 | int n = 4096; |
244 | if (length < n) { | 243 | if (length < n) { |
245 | n = length; | 244 | n = length; |
246 | } | 245 | } |
247 | 246 | ||
248 | long ret = ov_read(&d->vf, buf, n, &d->csection); | 247 | long ret = ov_read(&d->vf, buf, n, &d->csection); |
249 | // qDebug("%d", ret); | 248 | // qDebug("%d", ret); |
250 | if (ret == 0) { | 249 | if (ret == 0) { |
251 | break; | 250 | break; |
252 | } else if (ret < 0) { | 251 | } else if (ret < 0) { |
253 | return true; | 252 | return true; |
254 | } | 253 | } |
255 | 254 | ||
256 | if (old_section != d->csection) { | 255 | if (old_section != d->csection) { |
257 | d->bos = true; | 256 | d->bos = true; |
258 | } | 257 | } |
259 | 258 | ||
260 | buf += ret; | 259 | buf += ret; |
261 | length -= ret; | 260 | length -= ret; |
262 | 261 | ||
263 | } | 262 | } |
264 | 263 | ||
265 | samplesMade = samples; | 264 | samplesMade = samples; |
266 | 265 | ||
267 | return true; | 266 | return true; |
268 | } | 267 | } |
269 | 268 | ||
270 | double LibTremorPlugin::getTime() { | 269 | double LibTremorPlugin::getTime() { |
271 | debugMsg( "LibTremorPlugin::getTime" ); | 270 | debugMsg( "LibTremorPlugin::getTime" ); |
272 | return 0.0; | 271 | return 0.0; |
273 | } | 272 | } |
274 | 273 | ||
diff --git a/core/multimedia/opieplayer/vorbis/tremor/config.in b/core/multimedia/opieplayer/vorbis/tremor/config.in index 8ee753c..f803d16 100644 --- a/core/multimedia/opieplayer/vorbis/tremor/config.in +++ b/core/multimedia/opieplayer/vorbis/tremor/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config LIBTREMOR | 1 | config LIBTREMOR |
2 | boolean "libtremor (library needed to play OGG files)" | 2 | boolean "libtremor" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && OPIEPLAYER | 4 | depends ( LIBQPE || LIBQPE-X11 ) && OPIEPLAYER |
diff --git a/core/multimedia/opieplayer/vorbis/vorbis.pro b/core/multimedia/opieplayer/vorbis/vorbis.pro index a15cf9c..d566003 100644 --- a/core/multimedia/opieplayer/vorbis/vorbis.pro +++ b/core/multimedia/opieplayer/vorbis/vorbis.pro | |||
@@ -1,11 +1,11 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | HEADERS = libtremorplugin.h libtremorinimpl.h | 3 | HEADERS = libtremorplugin.h libtremorpluginimpl.h |
4 | SOURCES = libtremorplugin.cpp libtremorpluginimpl.cpp | 4 | SOURCES = libtremorplugin.cpp libtremorpluginimpl.cpp |
5 | TARGET = tremorplugin | 5 | TARGET = tremorplugin |
6 | DESTDIR = $(OPIEDIR)/plugins/codecs | 6 | DESTDIR = $(OPIEDIR)/plugins/codecs |
7 | INCLUDEPATH += $(OPIEDIR)/include .. tremor | 7 | INCLUDEPATH += $(OPIEDIR)/include .. tremor |
8 | DEPENDPATH += $(OPIEDIR)/include .. tremor | 8 | DEPENDPATH += $(OPIEDIR)/include .. tremor |
9 | LIBS += -lqpe -lm -ltremor | 9 | LIBS += -lqpe -lm -ltremor |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
11 | include ( $(OPIEDIR)/include.pro ) | 11 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/multimedia/opieplayer/wavplugin/config.in b/core/multimedia/opieplayer/wavplugin/config.in index 56bdfab..6e4c4b3 100644 --- a/core/multimedia/opieplayer/wavplugin/config.in +++ b/core/multimedia/opieplayer/wavplugin/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config WAVPLUGIN | 1 | config WAVPLUGIN |
2 | boolean "opieplayer1-wavplugin (play WAV files)" | 2 | boolean "wavplugin" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && OPIEPLAYER | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && OPIEPLAYER |