author | llornkcor <llornkcor> | 2002-04-26 23:55:00 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-26 23:55:00 (UTC) |
commit | 8ca9c8dad17ccaee9b0b8132324176c2a8e40526 (patch) (unidiff) | |
tree | 2a6b7cf8a2d5a45d32065cde00ed8399b5ef91d8 | |
parent | 75b32567bfeb67ed71877c4fa9e918c836a8a68b (diff) | |
download | opie-8ca9c8dad17ccaee9b0b8132324176c2a8e40526.zip opie-8ca9c8dad17ccaee9b0b8132324176c2a8e40526.tar.gz opie-8ca9c8dad17ccaee9b0b8132324176c2a8e40526.tar.bz2 |
fixed playing from audio/video list. added images from config file
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 26 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.h | 3 | ||||
-rw-r--r-- | core/multimedia/opieplayer/inputDialog.cpp | 29 | ||||
-rw-r--r-- | core/multimedia/opieplayer/inputDialog.h | 7 | ||||
-rw-r--r-- | core/multimedia/opieplayer/opieplayer.pro | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 71 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 6 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 21 |
8 files changed, 97 insertions, 68 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 94b979f..aa48961 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp | |||
@@ -18,8 +18,9 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
22 | #include <qpe/config.h> | ||
22 | 23 | ||
23 | #include <qwidget.h> | 24 | #include <qwidget.h> |
24 | #include <qpixmap.h> | 25 | #include <qpixmap.h> |
25 | #include <qbutton.h> | 26 | #include <qbutton.h> |
@@ -64,30 +65,37 @@ static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); | |||
64 | AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | 65 | AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : |
65 | QWidget( parent, name, f ) | 66 | QWidget( parent, name, f ) |
66 | { | 67 | { |
67 | setCaption( tr("OpiePlayer") ); | 68 | setCaption( tr("OpiePlayer") ); |
68 | 69 | Config cfg("OpiePlayer"); | |
70 | cfg.setGroup("AudioWidget"); | ||
69 | // QGridLayout *layout = new QGridLayout( this ); | 71 | // QGridLayout *layout = new QGridLayout( this ); |
70 | // layout->setSpacing( 2); | 72 | // layout->setSpacing( 2); |
71 | // layout->setMargin( 2); | 73 | // layout->setMargin( 2); |
72 | 74 | QString backgroundPix, buttonsAllPix, buttonsBigPix, controlsPix, animatedPix; | |
73 | setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 75 | backgroundPix=cfg.readEntry( " backgroundPix", "opieplayer/metalFinish"); |
74 | pixmaps[0] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsAll" ) ); | 76 | buttonsAllPix=cfg.readEntry( "buttonsAllPix","opieplayer/mediaButtonsAll"); |
75 | pixmaps[1] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsBig" ) ); | 77 | buttonsBigPix=cfg.readEntry( "buttonsBigPix","opieplayer/mediaButtonsBig"); |
76 | pixmaps[2] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaControls" ) ); | 78 | controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls"); |
77 | pixmaps[3] = new QPixmap( Resource::loadPixmap( "opieplayer/animatedButton" ) ); | 79 | animatedPix=cfg.readEntry( "animatedPix", "opieplayer/animatedButton"); |
80 | |||
81 | setBackgroundPixmap( Resource::loadPixmap( backgroundPix) ); | ||
82 | pixmaps[0] = new QPixmap( Resource::loadPixmap( buttonsAllPix ) ); | ||
83 | pixmaps[1] = new QPixmap( Resource::loadPixmap( buttonsBigPix ) ); | ||
84 | pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix ) ); | ||
85 | pixmaps[3] = new QPixmap( Resource::loadPixmap( animatedPix) ); | ||
78 | 86 | ||
79 | songInfo = new Ticker( this ); | 87 | songInfo = new Ticker( this ); |
80 | songInfo->setFocusPolicy( QWidget::NoFocus ); | 88 | songInfo->setFocusPolicy( QWidget::NoFocus ); |
81 | songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); | 89 | songInfo->setGeometry( QRect( 7, 3, 220, 20 ) ); |
82 | // layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 ); | 90 | // layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 ); |
83 | 91 | ||
84 | slider = new QSlider( Qt::Horizontal, this ); | 92 | slider = new QSlider( Qt::Horizontal, this ); |
85 | slider->setFixedWidth( 220 ); | 93 | slider->setFixedWidth( 220 ); |
86 | slider->setFixedHeight( 20 ); | 94 | slider->setFixedHeight( 20 ); |
87 | slider->setMinValue( 0 ); | 95 | slider->setMinValue( 0 ); |
88 | slider->setMaxValue( 1 ); | 96 | slider->setMaxValue( 1 ); |
89 | slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 97 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
90 | slider->setFocusPolicy( QWidget::NoFocus ); | 98 | slider->setFocusPolicy( QWidget::NoFocus ); |
91 | slider->setGeometry( QRect( 7, 262, 220, 20 ) ); | 99 | slider->setGeometry( QRect( 7, 262, 220, 20 ) ); |
92 | // layout->addMultiCellWidget( slider, 4, 4, 0, 2 ); | 100 | // layout->addMultiCellWidget( slider, 4, 4, 0, 2 ); |
93 | 101 | ||
diff --git a/core/multimedia/opieplayer/audiowidget.h b/core/multimedia/opieplayer/audiowidget.h index 41ae4b6..b3d39bf 100644 --- a/core/multimedia/opieplayer/audiowidget.h +++ b/core/multimedia/opieplayer/audiowidget.h | |||
@@ -121,17 +121,18 @@ signals: | |||
121 | void lessReleased(); | 121 | void lessReleased(); |
122 | void sliderMoved(long); | 122 | void sliderMoved(long); |
123 | 123 | ||
124 | protected: | 124 | protected: |
125 | void doBlank(); | ||
126 | void doUnblank(); | ||
125 | void paintEvent( QPaintEvent *pe ); | 127 | void paintEvent( QPaintEvent *pe ); |
126 | void showEvent( QShowEvent *se ); | 128 | void showEvent( QShowEvent *se ); |
127 | void mouseMoveEvent( QMouseEvent *event ); | 129 | void mouseMoveEvent( QMouseEvent *event ); |
128 | void mousePressEvent( QMouseEvent *event ); | 130 | void mousePressEvent( QMouseEvent *event ); |
129 | void mouseReleaseEvent( QMouseEvent *event ); | 131 | void mouseReleaseEvent( QMouseEvent *event ); |
130 | void timerEvent( QTimerEvent *event ); | 132 | void timerEvent( QTimerEvent *event ); |
131 | void closeEvent( QCloseEvent *event ); | 133 | void closeEvent( QCloseEvent *event ); |
132 | void keyReleaseEvent( QKeyEvent *e); | 134 | void keyReleaseEvent( QKeyEvent *e); |
133 | void showMe(); | ||
134 | private: | 135 | private: |
135 | void toggleButton( int ); | 136 | void toggleButton( int ); |
136 | void setToggleButton( int, bool ); | 137 | void setToggleButton( int, bool ); |
137 | void paintButton( QPainter *p, int i ); | 138 | void paintButton( QPainter *p, int i ); |
diff --git a/core/multimedia/opieplayer/inputDialog.cpp b/core/multimedia/opieplayer/inputDialog.cpp index b443747..b80d129 100644 --- a/core/multimedia/opieplayer/inputDialog.cpp +++ b/core/multimedia/opieplayer/inputDialog.cpp | |||
@@ -7,32 +7,33 @@ | |||
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | #include "inputDialog.h" | 9 | #include "inputDialog.h" |
10 | 10 | ||
11 | #include <qpe/resource.h> | ||
12 | |||
13 | #include <opie/ofiledialog.h> | ||
14 | |||
11 | #include <qlineedit.h> | 15 | #include <qlineedit.h> |
12 | #include <qlayout.h> | 16 | #include <qlayout.h> |
13 | #include <qvariant.h> | 17 | #include <qvariant.h> |
14 | #include <qtooltip.h> | 18 | #include <qpushbutton.h> |
15 | #include <qwhatsthis.h> | 19 | #include <qwhatsthis.h> |
16 | 20 | ||
17 | /* | ||
18 | * Constructs a InputDialog which is a child of 'parent', with the | ||
19 | * name 'name' and widget flags set to 'f' | ||
20 | * | ||
21 | * The dialog will by default be modeless, unless you set 'modal' to | ||
22 | * TRUE to construct a modal dialog. | ||
23 | */ | ||
24 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 21 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
25 | : QDialog( parent, name, modal, fl ) | 22 | : QDialog( parent, name, modal, fl ) |
26 | { | 23 | { |
27 | if ( !name ) | 24 | if ( !name ) |
28 | setName( "InputDialog" ); | 25 | setName( "InputDialog" ); |
29 | resize( 234, 50 ); | 26 | resize( 234, 115); |
30 | setMaximumSize( QSize( 240, 50 ) ); | 27 | setMaximumSize( QSize( 240, 40)); |
31 | setCaption( tr(name ) ); | 28 | setCaption( tr(name ) ); |
32 | 29 | ||
30 | QPushButton *browserButton; | ||
31 | browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); | ||
32 | browserButton->setGeometry( QRect( 205, 10, 22, 22)); | ||
33 | connect( browserButton, SIGNAL(released()),this,SLOT(browse())); | ||
33 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 34 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
34 | LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); | 35 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); |
35 | } | 36 | } |
36 | 37 | ||
37 | /* | 38 | /* |
38 | * Destroys the object and frees any allocated resources | 39 | * Destroys the object and frees any allocated resources |
@@ -42,4 +43,10 @@ InputDialog::~InputDialog() | |||
42 | inputText= LineEdit1->text(); | 43 | inputText= LineEdit1->text(); |
43 | 44 | ||
44 | } | 45 | } |
45 | 46 | ||
47 | void InputDialog::browse() { | ||
48 | |||
49 | QString str = OFileDialog::getOpenFileName( 1,"/","", "playlist/plain", 0 ); | ||
50 | LineEdit1->setText(str); | ||
51 | } | ||
52 | |||
diff --git a/core/multimedia/opieplayer/inputDialog.h b/core/multimedia/opieplayer/inputDialog.h index 26d5cd0..3e3e36f 100644 --- a/core/multimedia/opieplayer/inputDialog.h +++ b/core/multimedia/opieplayer/inputDialog.h | |||
@@ -10,11 +10,9 @@ | |||
10 | #define INPUTDIALOG_H | 10 | #define INPUTDIALOG_H |
11 | 11 | ||
12 | #include <qvariant.h> | 12 | #include <qvariant.h> |
13 | #include <qdialog.h> | 13 | #include <qdialog.h> |
14 | class QVBoxLayout; | 14 | |
15 | class QHBoxLayout; | ||
16 | class QGridLayout; | ||
17 | class QLineEdit; | 15 | class QLineEdit; |
18 | 16 | ||
19 | class InputDialog : public QDialog | 17 | class InputDialog : public QDialog |
20 | { | 18 | { |
@@ -24,8 +22,9 @@ public: | |||
24 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 22 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
25 | ~InputDialog(); | 23 | ~InputDialog(); |
26 | QString inputText; | 24 | QString inputText; |
27 | QLineEdit* LineEdit1; | 25 | QLineEdit* LineEdit1; |
28 | 26 | protected slots: | |
27 | void browse(); | ||
29 | }; | 28 | }; |
30 | 29 | ||
31 | #endif // INPUTDIALOG_H | 30 | #endif // INPUTDIALOG_H |
diff --git a/core/multimedia/opieplayer/opieplayer.pro b/core/multimedia/opieplayer/opieplayer.pro index 4cef319..6409bab 100644 --- a/core/multimedia/opieplayer/opieplayer.pro +++ b/core/multimedia/opieplayer/opieplayer.pro | |||
@@ -9,9 +9,9 @@ SOURCES = main.cpp \ | |||
9 | videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp audiodevice.cpp inputDialog.cpp | 9 | videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp audiodevice.cpp inputDialog.cpp |
10 | TARGET = opieplayer | 10 | TARGET = opieplayer |
11 | INCLUDEPATH += $(OPIEDIR)/include | 11 | INCLUDEPATH += $(OPIEDIR)/include |
12 | DEPENDPATH += $(OPIEDIR)/include | 12 | DEPENDPATH += $(OPIEDIR)/include |
13 | LIBS += -lqpe -lpthread | 13 | LIBS += -lqpe -lpthread -lopie |
14 | 14 | ||
15 | # INTERFACES = | 15 | # INTERFACES = |
16 | # INCLUDEPATH += $(OPIEDIR)/include | 16 | # INCLUDEPATH += $(OPIEDIR)/include |
17 | # CONFIG+=static | 17 | # CONFIG+=static |
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 70b7cef..2118051 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -626,17 +626,8 @@ void PlayListWidget::saveList() { | |||
626 | // qDebug("saving playlist "+filename+".playlist"); | 626 | // qDebug("saving playlist "+filename+".playlist"); |
627 | Config cfg( filename +".playlist"); | 627 | Config cfg( filename +".playlist"); |
628 | writeConfig( cfg ); | 628 | writeConfig( cfg ); |
629 | 629 | ||
630 | // qDebug("same name so delete lnk??"); | ||
631 | // if( playLists->selected()->name() == filename) { | ||
632 | |||
633 | // qDebug("same name so delete lnk"); | ||
634 | // QFile().remove(playLists->selected()->file()); | ||
635 | // QFile().remove(playLists->selected()->linkFile()); | ||
636 | // playLists->reread(); | ||
637 | // } | ||
638 | // qDebug("new doclnk"); | ||
639 | DocLnk lnk; | 630 | DocLnk lnk; |
640 | // lnk.setComment( ""); | 631 | // lnk.setComment( ""); |
641 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property | 632 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property |
642 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D | 633 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D |
@@ -846,8 +837,9 @@ void PlayListWidget::btnPlay(bool b) { | |||
846 | mediaPlayerState->setPlaying(b); | 837 | mediaPlayerState->setPlaying(b); |
847 | d->selectedFiles->removeSelected( ); | 838 | d->selectedFiles->removeSelected( ); |
848 | tabWidget->setCurrentPage(1); | 839 | tabWidget->setCurrentPage(1); |
849 | d->selectedFiles->unSelect(); | 840 | d->selectedFiles->unSelect(); |
841 | insanityBool=FALSE; | ||
850 | // audioView->clearSelection(); | 842 | // audioView->clearSelection(); |
851 | } | 843 | } |
852 | break; | 844 | break; |
853 | case 2: | 845 | case 2: |
@@ -857,8 +849,9 @@ void PlayListWidget::btnPlay(bool b) { | |||
857 | qApp->processEvents(); | 849 | qApp->processEvents(); |
858 | d->selectedFiles->removeSelected( ); | 850 | d->selectedFiles->removeSelected( ); |
859 | tabWidget->setCurrentPage(2); | 851 | tabWidget->setCurrentPage(2); |
860 | d->selectedFiles->unSelect(); | 852 | d->selectedFiles->unSelect(); |
853 | insanityBool=FALSE; | ||
861 | // videoView->clearSelection(); | 854 | // videoView->clearSelection(); |
862 | } | 855 | } |
863 | break; | 856 | break; |
864 | }; | 857 | }; |
@@ -898,9 +891,9 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint& | |||
898 | 891 | ||
899 | void PlayListWidget::playSelected() | 892 | void PlayListWidget::playSelected() |
900 | { | 893 | { |
901 | btnPlay( TRUE); | 894 | btnPlay( TRUE); |
902 | d->selectedFiles->unSelect(); | 895 | // d->selectedFiles->unSelect(); |
903 | } | 896 | } |
904 | 897 | ||
905 | void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) | 898 | void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) |
906 | { | 899 | { |
@@ -1023,40 +1016,34 @@ void PlayListWidget::openFile() { | |||
1023 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 1016 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
1024 | fileDlg->exec(); | 1017 | fileDlg->exec(); |
1025 | if( fileDlg->result() == 1 ) { | 1018 | if( fileDlg->result() == 1 ) { |
1026 | filename = fileDlg->LineEdit1->text(); | 1019 | filename = fileDlg->LineEdit1->text(); |
1027 | |||
1028 | // InputDialog *fileDlg2; | ||
1029 | // fileDlg2 = new InputDialog(this,tr("Name"),TRUE, 0); | ||
1030 | // fileDlg2->exec(); | ||
1031 | // if( fileDlg2->result() == 1 ) { | ||
1032 | // name = fileDlg2->LineEdit1->text(); | ||
1033 | // } | ||
1034 | //http://205.188.234.129:8030 | 1020 | //http://205.188.234.129:8030 |
1035 | // http://66.28.68.70:8000 | 1021 | // http://66.28.68.70:8000 |
1036 | qDebug(filename); | 1022 | qDebug(filename); |
1037 | DocLnk lnk; | 1023 | if(filename.right(3) == "m3u") |
1038 | // if(filename.left(7) == "http://") | 1024 | readm3u( filename); |
1039 | // name= filename.right(filename.length()-filename.find("http://")-7); | 1025 | else if(filename.right(3) == "pls") |
1040 | // else name = filename; | 1026 | readPls( filename); |
1041 | // qDebug("name is "+name); | 1027 | else { |
1042 | // lnk.setComment(filename); | 1028 | DocLnk lnk; |
1043 | lnk.setName(filename); //sets file name | 1029 | |
1044 | if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") | 1030 | lnk.setName(filename); //sets file name |
1045 | filename += "/"; | 1031 | if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") |
1046 | lnk.setFile(filename); //sets File property | 1032 | filename += "/"; |
1047 | 1033 | lnk.setFile(filename); //sets File property | |
1048 | lnk.setType("audio/x-mpegurl"); | 1034 | |
1049 | lnk.setExec("opieplayer"); | 1035 | lnk.setType("audio/x-mpegurl"); |
1050 | lnk.setIcon("opieplayer/MPEGPlayer"); | 1036 | lnk.setExec("opieplayer"); |
1051 | 1037 | lnk.setIcon("opieplayer/MPEGPlayer"); | |
1052 | if(!lnk.writeLink()) | 1038 | |
1053 | qDebug("Writing doclink did not work"); | 1039 | if(!lnk.writeLink()) |
1054 | d->selectedFiles->addToSelection( lnk); | 1040 | qDebug("Writing doclink did not work"); |
1041 | d->selectedFiles->addToSelection( lnk); | ||
1055 | // if(fileDlg2) | 1042 | // if(fileDlg2) |
1056 | // delete fileDlg2; | 1043 | // delete fileDlg2; |
1044 | } | ||
1057 | } | 1045 | } |
1058 | |||
1059 | if(fileDlg) | 1046 | if(fileDlg) |
1060 | delete fileDlg; | 1047 | delete fileDlg; |
1061 | } | 1048 | } |
1062 | 1049 | ||
@@ -1104,4 +1091,16 @@ void PlayListWidget::doUnblank() { | |||
1104 | } | 1091 | } |
1105 | QCopEnvelope h("QPE/System", "setBacklight(int)"); | 1092 | QCopEnvelope h("QPE/System", "setBacklight(int)"); |
1106 | h <<-3;// v[1]; // -3 Force on | 1093 | h <<-3;// v[1]; // -3 Force on |
1107 | } | 1094 | } |
1095 | |||
1096 | void PlayListWidget::readm3u(const QString &filename) { | ||
1097 | |||
1098 | } | ||
1099 | |||
1100 | void PlayListWidget::writem3u(const QString &filename) { | ||
1101 | |||
1102 | } | ||
1103 | |||
1104 | void PlayListWidget::readPls(const QString &filename) { | ||
1105 | |||
1106 | } | ||
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h index f22770f..c07d4f8 100644 --- a/core/multimedia/opieplayer/playlistwidget.h +++ b/core/multimedia/opieplayer/playlistwidget.h | |||
@@ -71,9 +71,13 @@ protected: | |||
71 | void keyReleaseEvent( QKeyEvent *e); | 71 | void keyReleaseEvent( QKeyEvent *e); |
72 | private: | 72 | private: |
73 | void doBlank(); | 73 | void doBlank(); |
74 | void doUnblank(); | 74 | void doUnblank(); |
75 | 75 | void readm3u(const QString &); | |
76 | void writem3u(const QString &); | ||
77 | void readPls(const QString &); | ||
78 | |||
79 | |||
76 | void initializeStates(); | 80 | void initializeStates(); |
77 | void readConfig( Config& cfg ); | 81 | void readConfig( Config& cfg ); |
78 | void writeConfig( Config& cfg ) const; | 82 | void writeConfig( Config& cfg ) const; |
79 | PlayListWidgetPrivate *d; // Private implementation data | 83 | PlayListWidgetPrivate *d; // Private implementation data |
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp index 3bce996..97997f9 100644 --- a/core/multimedia/opieplayer/videowidget.cpp +++ b/core/multimedia/opieplayer/videowidget.cpp | |||
@@ -18,8 +18,10 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qpe/resource.h> | 20 | #include <qpe/resource.h> |
21 | #include <qpe/mediaplayerplugininterface.h> | 21 | #include <qpe/mediaplayerplugininterface.h> |
22 | #include <qpe/config.h> | ||
23 | |||
22 | #include <qwidget.h> | 24 | #include <qwidget.h> |
23 | #include <qpainter.h> | 25 | #include <qpainter.h> |
24 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
25 | #include <qslider.h> | 27 | #include <qslider.h> |
@@ -66,18 +68,27 @@ static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton)); | |||
66 | 68 | ||
67 | VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | 69 | VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : |
68 | QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | 70 | QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { |
69 | setCaption( tr("OpiePlayer") ); | 71 | setCaption( tr("OpiePlayer") ); |
70 | setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 72 | Config cfg("OpiePlayer"); |
71 | pixmaps[0] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButton0a" ) ); | 73 | cfg.setGroup("VideoWidget"); |
72 | pixmaps[1] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButton0b" ) ); | 74 | |
73 | pixmaps[2] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaControls0" ) ); | 75 | QString backgroundPix, Button0aPix, Button0bPix, controlsPix; |
76 | backgroundPix=cfg.readEntry( "backgroundPix", "opieplayer/metalFinish"); | ||
77 | Button0aPix=cfg.readEntry( "Button0aPix", "opieplayer/mediaButton0a"); | ||
78 | Button0bPix=cfg.readEntry( "Button0bPix","opieplayer/mediaButton0b"); | ||
79 | controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls0" ); | ||
80 | |||
81 | setBackgroundPixmap( Resource::loadPixmap( backgroundPix) ); | ||
82 | pixmaps[0] = new QPixmap( Resource::loadPixmap( Button0aPix ) ); | ||
83 | pixmaps[1] = new QPixmap( Resource::loadPixmap( Button0bPix ) ); | ||
84 | pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix) ); | ||
74 | currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 ); | 85 | currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 ); |
75 | 86 | ||
76 | slider = new QSlider( Qt::Horizontal, this ); | 87 | slider = new QSlider( Qt::Horizontal, this ); |
77 | slider->setMinValue( 0 ); | 88 | slider->setMinValue( 0 ); |
78 | slider->setMaxValue( 1 ); | 89 | slider->setMaxValue( 1 ); |
79 | slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); | 90 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); |
80 | slider->setFocusPolicy( QWidget::NoFocus ); | 91 | slider->setFocusPolicy( QWidget::NoFocus ); |
81 | slider->setGeometry( QRect( 7, 250, 220, 20 ) ); | 92 | slider->setGeometry( QRect( 7, 250, 220, 20 ) ); |
82 | 93 | ||
83 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); | 94 | connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); |