00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include <qtoolbar.h>
00035 #include <qpe/qpeapplication.h>
00036
00037 #include <qlayout.h>
00038 #include <qmenubar.h>
00039
00040 #include "playlistselection.h"
00041 #include "playlistwidget.h"
00042 #include "mediaplayerstate.h"
00043 #include "inputDialog.h"
00044 #include "playlistfileview.h"
00045
00046
00047 PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name )
00048 : QMainWindow( parent, name ) {
00049
00050 d = new PlayListWidgetPrivate;
00051 d->setDocumentUsed = FALSE;
00052
00053 setBackgroundMode( PaletteButton );
00054 setToolBarsMovable( FALSE );
00055
00056
00057 QToolBar *toolbar = new QToolBar( this );
00058 toolbar->setHorizontalStretchable( TRUE );
00059
00060
00061 QMenuBar *menu = new QMenuBar( toolbar );
00062 menu->setMargin( 0 );
00063
00064 bar = new QToolBar( this );
00065 bar->setLabel( tr( "Play Operations" ) );
00066
00067 tbDeletePlaylist = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ),
00068 "", bar, "close" );
00069 tbDeletePlaylist->setFlat( TRUE );
00070 tbDeletePlaylist->setFixedSize( 20, 20 );
00071
00072 tbDeletePlaylist->hide();
00073
00074 pmPlayList = new QPopupMenu( this );
00075 menu->insertItem( tr( "File" ), pmPlayList );
00076
00077 pmView = new QPopupMenu( this );
00078 menu->insertItem( tr( "View" ), pmView );
00079 pmView->isCheckable();
00080
00081 skinsMenu = new QPopupMenu( this );
00082 pmView->insertItem( tr( "Skins" ), skinsMenu );
00083 skinsMenu->isCheckable();
00084
00085 gammaMenu = new QPopupMenu( this );
00086 pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu );
00087
00088 gammaSlider = new QSlider( QSlider::Vertical, gammaMenu );
00089 gammaSlider->setRange( -40, 40 );
00090 gammaSlider->setTickmarks( QSlider::Left );
00091 gammaSlider->setTickInterval( 20 );
00092 gammaSlider->setFocusPolicy( QWidget::StrongFocus );
00093 gammaSlider->setValue( 0 );
00094 gammaSlider->setMinimumHeight( 50 );
00095
00096 gammaLCD = new QLCDNumber( 3, gammaMenu );
00097 gammaLCD-> setFrameShape ( QFrame::NoFrame );
00098 gammaLCD-> setSegmentStyle ( QLCDNumber::Flat );
00099
00100 gammaMenu->insertItem( gammaSlider );
00101 gammaMenu->insertItem( gammaLCD );
00102
00103 connect( gammaSlider, SIGNAL( valueChanged(int) ), gammaLCD, SLOT( display(int) ) );
00104
00105 vbox5 = new QVBox( this );
00106 QVBox *vbox4 = new QVBox( vbox5 );
00107 QHBox *hbox6 = new QHBox( vbox4 );
00108
00109 tabWidget = new QTabWidget( hbox6, "tabWidget" );
00110
00111 playListTab = new QWidget( tabWidget, "PlayListTab" );
00112 tabWidget->insertTab( playListTab, "Playlist");
00113
00114 QGridLayout *Playout = new QGridLayout( playListTab );
00115 Playout->setSpacing( 2);
00116 Playout->setMargin( 2);
00117
00118
00119 QVBox *vbox3 = new QVBox( playListTab );
00120 d->playListFrame = vbox3;
00121
00122 QHBox *hbox2 = new QHBox( vbox3 );
00123 d->selectedFiles = new PlayListSelection( hbox2 );
00124
00125 vbox1 = new QVBox( hbox2 );
00126 QPEApplication::setStylusOperation( d->selectedFiles->viewport(), QPEApplication::RightOnHold );
00127 QVBox *stretch1 = new QVBox( vbox1 );
00128
00129 Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 );
00130
00131 QWidget *aTab;
00132 aTab = new QWidget( tabWidget, "aTab" );
00133
00134 QGridLayout *Alayout = new QGridLayout( aTab );
00135 Alayout->setSpacing( 2 );
00136 Alayout->setMargin( 2 );
00137
00138 audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;application/ogg", "opieplayer2/musicfile", aTab, "Audioview" );
00139 Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 );
00140 tabWidget->insertTab( aTab, tr( "Audio" ) );
00141
00142 QPEApplication::setStylusOperation( audioView->viewport(), QPEApplication::RightOnHold );
00143
00144 QWidget *vTab;
00145 vTab = new QWidget( tabWidget, "vTab" );
00146
00147 QGridLayout *Vlayout = new QGridLayout( vTab );
00148 Vlayout->setSpacing( 2 );
00149 Vlayout->setMargin( 2 );
00150 videoView = new PlayListFileView( "video/*", "opieplayer2/videofile", vTab, "Videoview" );
00151 Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 );
00152
00153 QPEApplication::setStylusOperation( videoView->viewport(), QPEApplication::RightOnHold );
00154
00155 tabWidget->insertTab( vTab, tr( "Video" ) );
00156
00157
00158 QWidget *LTab;
00159 LTab = new QWidget( tabWidget, "LTab" );
00160 QGridLayout *Llayout = new QGridLayout( LTab );
00161 Llayout->setSpacing( 2 );
00162 Llayout->setMargin( 2 );
00163
00164 playLists = new FileSelector( "playlist/plain;audio/x-mpegurl", LTab, "fileselector" , FALSE, FALSE );
00165 Llayout->addMultiCellWidget( playLists, 0, 0, 0, 1 );
00166
00167 tabWidget->insertTab( LTab, tr( "Lists" ) );
00168
00169 setCentralWidget( vbox5 );
00170 }
00171
00172
00173
00174 PlayListWidgetGui::~PlayListWidgetGui() {
00175 }
00176
00177 void PlayListWidgetGui::setView( char view ) {
00178 if ( view == 'l' )
00179 showMaximized();
00180 else
00181 hide();
00182 }
00183
00184
00185 void PlayListWidgetGui::setActiveWindow() {
00186
00187 MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType();
00188 mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection );
00189 mediaPlayerState->setDisplayType( origDisplayType );
00190 }
00191
00192