-rw-r--r-- | noncore/multimedia/opieplayer2/config.in | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/main.cpp | 9 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/opie-mediaplayer2.control | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/opieplayer2.pro | 9 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 69 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.h | 4 |
11 files changed, 67 insertions, 58 deletions
diff --git a/noncore/multimedia/opieplayer2/config.in b/noncore/multimedia/opieplayer2/config.in index 27142a8..2272a9b 100644 --- a/noncore/multimedia/opieplayer2/config.in +++ b/noncore/multimedia/opieplayer2/config.in @@ -1,6 +1,4 @@ config OPIEPLAYER2 - boolean "opie-mediaplayer2 (streaming capable media player for mp3, mpeg, wav, ogg, quicktime, divx and more)" + boolean "opieplayer2" default "n" depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE - comment "opie-mediaplayer2-skin-default-landscape automatically selected" - depends OPIEPLAYER2 diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 11ad745..00cfa33 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -1,4 +1,4 @@ - /* +/* This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> @@ -87,7 +87,7 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) ts << "# uncomment if you experience double speed audio \n #audio.oss_sync_method:softsync\n"; ts << "codec.ffmpeg_pp_quality:3\n"; ts << "audio.num_buffers:50\n"; - ts << "audio.size_buffers:4160\n"; + ts << "audio.size_buffers:4096\n"; ts << "video.num_buffers:20\n"; ts << "video.size_buffers:4096\n"; ts << "audio.out_num_audio_buf:16\n"; @@ -270,7 +270,7 @@ int Lib::length() const { int pos, time, length; /* dilb: patch to solve the wrong stream length reported to the GUI*/ int iRetVal=0, iTestLoop=0; - + do { iRetVal = xine_get_pos_length( m_stream, &pos, &time, &length ); diff --git a/noncore/multimedia/opieplayer2/main.cpp b/noncore/multimedia/opieplayer2/main.cpp index f87cee8..b0a22b2 100644 --- a/noncore/multimedia/opieplayer2/main.cpp +++ b/noncore/multimedia/opieplayer2/main.cpp @@ -4,6 +4,13 @@ #include "playlistwidget.h" #include "mediaplayer.h" + + +#include <opie/oapplicationfactory.h> + +OPIE_EXPORT_APP( OApplicationFactory<PlayListWidget> ) + +#if 0 int main(int argc, char **argv) { QPEApplication a(argc,argv); @@ -18,5 +25,5 @@ int main(int argc, char **argv) { return a.exec(); } - +#endif diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 4c9afca..9f51006 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -283,7 +283,6 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { void MediaPlayer::blank( bool b ) { -// ### FIXME use ODevice::inst()->setDisplayStatus( b ); fd=open("/dev/fb0",O_RDWR); #ifdef QT_QWS_SL5XXX fl= open( "/dev/fl", O_RDWR ); diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index b1f88c9..f193001 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp @@ -26,8 +26,6 @@ #include "playlistwidget.h" #include "skin.h" -#include <assert.h> - MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { diff --git a/noncore/multimedia/opieplayer2/opie-mediaplayer2.control b/noncore/multimedia/opieplayer2/opie-mediaplayer2.control index 8e68c57..3e3e856 100644 --- a/noncore/multimedia/opieplayer2/opie-mediaplayer2.control +++ b/noncore/multimedia/opieplayer2/opie-mediaplayer2.control @@ -4,8 +4,8 @@ Priority: optional Section: opie/applications Maintainer: L.J.Potter <ljp@llornkcor.com>, Maximilian Reiss <harlekin@handhelds.org> Architecture: arm -Depends: task-opie-minimal, libopie1, zlib1g, opie-mediaplayer2-skin-default | opie-mediaplayer2-skin-default-landscape , libxine1 | opie-mediaplayer2-codecs -Description: The Opie media player II +Depends: task-opie-minimal, libopie1, zlib1g, libstdc++2.10-glibc2.2, opie-mediaplayer2-skin-default | opie-mediaplayer2-skin-default-landscape , libxine1 | opie-mediaplayer2-codecs +Description: The Opie media player The mediaplayer for Opie. It plays mp3, mpeg, wav, ogg, quicktime, divx and more. Also it is streaming capable. Version: $QPE_VERSION$EXTRAVERSION diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro index 5dabbab..46e14a0 100644 --- a/noncore/multimedia/opieplayer2/opieplayer2.pro +++ b/noncore/multimedia/opieplayer2/opieplayer2.pro @@ -1,6 +1,4 @@ -TEMPLATE = app -CONFIG = qt warn_on release -DESTDIR = $(OPIEDIR)/bin +CONFIG = qt warn_on release quick-app HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h \ videowidget.h audiowidget.h playlistwidget.h om3u.h mediaplayer.h inputDialog.h \ frame.h lib.h xinevideowidget.h volumecontrol.h playlistwidgetgui.h\ @@ -21,11 +19,6 @@ LIBS += -lqpe -lpthread -lopie -lxine -lstdc++ MOC_DIR = qpeobj OBJECTS_DIR = qpeobj -#INCLUDEPATH += $(OPIEDIR)/include -#DEPENDPATH += $(OPIEDIR)/include - - - TRANSLATIONS = ../../../i18n/de/opieplayer2.ts \ ../../../i18n/nl/opieplayer2.ts \ ../../../i18n/da/opieplayer2.ts \ diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index a1a1016..9a9e1ec 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -39,6 +39,7 @@ #include "playlistselection.h" #include "playlistwidget.h" +#include "mediaplayer.h" #include "mediaplayerstate.h" #include "inputDialog.h" #include "om3u.h" @@ -47,9 +48,13 @@ //only needed for the random play #include <assert.h> -PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) - : PlayListWidgetGui( mediaPlayerState, parent, name ) , currentFileListView( 0 ) +PlayListWidget::PlayListWidget(QWidget* parent, const char* name, WFlags fl ) + : PlayListWidgetGui( parent, "playList" ) , currentFileListView( 0 ) { + mediaPlayerState = new MediaPlayerState(0, "mediaPlayerState" ); + m_mp = new MediaPlayer(*this, *mediaPlayerState, 0, "mediaPlayer"); + + d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer2/add_to_playlist", @@ -60,9 +65,9 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", this , SLOT( btnPlay( bool) ), TRUE ); d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", - &mediaPlayerState, SLOT( setShuffled( bool ) ), TRUE ); + mediaPlayerState, SLOT( setShuffled( bool ) ), TRUE ); d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", - &mediaPlayerState, SLOT( setLooping( bool ) ), TRUE ); + mediaPlayerState, SLOT( setLooping( bool ) ), TRUE ); (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), @@ -86,11 +91,11 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par videoView, SLOT( scanFiles() ) ); pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), - &mediaPlayerState, SLOT( toggleFullscreen() ) ); + mediaPlayerState, SLOT( toggleFullscreen() ) ); Config cfg( "OpiePlayer" ); bool b= cfg.readBoolEntry("FullScreen", 0); - mediaPlayerState.setFullscreen( b ); + mediaPlayerState->setFullscreen( b ); pmView->setItemChecked( -16, b ); (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", @@ -125,16 +130,19 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par this, SLOT( loadList( const DocLnk & ) ) ); connect( tabWidget, SIGNAL ( currentChanged(QWidget*) ), this, SLOT( tabChanged( QWidget* ) ) ); - connect( &mediaPlayerState, SIGNAL( playingToggled( bool ) ), + connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); - connect( &mediaPlayerState, SIGNAL( loopingToggled( bool ) ), + connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) ); - connect( &mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), + connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); connect ( gammaSlider, SIGNAL( valueChanged( int ) ), - &mediaPlayerState, SLOT( setVideoGamma( int ) ) ); + mediaPlayerState, SLOT( setVideoGamma( int ) ) ); + + connect( this, SIGNAL(skinSelected() ), + m_mp, SLOT( reloadSkins() ) ); // see which skins are installed populateSkinsMenu(); @@ -155,13 +163,14 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par PlayListWidget::~PlayListWidget() { delete d; + delete m_mp; } void PlayListWidget::initializeStates() { - d->tbPlay->setOn( mediaPlayerState.isPlaying() ); - d->tbLoop->setOn( mediaPlayerState.isLooping() ); - d->tbShuffle->setOn( mediaPlayerState.isShuffled() ); + d->tbPlay->setOn( mediaPlayerState->isPlaying() ); + d->tbLoop->setOn( mediaPlayerState->isLooping() ); + d->tbShuffle->setOn( mediaPlayerState->isShuffled() ); d->playListFrame->show(); } @@ -341,8 +350,8 @@ void PlayListWidget::setDocument( const QString& fileref ) { writeCurrentM3u(); d->setDocumentUsed = TRUE; - mediaPlayerState.setPlaying( FALSE ); - mediaPlayerState.setPlaying( TRUE ); + mediaPlayerState->setPlaying( FALSE ); + mediaPlayerState->setPlaying( TRUE ); } } @@ -366,7 +375,7 @@ const DocLnk *PlayListWidget::current() const { // this is fugly bool PlayListWidget::prev() { - if ( mediaPlayerState.isShuffled() ) { + if ( mediaPlayerState->isShuffled() ) { const DocLnk *cur = current(); int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0)); for ( int i = 0; i < j; i++ ) { @@ -380,7 +389,7 @@ bool PlayListWidget::prev() { return TRUE; } else { if ( !d->selectedFiles->prev() ) { - if ( mediaPlayerState.isLooping() ) { + if ( mediaPlayerState->isLooping() ) { return d->selectedFiles->last(); } else { return FALSE; @@ -393,11 +402,11 @@ bool PlayListWidget::prev() { bool PlayListWidget::next() { //qDebug("<<<<<<<<<<<<next()"); - if ( mediaPlayerState.isShuffled() ) { + if ( mediaPlayerState->isShuffled() ) { return prev(); } else { if ( !d->selectedFiles->next() ) { - if ( mediaPlayerState.isLooping() ) { + if ( mediaPlayerState->isLooping() ) { return d->selectedFiles->first(); } else { return FALSE; @@ -463,8 +472,8 @@ void PlayListWidget::removeSelected() { void PlayListWidget::playIt( QListViewItem *it) { if(!it) return; - mediaPlayerState.setPlaying(FALSE); - mediaPlayerState.setPlaying(TRUE); + mediaPlayerState->setPlaying(FALSE); + mediaPlayerState->setPlaying(TRUE); d->selectedFiles->unSelect(); } @@ -565,7 +574,7 @@ void PlayListWidget::tabChanged(QWidget *) { void PlayListWidget::btnPlay(bool b) { // mediaPlayerState->setPlaying(false); - mediaPlayerState.setPlaying(b); + mediaPlayerState->setPlaying(b); insanityBool=FALSE; } @@ -909,8 +918,8 @@ void PlayListWidget::pmViewActivated(int index) { switch(index) { case -16: { - mediaPlayerState.toggleFullscreen(); - bool b=mediaPlayerState.isFullscreen(); + mediaPlayerState->toggleFullscreen(); + bool b=mediaPlayerState->isFullscreen(); pmView->setItemChecked( index, b); Config cfg( "OpiePlayer" ); cfg.writeEntry( "FullScreen", b ); @@ -996,17 +1005,17 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { if ( msg == "play()" ) { //plays current selection btnPlay( true); } else if ( msg == "stop()" ) { - mediaPlayerState.setPlaying( false); + mediaPlayerState->setPlaying( false); } else if ( msg == "togglePause()" ) { - mediaPlayerState.togglePaused(); + mediaPlayerState->togglePaused(); } else if ( msg == "next()" ) { //select next in list - mediaPlayerState.setNext(); + mediaPlayerState->setNext(); } else if ( msg == "prev()" ) { //select previous in list - mediaPlayerState.setPrev(); + mediaPlayerState->setPrev(); } else if ( msg == "toggleLooping()" ) { //loop or not loop - mediaPlayerState.toggleLooping(); + mediaPlayerState->toggleLooping(); } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled - mediaPlayerState.toggleShuffled(); + mediaPlayerState->toggleShuffled(); } else if ( msg == "volUp()" ) { //volume more // emit moreClicked(); // emit moreReleased(); diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index fc305cd..29f3e8d 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h @@ -47,6 +47,8 @@ class QListView; class QPoint; class QAction; class QLabel; +class MediaPlayerState; +class MediaPlayer; class PlayListWidget : public PlayListWidgetGui { Q_OBJECT @@ -65,7 +67,8 @@ public: QString file; }; - PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent=0, const char* name=0 ); + static QString appName() { return QString::fromLatin1("opieplayer2"); } + PlayListWidget( QWidget* parent=0, const char* name=0, WFlags = 0 ); ~PlayListWidget(); // retrieve the current playlist entry (media file link) @@ -132,6 +135,8 @@ private: QString setDocFileRef, currentPlayList; int selected; QListView *currentFileListView; + + MediaPlayer *m_mp; }; #endif // PLAY_LIST_WIDGET_H diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 293bf45..fec91ea 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp @@ -46,8 +46,8 @@ #include "mediaplayerstate.h" -PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidget* parent, const char* name ) - : QMainWindow( parent, name ), mediaPlayerState( _mediaPlayerState ) { +PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) + : QMainWindow( parent, name ) { d = new PlayListWidgetPrivate; d->setDocumentUsed = FALSE; @@ -186,9 +186,9 @@ void PlayListWidgetGui::setView( char view ) { void PlayListWidgetGui::setActiveWindow() { // qDebug("SETTING active window"); // When we get raised we need to ensure that it switches views - MediaPlayerState::DisplayType origDisplayType = mediaPlayerState.displayType(); - mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); // invalidate - mediaPlayerState.setDisplayType( origDisplayType ); // now switch back + MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); + mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate + mediaPlayerState->setDisplayType( origDisplayType ); // now switch back } diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.h b/noncore/multimedia/opieplayer2/playlistwidgetgui.h index c0cd37a..5706d14 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.h +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.h @@ -93,7 +93,7 @@ public: class PlayListWidgetGui : public QMainWindow { Q_OBJECT public: - PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidget* parent=0, const char* name=0 ); + PlayListWidgetGui( QWidget* parent=0, const char* name=0 ); ~PlayListWidgetGui(); protected: @@ -122,7 +122,7 @@ protected: void setActiveWindow(); // need to handle this to show the right view void setView( char ); - MediaPlayerState &mediaPlayerState; + MediaPlayerState *mediaPlayerState; }; #endif |