summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.h1
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp14
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h1
3 files changed, 1 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h
index d15894f..7a80ad8 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.h
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h
@@ -73,65 +73,64 @@ public slots:
void setShuffled( bool b );
void setPaused( bool b );
void setPlaying( bool b );
void setStopped( bool b );
void setPosition( long p );
void updatePosition( long p );
void setLength( long l );
void setView( char v );
void setBlanked( bool b );
void setVideoGamma( int v );
void setPrev();
void setNext();
void setList();
void setVideo();
void setAudio();
void toggleFullscreen();
void toggleScaled();
void toggleLooping();
void toggleShuffled();
void togglePaused();
void togglePlaying();
void toggleBlank();
void writeConfig( Config& cfg ) const;
signals:
void fullscreenToggled( bool );
void scaledToggled( bool );
void loopingToggled( bool );
void shuffledToggled( bool );
- void playlistToggled( bool );
void pausedToggled( bool );
void playingToggled( bool );
void stopToggled( bool );
void positionChanged( long ); // When the slider is moved
void positionUpdated( long ); // When the media file progresses
void lengthChanged( long );
void viewChanged( char );
void isSeekableToggled( bool );
void blankToggled( bool );
void videoGammaChanged( int );
void prev();
void next();
private:
bool streaming : 1;
bool seekable : 1;
bool fullscreen: 1;
bool scaled : 1;
bool blanked : 1;
bool looping : 1;
bool shuffled : 1;
bool usePlaylist : 1;
bool paused : 1;
bool playing : 1;
bool stopped : 1;
long curPosition;
long curLength;
char curView;
int videoGamma;
void readConfig( Config& cfg );
};
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 6355bec..5b277cc 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -118,95 +118,93 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
// QVBox *stretch2 = new QVBox( vbox1 );
connect( tbDeletePlaylist, ( SIGNAL( released() ) ),
SLOT( deletePlaylist() ) );
connect( pmView, SIGNAL( activated( int ) ),
this, SLOT( pmViewActivated( int ) ) );
connect( skinsMenu, SIGNAL( activated( int ) ) ,
this, SLOT( skinsMenuActivated( int ) ) );
connect( d->selectedFiles, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ),
this,SLOT( playlistViewPressed( int, QListViewItem *, const QPoint&, int ) ) );
connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int ) ),
this,SLOT( viewPressed( int, QListViewItem *, const QPoint&, int ) ) );
connect( audioView, SIGNAL( returnPressed( QListViewItem *) ),
this,SLOT( playIt( QListViewItem *) ) );
connect( audioView, SIGNAL( doubleClicked( QListViewItem *) ),
this, SLOT( addToSelection( QListViewItem *) ) );
connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int) ),
this,SLOT( viewPressed( int, QListViewItem *, const QPoint&, int) ) );
connect( videoView, SIGNAL( returnPressed( QListViewItem *) ),
this,SLOT( playIt( QListViewItem *) ) );
connect( videoView, SIGNAL( doubleClicked( QListViewItem *) ),
this, SLOT( addToSelection( QListViewItem *) ) );
connect( playLists, SIGNAL( fileSelected( const DocLnk &) ),
this, SLOT( loadList( const DocLnk & ) ) );
connect( tabWidget, SIGNAL ( currentChanged(QWidget*) ),
this, SLOT( tabChanged( QWidget* ) ) );
connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ),
d->tbPlay, SLOT( setOn( bool ) ) );
connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ),
d->tbLoop, SLOT( setOn( bool ) ) );
connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ),
d->tbShuffle, SLOT( setOn( bool ) ) );
- connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ),
- this, SLOT( setPlaylist( bool ) ) );
connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ),
this, SLOT( playIt( QListViewItem *) ) );
connect ( gammaSlider, SIGNAL( valueChanged( int ) ),
mediaPlayerState, SLOT( setVideoGamma( int ) ) );
// see which skins are installed
videoScan=false;
audioScan=false;
audioPopulated=false;
videoPopulated=false;
populateSkinsMenu();
initializeStates();
cfg.setGroup("PlayList");
QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default");
loadList(DocLnk( currentPlaylist ) );
}
PlayListWidget::~PlayListWidget() {
delete d;
}
void PlayListWidget::initializeStates() {
d->tbPlay->setOn( mediaPlayerState->isPlaying() );
d->tbLoop->setOn( mediaPlayerState->isLooping() );
d->tbShuffle->setOn( mediaPlayerState->isShuffled() );
- setPlaylist( true );
+ d->playListFrame->show();
}
void PlayListWidget::writeDefaultPlaylist() {
Config config( "OpiePlayer" );
config.setGroup( "PlayList" );
QString filename=QPEApplication::documentDir() + "/default.m3u";
QString currentString = config.readEntry( "CurrentPlaylist", filename);
if( currentString == filename) {
Om3u *m3uList;
// qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>");
if( d->selectedFiles->first() ) {
m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate);
do {
// qDebug(d->selectedFiles->current()->file());
m3uList->add( d->selectedFiles->current()->file() );
}
while ( d->selectedFiles->next() );
m3uList->write();
m3uList->close();
if(m3uList) delete m3uList;
}
}
}
void PlayListWidget::addToSelection( const DocLnk& lnk ) {
d->setDocumentUsed = FALSE;
if ( mediaPlayerState->isUsingPlaylist() ) {
if( QFileInfo( lnk.file() ).exists() ||
lnk.file().left(4) == "http" ) {
@@ -488,74 +486,64 @@ bool PlayListWidget::first() {
return d->selectedFiles->first();
else
return mediaPlayerState->isLooping();
}
bool PlayListWidget::last() {
if ( mediaPlayerState->isUsingPlaylist() )
return d->selectedFiles->last();
else
return mediaPlayerState->isLooping();
}
void PlayListWidget::saveList() {
writem3u();
}
void PlayListWidget::loadList( const DocLnk & lnk) {
QString name = lnk.name();
// qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name);
if( name.length()>0) {
setCaption("OpiePlayer: "+name);
// qDebug("<<<<<<<<<<<<load list "+ lnk.file());
clearList();
readm3u(lnk.file());
tabWidget->setCurrentPage(0);
}
}
-
-void PlayListWidget::setPlaylist( bool shown ) {
- if ( shown ) {
- d->playListFrame->show();
- } else {
- d->playListFrame->hide();
- }
-}
-
-
void PlayListWidget::addSelected() {
assert( inFileListMode() );
QListView *fileListView = currentFileListView();
QListViewItemIterator it( fileListView );
for ( ; it.current(); ++it )
if ( it.current()->isSelected() ) {
QString filename = it.current()->text(3);
DocLnk lnk;
lnk.setName( QFileInfo( filename ).baseName() ); //sets name
lnk.setFile( filename ); //sets file name
d->selectedFiles->addToSelection( lnk );
}
fileListView->clearSelection();
tabWidget->setCurrentPage( 0 );
writeCurrentM3u();
}
void PlayListWidget::removeSelected() {
d->selectedFiles->removeSelected( );
writeCurrentM3u();
}
void PlayListWidget::playIt( QListViewItem *it) {
if(!it) return;
mediaPlayerState->setPlaying(FALSE);
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index 511a192..fa2837a 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -90,52 +90,51 @@ public slots:
bool next();
bool prev();
void writeDefaultPlaylist( );
QString currentFileListPathName() const;
protected:
void keyReleaseEvent( QKeyEvent *e);
private:
int defaultSkinIndex;
bool audioScan, videoScan, audioPopulated, videoPopulated;
void readm3u(const QString &);
void readPls(const QString &);
void initializeStates();
void populateAudioView();
void populateVideoView();
QListView *currentFileListView() const;
bool inFileListMode() const;
private slots:
void populateSkinsMenu();
void skinsMenuActivated(int);
void pmViewActivated(int);
void writem3u();
void writeCurrentM3u();
void scanForAudio();
void scanForVideo();
void openFile();
void setDocument( const QString& fileref );
void addToSelection( const DocLnk& ); // Add a media file to the playlist
void addToSelection( QListViewItem* ); // Add a media file to the playlist
- void setPlaylist( bool ); // Show/Hide the playlist
void clearList();
void addAllToList();
void addAllMusicToList();
void addAllVideoToList();
void saveList(); // Save the playlist
void loadList( const DocLnk &); // Load a playlist
void playIt( QListViewItem *);
void btnPlay(bool);
void deletePlaylist();
void addSelected();
void removeSelected();
void tabChanged(QWidget*);
void viewPressed( int, QListViewItem *, const QPoint&, int);
void playlistViewPressed( int, QListViewItem *, const QPoint&, int);
void playSelected();
};
#endif // PLAY_LIST_WIDGET_H