-rw-r--r-- | noncore/multimedia/opieplayer2/opie-mediaplayer2.control | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 26 |
2 files changed, 14 insertions, 14 deletions
diff --git a/noncore/multimedia/opieplayer2/opie-mediaplayer2.control b/noncore/multimedia/opieplayer2/opie-mediaplayer2.control index 3869b14..6825fb9 100644 --- a/noncore/multimedia/opieplayer2/opie-mediaplayer2.control +++ b/noncore/multimedia/opieplayer2/opie-mediaplayer2.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Files: bin/opieplayer2 pics/opieplayer2 apps/Applications/mediaplayer.desktop | 1 | Files: bin/opieplayer2 pics/opieplayer2 apps/Applications/mediaplayer.desktop |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/applications | 3 | Section: opie/applications |
4 | Maintainer: L.J.Potter <ljp@llornkcor.com> | 4 | Maintainer: L.J.Potter <ljp@llornkcor.com> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: $QPE_VERSION-$SUB_VERSION | 6 | Version: $QPE_VERSION-$SUB_VERSION |
7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) | 7 | Depends: opie-base ($QPE_VERSION), libopie ($QPE_VERSION) |
8 | Description: The Opie media player | 8 | Description: The Opie media player |
9 | The mediaplayer for Opie. It plays mp3, mpeg, wav, ogg, quicktime, divx and | 9 | The mediaplayer for Opie. It plays mp3, mpeg, wav, ogg, quicktime, divx and |
10 | more. Also it is streaming capable. | 10 | more. Also it is streaming capable. |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 83161ec..e33998f 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -84,92 +84,92 @@ public: | |||
84 | setFocusPolicy( QWidget::NoFocus ); | 84 | setFocusPolicy( QWidget::NoFocus ); |
85 | setToggleButton( t ); | 85 | setToggleButton( t ); |
86 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); | 86 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); |
87 | QPEMenuToolFocusManager::manager()->addWidget( this ); | 87 | QPEMenuToolFocusManager::manager()->addWidget( this ); |
88 | } | 88 | } |
89 | }; | 89 | }; |
90 | 90 | ||
91 | 91 | ||
92 | class MenuItem : public QAction { | 92 | class MenuItem : public QAction { |
93 | public: | 93 | public: |
94 | MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) | 94 | MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) |
95 | : QAction( text, QString::null, 0, 0 ) { | 95 | : QAction( text, QString::null, 0, 0 ) { |
96 | connect( this, SIGNAL( activated() ), handler, slot ); | 96 | connect( this, SIGNAL( activated() ), handler, slot ); |
97 | addTo( parent ); | 97 | addTo( parent ); |
98 | } | 98 | } |
99 | }; | 99 | }; |
100 | 100 | ||
101 | 101 | ||
102 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | 102 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) |
103 | : QMainWindow( parent, name, fl ) { | 103 | : QMainWindow( parent, name, fl ) { |
104 | 104 | ||
105 | d = new PlayListWidgetPrivate; | 105 | d = new PlayListWidgetPrivate; |
106 | d->setDocumentUsed = FALSE; | 106 | d->setDocumentUsed = FALSE; |
107 | d->current = NULL; | 107 | d->current = NULL; |
108 | fromSetDocument = FALSE; | 108 | fromSetDocument = FALSE; |
109 | insanityBool=FALSE; | 109 | insanityBool=FALSE; |
110 | audioScan = FALSE; | 110 | audioScan = FALSE; |
111 | videoScan = FALSE; | 111 | videoScan = FALSE; |
112 | 112 | ||
113 | setBackgroundMode( PaletteButton ); | 113 | setBackgroundMode( PaletteButton ); |
114 | 114 | ||
115 | setCaption( tr("OpiePlayer") ); | 115 | setCaption( tr("OpiePlayer") ); |
116 | setIcon( Resource::loadPixmap( "opieplayer/MPEGPlayer" ) ); | 116 | setIcon( Resource::loadPixmap( "opieplayer2/MPEGPlayer" ) ); |
117 | 117 | ||
118 | setToolBarsMovable( FALSE ); | 118 | setToolBarsMovable( FALSE ); |
119 | 119 | ||
120 | // Create Toolbar | 120 | // Create Toolbar |
121 | QPEToolBar *toolbar = new QPEToolBar( this ); | 121 | QPEToolBar *toolbar = new QPEToolBar( this ); |
122 | toolbar->setHorizontalStretchable( TRUE ); | 122 | toolbar->setHorizontalStretchable( TRUE ); |
123 | 123 | ||
124 | // Create Menubar | 124 | // Create Menubar |
125 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); | 125 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); |
126 | menu->setMargin( 0 ); | 126 | menu->setMargin( 0 ); |
127 | 127 | ||
128 | QPEToolBar *bar = new QPEToolBar( this ); | 128 | QPEToolBar *bar = new QPEToolBar( this ); |
129 | bar->setLabel( tr( "Play Operations" ) ); | 129 | bar->setLabel( tr( "Play Operations" ) ); |
130 | 130 | ||
131 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); | 131 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); |
132 | tbDeletePlaylist->setFlat(TRUE); | 132 | tbDeletePlaylist->setFlat(TRUE); |
133 | tbDeletePlaylist->setFixedSize(20,20); | 133 | tbDeletePlaylist->setFixedSize(20,20); |
134 | 134 | ||
135 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer/add_to_playlist", | 135 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer2/add_to_playlist", |
136 | this , SLOT(addSelected()) ); | 136 | this , SLOT(addSelected()) ); |
137 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer/remove_from_playlist", | 137 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer2/remove_from_playlist", |
138 | this , SLOT(removeSelected()) ); | 138 | this , SLOT(removeSelected()) ); |
139 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer/play", | 139 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", |
140 | this , SLOT( btnPlay(bool) ), TRUE ); | 140 | this , SLOT( btnPlay(bool) ), TRUE ); |
141 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer/shuffle", | 141 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", |
142 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); | 142 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); |
143 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer/loop", | 143 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer2/loop", |
144 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); | 144 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); |
145 | tbDeletePlaylist->hide(); | 145 | tbDeletePlaylist->hide(); |
146 | 146 | ||
147 | QPopupMenu *pmPlayList = new QPopupMenu( this ); | 147 | QPopupMenu *pmPlayList = new QPopupMenu( this ); |
148 | menu->insertItem( tr( "File" ), pmPlayList ); | 148 | menu->insertItem( tr( "File" ), pmPlayList ); |
149 | new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); | 149 | new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); |
150 | new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); | 150 | new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); |
151 | new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); | 151 | new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); |
152 | new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); | 152 | new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); |
153 | pmPlayList->insertSeparator(-1); | 153 | pmPlayList->insertSeparator(-1); |
154 | new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); | 154 | new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); |
155 | new MenuItem( pmPlayList, tr( "Export playlist to m3u" ), this, SLOT(writem3u() ) ); | 155 | new MenuItem( pmPlayList, tr( "Export playlist to m3u" ), this, SLOT(writem3u() ) ); |
156 | pmPlayList->insertSeparator(-1); | 156 | pmPlayList->insertSeparator(-1); |
157 | new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); | 157 | new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); |
158 | pmPlayList->insertSeparator(-1); | 158 | pmPlayList->insertSeparator(-1); |
159 | new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); | 159 | new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); |
160 | new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); | 160 | new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); |
161 | 161 | ||
162 | 162 | ||
163 | pmView = new QPopupMenu( this ); | 163 | pmView = new QPopupMenu( this ); |
164 | menu->insertItem( tr( "View" ), pmView ); | 164 | menu->insertItem( tr( "View" ), pmView ); |
165 | pmView->isCheckable(); | 165 | pmView->isCheckable(); |
166 | 166 | ||
167 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) ); | 167 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) ); |
168 | 168 | ||
169 | Config cfg( "OpiePlayer" ); | 169 | Config cfg( "OpiePlayer" ); |
170 | bool b= cfg.readBoolEntry("FullScreen", 0); | 170 | bool b= cfg.readBoolEntry("FullScreen", 0); |
171 | mediaPlayerState->setFullscreen( b ); | 171 | mediaPlayerState->setFullscreen( b ); |
172 | pmView->setItemChecked( -16, b ); | 172 | pmView->setItemChecked( -16, b ); |
173 | 173 | ||
174 | // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); | 174 | // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); |
175 | 175 | ||
@@ -178,67 +178,67 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
178 | skinsMenu = new QPopupMenu( this ); | 178 | skinsMenu = new QPopupMenu( this ); |
179 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 179 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
180 | skinsMenu->isCheckable(); | 180 | skinsMenu->isCheckable(); |
181 | populateSkinsMenu(); | 181 | populateSkinsMenu(); |
182 | 182 | ||
183 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); | 183 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); |
184 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); | 184 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); |
185 | 185 | ||
186 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); | 186 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); |
187 | 187 | ||
188 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 188 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
189 | // tabWidget->setTabShape(QTabWidget::Triangular); | 189 | // tabWidget->setTabShape(QTabWidget::Triangular); |
190 | 190 | ||
191 | QWidget *pTab; | 191 | QWidget *pTab; |
192 | pTab = new QWidget( tabWidget, "pTab" ); | 192 | pTab = new QWidget( tabWidget, "pTab" ); |
193 | tabWidget->insertTab( pTab,"Playlist"); | 193 | tabWidget->insertTab( pTab,"Playlist"); |
194 | 194 | ||
195 | 195 | ||
196 | // Add the playlist area | 196 | // Add the playlist area |
197 | 197 | ||
198 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); | 198 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); |
199 | d->playListFrame = vbox3; | 199 | d->playListFrame = vbox3; |
200 | d->playListFrame ->setMinimumSize(235,260); | 200 | d->playListFrame ->setMinimumSize(235,260); |
201 | 201 | ||
202 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); | 202 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); |
203 | 203 | ||
204 | d->selectedFiles = new PlayListSelection( hbox2); | 204 | d->selectedFiles = new PlayListSelection( hbox2); |
205 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); | 205 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); |
206 | 206 | ||
207 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); | 207 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); |
208 | 208 | ||
209 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch | 209 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch |
210 | new ToolButton( vbox1, tr( "Move Up" ), "opieplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) ); | 210 | new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) ); |
211 | new ToolButton( vbox1, tr( "Remove" ), "opieplayer/cut", d->selectedFiles, SLOT(removeSelected()) ); | 211 | new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", d->selectedFiles, SLOT(removeSelected()) ); |
212 | new ToolButton( vbox1, tr( "Move Down" ), "opieplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) ); | 212 | new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) ); |
213 | QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch | 213 | QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch |
214 | 214 | ||
215 | QWidget *aTab; | 215 | QWidget *aTab; |
216 | aTab = new QWidget( tabWidget, "aTab" ); | 216 | aTab = new QWidget( tabWidget, "aTab" ); |
217 | audioView = new QListView( aTab, "Audioview" ); | 217 | audioView = new QListView( aTab, "Audioview" ); |
218 | audioView->setMinimumSize(233,260); | 218 | audioView->setMinimumSize(233,260); |
219 | audioView->addColumn( tr("Title"),140); | 219 | audioView->addColumn( tr("Title"),140); |
220 | audioView->addColumn(tr("Size"), -1); | 220 | audioView->addColumn(tr("Size"), -1); |
221 | audioView->addColumn(tr("Media"),-1); | 221 | audioView->addColumn(tr("Media"),-1); |
222 | audioView->setColumnAlignment(1, Qt::AlignRight); | 222 | audioView->setColumnAlignment(1, Qt::AlignRight); |
223 | audioView->setColumnAlignment(2, Qt::AlignRight); | 223 | audioView->setColumnAlignment(2, Qt::AlignRight); |
224 | audioView->setAllColumnsShowFocus(TRUE); | 224 | audioView->setAllColumnsShowFocus(TRUE); |
225 | 225 | ||
226 | audioView->setMultiSelection( TRUE ); | 226 | audioView->setMultiSelection( TRUE ); |
227 | audioView->setSelectionMode( QListView::Extended); | 227 | audioView->setSelectionMode( QListView::Extended); |
228 | 228 | ||
229 | tabWidget->insertTab(aTab,tr("Audio")); | 229 | tabWidget->insertTab(aTab,tr("Audio")); |
230 | 230 | ||
231 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); | 231 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); |
232 | 232 | ||
233 | QWidget *vTab; | 233 | QWidget *vTab; |
234 | vTab = new QWidget( tabWidget, "vTab" ); | 234 | vTab = new QWidget( tabWidget, "vTab" ); |
235 | videoView = new QListView( vTab, "Videoview" ); | 235 | videoView = new QListView( vTab, "Videoview" ); |
236 | videoView->setMinimumSize(233,260); | 236 | videoView->setMinimumSize(233,260); |
237 | 237 | ||
238 | videoView->addColumn(tr("Title"),140); | 238 | videoView->addColumn(tr("Title"),140); |
239 | videoView->addColumn(tr("Size"),-1); | 239 | videoView->addColumn(tr("Size"),-1); |
240 | videoView->addColumn(tr("Media"),-1); | 240 | videoView->addColumn(tr("Media"),-1); |
241 | videoView->setColumnAlignment(1, Qt::AlignRight); | 241 | videoView->setColumnAlignment(1, Qt::AlignRight); |
242 | videoView->setColumnAlignment(2, Qt::AlignRight); | 242 | videoView->setColumnAlignment(2, Qt::AlignRight); |
243 | videoView->setAllColumnsShowFocus(TRUE); | 243 | videoView->setAllColumnsShowFocus(TRUE); |
244 | videoView->setMultiSelection( TRUE ); | 244 | videoView->setMultiSelection( TRUE ); |
@@ -554,65 +554,65 @@ bool PlayListWidget::first() { | |||
554 | if ( mediaPlayerState->playlist() ) | 554 | if ( mediaPlayerState->playlist() ) |
555 | return d->selectedFiles->first(); | 555 | return d->selectedFiles->first(); |
556 | else | 556 | else |
557 | return mediaPlayerState->looping(); | 557 | return mediaPlayerState->looping(); |
558 | } | 558 | } |
559 | 559 | ||
560 | 560 | ||
561 | bool PlayListWidget::last() { | 561 | bool PlayListWidget::last() { |
562 | if ( mediaPlayerState->playlist() ) | 562 | if ( mediaPlayerState->playlist() ) |
563 | return d->selectedFiles->last(); | 563 | return d->selectedFiles->last(); |
564 | else | 564 | else |
565 | return mediaPlayerState->looping(); | 565 | return mediaPlayerState->looping(); |
566 | } | 566 | } |
567 | 567 | ||
568 | 568 | ||
569 | void PlayListWidget::saveList() { | 569 | void PlayListWidget::saveList() { |
570 | 570 | ||
571 | QString filename; | 571 | QString filename; |
572 | InputDialog *fileDlg; | 572 | InputDialog *fileDlg; |
573 | fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0); | 573 | fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0); |
574 | fileDlg->exec(); | 574 | fileDlg->exec(); |
575 | if( fileDlg->result() == 1 ) { | 575 | if( fileDlg->result() == 1 ) { |
576 | if ( d->current ) | 576 | if ( d->current ) |
577 | delete d->current; | 577 | delete d->current; |
578 | filename = fileDlg->LineEdit1->text();//+".playlist"; | 578 | filename = fileDlg->LineEdit1->text();//+".playlist"; |
579 | // qDebug("saving playlist "+filename+".playlist"); | 579 | // qDebug("saving playlist "+filename+".playlist"); |
580 | Config cfg( filename +".playlist"); | 580 | Config cfg( filename +".playlist"); |
581 | writeConfig( cfg ); | 581 | writeConfig( cfg ); |
582 | 582 | ||
583 | DocLnk lnk; | 583 | DocLnk lnk; |
584 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property | 584 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property |
585 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D | 585 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D |
586 | lnk.setIcon("opieplayer/playlist2"); | 586 | lnk.setIcon("opieplayer2/playlist2"); |
587 | lnk.setName( filename); //sets file name | 587 | lnk.setName( filename); //sets file name |
588 | // qDebug(filename); | 588 | // qDebug(filename); |
589 | if(!lnk.writeLink()) { | 589 | if(!lnk.writeLink()) { |
590 | qDebug("Writing doclink did not work"); | 590 | qDebug("Writing doclink did not work"); |
591 | } | 591 | } |
592 | } | 592 | } |
593 | Config config( "OpiePlayer" ); | 593 | Config config( "OpiePlayer" ); |
594 | config.writeEntry("CurrentPlaylist",filename); | 594 | config.writeEntry("CurrentPlaylist",filename); |
595 | setCaption(tr("OpiePlayer: ")+filename); | 595 | setCaption(tr("OpiePlayer: ")+filename); |
596 | d->selectedFiles->first(); | 596 | d->selectedFiles->first(); |
597 | if(fileDlg) { | 597 | if(fileDlg) { |
598 | delete fileDlg; | 598 | delete fileDlg; |
599 | } | 599 | } |
600 | } | 600 | } |
601 | 601 | ||
602 | void PlayListWidget::loadList( const DocLnk & lnk) { | 602 | void PlayListWidget::loadList( const DocLnk & lnk) { |
603 | QString name= lnk.name(); | 603 | QString name= lnk.name(); |
604 | // qDebug("currentList is "+name); | 604 | // qDebug("currentList is "+name); |
605 | if( name.length()>1) { | 605 | if( name.length()>1) { |
606 | setCaption("OpiePlayer: "+name); | 606 | setCaption("OpiePlayer: "+name); |
607 | // qDebug("load list "+ name+".playlist"); | 607 | // qDebug("load list "+ name+".playlist"); |
608 | clearList(); | 608 | clearList(); |
609 | Config cfg( name+".playlist"); | 609 | Config cfg( name+".playlist"); |
610 | readConfig(cfg); | 610 | readConfig(cfg); |
611 | 611 | ||
612 | tabWidget->setCurrentPage(0); | 612 | tabWidget->setCurrentPage(0); |
613 | 613 | ||
614 | Config config( "OpiePlayer" ); | 614 | Config config( "OpiePlayer" ); |
615 | config.writeEntry("CurrentPlaylist", name); | 615 | config.writeEntry("CurrentPlaylist", name); |
616 | // d->selectedFiles->first(); | 616 | // d->selectedFiles->first(); |
617 | } | 617 | } |
618 | 618 | ||
@@ -894,118 +894,118 @@ void PlayListWidget::scanForVideo() { | |||
894 | vFiles.detachChildren(); | 894 | vFiles.detachChildren(); |
895 | QListIterator<DocLnk> sdit( vFiles.children() ); | 895 | QListIterator<DocLnk> sdit( vFiles.children() ); |
896 | for ( ; sdit.current(); ++sdit ) { | 896 | for ( ; sdit.current(); ++sdit ) { |
897 | delete sdit.current(); | 897 | delete sdit.current(); |
898 | } | 898 | } |
899 | Global::findDocuments(&vFiles, "video/*"); | 899 | Global::findDocuments(&vFiles, "video/*"); |
900 | videoScan = TRUE; | 900 | videoScan = TRUE; |
901 | } | 901 | } |
902 | 902 | ||
903 | void PlayListWidget::populateAudioView() { | 903 | void PlayListWidget::populateAudioView() { |
904 | 904 | ||
905 | audioView->clear(); | 905 | audioView->clear(); |
906 | StorageInfo storageInfo; | 906 | StorageInfo storageInfo; |
907 | const QList<FileSystem> &fs = storageInfo.fileSystems(); | 907 | const QList<FileSystem> &fs = storageInfo.fileSystems(); |
908 | if(!audioScan) scanForAudio(); | 908 | if(!audioScan) scanForAudio(); |
909 | 909 | ||
910 | QListIterator<DocLnk> dit( files.children() ); | 910 | QListIterator<DocLnk> dit( files.children() ); |
911 | QListIterator<FileSystem> it ( fs ); | 911 | QListIterator<FileSystem> it ( fs ); |
912 | 912 | ||
913 | QString storage; | 913 | QString storage; |
914 | for ( ; dit.current(); ++dit ) { | 914 | for ( ; dit.current(); ++dit ) { |
915 | for( ; it.current(); ++it ){ | 915 | for( ; it.current(); ++it ){ |
916 | const QString name = (*it)->name(); | 916 | const QString name = (*it)->name(); |
917 | const QString path = (*it)->path(); | 917 | const QString path = (*it)->path(); |
918 | if(dit.current()->file().find(path) != -1 ) storage=name; | 918 | if(dit.current()->file().find(path) != -1 ) storage=name; |
919 | } | 919 | } |
920 | 920 | ||
921 | QListViewItem * newItem; | 921 | QListViewItem * newItem; |
922 | if ( QFile( dit.current()->file()).exists() ) { | 922 | if ( QFile( dit.current()->file()).exists() ) { |
923 | // qDebug(dit.current()->name()); | 923 | // qDebug(dit.current()->name()); |
924 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), | 924 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), |
925 | QString::number( QFile( dit.current()->file()).size() ), storage); | 925 | QString::number( QFile( dit.current()->file()).size() ), storage); |
926 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" )); | 926 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/musicfile" )); |
927 | } | 927 | } |
928 | } | 928 | } |
929 | 929 | ||
930 | } | 930 | } |
931 | 931 | ||
932 | void PlayListWidget::populateVideoView() { | 932 | void PlayListWidget::populateVideoView() { |
933 | videoView->clear(); | 933 | videoView->clear(); |
934 | StorageInfo storageInfo; | 934 | StorageInfo storageInfo; |
935 | const QList<FileSystem> &fs = storageInfo.fileSystems(); | 935 | const QList<FileSystem> &fs = storageInfo.fileSystems(); |
936 | 936 | ||
937 | if(!videoScan ) scanForVideo(); | 937 | if(!videoScan ) scanForVideo(); |
938 | 938 | ||
939 | QListIterator<DocLnk> Vdit( vFiles.children() ); | 939 | QListIterator<DocLnk> Vdit( vFiles.children() ); |
940 | QListIterator<FileSystem> it ( fs ); | 940 | QListIterator<FileSystem> it ( fs ); |
941 | videoView->clear(); | 941 | videoView->clear(); |
942 | QString storage; | 942 | QString storage; |
943 | for ( ; Vdit.current(); ++Vdit ) { | 943 | for ( ; Vdit.current(); ++Vdit ) { |
944 | for( ; it.current(); ++it ){ | 944 | for( ; it.current(); ++it ){ |
945 | const QString name = (*it)->name(); | 945 | const QString name = (*it)->name(); |
946 | const QString path = (*it)->path(); | 946 | const QString path = (*it)->path(); |
947 | if( Vdit.current()->file().find(path) != -1 ) storage=name; | 947 | if( Vdit.current()->file().find(path) != -1 ) storage=name; |
948 | } | 948 | } |
949 | 949 | ||
950 | QListViewItem * newItem; | 950 | QListViewItem * newItem; |
951 | if ( QFile( Vdit.current()->file()).exists() ) { | 951 | if ( QFile( Vdit.current()->file()).exists() ) { |
952 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), | 952 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), |
953 | QString::number( QFile( Vdit.current()->file()).size() ), storage); | 953 | QString::number( QFile( Vdit.current()->file()).size() ), storage); |
954 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" )); | 954 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" )); |
955 | } | 955 | } |
956 | } | 956 | } |
957 | } | 957 | } |
958 | 958 | ||
959 | void PlayListWidget::openFile() { | 959 | void PlayListWidget::openFile() { |
960 | QString filename, name; | 960 | QString filename, name; |
961 | InputDialog *fileDlg; | 961 | InputDialog *fileDlg; |
962 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 962 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
963 | fileDlg->exec(); | 963 | fileDlg->exec(); |
964 | if( fileDlg->result() == 1 ) { | 964 | if( fileDlg->result() == 1 ) { |
965 | filename = fileDlg->LineEdit1->text(); | 965 | filename = fileDlg->LineEdit1->text(); |
966 | 966 | ||
967 | qDebug("Selected filename is "+filename); | 967 | qDebug("Selected filename is "+filename); |
968 | if(filename.right(3) == "m3u") { | 968 | if(filename.right(3) == "m3u") { |
969 | readm3u( filename ); | 969 | readm3u( filename ); |
970 | } else if(filename.right(3) == "pls") { | 970 | } else if(filename.right(3) == "pls") { |
971 | readPls( filename ); | 971 | readPls( filename ); |
972 | } else { | 972 | } else { |
973 | DocLnk lnk; | 973 | DocLnk lnk; |
974 | 974 | ||
975 | lnk.setName(filename); //sets file name | 975 | lnk.setName(filename); //sets file name |
976 | lnk.setFile(filename); //sets File property | 976 | lnk.setFile(filename); //sets File property |
977 | lnk.setType("audio/x-mpegurl"); | 977 | lnk.setType("audio/x-mpegurl"); |
978 | lnk.setExec("opieplayer"); | 978 | lnk.setExec("opieplayer"); |
979 | lnk.setIcon("opieplayer/MPEGPlayer"); | 979 | lnk.setIcon("opieplayer2/MPEGPlayer"); |
980 | 980 | ||
981 | if(!lnk.writeLink()) { | 981 | if(!lnk.writeLink()) { |
982 | qDebug("Writing doclink did not work"); | 982 | qDebug("Writing doclink did not work"); |
983 | } | 983 | } |
984 | d->selectedFiles->addToSelection( lnk); | 984 | d->selectedFiles->addToSelection( lnk); |
985 | } | 985 | } |
986 | } | 986 | } |
987 | if(fileDlg) { | 987 | if(fileDlg) { |
988 | delete fileDlg; | 988 | delete fileDlg; |
989 | } | 989 | } |
990 | } | 990 | } |
991 | 991 | ||
992 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | 992 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) |
993 | { | 993 | { |
994 | switch ( e->key() ) { | 994 | switch ( e->key() ) { |
995 | ////////////////////////////// Zaurus keys | 995 | ////////////////////////////// Zaurus keys |
996 | case Key_F9: //activity | 996 | case Key_F9: //activity |
997 | // if(audioUI->isHidden()) | 997 | // if(audioUI->isHidden()) |
998 | // audioUI->showMaximized(); | 998 | // audioUI->showMaximized(); |
999 | break; | 999 | break; |
1000 | case Key_F10: //contacts | 1000 | case Key_F10: //contacts |
1001 | // if( videoUI->isHidden()) | 1001 | // if( videoUI->isHidden()) |
1002 | // videoUI->showMaximized(); | 1002 | // videoUI->showMaximized(); |
1003 | break; | 1003 | break; |
1004 | case Key_F11: //menu | 1004 | case Key_F11: //menu |
1005 | break; | 1005 | break; |
1006 | case Key_F12: //home | 1006 | case Key_F12: //home |
1007 | // doBlank(); | 1007 | // doBlank(); |
1008 | break; | 1008 | break; |
1009 | case Key_F13: //mail | 1009 | case Key_F13: //mail |
1010 | // doUnblank(); | 1010 | // doUnblank(); |
1011 | break; | 1011 | break; |