author | bipolar <bipolar> | 2002-03-03 17:13:17 (UTC) |
---|---|---|
committer | bipolar <bipolar> | 2002-03-03 17:13:17 (UTC) |
commit | a99347380a9006ec81a9dba2340d6aaab690a86e (patch) (unidiff) | |
tree | 73fdc2eff476fba2113172ed881dd64a4031def6 /core/multimedia | |
parent | 0e245156b28b70be5cd98a58a9256fe5e2739562 (diff) | |
download | opie-a99347380a9006ec81a9dba2340d6aaab690a86e.zip opie-a99347380a9006ec81a9dba2340d6aaab690a86e.tar.gz opie-a99347380a9006ec81a9dba2340d6aaab690a86e.tar.bz2 |
commited by ljp (llornkcor) reverted to qpe's interface for compatibility. Added playlist features:
save, remove, and have different ones. Uncommented code for background image and added opielogo.
25 files changed, 353 insertions, 133 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index 9a10eb4..5fef792 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp | |||
@@ -189,2 +189,3 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
189 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | 189 | AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { |
190 | qDebug("creating new audio device"); | ||
190 | d = new AudioDevicePrivate; | 191 | d = new AudioDevicePrivate; |
@@ -193,3 +194,3 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
193 | d->bytesPerSample = bps; | 194 | d->bytesPerSample = bps; |
194 | // qDebug("%d",bps); | 195 | qDebug("%d",bps); |
195 | int format=0; | 196 | int format=0; |
@@ -199,3 +200,3 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
199 | 200 | ||
200 | // qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); | 201 | qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); |
201 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); | 202 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); |
diff --git a/core/multimedia/opieplayer/inputDialog.cpp b/core/multimedia/opieplayer/inputDialog.cpp new file mode 100644 index 0000000..b443747 --- a/dev/null +++ b/core/multimedia/opieplayer/inputDialog.cpp | |||
@@ -0,0 +1,45 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form implementation generated from reading ui file 'inputDialog.ui' | ||
3 | ** | ||
4 | ** Created: Sat Mar 2 07:55:03 2002 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #include "inputDialog.h" | ||
10 | |||
11 | #include <qlineedit.h> | ||
12 | #include <qlayout.h> | ||
13 | #include <qvariant.h> | ||
14 | #include <qtooltip.h> | ||
15 | #include <qwhatsthis.h> | ||
16 | |||
17 | /* | ||
18 | * Constructs a InputDialog which is a child of 'parent', with the | ||
19 | * name 'name' and widget flags set to 'f' | ||
20 | * | ||
21 | * The dialog will by default be modeless, unless you set 'modal' to | ||
22 | * TRUE to construct a modal dialog. | ||
23 | */ | ||
24 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | ||
25 | : QDialog( parent, name, modal, fl ) | ||
26 | { | ||
27 | if ( !name ) | ||
28 | setName( "InputDialog" ); | ||
29 | resize( 234, 50 ); | ||
30 | setMaximumSize( QSize( 240, 50 ) ); | ||
31 | setCaption( tr(name ) ); | ||
32 | |||
33 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | ||
34 | LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); | ||
35 | } | ||
36 | |||
37 | /* | ||
38 | * Destroys the object and frees any allocated resources | ||
39 | */ | ||
40 | InputDialog::~InputDialog() | ||
41 | { | ||
42 | inputText= LineEdit1->text(); | ||
43 | |||
44 | } | ||
45 | |||
diff --git a/core/multimedia/opieplayer/inputDialog.h b/core/multimedia/opieplayer/inputDialog.h new file mode 100644 index 0000000..26d5cd0 --- a/dev/null +++ b/core/multimedia/opieplayer/inputDialog.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form interface generated from reading ui file 'inputDialog.ui' | ||
3 | ** | ||
4 | ** Created: Sat Mar 2 07:54:46 2002 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #ifndef INPUTDIALOG_H | ||
10 | #define INPUTDIALOG_H | ||
11 | |||
12 | #include <qvariant.h> | ||
13 | #include <qdialog.h> | ||
14 | class QVBoxLayout; | ||
15 | class QHBoxLayout; | ||
16 | class QGridLayout; | ||
17 | class QLineEdit; | ||
18 | |||
19 | class InputDialog : public QDialog | ||
20 | { | ||
21 | Q_OBJECT | ||
22 | |||
23 | public: | ||
24 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | ||
25 | ~InputDialog(); | ||
26 | QString inputText; | ||
27 | QLineEdit* LineEdit1; | ||
28 | |||
29 | }; | ||
30 | |||
31 | #endif // INPUTDIALOG_H | ||
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.h b/core/multimedia/opieplayer/libmad/libmadplugin.h index d163458..b240b77 100644 --- a/core/multimedia/opieplayer/libmad/libmadplugin.h +++ b/core/multimedia/opieplayer/libmad/libmadplugin.h | |||
@@ -23,4 +23,4 @@ | |||
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 | ||
@@ -55,3 +55,3 @@ public: | |||
55 | bool audioSetSample( long sample, int stream ); | 55 | bool audioSetSample( long sample, int stream ); |
56 | int audioBitsPerSample(int) {return 0;} | 56 | /* int audioBitsPerSample(int) {return 0;} */ |
57 | long audioGetSample( int stream ); | 57 | long audioGetSample( int stream ); |
diff --git a/core/multimedia/opieplayer/libmad/libmadpluginimpl.cpp b/core/multimedia/opieplayer/libmad/libmadpluginimpl.cpp index 028c658..67779e8 100644 --- a/core/multimedia/opieplayer/libmad/libmadpluginimpl.cpp +++ b/core/multimedia/opieplayer/libmad/libmadpluginimpl.cpp | |||
diff --git a/core/multimedia/opieplayer/libmad/libmadpluginimpl.h b/core/multimedia/opieplayer/libmad/libmadpluginimpl.h index bc864ee..9b35b90 100644 --- a/core/multimedia/opieplayer/libmad/libmadpluginimpl.h +++ b/core/multimedia/opieplayer/libmad/libmadpluginimpl.h | |||
@@ -22,4 +22,4 @@ | |||
22 | 22 | ||
23 | //#include <qpe/mediaplayerplugininterface.h> | 23 | #include <qpe/mediaplayerplugininterface.h> |
24 | #include "../mediaplayerplugininterface.h" | 24 | //#include "../mediaplayerplugininterface.h" |
25 | 25 | ||
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h index bd31706..b573e84 100644 --- a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h +++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h | |||
@@ -26,4 +26,3 @@ | |||
26 | #include "mpeg3protos.h" | 26 | #include "mpeg3protos.h" |
27 | //#include <qpe/mediaplayerplugininterface.h> | 27 | #include <qpe/mediaplayerplugininterface.h> |
28 | #include "../mediaplayerplugininterface.h" | ||
29 | 28 | ||
@@ -53,3 +52,3 @@ public: | |||
53 | int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; } | 52 | int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; } |
54 | int audioBitsPerSample(int) { return 0;} | 53 | /* int audioBitsPerSample(int) { return 0;} */ |
55 | int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; } | 54 | int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; } |
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp index e7216af..bf3f372 100644 --- a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp +++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.cpp | |||
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h index a2f5211..ef3743e 100644 --- a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h +++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h | |||
@@ -22,4 +22,4 @@ | |||
22 | 22 | ||
23 | //#include <qpe/mediaplayerplugininterface.h> | 23 | #include <qpe/mediaplayerplugininterface.h> |
24 | #include "../mediaplayerplugininterface.h" | 24 | //#include "../mediaplayerplugininterface.h" |
25 | 25 | ||
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 90a7cc6..cb8de8a 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp | |||
@@ -36,3 +36,3 @@ | |||
36 | #include "audiodevice.h" | 36 | #include "audiodevice.h" |
37 | #include "mediaplayerplugininterface.h" | 37 | #include <qpe/mediaplayerplugininterface.h> |
38 | #include "mediaplayerstate.h" | 38 | #include "mediaplayerstate.h" |
@@ -103,3 +103,3 @@ LoopControl::LoopControl( QObject *parent, const char *name ) | |||
103 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) ); | 103 | connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) ); |
104 | 104 | //qDebug("starting loopcontrol"); | |
105 | audioMutex = new Mutex; | 105 | audioMutex = new Mutex; |
@@ -120,2 +120,3 @@ LoopControl::LoopControl( QObject *parent, const char *name ) | |||
120 | #endif | 120 | #endif |
121 | //qDebug("create audio thread"); | ||
121 | pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this); | 122 | pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this); |
@@ -222,4 +223,4 @@ void LoopControl::startAudio() { | |||
222 | 223 | ||
224 | //qDebug("start audio"); | ||
223 | audioMutex->lock(); | 225 | audioMutex->lock(); |
224 | |||
225 | if ( moreAudio ) { | 226 | if ( moreAudio ) { |
@@ -238,10 +239,10 @@ void LoopControl::startAudio() { | |||
238 | 239 | ||
239 | if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { | 240 | // if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { |
240 | usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); | 241 | // usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); |
241 | } | 242 | // } |
242 | else if ( sampleWaitTime <= -5000 ) { | 243 | // else if ( sampleWaitTime <= -5000 ) { |
243 | qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); | 244 | // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); |
244 | //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); | 245 | // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); |
245 | currentSample = sampleWeShouldBeAt; | 246 | // currentSample = sampleWeShouldBeAt; |
246 | } | 247 | // } |
247 | 248 | ||
@@ -393,4 +394,9 @@ bool LoopControl::init( const QString& filename ) { | |||
393 | audioSampleCounter = 0; | 394 | audioSampleCounter = 0; |
394 | 395 | int bits_per_sample; | |
395 | int bits_per_sample = mediaPlayerState->curDecoder()->audioBitsPerSample( astream); | 396 | if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibWavPlugin") ) { |
397 | bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime(); | ||
398 | qDebug("using stupid hack"); | ||
399 | } else { | ||
400 | bits_per_sample=0; | ||
401 | } | ||
396 | 402 | ||
@@ -439,3 +445,3 @@ bool LoopControl::init( const QString& filename ) { | |||
439 | void LoopControl::play() { | 445 | void LoopControl::play() { |
440 | 446 | qDebug("LC- play"); | |
441 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 447 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
diff --git a/core/multimedia/opieplayer/main.cpp b/core/multimedia/opieplayer/main.cpp index 720a1ca..4f43ff6 100644 --- a/core/multimedia/opieplayer/main.cpp +++ b/core/multimedia/opieplayer/main.cpp | |||
@@ -49,3 +49,3 @@ int main(int argc, char **argv) { | |||
49 | 49 | ||
50 | pl.setCaption( MediaPlayer::tr("Media Player") ); | 50 | pl.setCaption( MediaPlayer::tr("OpiePlayer") ); |
51 | a.showMainDocumentWidget(&pl); | 51 | a.showMainDocumentWidget(&pl); |
diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp index ce42c2c..c971a3c 100644 --- a/core/multimedia/opieplayer/mediaplayer.cpp +++ b/core/multimedia/opieplayer/mediaplayer.cpp | |||
@@ -78,3 +78,2 @@ void MediaPlayer::play() { | |||
78 | void MediaPlayer::setPlaying( bool play ) { | 78 | void MediaPlayer::setPlaying( bool play ) { |
79 | |||
80 | if ( !play ) { | 79 | if ( !play ) { |
@@ -91,3 +90,2 @@ void MediaPlayer::setPlaying( bool play ) { | |||
91 | const DocLnk *playListCurrent = playList->current(); | 90 | const DocLnk *playListCurrent = playList->current(); |
92 | |||
93 | if ( playListCurrent != NULL ) { | 91 | if ( playListCurrent != NULL ) { |
@@ -96,3 +94,2 @@ void MediaPlayer::setPlaying( bool play ) { | |||
96 | } | 94 | } |
97 | |||
98 | if ( currentFile == NULL ) { | 95 | if ( currentFile == NULL ) { |
@@ -102,3 +99,2 @@ void MediaPlayer::setPlaying( bool play ) { | |||
102 | } | 99 | } |
103 | |||
104 | if ( !QFile::exists( currentFile->file() ) ) { | 100 | if ( !QFile::exists( currentFile->file() ) ) { |
@@ -120,3 +116,2 @@ void MediaPlayer::setPlaying( bool play ) { | |||
120 | } | 116 | } |
121 | |||
122 | long seconds = loopControl->totalPlaytime(); | 117 | long seconds = loopControl->totalPlaytime(); |
diff --git a/core/multimedia/opieplayer/mediaplayer.h b/core/multimedia/opieplayer/mediaplayer.h index 73f8124..d6e90cb 100644 --- a/core/multimedia/opieplayer/mediaplayer.h +++ b/core/multimedia/opieplayer/mediaplayer.h | |||
diff --git a/core/multimedia/opieplayer/mediaplayerplugininterface.h b/core/multimedia/opieplayer/mediaplayerplugininterface.h index 339b2e4..97e4066 100644 --- a/core/multimedia/opieplayer/mediaplayerplugininterface.h +++ b/core/multimedia/opieplayer/mediaplayerplugininterface.h | |||
@@ -25,4 +25,8 @@ | |||
25 | #ifndef QT_NO_COMPONENT | 25 | #ifndef QT_NO_COMPONENT |
26 | // {c0093632-b44c-4cf7-a279-d82fe8a8890c} | 26 | # ifndef IID_OpiePlayerPlugin |
27 | // {F56F6CE0-1333-41FD-9B46-C0AF44D0B006} | ||
28 | # define IID_OpiePlayerPlugin QUuid( 0xF56F6CE0, 0x1333, 0x41FD, 0x9B, 0x46, 0xC0, 0xAF, 0x44, 0xD0, 0xB0, 0x06); | ||
29 | # endif | ||
27 | # ifndef IID_MediaPlayerPlugin | 30 | # ifndef IID_MediaPlayerPlugin |
31 | // {c0093632-b44c-4cf7-a279-d82fe8a8890c} | ||
28 | # define IID_MediaPlayerPlugin QUuid( 0xc0093632, 0xb44c, 0x4cf7, 0xa2, 0x79, 0xd8, 0x2f, 0xe8, 0xa8, 0x89, 0x0c ) | 32 | # define IID_MediaPlayerPlugin QUuid( 0xc0093632, 0xb44c, 0x4cf7, 0xa2, 0x79, 0xd8, 0x2f, 0xe8, 0xa8, 0x89, 0x0c ) |
@@ -95,3 +99,5 @@ public: | |||
95 | virtual long getPlayTime() { return -1; } | 99 | virtual long getPlayTime() { return -1; } |
100 | #ifdef IID_OpiePlayerPlugin | ||
96 | virtual int audioBitsPerSample( int stream ) = 0; | 101 | virtual int audioBitsPerSample( int stream ) = 0; |
102 | #endif | ||
97 | }; | 103 | }; |
@@ -108,2 +114,9 @@ struct MediaPlayerPluginInterface : public QUnknownInterface | |||
108 | 114 | ||
115 | #ifdef IID_OpiePlayerPlugin | ||
116 | struct OpiePlayerPluginInterface : public QUnknownInterface | ||
117 | { | ||
118 | virtual MediaPlayerDecoder *decoder() = 0; | ||
119 | virtual MediaPlayerEncoder *encoder() = 0; | ||
120 | }; | ||
121 | #endif | ||
109 | 122 | ||
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp index 13741f6..a960c49 100644 --- a/core/multimedia/opieplayer/mediaplayerstate.cpp +++ b/core/multimedia/opieplayer/mediaplayerstate.cpp | |||
@@ -25,3 +25,3 @@ | |||
25 | #include <qdir.h> | 25 | #include <qdir.h> |
26 | #include "mediaplayerplugininterface.h" | 26 | #include <qpe/mediaplayerplugininterface.h> |
27 | #include "mediaplayerstate.h" | 27 | #include "mediaplayerstate.h" |
@@ -29,2 +29,3 @@ | |||
29 | 29 | ||
30 | |||
30 | #ifdef QT_NO_COMPONENT | 31 | #ifdef QT_NO_COMPONENT |
@@ -62,2 +63,3 @@ void MediaPlayerState::readConfig( Config& cfg ) { | |||
62 | usePlaylist = cfg.readBoolEntry( "UsePlayList" ); | 63 | usePlaylist = cfg.readBoolEntry( "UsePlayList" ); |
64 | usePlaylist = TRUE; | ||
63 | isPlaying = FALSE; | 65 | isPlaying = FALSE; |
@@ -123,3 +125,3 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { | |||
123 | void MediaPlayerState::loadPlugins() { | 125 | void MediaPlayerState::loadPlugins() { |
124 | 126 | qDebug("load plugins"); | |
125 | #ifndef QT_NO_COMPONENT | 127 | #ifndef QT_NO_COMPONENT |
@@ -140,4 +142,3 @@ void MediaPlayerState::loadPlugins() { | |||
140 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 142 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
141 | 143 | // qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | |
142 | MediaPlayerDebug(( "querying: %s", QString( path + "/" + *it ).latin1() )); | ||
143 | 144 | ||
@@ -145,3 +146,3 @@ void MediaPlayerState::loadPlugins() { | |||
145 | 146 | ||
146 | MediaPlayerDebug(( "loading: %s", QString( path + "/" + *it ).latin1() )); | 147 | // qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); |
147 | 148 | ||
diff --git a/core/multimedia/opieplayer/mediaplayerstate.h b/core/multimedia/opieplayer/mediaplayerstate.h index e82c263..ad273f1 100644 --- a/core/multimedia/opieplayer/mediaplayerstate.h +++ b/core/multimedia/opieplayer/mediaplayerstate.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
@@ -22,2 +22,3 @@ | |||
22 | 22 | ||
23 | |||
23 | #include <qobject.h> | 24 | #include <qobject.h> |
@@ -35,2 +36,3 @@ public: | |||
35 | 36 | ||
37 | |||
36 | bool fullscreen() { return isFullscreen; } | 38 | bool fullscreen() { return isFullscreen; } |
@@ -107,2 +109,3 @@ private: | |||
107 | MediaPlayerDecoder *libmpeg3decoder; | 109 | MediaPlayerDecoder *libmpeg3decoder; |
110 | // MediaPlayerDecoder *libwavdecoder; | ||
108 | 111 | ||
diff --git a/core/multimedia/opieplayer/mpegplayer.pro b/core/multimedia/opieplayer/mpegplayer.pro index 41f2de0..5bea541 100644 --- a/core/multimedia/opieplayer/mpegplayer.pro +++ b/core/multimedia/opieplayer/mpegplayer.pro | |||
@@ -5,6 +5,6 @@ DESTDIR = $(OPIEDIR)/bin | |||
5 | HEADERS = loopcontrol.h mediaplayerplugininterface.h playlistselection.h mediaplayerstate.h \ | 5 | HEADERS = loopcontrol.h mediaplayerplugininterface.h playlistselection.h mediaplayerstate.h \ |
6 | videowidget.h audiowidget.h playlistwidget.h mediaplayer.h audiodevice.h | 6 | videowidget.h audiowidget.h playlistwidget.h mediaplayer.h audiodevice.h inputDialog.h |
7 | SOURCES = main.cpp \ | 7 | SOURCES = main.cpp \ |
8 | loopcontrol.cpp playlistselection.cpp mediaplayerstate.cpp \ | 8 | loopcontrol.cpp playlistselection.cpp mediaplayerstate.cpp \ |
9 | videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp audiodevice.cpp | 9 | videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp audiodevice.cpp inputDialog.cpp |
10 | TARGET = mpegplayer | 10 | TARGET = mpegplayer |
@@ -21,2 +21,5 @@ LIBS += -lqpe -lpthread | |||
21 | 21 | ||
22 | INCLUDEPATH += $(OPIEDIR)/include | ||
23 | DEPENDPATH += $(OPIEDIR)/include | ||
24 | |||
22 | TRANSLATIONS = ../i18n/de/mpegplayer.ts | 25 | TRANSLATIONS = ../i18n/de/mpegplayer.ts |
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp index 2c62e86..d70df51 100644 --- a/core/multimedia/opieplayer/playlistselection.cpp +++ b/core/multimedia/opieplayer/playlistselection.cpp | |||
@@ -57,4 +57,4 @@ PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) | |||
57 | // #endif | 57 | // #endif |
58 | addColumn("Title",236); | 58 | // addColumn("Title",236); |
59 | setAllColumnsShowFocus( TRUE ); | 59 | // setAllColumnsShowFocus( TRUE ); |
60 | addColumn( tr( "Playlist Selection" ) ); | 60 | addColumn( tr( "Playlist Selection" ) ); |
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 202f351..7862d8d 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -19,2 +19,3 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | // code added by L. J. Potter Sat 03-02-2002 06:17:54 | ||
20 | 21 | ||
@@ -42,2 +43,5 @@ | |||
42 | #include <qpoint.h> | 43 | #include <qpoint.h> |
44 | #include <qlineedit.h> | ||
45 | #include <qpushbutton.h> | ||
46 | |||
43 | //#include <qtimer.h> | 47 | //#include <qtimer.h> |
@@ -48,2 +52,5 @@ | |||
48 | 52 | ||
53 | #include "fileBrowser.h" | ||
54 | #include "inputDialog.h" | ||
55 | |||
49 | #include <stdlib.h> | 56 | #include <stdlib.h> |
@@ -121,7 +128,21 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
121 | bar->setLabel( tr( "Play Operations" ) ); | 128 | bar->setLabel( tr( "Play Operations" ) ); |
122 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ),"mpegplayer/add_to_playlist",this , SLOT(addSelected()) ); | 129 | // d->tbPlayCurList = new ToolButton( bar, tr( "play List" ), "mpegplayer/play_current_list", |
123 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "mpegplayer/remove_from_playlist", this , SLOT(removeSelected()) ); | 130 | // this , SLOT( addSelected()) ); |
124 | d->tbPlay = new ToolButton( bar, tr( "Play" ),"mpegplayer/play", mediaPlayerState, SLOT( setPlaying(bool)), TRUE ); | 131 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet("close"),"",bar,"close"); |
125 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ), "mpegplayer/shuffle", mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); | 132 | tbDeletePlaylist->setFlat(TRUE); |
126 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"mpegplayer/loop", mediaPlayerState, SLOT(setLooping(bool)), TRUE ); | 133 | tbDeletePlaylist->setFixedSize(20,20); |
134 | connect(tbDeletePlaylist,(SIGNAL(released())),SLOT( deletePlaylist())); | ||
135 | |||
136 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "mpegplayer/add_to_playlist", | ||
137 | this , SLOT(addSelected()) ); | ||
138 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "mpegplayer/remove_from_playlist", | ||
139 | this , SLOT(removeSelected()) ); | ||
140 | // d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play", /*this */mediaPlayerState , SLOT(setPlaying(bool) /* btnPlay() */), TRUE ); | ||
141 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play", | ||
142 | this , SLOT( btnPlay(bool) ), TRUE ); | ||
143 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"mpegplayer/shuffle", | ||
144 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); | ||
145 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"mpegplayer/loop", | ||
146 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); | ||
147 | tbDeletePlaylist->hide(); | ||
127 | 148 | ||
@@ -134,3 +155,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
134 | new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); | 155 | new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); |
135 | new MenuItem( pmPlayList, tr( "Load PlayList" ), this, SLOT( loadList() ) ); | 156 | // new MenuItem( pmPlayList, tr( "Load PlayList" ), this, SLOT( loadList() ) ); |
136 | 157 | ||
@@ -230,2 +251,13 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
230 | } | 251 | } |
252 | |||
253 | //playlists list | ||
254 | QWidget *LTab; | ||
255 | LTab = new QWidget( tabWidget, "LTab" ); | ||
256 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy | ||
257 | playLists->setMinimumSize(233,260);; | ||
258 | tabWidget->insertTab(LTab,"Lists"); | ||
259 | connect( playLists, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( loadList( const DocLnk & ) ) ); | ||
260 | // connect( playLists, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) ); | ||
261 | |||
262 | |||
231 | // add the library area | 263 | // add the library area |
@@ -233,17 +265,15 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
233 | 265 | ||
234 | // connect( audioView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); | ||
235 | // connect( videoView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); | ||
236 | 266 | ||
237 | connect( audioView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); | 267 | connect( audioView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), |
238 | connect( videoView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); | 268 | this, SLOT( fauxPlay( QListViewItem *) ) ); |
269 | connect( videoView, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int)), | ||
270 | this, SLOT( fauxPlay( QListViewItem *)) ); | ||
239 | 271 | ||
240 | connect( audioView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint&, int ) ), | 272 | // connect( audioView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( fauxPlay( QListViewItem *) ) ); |
241 | this, SLOT( addToSelection( QListViewItem *, const QPoint&, int )) ); | 273 | // connect( videoView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( fauxPlay( QListViewItem *) ) ); |
242 | connect( videoView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint&, int ) ), | ||
243 | this, SLOT( addToSelection( QListViewItem *, const QPoint&, int )) ); | ||
244 | 274 | ||
275 | connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); | ||
276 | connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); | ||
245 | 277 | ||
246 | connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); | 278 | connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); |
247 | // connect( d->files, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) ); | ||
248 | // connect( d->files, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) ); | ||
249 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); | 279 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); |
@@ -251,10 +281,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
251 | connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); | 281 | connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); |
252 | |||
253 | // connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), fullScreenButton, SLOT( setOn( bool ) ) ); | ||
254 | // connect( mediaPlayerState, SIGNAL( scaledToggled( bool ) ), scaleButton, SLOT( setEnabled( bool ) ) ); | ||
255 | // connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), fullScreenButton, SLOT( setEnabled( bool ) ) ); | ||
256 | |||
257 | connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); | 282 | connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); |
258 | 283 | ||
259 | connect( d->selectedFiles, SIGNAL( clicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); | 284 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); |
260 | // connect( d->selectedFiles, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) ); | 285 | // connect( d->selectedFiles, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) ); |
@@ -289,2 +314,5 @@ void PlayListWidget::initializeStates() { | |||
289 | // setPlaylist( mediaPlayerState->playlist() ); | 314 | // setPlaylist( mediaPlayerState->playlist() ); |
315 | setPlaylist( true); | ||
316 | d->selectedFiles->first(); | ||
317 | |||
290 | } | 318 | } |
@@ -304,3 +332,2 @@ void PlayListWidget::readConfig( Config& cfg ) { | |||
304 | d->selectedFiles->addToSelection( lnk ); | 332 | d->selectedFiles->addToSelection( lnk ); |
305 | |||
306 | } | 333 | } |
@@ -341,2 +368,4 @@ void PlayListWidget::writeConfig( Config& cfg ) const { | |||
341 | cfg.writeEntry("NumberOfFiles", noOfFiles ); | 368 | cfg.writeEntry("NumberOfFiles", noOfFiles ); |
369 | |||
370 | |||
342 | } | 371 | } |
@@ -345,2 +374,3 @@ void PlayListWidget::writeConfig( Config& cfg ) const { | |||
345 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { | 374 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { |
375 | qDebug("add"); | ||
346 | d->setDocumentUsed = FALSE; | 376 | d->setDocumentUsed = FALSE; |
@@ -353,12 +383,2 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) { | |||
353 | 383 | ||
354 | void PlayListWidget::addToSelection( QListViewItem *it ,const QPoint & p, int index) { | ||
355 | qDebug("add"); | ||
356 | // d->selectedFiles->addToSelection( lnk ); | ||
357 | // } | ||
358 | // else | ||
359 | // mediaPlayerState->setPlaying( TRUE ); | ||
360 | // | ||
361 | } | ||
362 | |||
363 | |||
364 | void PlayListWidget::clearList() { | 384 | void PlayListWidget::clearList() { |
@@ -428,9 +448,13 @@ void PlayListWidget::useSelectedDocument() { | |||
428 | const DocLnk *PlayListWidget::current() { | 448 | const DocLnk *PlayListWidget::current() { |
429 | if ( mediaPlayerState->playlist() ) | 449 | |
450 | // qDebug("in Playlist widget ::current"); | ||
451 | if ( mediaPlayerState->playlist() ) { | ||
430 | return d->selectedFiles->current(); | 452 | return d->selectedFiles->current(); |
453 | } | ||
431 | else if ( d->setDocumentUsed && d->current ) { | 454 | else if ( d->setDocumentUsed && d->current ) { |
432 | return d->current; | 455 | return d->current; |
433 | } else | 456 | } else { |
434 | return d->files->selected(); | 457 | return d->files->selected(); |
435 | } | 458 | } |
459 | } | ||
436 | 460 | ||
@@ -503,5 +527,20 @@ bool PlayListWidget::last() { | |||
503 | void PlayListWidget::saveList() { | 527 | void PlayListWidget::saveList() { |
528 | |||
504 | QString filename; | 529 | QString filename; |
505 | // pseudo code | 530 | InputDialog *fileDlg; |
506 | // filename = QLineEdit->getText(); | 531 | fileDlg=new InputDialog(this,"Save Playlist",TRUE, 0); |
532 | fileDlg->exec(); | ||
533 | if( fileDlg->result() == 1 ) { | ||
534 | filename = fileDlg->LineEdit1->text();//+".playlist"; | ||
535 | qDebug("saving playlist "+filename+".playlist"); | ||
536 | |||
537 | // DocLnk *lnk; | ||
538 | // lnk.setName( filename); //sets file name | ||
539 | // // lnk.setComment(title); | ||
540 | // lnk.setFile( filename+".playlist"); //sets File property | ||
541 | // lnk.setType("player/plain");// hey is this a REGISTERED mime type?!?!? ;D | ||
542 | // lnk.setIcon("MPEGPlayer"); | ||
543 | // if(!lnk.writeLink()) | ||
544 | // qDebug("Writing doclink did not work"); | ||
545 | |||
507 | Config cfg( filename + ".playlist" ); | 546 | Config cfg( filename + ".playlist" ); |
@@ -509,10 +548,23 @@ void PlayListWidget::saveList() { | |||
509 | } | 548 | } |
549 | DocLnk lnk; | ||
550 | lnk.setName( filename); //sets file name | ||
551 | // lnk.setComment(title); | ||
552 | lnk.setFile(QPEApplication::qpeDir()+"Settings/"+filename+".playlist.conf"); //sets File property | ||
553 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D | ||
554 | lnk.setIcon("MPEGPlayer"); | ||
555 | if(!lnk.writeLink()) | ||
556 | qDebug("Writing doclink did not work"); | ||
510 | 557 | ||
558 | if(fileDlg) | ||
559 | delete fileDlg; | ||
560 | } | ||
511 | 561 | ||
512 | void PlayListWidget::loadList() { | 562 | |
513 | QString filename; | 563 | void PlayListWidget::loadList( const DocLnk & lnk) { |
514 | // pseudo code | 564 | |
515 | // filename = FileSelector->openFile( "*.playlist" ); | 565 | clearList(); |
516 | Config cfg( filename + ".playlist" ); | 566 | Config cfg( lnk.file()); |
517 | readConfig( cfg ); | 567 | readConfig( cfg ); |
568 | tabWidget->setCurrentPage(0); | ||
569 | setCaption("OpiePlayer: "+lnk.name()); | ||
518 | } | 570 | } |
@@ -536,5 +588,4 @@ void PlayListWidget::setView( char view ) { | |||
536 | void PlayListWidget::addSelected() { | 588 | void PlayListWidget::addSelected() { |
537 | // QMessageBox::message("Note","Bozo the clown thinks\nthere's something actually here"); | 589 | |
538 | int tabPage=tabWidget->currentPageIndex(); | 590 | switch (tabWidget->currentPageIndex()) { |
539 | switch (tabPage) { | ||
540 | case 0: //playlist | 591 | case 0: //playlist |
@@ -559,3 +610,3 @@ void PlayListWidget::playIt( QListViewItem *it) { | |||
559 | // d->setDocumentUsed = FALSE; | 610 | // d->setDocumentUsed = FALSE; |
560 | mediaPlayerState->setPlaying(true); | 611 | mediaPlayerState->setPlaying(TRUE); |
561 | } | 612 | } |
@@ -566,8 +617,9 @@ void PlayListWidget::addToSelection( QListViewItem *it) { | |||
566 | if(it) { | 617 | if(it) { |
567 | qDebug("add to selection"); | 618 | // qDebug("add to selection"); |
568 | int tabPage=tabWidget->currentPageIndex(); | 619 | switch (tabWidget->currentPageIndex()) { |
569 | switch (tabPage) { | ||
570 | case 1: { | 620 | case 1: { |
621 | // qDebug("case 1"); | ||
571 | QListIterator<DocLnk> dit( files.children() ); | 622 | QListIterator<DocLnk> dit( files.children() ); |
572 | for ( ; dit.current(); ++dit ) { | 623 | for ( ; dit.current(); ++dit ) { |
624 | // qDebug(dit.current()->name()); | ||
573 | if( dit.current()->name() == it->text(0)) { | 625 | if( dit.current()->name() == it->text(0)) { |
@@ -579,5 +631,6 @@ void PlayListWidget::addToSelection( QListViewItem *it) { | |||
579 | case 2: { | 631 | case 2: { |
632 | // qDebug("case 2"); | ||
580 | QListIterator<DocLnk> dit( vFiles.children() ); | 633 | QListIterator<DocLnk> dit( vFiles.children() ); |
581 | for ( ; dit.current(); ++dit ) { | 634 | for ( ; dit.current(); ++dit ) { |
582 | qDebug(dit.current()->name()); | 635 | // qDebug(dit.current()->name()); |
583 | if( dit.current()->name() == it->text(0)) { | 636 | if( dit.current()->name() == it->text(0)) { |
@@ -598,6 +651,7 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
598 | 651 | ||
599 | int tabPage=tabWidget->currentPageIndex(); | 652 | switch ( tabWidget->currentPageIndex()) { |
600 | switch (tabPage) { | ||
601 | case 0: | 653 | case 0: |
602 | { | 654 | { |
655 | if( !tbDeletePlaylist->isHidden()) | ||
656 | tbDeletePlaylist->hide(); | ||
603 | d->tbRemoveFromList->setEnabled(TRUE); | 657 | d->tbRemoveFromList->setEnabled(TRUE); |
@@ -608,2 +662,4 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
608 | { | 662 | { |
663 | if( !tbDeletePlaylist->isHidden()) | ||
664 | tbDeletePlaylist->hide(); | ||
609 | d->tbRemoveFromList->setEnabled(FALSE); | 665 | d->tbRemoveFromList->setEnabled(FALSE); |
@@ -614,2 +670,4 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
614 | { | 670 | { |
671 | if( !tbDeletePlaylist->isHidden()) | ||
672 | tbDeletePlaylist->hide(); | ||
615 | d->tbRemoveFromList->setEnabled(FALSE); | 673 | d->tbRemoveFromList->setEnabled(FALSE); |
@@ -618,2 +676,9 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
618 | break; | 676 | break; |
677 | case 3: | ||
678 | { | ||
679 | if( tbDeletePlaylist->isHidden()) | ||
680 | tbDeletePlaylist->show(); | ||
681 | playLists->reread(); | ||
682 | } | ||
683 | break; | ||
619 | }; | 684 | }; |
@@ -621,29 +686,77 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
621 | 686 | ||
622 | // void PlayListWidget::cancelMenuTimer() { | 687 | /* |
623 | // if( menuTimer->isActive() ) | 688 | list is right clicked*/ |
624 | // menuTimer->stop(); | 689 | void PlayListWidget::fauxPlay(QListViewItem *it) { |
625 | // } | ||
626 | 690 | ||
627 | // void PlayListWidget::showFileMenu() { | 691 | switch (tabWidget->currentPageIndex()) { |
628 | 692 | case 0: //playlist | |
629 | // } | 693 | break; |
694 | case 1: { //audio | ||
695 | QListIterator<DocLnk> dit( files.children() ); | ||
696 | for ( ; dit.current(); ++dit ) { | ||
697 | // qDebug(dit.current()->name()); | ||
698 | if( dit.current()->name() == it->text(0)) { | ||
699 | d->selectedFiles->addToSelection( **dit ); | ||
700 | } | ||
701 | } | ||
702 | } | ||
703 | break; | ||
704 | case 2: { // video | ||
705 | QListIterator<DocLnk> dit( vFiles.children() ); | ||
706 | for ( ; dit.current(); ++dit ) { | ||
707 | // qDebug(dit.current()->name()); | ||
708 | if( dit.current()->name() == it->text(0)) { | ||
709 | d->selectedFiles->addToSelection( **dit ); | ||
710 | } | ||
711 | } | ||
712 | } | ||
713 | break; | ||
714 | }; | ||
715 | mediaPlayerState->setPlaying( TRUE ); | ||
716 | // tabWidget->setCurrentPage(0); | ||
717 | d->selectedFiles->removeSelected(); | ||
718 | } | ||
630 | 719 | ||
631 | // void PlayListWidget::contentsMousePressEvent( QMouseEvent * e ) | 720 | /* |
632 | // { | 721 | play button is pressed*/ |
633 | // // QListView::contentsMousePressEvent( e ); | 722 | void PlayListWidget::btnPlay(bool b) { // this is fugly |
634 | // menuTimer->start( 750, TRUE ); | 723 | switch ( tabWidget->currentPageIndex()) { |
635 | // } | 724 | case 0: |
725 | { | ||
726 | mediaPlayerState->setPlaying(b); | ||
727 | } | ||
728 | break; | ||
729 | case 1: | ||
730 | { | ||
731 | addToSelection( audioView->selectedItem() ); | ||
732 | mediaPlayerState->setPlaying(b); | ||
733 | d->selectedFiles->removeSelected( ); | ||
734 | tabWidget->setCurrentPage(1); | ||
735 | } | ||
736 | break; | ||
737 | case 2: | ||
738 | { | ||
739 | addToSelection( videoView->selectedItem() ); | ||
740 | mediaPlayerState->setPlaying(b); | ||
741 | d->selectedFiles->removeSelected( ); | ||
742 | tabWidget->setCurrentPage(2); | ||
743 | } | ||
744 | break; | ||
745 | }; | ||
636 | 746 | ||
747 | } | ||
637 | 748 | ||
638 | // void PlayListWidget::contentsMouseReleaseEvent( QMouseEvent * e ) | 749 | void PlayListWidget::deletePlaylist() { |
639 | // { | 750 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), |
640 | // // QListView::contentsMouseReleaseEvent( e ); | 751 | (tr("You really want to delete\nthis playlist?")), |
641 | // menuTimer->stop(); | 752 | (tr("Yes")), (tr("No")), 0 )){ |
642 | // } | 753 | case 0: // Yes clicked, |
643 | // // void PlayListWidget::setFullScreen() { | 754 | QFile().remove(playLists->selected()->file()); |
644 | // mediaPlayerState->toggleFullscreen( ); | 755 | QFile().remove(playLists->selected()->linkFile()); |
645 | // } | 756 | playLists->reread(); |
757 | break; | ||
758 | case 1: // Cancel | ||
759 | break; | ||
760 | }; | ||
646 | 761 | ||
647 | // void PlayListWidget::setScaled() { | 762 | } |
648 | // mediaPlayerState->toggleScaled(); | ||
649 | // } | ||
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h index 5b05f11..46272a0 100644 --- a/core/multimedia/opieplayer/playlistwidget.h +++ b/core/multimedia/opieplayer/playlistwidget.h | |||
@@ -25,2 +25,5 @@ | |||
25 | #include <qtabwidget.h> | 25 | #include <qtabwidget.h> |
26 | #include <fileselector.h> | ||
27 | #include <qpushbutton.h> | ||
28 | |||
26 | /* #include <qtimer.h> */ | 29 | /* #include <qtimer.h> */ |
@@ -51,3 +54,4 @@ public: | |||
51 | /* QTimer * menuTimer; */ | 54 | /* QTimer * menuTimer; */ |
52 | 55 | FileSelector* playLists; | |
56 | QPushButton *tbDeletePlaylist; | ||
53 | public slots: | 57 | public slots: |
@@ -56,3 +60,2 @@ public slots: | |||
56 | void addToSelection( QListViewItem* ); // Add a media file to the playlist | 60 | void addToSelection( QListViewItem* ); // Add a media file to the playlist |
57 | void addToSelection( QListViewItem*, const QPoint&,int ); // Add a media file to the playlist | ||
58 | void setActiveWindow(); // need to handle this to show the right view | 61 | void setActiveWindow(); // need to handle this to show the right view |
@@ -65,4 +68,7 @@ public slots: | |||
65 | void saveList(); // Save the playlist | 68 | void saveList(); // Save the playlist |
66 | void loadList(); // Load a playlist | 69 | void loadList( const DocLnk &); // Load a playlist |
67 | void playIt( QListViewItem *); | 70 | void playIt( QListViewItem *); |
71 | void fauxPlay(QListViewItem *); | ||
72 | void btnPlay(bool); | ||
73 | void deletePlaylist(); | ||
68 | bool first(); | 74 | bool first(); |
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp index 1f128a4..be838c4 100644 --- a/core/multimedia/opieplayer/videowidget.cpp +++ b/core/multimedia/opieplayer/videowidget.cpp | |||
@@ -20,3 +20,3 @@ | |||
20 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
21 | #include "mediaplayerplugininterface.h" | 21 | #include <qpe/mediaplayerplugininterface.h> |
22 | #include <qwidget.h> | 22 | #include <qwidget.h> |
diff --git a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp index 7ac63c0..4a0da16 100644 --- a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp +++ b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp | |||
@@ -72,3 +72,3 @@ public: | |||
72 | 72 | ||
73 | // expands out samples to the frequency of 44kHz | 73 | // expands out samples to the frequency of 44kHz //not any more |
74 | bool add( short *output, long count, long& done, bool stereo ) | 74 | bool add( short *output, long count, long& done, bool stereo ) |
@@ -90,2 +90,4 @@ public: | |||
90 | samples_due += chunkdata.samplesPerSec; | 90 | samples_due += chunkdata.samplesPerSec; |
91 | printf("samples due %d\r", samples_due); | ||
92 | fflush(stdout); | ||
91 | while ( count && (samples_due > chunkdata.samplesPerSec) ) { | 93 | while ( count && (samples_due > chunkdata.samplesPerSec) ) { |
@@ -330,10 +332,10 @@ bool WavPlugin::audioReadSamples( short *output, int channels, long samples, lon | |||
330 | double WavPlugin::getTime() { | 332 | double WavPlugin::getTime() { |
331 | // qDebug( "WavPlugin::getTime" ); | 333 | // qDebug( "WavPlugin::getTime" ); //this is a stupid hack here!! |
332 | return 0.0; | 334 | return d->chunkdata.wBitsPerSample; /*0.0*/; |
333 | } | 335 | } |
334 | 336 | ||
335 | int WavPlugin::audioBitsPerSample( int ) { | 337 | // int WavPlugin::audioBitsPerSample( int ) { |
336 | // qDebug( "WavPlugin::audioFormat %d", d->chunkdata.wBitsPerSample ); | 338 | // // qDebug( "WavPlugin::audioFormat %d", d->chunkdata.wBitsPerSample ); |
337 | return d->chunkdata.wBitsPerSample; // | 339 | // return d->chunkdata.wBitsPerSample; // |
338 | } | 340 | // } |
339 | 341 | ||
diff --git a/core/multimedia/opieplayer/wavplugin/wavplugin.h b/core/multimedia/opieplayer/wavplugin/wavplugin.h index 6ae6e06..1c8ba14 100644 --- a/core/multimedia/opieplayer/wavplugin/wavplugin.h +++ b/core/multimedia/opieplayer/wavplugin/wavplugin.h | |||
@@ -26,3 +26,4 @@ | |||
26 | #include <qapplication.h> | 26 | #include <qapplication.h> |
27 | #include "../mediaplayerplugininterface.h" | 27 | /* #include "../mediaplayerplugininterface.h" */ |
28 | #include <qpe/mediaplayerplugininterface.h> | ||
28 | 29 | ||
@@ -55,3 +56,3 @@ public: | |||
55 | int audioFrequency( int stream ); | 56 | int audioFrequency( int stream ); |
56 | int audioBitsPerSample( int stream ); | 57 | /* int audioBitsPerSample( int stream ); */ |
57 | int audioSamples( int stream ); | 58 | int audioSamples( int stream ); |
diff --git a/core/multimedia/opieplayer/wavplugin/wavpluginimpl.cpp b/core/multimedia/opieplayer/wavplugin/wavpluginimpl.cpp index 2923180..c232d7b 100644 --- a/core/multimedia/opieplayer/wavplugin/wavpluginimpl.cpp +++ b/core/multimedia/opieplayer/wavplugin/wavpluginimpl.cpp | |||
diff --git a/core/multimedia/opieplayer/wavplugin/wavpluginimpl.h b/core/multimedia/opieplayer/wavplugin/wavpluginimpl.h index 10f9305..fb1fa73 100644 --- a/core/multimedia/opieplayer/wavplugin/wavpluginimpl.h +++ b/core/multimedia/opieplayer/wavplugin/wavpluginimpl.h | |||
@@ -22,3 +22,4 @@ | |||
22 | 22 | ||
23 | #include "../mediaplayerplugininterface.h" | 23 | |
24 | /* #include "../mediaplayerplugininterface.h" */ | ||
24 | 25 | ||