summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp26
-rw-r--r--core/multimedia/opieplayer/audiowidget.h3
-rw-r--r--core/multimedia/opieplayer/inputDialog.cpp29
-rw-r--r--core/multimedia/opieplayer/inputDialog.h7
-rw-r--r--core/multimedia/opieplayer/opieplayer.pro2
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp71
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h6
-rw-r--r--core/multimedia/opieplayer/videowidget.cpp21
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
@@ -21,2 +21,3 @@
#include <qpe/resource.h>
+#include <qpe/config.h>
@@ -67,3 +68,4 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
setCaption( tr("OpiePlayer") );
-
+ Config cfg("OpiePlayer");
+ cfg.setGroup("AudioWidget");
// QGridLayout *layout = new QGridLayout( this );
@@ -71,8 +73,14 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
// layout->setMargin( 2);
-
- setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) );
- pixmaps[0] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsAll" ) );
- pixmaps[1] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButtonsBig" ) );
- pixmaps[2] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaControls" ) );
- pixmaps[3] = new QPixmap( Resource::loadPixmap( "opieplayer/animatedButton" ) );
+ QString backgroundPix, buttonsAllPix, buttonsBigPix, controlsPix, animatedPix;
+ backgroundPix=cfg.readEntry( " backgroundPix", "opieplayer/metalFinish");
+ buttonsAllPix=cfg.readEntry( "buttonsAllPix","opieplayer/mediaButtonsAll");
+ buttonsBigPix=cfg.readEntry( "buttonsBigPix","opieplayer/mediaButtonsBig");
+ controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls");
+ animatedPix=cfg.readEntry( "animatedPix", "opieplayer/animatedButton");
+
+ setBackgroundPixmap( Resource::loadPixmap( backgroundPix) );
+ pixmaps[0] = new QPixmap( Resource::loadPixmap( buttonsAllPix ) );
+ pixmaps[1] = new QPixmap( Resource::loadPixmap( buttonsBigPix ) );
+ pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix ) );
+ pixmaps[3] = new QPixmap( Resource::loadPixmap( animatedPix) );
@@ -80,3 +88,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
songInfo->setFocusPolicy( QWidget::NoFocus );
- songInfo->setGeometry( QRect( 7, 3, 220, 20 ) );
+ songInfo->setGeometry( QRect( 7, 3, 220, 20 ) );
// layout->addMultiCellWidget( songInfo, 0, 0, 0, 2 );
@@ -88,3 +96,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
slider->setMaxValue( 1 );
- slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) );
+ slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) );
slider->setFocusPolicy( QWidget::NoFocus );
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
@@ -124,2 +124,4 @@ signals:
protected:
+ void doBlank();
+ void doUnblank();
void paintEvent( QPaintEvent *pe );
@@ -132,3 +134,2 @@ protected:
void keyReleaseEvent( QKeyEvent *e);
- void showMe();
private:
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
@@ -10,2 +10,6 @@
+#include <qpe/resource.h>
+
+#include <opie/ofiledialog.h>
+
#include <qlineedit.h>
@@ -13,12 +17,5 @@
#include <qvariant.h>
-#include <qtooltip.h>
+#include <qpushbutton.h>
#include <qwhatsthis.h>
-/*
- * Constructs a InputDialog which is a child of 'parent', with the
- * name 'name' and widget flags set to 'f'
- *
- * The dialog will by default be modeless, unless you set 'modal' to
- * TRUE to construct a modal dialog.
- */
InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
@@ -28,8 +25,12 @@ InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags
setName( "InputDialog" );
- resize( 234, 50 );
- setMaximumSize( QSize( 240, 50 ) );
+ resize( 234, 115);
+ setMaximumSize( QSize( 240, 40));
setCaption( tr(name ) );
+ QPushButton *browserButton;
+ browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton");
+ browserButton->setGeometry( QRect( 205, 10, 22, 22));
+ connect( browserButton, SIGNAL(released()),this,SLOT(browse()));
LineEdit1 = new QLineEdit( this, "LineEdit1" );
- LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) );
+ LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) );
}
@@ -45 +46,7 @@ InputDialog::~InputDialog()
+void InputDialog::browse() {
+
+ QString str = OFileDialog::getOpenFileName( 1,"/","", "playlist/plain", 0 );
+ LineEdit1->setText(str);
+}
+
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
@@ -13,5 +13,3 @@
#include <qdialog.h>
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
+
class QLineEdit;
@@ -27,3 +25,4 @@ public:
QLineEdit* LineEdit1;
-
+protected slots:
+ void browse();
};
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
@@ -12,3 +12,3 @@ INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lpthread
+LIBS += -lqpe -lpthread -lopie
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
@@ -629,11 +629,2 @@ void PlayListWidget::saveList() {
-// qDebug("same name so delete lnk??");
-// if( playLists->selected()->name() == filename) {
-
-// qDebug("same name so delete lnk");
-// QFile().remove(playLists->selected()->file());
-// QFile().remove(playLists->selected()->linkFile());
-// playLists->reread();
-// }
-// qDebug("new doclnk");
DocLnk lnk;
@@ -849,2 +840,3 @@ void PlayListWidget::btnPlay(bool b) {
d->selectedFiles->unSelect();
+ insanityBool=FALSE;
// audioView->clearSelection();
@@ -860,2 +852,3 @@ void PlayListWidget::btnPlay(bool b) {
d->selectedFiles->unSelect();
+ insanityBool=FALSE;
// videoView->clearSelection();
@@ -901,3 +894,3 @@ void PlayListWidget::playSelected()
btnPlay( TRUE);
- d->selectedFiles->unSelect();
+// d->selectedFiles->unSelect();
}
@@ -1026,9 +1019,2 @@ void PlayListWidget::openFile() {
filename = fileDlg->LineEdit1->text();
-
-// InputDialog *fileDlg2;
-// fileDlg2 = new InputDialog(this,tr("Name"),TRUE, 0);
-// fileDlg2->exec();
-// if( fileDlg2->result() == 1 ) {
-// name = fileDlg2->LineEdit1->text();
-// }
//http://205.188.234.129:8030
@@ -1036,24 +1022,25 @@ void PlayListWidget::openFile() {
qDebug(filename);
- DocLnk lnk;
-// if(filename.left(7) == "http://")
-// name= filename.right(filename.length()-filename.find("http://")-7);
-// else name = filename;
-// qDebug("name is "+name);
-// lnk.setComment(filename);
- lnk.setName(filename); //sets file name
- if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3")
- filename += "/";
- lnk.setFile(filename); //sets File property
-
- lnk.setType("audio/x-mpegurl");
- lnk.setExec("opieplayer");
- lnk.setIcon("opieplayer/MPEGPlayer");
-
- if(!lnk.writeLink())
- qDebug("Writing doclink did not work");
- d->selectedFiles->addToSelection( lnk);
+ if(filename.right(3) == "m3u")
+ readm3u( filename);
+ else if(filename.right(3) == "pls")
+ readPls( filename);
+ else {
+ DocLnk lnk;
+
+ lnk.setName(filename); //sets file name
+ if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3")
+ filename += "/";
+ lnk.setFile(filename); //sets File property
+
+ lnk.setType("audio/x-mpegurl");
+ lnk.setExec("opieplayer");
+ lnk.setIcon("opieplayer/MPEGPlayer");
+
+ if(!lnk.writeLink())
+ qDebug("Writing doclink did not work");
+ d->selectedFiles->addToSelection( lnk);
// if(fileDlg2)
// delete fileDlg2;
+ }
}
-
if(fileDlg)
@@ -1107 +1094,13 @@ void PlayListWidget::doUnblank() {
}
+
+void PlayListWidget::readm3u(const QString &filename) {
+
+}
+
+void PlayListWidget::writem3u(const QString &filename) {
+
+}
+
+void PlayListWidget::readPls(const QString &filename) {
+
+}
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
@@ -74,3 +74,7 @@ private:
void doUnblank();
-
+ void readm3u(const QString &);
+ void writem3u(const QString &);
+ void readPls(const QString &);
+
+
void initializeStates();
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
@@ -21,2 +21,4 @@
#include <qpe/mediaplayerplugininterface.h>
+#include <qpe/config.h>
+
#include <qwidget.h>
@@ -69,6 +71,15 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
setCaption( tr("OpiePlayer") );
- setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) );
- pixmaps[0] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButton0a" ) );
- pixmaps[1] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaButton0b" ) );
- pixmaps[2] = new QPixmap( Resource::loadPixmap( "opieplayer/mediaControls0" ) );
+ Config cfg("OpiePlayer");
+ cfg.setGroup("VideoWidget");
+
+ QString backgroundPix, Button0aPix, Button0bPix, controlsPix;
+ backgroundPix=cfg.readEntry( "backgroundPix", "opieplayer/metalFinish");
+ Button0aPix=cfg.readEntry( "Button0aPix", "opieplayer/mediaButton0a");
+ Button0bPix=cfg.readEntry( "Button0bPix","opieplayer/mediaButton0b");
+ controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls0" );
+
+ setBackgroundPixmap( Resource::loadPixmap( backgroundPix) );
+ pixmaps[0] = new QPixmap( Resource::loadPixmap( Button0aPix ) );
+ pixmaps[1] = new QPixmap( Resource::loadPixmap( Button0bPix ) );
+ pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix) );
currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 );
@@ -78,3 +89,3 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
slider->setMaxValue( 1 );
- slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) );
+ slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) );
slider->setFocusPolicy( QWidget::NoFocus );