summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.cpp4
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp12
2 files changed, 8 insertions, 8 deletions
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp
index a960c49..4e14436 100644
--- a/core/multimedia/opieplayer/mediaplayerstate.cpp
+++ b/core/multimedia/opieplayer/mediaplayerstate.cpp
@@ -29,40 +29,40 @@
29 29
30 30
31#ifdef QT_NO_COMPONENT 31#ifdef QT_NO_COMPONENT
32// Plugins which are compiled in when no plugin architecture available 32// Plugins which are compiled in when no plugin architecture available
33#include "libmad/libmadpluginimpl.h" 33#include "libmad/libmadpluginimpl.h"
34#include "libmpeg3/libmpeg3pluginimpl.h" 34#include "libmpeg3/libmpeg3pluginimpl.h"
35#include "wavplugin/wavpluginimpl.h" 35#include "wavplugin/wavpluginimpl.h"
36#endif 36#endif
37 37
38 38
39//#define MediaPlayerDebug(x) qDebug x 39//#define MediaPlayerDebug(x) qDebug x
40#define MediaPlayerDebug(x) 40#define MediaPlayerDebug(x)
41 41
42 42
43MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) 43MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
44 : QObject( parent, name ), decoder( NULL ), libmpeg3decoder( NULL ) { 44 : QObject( parent, name ), decoder( NULL ), libmpeg3decoder( NULL ) {
45 Config cfg( "MediaPlayer" ); 45 Config cfg( "OpiePlayer" );
46 readConfig( cfg ); 46 readConfig( cfg );
47 loadPlugins(); 47 loadPlugins();
48} 48}
49 49
50 50
51MediaPlayerState::~MediaPlayerState() { 51MediaPlayerState::~MediaPlayerState() {
52 Config cfg( "MediaPlayer" ); 52 Config cfg( "OpiePlayer" );
53 writeConfig( cfg ); 53 writeConfig( cfg );
54} 54}
55 55
56 56
57void MediaPlayerState::readConfig( Config& cfg ) { 57void MediaPlayerState::readConfig( Config& cfg ) {
58 cfg.setGroup("Options"); 58 cfg.setGroup("Options");
59 isFullscreen = cfg.readBoolEntry( "FullScreen" ); 59 isFullscreen = cfg.readBoolEntry( "FullScreen" );
60 isScaled = cfg.readBoolEntry( "Scaling" ); 60 isScaled = cfg.readBoolEntry( "Scaling" );
61 isLooping = cfg.readBoolEntry( "Looping" ); 61 isLooping = cfg.readBoolEntry( "Looping" );
62 isShuffled = cfg.readBoolEntry( "Shuffle" ); 62 isShuffled = cfg.readBoolEntry( "Shuffle" );
63 usePlaylist = cfg.readBoolEntry( "UsePlayList" ); 63 usePlaylist = cfg.readBoolEntry( "UsePlayList" );
64 usePlaylist = TRUE; 64 usePlaylist = TRUE;
65 isPlaying = FALSE; 65 isPlaying = FALSE;
66 isPaused = FALSE; 66 isPaused = FALSE;
67 curPosition = 0; 67 curPosition = 0;
68 curLength = 0; 68 curLength = 0;
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 4b1ff22..218fd49 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -276,45 +276,45 @@ populateVideoView();
276// connect( videoView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( fauxPlay( QListViewItem *) ) ); 276// connect( videoView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( fauxPlay( QListViewItem *) ) );
277 277
278 connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); 278 connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) );
279 connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) ); 279 connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) );
280 280
281 connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*))); 281 connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*)));
282 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); 282 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) );
283 connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) ); 283 connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) );
284 connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); 284 connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) );
285 connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); 285 connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) );
286 286
287 connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); 287 connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) );
288// connect( d->selectedFiles, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) ); 288// connect( d->selectedFiles, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) );
289 289
290 setCentralWidget( vbox5 ); 290 setCentralWidget( vbox5 );
291 291
292 Config cfg( "MediaPlayer" ); 292 Config cfg( "OpiePlayer" );
293 readConfig( cfg ); 293 readConfig( cfg );
294 QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); 294 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","");
295// qDebug("currentList is "+currentPlaylist); 295// qDebug("currentList is "+currentPlaylist);
296 loadList(DocLnk( currentPlaylist)); 296 loadList(DocLnk( currentPlaylist));
297 setCaption(tr("OpiePlayer: ")+ currentPlaylist ); 297 setCaption(tr("OpiePlayer: ")+ currentPlaylist );
298 298
299 initializeStates(); 299 initializeStates();
300} 300}
301 301
302 302
303PlayListWidget::~PlayListWidget() { 303PlayListWidget::~PlayListWidget() {
304 Config cfg( "MediaPlayer" ); 304 Config cfg( "OpiePlayer" );
305 writeConfig( cfg ); 305 writeConfig( cfg );
306 306
307 307
308 if ( d->current ) 308 if ( d->current )
309 delete d->current; 309 delete d->current;
310 delete d; 310 delete d;
311} 311}
312 312
313 313
314void PlayListWidget::initializeStates() { 314void PlayListWidget::initializeStates() {
315 315
316 d->tbPlay->setOn( mediaPlayerState->playing() ); 316 d->tbPlay->setOn( mediaPlayerState->playing() );
317 d->tbLoop->setOn( mediaPlayerState->looping() ); 317 d->tbLoop->setOn( mediaPlayerState->looping() );
318 d->tbShuffle->setOn( mediaPlayerState->shuffled() ); 318 d->tbShuffle->setOn( mediaPlayerState->shuffled() );
319// d->tbFull->setOn( mediaPlayerState->fullscreen() ); 319// d->tbFull->setOn( mediaPlayerState->fullscreen() );
320// d->tbScale->setOn( mediaPlayerState->scaled() ); 320// d->tbScale->setOn( mediaPlayerState->scaled() );
@@ -612,76 +612,76 @@ void PlayListWidget::saveList() {
612// qDebug("same name so delete lnk"); 612// qDebug("same name so delete lnk");
613// QFile().remove(playLists->selected()->file()); 613// QFile().remove(playLists->selected()->file());
614// QFile().remove(playLists->selected()->linkFile()); 614// QFile().remove(playLists->selected()->linkFile());
615// playLists->reread(); 615// playLists->reread();
616// } 616// }
617// qDebug("new doclnk"); 617// qDebug("new doclnk");
618 DocLnk lnk; 618 DocLnk lnk;
619// lnk.setComment( ""); 619// lnk.setComment( "");
620 lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property 620 lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property
621 lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D 621 lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D
622 lnk.setIcon("mpegplayer/playlist2"); 622 lnk.setIcon("mpegplayer/playlist2");
623 lnk.setName( filename); //sets file name 623 lnk.setName( filename); //sets file name
624// qDebug(filename); 624// qDebug(filename);
625 if(!lnk.writeLink()) 625 if(!lnk.writeLink())
626 qDebug("Writing doclink did not work"); 626 qDebug("Writing doclink did not work");
627 } 627 }
628 Config config( "MediaPlayer" ); 628 Config config( "OpiePlayer" );
629 config.writeEntry("CurrentPlaylist",filename); 629 config.writeEntry("CurrentPlaylist",filename);
630 setCaption(tr("OpiePlayer: ")+filename); 630 setCaption(tr("OpiePlayer: ")+filename);
631 d->selectedFiles->first(); 631 d->selectedFiles->first();
632 if(fileDlg) 632 if(fileDlg)
633 delete fileDlg; 633 delete fileDlg;
634} 634}
635 635
636void PlayListWidget::loadList( const DocLnk & lnk) { 636void PlayListWidget::loadList( const DocLnk & lnk) {
637 QString name= lnk.name(); 637 QString name= lnk.name();
638// qDebug("currentList is "+name); 638// qDebug("currentList is "+name);
639 if( name.length()>1) { 639 if( name.length()>1) {
640 setCaption("OpiePlayer: "+name); 640 setCaption("OpiePlayer: "+name);
641// qDebug("load list "+ name+".playlist"); 641// qDebug("load list "+ name+".playlist");
642 clearList(); 642 clearList();
643 Config cfg( name+".playlist"); 643 Config cfg( name+".playlist");
644 readConfig(cfg); 644 readConfig(cfg);
645 645
646 tabWidget->setCurrentPage(0); 646 tabWidget->setCurrentPage(0);
647 647
648 Config config( "MediaPlayer" ); 648 Config config( "OpiePlayer" );
649 config.writeEntry("CurrentPlaylist", name); 649 config.writeEntry("CurrentPlaylist", name);
650// d->selectedFiles->first(); 650// d->selectedFiles->first();
651 } 651 }
652 652
653} 653}
654 654
655void PlayListWidget::setPlaylist( bool shown ) { 655void PlayListWidget::setPlaylist( bool shown ) {
656 if ( shown ) 656 if ( shown )
657 d->playListFrame->show(); 657 d->playListFrame->show();
658 else 658 else
659 d->playListFrame->hide(); 659 d->playListFrame->hide();
660} 660}
661 661
662void PlayListWidget::setView( char view ) { 662void PlayListWidget::setView( char view ) {
663 if ( view == 'l' ) 663 if ( view == 'l' )
664 showMaximized(); 664 showMaximized();
665 else 665 else
666 hide(); 666 hide();
667} 667}
668 668
669void PlayListWidget::addSelected() { 669void PlayListWidget::addSelected() {
670 670
671 Config cfg( "MediaPlayer" ); 671 Config cfg( "OpiePlayer" );
672 cfg.setGroup("PlayList"); 672 cfg.setGroup("PlayList");
673 QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); 673 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","");
674 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); 674 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
675 675
676 switch (tabWidget->currentPageIndex()) { 676 switch (tabWidget->currentPageIndex()) {
677 case 0: //playlist 677 case 0: //playlist
678 break; 678 break;
679 case 1: { //audio 679 case 1: { //audio
680 for ( int i = 0; i < noOfFiles; i++ ) { 680 for ( int i = 0; i < noOfFiles; i++ ) {
681 QString entryName; 681 QString entryName;
682 entryName.sprintf( "File%i", i + 1 ); 682 entryName.sprintf( "File%i", i + 1 );
683 QString linkFile = cfg.readEntry( entryName ); 683 QString linkFile = cfg.readEntry( entryName );
684 if( DocLnk( linkFile).name() == audioView->selectedItem()->text(0) ) { 684 if( DocLnk( linkFile).name() == audioView->selectedItem()->text(0) ) {
685 int result= QMessageBox::warning(this,tr("OpiePlayer"), 685 int result= QMessageBox::warning(this,tr("OpiePlayer"),
686 tr("This is all ready in your playlist.\nContinue?"), 686 tr("This is all ready in your playlist.\nContinue?"),
687 tr("Yes"),tr("No"),0,0,1); 687 tr("Yes"),tr("No"),0,0,1);
@@ -866,33 +866,33 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const
866 switch (mouse) { 866 switch (mouse) {
867 case 1: 867 case 1:
868 break; 868 break;
869 case 2:{ 869 case 2:{
870 QPopupMenu m; 870 QPopupMenu m;
871 m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() )); 871 m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() ));
872 m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() )); 872 m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() ));
873// m.insertSeparator(); 873// m.insertSeparator();
874 m.exec( QCursor::pos() ); 874 m.exec( QCursor::pos() );
875 } 875 }
876 break; 876 break;
877 }; 877 };
878 878
879} 879}
880 880
881void PlayListWidget::listDelete() { 881void PlayListWidget::listDelete() {
882 Config cfg( "MediaPlayer" ); 882 Config cfg( "OpiePlayer" );
883 cfg.setGroup("PlayList"); 883 cfg.setGroup("PlayList");
884 QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); 884 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","");
885 QString file; 885 QString file;
886 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); 886 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
887 switch ( tabWidget->currentPageIndex()) { 887 switch ( tabWidget->currentPageIndex()) {
888 case 0: 888 case 0:
889 break; 889 break;
890 case 1: 890 case 1:
891 { 891 {
892 file = audioView->selectedItem()->text(0); 892 file = audioView->selectedItem()->text(0);
893// Global::findDocuments(&files, "audio/*"); 893// Global::findDocuments(&files, "audio/*");
894// AppLnkSet appFiles; 894// AppLnkSet appFiles;
895 QListIterator<DocLnk> dit( files.children() ); 895 QListIterator<DocLnk> dit( files.children() );
896 for ( ; dit.current(); ++dit ) { 896 for ( ; dit.current(); ++dit ) {
897 if( dit.current()->name() == file) { 897 if( dit.current()->name() == file) {
898// qDebug(file); 898// qDebug(file);