summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index c0d3108..d53c423 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -58,4 +58,6 @@
extern MediaPlayerState *mediaPlayerState;
+QString audioMimes ="audio/mpeg;audio/x-wav;audio/x-ogg";
+// no m3u's here please
PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
@@ -206,5 +208,5 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) {
lnk.file().left(4) == "http" )
d->selectedFiles->addToSelection( lnk );
- writeCurrentM3u();
+// writeCurrentM3u();
}
else
@@ -253,5 +255,5 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoi
void PlayListWidget::addAllToList() {
DocLnkSet filesAll;
- Global::findDocuments(&filesAll, "video/*;audio/*");
+ Global::findDocuments(&filesAll, "video/*;"+audioMimes);
QListIterator<DocLnk> Adit( filesAll.children() );
for ( ; Adit.current(); ++Adit ) {
@@ -265,4 +267,6 @@ void PlayListWidget::addAllToList() {
void PlayListWidget::addAllMusicToList() {
+ if(!audioScan)
+ scanForAudio();
QListIterator<DocLnk> dit( files.children() );
for ( ; dit.current(); ++dit ) {
@@ -276,4 +280,6 @@ void PlayListWidget::addAllMusicToList() {
void PlayListWidget::addAllVideoToList() {
+ if(!videoScan)
+ scanForVideo();
QListIterator<DocLnk> dit( vFiles.children() );
for ( ; dit.current(); ++dit ) {
@@ -307,4 +313,6 @@ void PlayListWidget::setDocument( const QString& fileref ) {
clearList();
addToSelection( DocLnk( fileref ) );
+ writeCurrentM3u();
+
d->setDocumentUsed = TRUE;
mediaPlayerState->setPlaying( FALSE );
@@ -613,5 +621,5 @@ void PlayListWidget::scanForAudio() {
}
// Global::findDocuments( &files, "audio/*");
- Global::findDocuments( &files, "audio/mpeg;audio/x-wav;audio/x-ogg");
+ Global::findDocuments( &files, audioMimes);
audioScan = TRUE;
}
@@ -845,14 +853,15 @@ void PlayListWidget::writeCurrentM3u() {
cfg.setGroup("PlayList");
QString currentPlaylist = cfg.readEntry("CurrentPlaylist","");
- // int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
+
Om3u *m3uList;
- m3uList = new Om3u( currentPlaylist, IO_ReadWrite |IO_Truncate );
+ m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate );
d->selectedFiles->first();
-
+ qDebug( d->selectedFiles->current()->file());
do {
- m3uList->add( d->selectedFiles->current()->file());
+ qDebug( d->selectedFiles->current()->file());
+ m3uList->add( d->selectedFiles->current()->file() );
}
while ( d->selectedFiles->next() );
-// qDebug( list );
+ qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" );
m3uList->write();
m3uList->close();