author | llornkcor <llornkcor> | 2002-04-21 17:51:24 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-21 17:51:24 (UTC) |
commit | 53a4a3f6398640d182a067a8ffef9b402cd35d7a (patch) (unidiff) | |
tree | 3c989e5ebde8cab36d0a089aa6d63e5e017c86d8 /core/multimedia/opieplayer/playlistwidget.cpp | |
parent | 746afd0d27f33eed5451b54819773cf055858964 (diff) | |
download | opie-53a4a3f6398640d182a067a8ffef9b402cd35d7a.zip opie-53a4a3f6398640d182a067a8ffef9b402cd35d7a.tar.gz opie-53a4a3f6398640d182a067a8ffef9b402cd35d7a.tar.bz2 |
added f9= hide/show audio widget, f10= hide/show video widget, fixed laylist stuff, and fixed slier for the last time
Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 7c76400..faa6e3f 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -50,29 +50,33 @@ | |||
50 | #include <qpushbutton.h> | 50 | #include <qpushbutton.h> |
51 | #include <qregexp.h> | 51 | #include <qregexp.h> |
52 | 52 | ||
53 | //#include <qtimer.h> | 53 | //#include <qtimer.h> |
54 | 54 | ||
55 | #include "playlistselection.h" | 55 | #include "playlistselection.h" |
56 | #include "playlistwidget.h" | 56 | #include "playlistwidget.h" |
57 | #include "mediaplayerstate.h" | 57 | #include "mediaplayerstate.h" |
58 | 58 | ||
59 | #include "inputDialog.h" | 59 | #include "inputDialog.h" |
60 | 60 | ||
61 | #include <stdlib.h> | 61 | #include <stdlib.h> |
62 | #include "audiowidget.h" | ||
63 | #include "videowidget.h" | ||
62 | 64 | ||
63 | #define BUTTONS_ON_TOOLBAR | 65 | #define BUTTONS_ON_TOOLBAR |
64 | #define SIDE_BUTTONS | 66 | #define SIDE_BUTTONS |
65 | #define CAN_SAVE_LOAD_PLAYLISTS | 67 | #define CAN_SAVE_LOAD_PLAYLISTS |
66 | 68 | ||
69 | extern AudioWidget *audioUI; | ||
70 | extern VideoWidget *videoUI; | ||
67 | extern MediaPlayerState *mediaPlayerState; | 71 | extern MediaPlayerState *mediaPlayerState; |
68 | 72 | ||
69 | // class myFileSelector { | 73 | // class myFileSelector { |
70 | 74 | ||
71 | // }; | 75 | // }; |
72 | class PlayListWidgetPrivate { | 76 | class PlayListWidgetPrivate { |
73 | public: | 77 | public: |
74 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; | 78 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; |
75 | QFrame *playListFrame; | 79 | QFrame *playListFrame; |
76 | FileSelector *files; | 80 | FileSelector *files; |
77 | PlayListSelection *selectedFiles; | 81 | PlayListSelection *selectedFiles; |
78 | bool setDocumentUsed; | 82 | bool setDocumentUsed; |
@@ -192,25 +196,26 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
192 | // Add the playlist area | 196 | // Add the playlist area |
193 | 197 | ||
194 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); | 198 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); |
195 | d->playListFrame = vbox3; | 199 | d->playListFrame = vbox3; |
196 | d->playListFrame ->setMinimumSize(235,260); | 200 | d->playListFrame ->setMinimumSize(235,260); |
197 | 201 | ||
198 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); | 202 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); |
199 | 203 | ||
200 | d->selectedFiles = new PlayListSelection( hbox2); | 204 | d->selectedFiles = new PlayListSelection( hbox2); |
201 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); | 205 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); |
202 | 206 | ||
203 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); | 207 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); |
204 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 208 | |
209 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | ||
205 | this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); | 210 | this,SLOT( playlistViewPressed(int, QListViewItem *, const QPoint&, int)) ); |
206 | 211 | ||
207 | 212 | ||
208 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch | 213 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch |
209 | new ToolButton( vbox1, tr( "Move Up" ), "opieplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) ); | 214 | new ToolButton( vbox1, tr( "Move Up" ), "opieplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) ); |
210 | new ToolButton( vbox1, tr( "Remove" ), "opieplayer/cut", d->selectedFiles, SLOT(removeSelected()) ); | 215 | new ToolButton( vbox1, tr( "Remove" ), "opieplayer/cut", d->selectedFiles, SLOT(removeSelected()) ); |
211 | new ToolButton( vbox1, tr( "Move Down" ), "opieplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) ); | 216 | new ToolButton( vbox1, tr( "Move Down" ), "opieplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) ); |
212 | QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch | 217 | QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch |
213 | 218 | ||
214 | QWidget *aTab; | 219 | QWidget *aTab; |
215 | aTab = new QWidget( tabWidget, "aTab" ); | 220 | aTab = new QWidget( tabWidget, "aTab" ); |
216 | audioView = new QListView( aTab, "Audioview" ); | 221 | audioView = new QListView( aTab, "Audioview" ); |
@@ -731,25 +736,27 @@ void PlayListWidget::addSelected() { | |||
731 | tabWidget->setCurrentPage(0); | 736 | tabWidget->setCurrentPage(0); |
732 | } | 737 | } |
733 | break; | 738 | break; |
734 | }; | 739 | }; |
735 | } | 740 | } |
736 | 741 | ||
737 | void PlayListWidget::removeSelected() { | 742 | void PlayListWidget::removeSelected() { |
738 | d->selectedFiles->removeSelected( ); | 743 | d->selectedFiles->removeSelected( ); |
739 | } | 744 | } |
740 | 745 | ||
741 | void PlayListWidget::playIt( QListViewItem *it) { | 746 | void PlayListWidget::playIt( QListViewItem *it) { |
742 | // d->setDocumentUsed = FALSE; | 747 | // d->setDocumentUsed = FALSE; |
748 | mediaPlayerState->setPlaying(FALSE); | ||
743 | mediaPlayerState->setPlaying(TRUE); | 749 | mediaPlayerState->setPlaying(TRUE); |
750 | d->selectedFiles->unSelect(); | ||
744 | } | 751 | } |
745 | 752 | ||
746 | void PlayListWidget::addToSelection( QListViewItem *it) { | 753 | void PlayListWidget::addToSelection( QListViewItem *it) { |
747 | d->setDocumentUsed = FALSE; | 754 | d->setDocumentUsed = FALSE; |
748 | 755 | ||
749 | if(it) { | 756 | if(it) { |
750 | switch (tabWidget->currentPageIndex()) { | 757 | switch (tabWidget->currentPageIndex()) { |
751 | case 1: { | 758 | case 1: { |
752 | QListIterator<DocLnk> dit( files.children() ); | 759 | QListIterator<DocLnk> dit( files.children() ); |
753 | for ( ; dit.current(); ++dit ) { | 760 | for ( ; dit.current(); ++dit ) { |
754 | if( dit.current()->name() == it->text(0)) { | 761 | if( dit.current()->name() == it->text(0)) { |
755 | d->selectedFiles->addToSelection( **dit ); | 762 | d->selectedFiles->addToSelection( **dit ); |
@@ -871,30 +878,32 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint& | |||
871 | m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() )); | 878 | m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() )); |
872 | m.insertSeparator(); | 879 | m.insertSeparator(); |
873 | m.insertItem( tr( "Properties" ), this, SLOT( listDelete() )); | 880 | m.insertItem( tr( "Properties" ), this, SLOT( listDelete() )); |
874 | m.exec( QCursor::pos() ); | 881 | m.exec( QCursor::pos() ); |
875 | } | 882 | } |
876 | break; | 883 | break; |
877 | }; | 884 | }; |
878 | } | 885 | } |
879 | 886 | ||
880 | void PlayListWidget::playSelected() | 887 | void PlayListWidget::playSelected() |
881 | { | 888 | { |
882 | btnPlay( TRUE); | 889 | btnPlay( TRUE); |
890 | d->selectedFiles->unSelect(); | ||
883 | } | 891 | } |
884 | 892 | ||
885 | void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) | 893 | void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) |
886 | { | 894 | { |
887 | switch (mouse) { | 895 | switch (mouse) { |
888 | case 1: | 896 | case 1: |
897 | |||
889 | break; | 898 | break; |
890 | case 2:{ | 899 | case 2:{ |
891 | QPopupMenu m; | 900 | QPopupMenu m; |
892 | m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() )); | 901 | m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() )); |
893 | m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() )); | 902 | m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() )); |
894 | // m.insertSeparator(); | 903 | // m.insertSeparator(); |
895 | m.exec( QCursor::pos() ); | 904 | m.exec( QCursor::pos() ); |
896 | } | 905 | } |
897 | break; | 906 | break; |
898 | }; | 907 | }; |
899 | 908 | ||
900 | } | 909 | } |
@@ -1029,12 +1038,29 @@ void PlayListWidget::openFile() { | |||
1029 | lnk.setIcon("opieplayer/MPEGPlayer"); | 1038 | lnk.setIcon("opieplayer/MPEGPlayer"); |
1030 | 1039 | ||
1031 | if(!lnk.writeLink()) | 1040 | if(!lnk.writeLink()) |
1032 | qDebug("Writing doclink did not work"); | 1041 | qDebug("Writing doclink did not work"); |
1033 | d->selectedFiles->addToSelection( lnk); | 1042 | d->selectedFiles->addToSelection( lnk); |
1034 | // if(fileDlg2) | 1043 | // if(fileDlg2) |
1035 | // delete fileDlg2; | 1044 | // delete fileDlg2; |
1036 | } | 1045 | } |
1037 | 1046 | ||
1038 | if(fileDlg) | 1047 | if(fileDlg) |
1039 | delete fileDlg; | 1048 | delete fileDlg; |
1040 | } | 1049 | } |
1050 | |||
1051 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | ||
1052 | { | ||
1053 | switch ( e->key() ) { | ||
1054 | ////////////////////////////// Zaurus keys | ||
1055 | case Key_F9: //activity | ||
1056 | if(audioUI->isHidden()) | ||
1057 | audioUI->showMaximized(); | ||
1058 | break; | ||
1059 | case Key_F10: //contacts | ||
1060 | if( videoUI->isHidden()) | ||
1061 | videoUI->showMaximized(); | ||
1062 | |||
1063 | break; | ||
1064 | |||
1065 | } | ||
1066 | } | ||