summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp13
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h2
2 files changed, 2 insertions, 13 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index e754067..86b3424 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -74,51 +74,51 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par
74 d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", 74 d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play",
75 this , SLOT( btnPlay( bool) ), TRUE ); 75 this , SLOT( btnPlay( bool) ), TRUE );
76 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", 76 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle",
77 &mediaPlayerState, SLOT( setShuffled( bool ) ), TRUE ); 77 &mediaPlayerState, SLOT( setShuffled( bool ) ), TRUE );
78 d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", 78 d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop",
79 &mediaPlayerState, SLOT( setLooping( bool ) ), TRUE ); 79 &mediaPlayerState, SLOT( setLooping( bool ) ), TRUE );
80 80
81 (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); 81 (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) );
82 (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), 82 (void)new MenuItem( pmPlayList, tr( "Add all audio files" ),
83 this, SLOT( addAllMusicToList() ) ); 83 this, SLOT( addAllMusicToList() ) );
84 (void)new MenuItem( pmPlayList, tr( "Add all video files" ), 84 (void)new MenuItem( pmPlayList, tr( "Add all video files" ),
85 this, SLOT( addAllVideoToList() ) ); 85 this, SLOT( addAllVideoToList() ) );
86 (void)new MenuItem( pmPlayList, tr( "Add all files" ), 86 (void)new MenuItem( pmPlayList, tr( "Add all files" ),
87 this, SLOT( addAllToList() ) ); 87 this, SLOT( addAllToList() ) );
88 pmPlayList->insertSeparator(-1); 88 pmPlayList->insertSeparator(-1);
89// (void)new MenuItem( pmPlayList, tr( "Save PlayList" ), 89// (void)new MenuItem( pmPlayList, tr( "Save PlayList" ),
90// this, SLOT( saveList() ) ); 90// this, SLOT( saveList() ) );
91 (void)new MenuItem( pmPlayList, tr( "Save Playlist" ), 91 (void)new MenuItem( pmPlayList, tr( "Save Playlist" ),
92 this, SLOT(writem3u() ) ); 92 this, SLOT(writem3u() ) );
93 pmPlayList->insertSeparator(-1); 93 pmPlayList->insertSeparator(-1);
94 (void)new MenuItem( pmPlayList, tr( "Open File or URL" ), 94 (void)new MenuItem( pmPlayList, tr( "Open File or URL" ),
95 this,SLOT( openFile() ) ); 95 this,SLOT( openFile() ) );
96 pmPlayList->insertSeparator(-1); 96 pmPlayList->insertSeparator(-1);
97 (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), 97 (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ),
98 this,SLOT( scanForAudio() ) ); 98 audioView, SLOT( scanFiles() ) );
99 (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), 99 (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ),
100 this,SLOT( scanForVideo() ) ); 100 videoView, SLOT( scanFiles() ) );
101 101
102 pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), 102 pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"),
103 &mediaPlayerState, SLOT( toggleFullscreen() ) ); 103 &mediaPlayerState, SLOT( toggleFullscreen() ) );
104 104
105 Config cfg( "OpiePlayer" ); 105 Config cfg( "OpiePlayer" );
106 bool b= cfg.readBoolEntry("FullScreen", 0); 106 bool b= cfg.readBoolEntry("FullScreen", 0);
107 mediaPlayerState.setFullscreen( b ); 107 mediaPlayerState.setFullscreen( b );
108 pmView->setItemChecked( -16, b ); 108 pmView->setItemChecked( -16, b );
109 109
110 (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", 110 (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up",
111 d->selectedFiles, SLOT(moveSelectedUp() ) ); 111 d->selectedFiles, SLOT(moveSelectedUp() ) );
112 (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", 112 (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut",
113 d->selectedFiles, SLOT(removeSelected() ) ); 113 d->selectedFiles, SLOT(removeSelected() ) );
114 (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", 114 (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down",
115 d->selectedFiles, SLOT(moveSelectedDown() ) ); 115 d->selectedFiles, SLOT(moveSelectedDown() ) );
116 // QVBox *stretch2 = new QVBox( vbox1 ); 116 // QVBox *stretch2 = new QVBox( vbox1 );
117 117
118 connect( tbDeletePlaylist, ( SIGNAL( released() ) ), 118 connect( tbDeletePlaylist, ( SIGNAL( released() ) ),
119 SLOT( deletePlaylist() ) ); 119 SLOT( deletePlaylist() ) );
120 connect( pmView, SIGNAL( activated( int ) ), 120 connect( pmView, SIGNAL( activated( int ) ),
121 this, SLOT( pmViewActivated( int ) ) ); 121 this, SLOT( pmViewActivated( int ) ) );
122 connect( skinsMenu, SIGNAL( activated( int ) ) , 122 connect( skinsMenu, SIGNAL( activated( int ) ) ,
123 this, SLOT( skinsMenuActivated( int ) ) ); 123 this, SLOT( skinsMenuActivated( int ) ) );
124 connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ), 124 connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ),
@@ -596,57 +596,48 @@ void PlayListWidget::btnPlay(bool b) {
596// mediaPlayerState->setPlaying(false); 596// mediaPlayerState->setPlaying(false);
597 mediaPlayerState.setPlaying(b); 597 mediaPlayerState.setPlaying(b);
598 insanityBool=FALSE; 598 insanityBool=FALSE;
599} 599}
600 600
601void PlayListWidget::deletePlaylist() { 601void PlayListWidget::deletePlaylist() {
602 switch( QMessageBox::information( this, (tr("Remove Playlist?")), 602 switch( QMessageBox::information( this, (tr("Remove Playlist?")),
603 (tr("You really want to delete\nthis playlist?")), 603 (tr("You really want to delete\nthis playlist?")),
604 (tr("Yes")), (tr("No")), 0 )){ 604 (tr("Yes")), (tr("No")), 0 )){
605 case 0: // Yes clicked, 605 case 0: // Yes clicked,
606 QFile().remove(playLists->selectedDocument().file()); 606 QFile().remove(playLists->selectedDocument().file());
607 QFile().remove(playLists->selectedDocument().linkFile()); 607 QFile().remove(playLists->selectedDocument().linkFile());
608 playLists->reread(); 608 playLists->reread();
609 break; 609 break;
610 case 1: // Cancel 610 case 1: // Cancel
611 break; 611 break;
612 }; 612 };
613} 613}
614 614
615 615
616void PlayListWidget::playSelected() { 616void PlayListWidget::playSelected() {
617 btnPlay( TRUE); 617 btnPlay( TRUE);
618} 618}
619 619
620
621void PlayListWidget::scanForAudio() {
622 audioView->scanFiles();
623}
624
625void PlayListWidget::scanForVideo() {
626 videoView->scanFiles();
627}
628
629QListView *PlayListWidget::currentFileListView() const 620QListView *PlayListWidget::currentFileListView() const
630{ 621{
631 switch ( currentTab() ) { 622 switch ( currentTab() ) {
632 case AudioFiles: return audioView; 623 case AudioFiles: return audioView;
633 case VideoFiles: return videoView; 624 case VideoFiles: return videoView;
634 default: assert( false ); 625 default: assert( false );
635 } 626 }
636 return 0; 627 return 0;
637} 628}
638 629
639bool PlayListWidget::inFileListMode() const 630bool PlayListWidget::inFileListMode() const
640{ 631{
641 TabType tab = currentTab(); 632 TabType tab = currentTab();
642 return tab == AudioFiles || tab == VideoFiles; 633 return tab == AudioFiles || tab == VideoFiles;
643} 634}
644 635
645void PlayListWidget::openFile() { 636void PlayListWidget::openFile() {
646 // http://66.28.164.33:2080 637 // http://66.28.164.33:2080
647 // http://somafm.com/star0242.m3u 638 // http://somafm.com/star0242.m3u
648 QString filename, name; 639 QString filename, name;
649 InputDialog *fileDlg; 640 InputDialog *fileDlg;
650 fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); 641 fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0);
651 fileDlg->exec(); 642 fileDlg->exec();
652 if( fileDlg->result() == 1 ) { 643 if( fileDlg->result() == 1 ) {
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index 8c22f17..5c8f30c 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -87,50 +87,48 @@ public slots:
87 void writeDefaultPlaylist( ); 87 void writeDefaultPlaylist( );
88 QString currentFileListPathName() const; 88 QString currentFileListPathName() const;
89protected: 89protected:
90 void keyReleaseEvent( QKeyEvent *e); 90 void keyReleaseEvent( QKeyEvent *e);
91 91
92signals: 92signals:
93 void skinSelected(); 93 void skinSelected();
94 94
95private: 95private:
96 int defaultSkinIndex; 96 int defaultSkinIndex;
97 void readm3u(const QString &); 97 void readm3u(const QString &);
98 void readPls(const QString &); 98 void readPls(const QString &);
99 void initializeStates(); 99 void initializeStates();
100 100
101 QListView *currentFileListView() const; 101 QListView *currentFileListView() const;
102 102
103 bool inFileListMode() const; 103 bool inFileListMode() const;
104 104
105private slots: 105private slots:
106 void populateSkinsMenu(); 106 void populateSkinsMenu();
107 void skinsMenuActivated(int); 107 void skinsMenuActivated(int);
108 void pmViewActivated(int); 108 void pmViewActivated(int);
109 void writem3u(); 109 void writem3u();
110 void writeCurrentM3u(); 110 void writeCurrentM3u();
111 void scanForAudio();
112 void scanForVideo();
113 void openFile(); 111 void openFile();
114 void setDocument( const QString& fileref ); 112 void setDocument( const QString& fileref );
115 void addToSelection( const DocLnk& ); // Add a media file to the playlist 113 void addToSelection( const DocLnk& ); // Add a media file to the playlist
116 void addToSelection( QListViewItem* ); // Add a media file to the playlist 114 void addToSelection( QListViewItem* ); // Add a media file to the playlist
117 void clearList(); 115 void clearList();
118 void addAllToList(); 116 void addAllToList();
119 void addAllMusicToList(); 117 void addAllMusicToList();
120 void addAllVideoToList(); 118 void addAllVideoToList();
121 void saveList(); // Save the playlist 119 void saveList(); // Save the playlist
122 void loadList( const DocLnk &); // Load a playlist 120 void loadList( const DocLnk &); // Load a playlist
123 void playIt( QListViewItem *); 121 void playIt( QListViewItem *);
124 void btnPlay(bool); 122 void btnPlay(bool);
125 void deletePlaylist(); 123 void deletePlaylist();
126 void addSelected(); 124 void addSelected();
127 void removeSelected(); 125 void removeSelected();
128 void tabChanged(QWidget*); 126 void tabChanged(QWidget*);
129 void viewPressed( int, QListViewItem *, const QPoint&, int); 127 void viewPressed( int, QListViewItem *, const QPoint&, int);
130 void playlistViewPressed( int, QListViewItem *, const QPoint&, int); 128 void playlistViewPressed( int, QListViewItem *, const QPoint&, int);
131 void playSelected(); 129 void playSelected();
132 130
133private: 131private:
134 bool fromSetDocument; 132 bool fromSetDocument;
135 bool insanityBool; 133 bool insanityBool;
136 QString setDocFileRef, currentPlayList; 134 QString setDocFileRef, currentPlayList;