summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistfileview.cpp16
-rw-r--r--noncore/multimedia/opieplayer2/playlistfileview.h13
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp25
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h2
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidgetgui.cpp5
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidgetgui.h4
6 files changed, 37 insertions, 28 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.cpp b/noncore/multimedia/opieplayer2/playlistfileview.cpp
index c4f93e7..2726296 100644
--- a/noncore/multimedia/opieplayer2/playlistfileview.cpp
+++ b/noncore/multimedia/opieplayer2/playlistfileview.cpp
@@ -1,11 +1,13 @@
#include "playlistfileview.h"
-PlayListFileView::PlayListFileView( QWidget *parent, const char *name )
- : PlayListView( parent, name )
+#include <qpe/global.h>
+
+PlayListFileView::PlayListFileView( const QString &mimeTypePattern, QWidget *parent, const char *name )
+ : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern )
{
addColumn( tr( "Title" ), 140);
addColumn( tr( "Size" ), -1 );
addColumn(tr( "Media" ), 0 );
addColumn(tr( "Path" ), -1 );
setColumnAlignment( 1, Qt::AlignRight );
@@ -17,8 +19,18 @@ PlayListFileView::PlayListFileView( QWidget *parent, const char *name )
}
PlayListFileView::~PlayListFileView()
{
}
+void PlayListFileView::scanFiles()
+{
+ m_files.detachChildren();
+ QListIterator<DocLnk> sdit( m_files.children() );
+ for ( ; sdit.current(); ++sdit )
+ delete sdit.current();
+
+ Global::findDocuments( &m_files, m_mimeTypePattern );
+}
+
/* vim: et sw=4 ts=4
*/
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.h b/noncore/multimedia/opieplayer2/playlistfileview.h
index eef4bd1..08db929 100644
--- a/noncore/multimedia/opieplayer2/playlistfileview.h
+++ b/noncore/multimedia/opieplayer2/playlistfileview.h
@@ -1,16 +1,27 @@
#ifndef PLAYLISTFILEVIEW_H
#define PLAYLISTFILEVIEW_H
#include "playlistview.h"
+#include <qpe/applnk.h>
+
class PlayListFileView : public PlayListView
{
Q_OBJECT
public:
- PlayListFileView( QWidget *parent, const char *name = 0 );
+ PlayListFileView( const QString &mimeTypePattern, QWidget *parent, const char *name = 0 );
virtual ~PlayListFileView();
+
+ DocLnkSet &files() { return m_files; }
+
+public slots:
+ void scanFiles();
+
+private:
+ QString m_mimeTypePattern;
+ DocLnkSet m_files;
};
#endif // PLAYLISTFILEVIEW_H
/* vim: et sw=4 ts=4
*/
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 6bda71e..93e7919 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -46,27 +46,25 @@
#include "playlistselection.h"
#include "playlistwidget.h"
#include "mediaplayerstate.h"
#include "inputDialog.h"
#include "om3u.h"
+#include "playlistfileview.h"
//only needed for the random play
#include <stdlib.h>
#include <assert.h>
#include "audiowidget.h"
#include "videowidget.h"
extern MediaPlayerState *mediaPlayerState;
// extern AudioWidget *audioUI;
// extern VideoWidget *videoUI;
-QString audioMimes ="audio/mpeg;audio/x-wav;audio/x-ogg";
-// no m3u's here please
-
PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name )
: PlayListWidgetGui( mediaPlayerState, parent, name ) {
d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ),
"opieplayer2/add_to_playlist",
this , SLOT(addSelected() ) );
@@ -636,45 +634,32 @@ void PlayListWidget::deletePlaylist() {
void PlayListWidget::playSelected() {
btnPlay( TRUE);
}
void PlayListWidget::scanForAudio() {
-// qDebug("scan for audio");
- files.detachChildren();
- QListIterator<DocLnk> sdit( files.children() );
- for ( ; sdit.current(); ++sdit ) {
- delete sdit.current();
- }
-// Global::findDocuments( &files, "audio/*");
- Global::findDocuments( &files, audioMimes);
+ audioView->scanFiles();
audioScan = true;
populateAudioView();
}
void PlayListWidget::scanForVideo() {
-// qDebug("scan for video");
- vFiles.detachChildren();
- QListIterator<DocLnk> sdit( vFiles.children() );
- for ( ; sdit.current(); ++sdit ) {
- delete sdit.current();
- }
- Global::findDocuments(&vFiles, "video/*");
+ videoView->scanFiles();
videoScan = true;
populateVideoView();
}
void PlayListWidget::populateAudioView() {
audioView->clear();
StorageInfo storageInfo;
// const QList<FileSystem> &fs = storageInfo.fileSystems();
if(!audioScan) {
scanForAudio();
}
- QListIterator<DocLnk> dit( files.children() );
+ QListIterator<DocLnk> dit( audioView->files().children() );
// QListIterator<FileSystem> it ( fs );
audioView->clear();
QString storage;
for ( ; dit.current(); ++dit ) {
// // for( ; it.current(); ++it ){
@@ -711,13 +696,13 @@ void PlayListWidget::populateVideoView() {
// const QList<FileSystem> &fs = storageInfo.fileSystems();
if(!videoScan ) {
scanForVideo();
}
- QListIterator<DocLnk> Vdit( vFiles.children() );
+ QListIterator<DocLnk> Vdit( videoView->files().children() );
// QListIterator<FileSystem> it ( fs );
videoView->clear();
QString storage, pathName;
for ( ; Vdit.current(); ++Vdit ) {
// // for( ; it.current(); ++it ) {
// const QString name = (*Vdit)->name();
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index 62d78a2..e81ef3c 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -131,14 +131,12 @@ private slots:
void tabChanged(QWidget*);
void viewPressed( int, QListViewItem *, const QPoint&, int);
void playlistViewPressed( int, QListViewItem *, const QPoint&, int);
void playSelected();
private:
- DocLnkSet files;
- DocLnkSet vFiles;
bool fromSetDocument;
bool insanityBool;
QString setDocFileRef, currentPlayList;
int selected;
};
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
index cfca5e3..a219cfd 100644
--- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
@@ -147,25 +147,26 @@ PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidg
QWidget *aTab;
aTab = new QWidget( tabWidget, "aTab" );
QGridLayout *Alayout = new QGridLayout( aTab );
Alayout->setSpacing( 2 );
Alayout->setMargin( 2 );
- audioView = new PlayListFileView( aTab, "Audioview" );
+ // no m3u's here please
+ audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;audio/x-ogg", aTab, "Audioview" );
Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 );
tabWidget->insertTab( aTab, tr( "Audio" ) );
QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold );
QWidget *vTab;
vTab = new QWidget( tabWidget, "vTab" );
QGridLayout *Vlayout = new QGridLayout( vTab );
Vlayout->setSpacing( 2 );
Vlayout->setMargin( 2 );
- videoView = new PlayListFileView( vTab, "Videoview" );
+ videoView = new PlayListFileView( "video/*", vTab, "Videoview" );
Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 );
QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold );
tabWidget->insertTab( vTab, tr( "Video" ) );
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.h b/noncore/multimedia/opieplayer2/playlistwidgetgui.h
index 9b5252a..0d8af43 100644
--- a/noncore/multimedia/opieplayer2/playlistwidgetgui.h
+++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.h
@@ -47,12 +47,13 @@
#include <qslider.h>
#include <qlcdnumber.h>
class PlayListWidgetPrivate;
class PlayListSelection;
class MediaPlayerState;
+class PlayListFileView;
class Config;
class QPEToolBar;
class QListViewItem;
class QListView;
class QPoint;
@@ -98,13 +99,14 @@ class PlayListWidgetGui : public QMainWindow {
public:
PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidget* parent=0, const char* name=0 );
~PlayListWidgetGui();
protected:
QTabWidget * tabWidget;
- QListView *audioView, *videoView, *playlistView;
+ PlayListFileView *audioView, *videoView;
+ QListView *playlistView;
QLabel *libString;
QPopupMenu *pmView ;
QPopupMenu *gammaMenu;
QSlider *gammaSlider;
QLCDNumber *gammaLCD;
bool fromSetDocument;