-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 24 | ||||
-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 | 45 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 21 |
8 files changed, 82 insertions, 53 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 @@ -20,4 +20,5 @@ #include <qpe/qpeapplication.h> #include <qpe/resource.h> +#include <qpe/config.h> #include <qwidget.h> @@ -66,14 +67,21 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : { setCaption( tr("OpiePlayer") ); - + Config cfg("OpiePlayer"); + cfg.setGroup("AudioWidget"); // QGridLayout *layout = new QGridLayout( this ); // layout->setSpacing( 2); // 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) ); songInfo = new Ticker( this ); @@ -87,5 +95,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : slider->setMinValue( 0 ); slider->setMaxValue( 1 ); - slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); + slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); slider->setFocusPolicy( QWidget::NoFocus ); slider->setGeometry( QRect( 7, 262, 220, 20 ) ); 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 @@ -123,4 +123,6 @@ signals: protected: + void doBlank(); + void doUnblank(); void paintEvent( QPaintEvent *pe ); void showEvent( QShowEvent *se ); @@ -131,5 +133,4 @@ protected: void closeEvent( QCloseEvent *event ); void keyReleaseEvent( QKeyEvent *e); - void showMe(); private: void toggleButton( int ); 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 @@ -9,17 +9,14 @@ #include "inputDialog.h" +#include <qpe/resource.h> + +#include <opie/ofiledialog.h> + #include <qlineedit.h> #include <qlayout.h> #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 ) : QDialog( parent, name, modal, fl ) @@ -27,10 +24,14 @@ InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags if ( !name ) 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 ) ); } @@ -44,2 +45,8 @@ 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 @@ -12,7 +12,5 @@ #include <qvariant.h> #include <qdialog.h> -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; + class QLineEdit; @@ -26,5 +24,6 @@ public: QString inputText; 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 @@ -11,5 +11,5 @@ TARGET = opieplayer INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lpthread +LIBS += -lqpe -lpthread -lopie # INTERFACES = 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 @@ -628,13 +628,4 @@ void PlayListWidget::saveList() { writeConfig( cfg ); -// 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; // lnk.setComment( ""); @@ -848,4 +839,5 @@ void PlayListWidget::btnPlay(bool b) { tabWidget->setCurrentPage(1); d->selectedFiles->unSelect(); + insanityBool=FALSE; // audioView->clearSelection(); } @@ -859,4 +851,5 @@ void PlayListWidget::btnPlay(bool b) { tabWidget->setCurrentPage(2); d->selectedFiles->unSelect(); + insanityBool=FALSE; // videoView->clearSelection(); } @@ -900,5 +893,5 @@ void PlayListWidget::playSelected() { btnPlay( TRUE); - d->selectedFiles->unSelect(); +// d->selectedFiles->unSelect(); } @@ -1025,20 +1018,14 @@ void PlayListWidget::openFile() { if( fileDlg->result() == 1 ) { 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 // http://66.28.68.70:8000 qDebug(filename); + if(filename.right(3) == "m3u") + readm3u( filename); + else if(filename.right(3) == "pls") + readPls( filename); + else { 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") @@ -1056,5 +1043,5 @@ void PlayListWidget::openFile() { // delete fileDlg2; } - + } if(fileDlg) delete fileDlg; @@ -1106,2 +1093,14 @@ void PlayListWidget::doUnblank() { h <<-3;// v[1]; // -3 Force on } + +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 @@ -73,4 +73,8 @@ private: void doBlank(); 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 @@ -20,4 +20,6 @@ #include <qpe/resource.h> #include <qpe/mediaplayerplugininterface.h> +#include <qpe/config.h> + #include <qwidget.h> #include <qpainter.h> @@ -68,8 +70,17 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { 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 ); @@ -77,5 +88,5 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : slider->setMinValue( 0 ); slider->setMaxValue( 1 ); - slider->setBackgroundPixmap( Resource::loadPixmap( "opieplayer/metalFinish" ) ); + slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); slider->setFocusPolicy( QWidget::NoFocus ); slider->setGeometry( QRect( 7, 250, 220, 20 ) ); |