author | mickeyl <mickeyl> | 2004-04-04 17:38:26 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 17:38:26 (UTC) |
commit | 4588425855268ce88a80ddbac7e1c3d4b87b03f4 (patch) (side-by-side diff) | |
tree | cc2ba17458cd68592093e6c1bb216df3582cb6f5 | |
parent | ea3708cbc40ebc5f1db70546f0a93e8a23ba967c (diff) | |
download | opie-4588425855268ce88a80ddbac7e1c3d4b87b03f4.zip opie-4588425855268ce88a80ddbac7e1c3d4b87b03f4.tar.gz opie-4588425855268ce88a80ddbac7e1c3d4b87b03f4.tar.bz2 |
use odebug classes
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 16 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistselection.cpp | 9 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 19 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 12 |
7 files changed, 51 insertions, 30 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 36def67..95a0f45 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -5,67 +5,70 @@ Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "audiowidget.h" +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> - +using namespace Opie::Core; using namespace Opie::Ui; + namespace { const int xo = -2; // movable x offset const int yo = 22; // movable y offset const MediaWidget::SkinButtonInfo skinInfo[] = { { MediaWidget::Play, "play", MediaWidget::ToggleButton }, { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, { MediaWidget::Next, "next", MediaWidget::NormalButton }, { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, { MediaWidget::Back, "back", MediaWidget::NormalButton } }; const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); void changeTextColor( QWidget * w) { QPalette p = w->palette(); p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); w->setPalette( p ); } } AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 5c24dbe..1ab5c96 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -2,78 +2,80 @@ This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 LJP <> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "xinevideowidget.h" +#include "frame.h" +#include "lib.h" -#include <qtextstream.h> +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; +/* QT */ +#include <qtextstream.h> #include <qdir.h> - #include <qgfx_qws.h> +/* STD */ #include <assert.h> -#include "xinevideowidget.h" -#include "frame.h" -#include "lib.h" - - typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, int width, int height,int bytes ); extern "C" { xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * ); int null_is_showing_video( const xine_vo_driver_t* self ); void null_set_show_video( const xine_vo_driver_t* self, int show ); int null_is_fullscreen( const xine_vo_driver_t* self ); void null_set_fullscreen( const xine_vo_driver_t* self, int screen ); int null_is_scaling( const xine_vo_driver_t* self ); void null_set_scaling( const xine_vo_driver_t* self, int scale ); void null_set_gui_width( const xine_vo_driver_t* self, int width ); void null_set_gui_height( const xine_vo_driver_t* self, int height ); void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb ); void null_set_videoGamma( const xine_vo_driver_t* self , int value ); void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data ); void null_preload_decoders( xine_stream_t *stream ); } using namespace XINE; Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) { m_initialized = false; m_duringInitialization = false; m_video = false; m_wid = widget; printf("Lib"); QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; // get the configuration diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 7e38fc7..7b4bfd9 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -1,49 +1,51 @@ -#include <qpe/qpeapplication.h> -#include <qpe/config.h> -#include <qfileinfo.h> - #include "mediaplayer.h" #include "audiowidget.h" #include "videowidget.h" #include "volumecontrol.h" +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/qpeapplication.h> +#include <qpe/config.h> + +/* QT */ +#include <qfileinfo.h> - // for setBacklight() +/* STD */ #include <linux/fb.h> #include <sys/file.h> #include <sys/ioctl.h> - -#define FBIOBLANK 0x4611 +#define FBIOBLANK 0x4611 MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { m_audioUI = 0; m_videoUI = 0; m_xineControl = 0; xine = new XINE::Lib( XINE::Lib::InitializeInThread ); fd=-1;fl=-1; playList.setCaption( tr( "OpiePlayer: Initializating" ) ); qApp->processEvents(); // QPEApplication::grabKeyboard(); // EVIL connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); // What is pauseCheck good for? (Simon) // connect( &mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pauseCheck(bool) ) ); connect( &mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); connect( &mediaPlayerState, SIGNAL( blankToggled(bool) ), this, SLOT ( blank(bool) ) ); volControl = new VolumeControl; Config cfg( "OpiePlayer" ); cfg.setGroup("PlayList"); QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); playList.setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); m_skinLoader = new SkinLoader; diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index 95dbab5..790fa09 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/om3u.cpp @@ -2,65 +2,67 @@ This file is part of the Opie Project Copyright (c) 2002 L. Potter <ljp@llornkcor.com> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "om3u.h" - +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; //extern PlayListWidget *playList; Om3u::Om3u( const QString &filePath, int mode) : QStringList (){ odebug << "<<<<<<<new m3u "+filePath << oendl; f.setName(filePath); f.open(mode); } Om3u::~Om3u(){} void Om3u::readM3u() { // odebug << "<<<<<<reading m3u "+f.name() << oendl; QTextStream t(&f); t.setEncoding(QTextStream::UnicodeUTF8); QString s; while ( !t.atEnd() ) { s=t.readLine(); // odebug << s << oendl; if( s.find( "#", 0, TRUE) == -1 ) { if( s.left(2) == "E:" || s.left(2) == "P:" ) { s = s.right( s.length() -2 ); QFileInfo f( s ); QString name = f.baseName(); name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); s=s.replace( QRegExp( "\\" ), "/" ); append(s); // odebug << s << oendl; } else { // is url QString name; name = s; diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp index 3499837..678ebdf 100644 --- a/noncore/multimedia/opieplayer2/playlistselection.cpp +++ b/noncore/multimedia/opieplayer2/playlistselection.cpp @@ -1,56 +1,61 @@ /********************************************************************** ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ +#include "playlistselection.h" -#include <qheader.h> +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; -#include "playlistselection.h" +/* QT */ +#include <qheader.h> +/* STD */ #include <stdlib.h> class PlayListSelectionItem : public QListViewItem { public: PlayListSelectionItem( QListView *parent, const DocLnk *f ) : QListViewItem( parent ), fl( f ) { setText( 0, f->name() ); setPixmap( 0, f->pixmap() ); } ~PlayListSelectionItem() { }; const DocLnk *file() const { return fl; } private: const DocLnk *fl; }; PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) : QListView( parent, name ) { // odebug << "starting playlistselector" << oendl; // #ifdef USE_PLAYLIST_BACKGROUND // setStaticBackground( TRUE ); // setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) ); // setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); // #endif // addColumn("Title",236); // setAllColumnsShowFocus( TRUE ); addColumn( tr( "Playlist Selection" ) ); diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 956d206..6a15134 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -2,81 +2,84 @@ This file is part of the Opie Project Copyright (c) 2002,2003 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <qtoolbar.h> - -#include <opie2/ofiledialog.h> - -#include <qmessagebox.h> - #include "playlistselection.h" #include "playlistwidget.h" #include "mediaplayer.h" #include "inputDialog.h" #include "om3u.h" #include "playlistfileview.h" -//only needed for the random play +/* OPIE */ +#include <opie2/odebug.h> +#include <opie2/ofiledialog.h> +using namespace Opie::Core; +using namespace Opie::Ui; + +/* QT */ +#include <qmessagebox.h> +#include <qtoolbar.h> + +/* STD */ #include <assert.h> -using namespace Opie::Ui; 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", this , SLOT(addSelected() ) ); d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer2/remove_from_playlist", this , SLOT(removeSelected() ) ); 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 ); d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", mediaPlayerState, SLOT( setLooping(bool) ), TRUE ); (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); (void)new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); (void)new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); pmPlayList->insertSeparator(-1); (void)new MenuItem( pmPlayList, tr( "Add File" ), this,SLOT( openFile() ) ); (void)new MenuItem( pmPlayList, tr("Add URL"), diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 94f99f8..9f944d7 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -2,72 +2,76 @@ This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "xinecontrol.h" +#include "xinevideowidget.h" -#include <qtimer.h> -#include <qmessagebox.h> +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> +using namespace Opie::Core; -#include "xinecontrol.h" -#include "xinevideowidget.h" +/* QT */ +#include <qtimer.h> +#include <qmessagebox.h> XineControl::XineControl( XineVideoWidget *xineWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) { libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget ); init(); } XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) { xine->ensureInitialized(); xine->setWidget( xineWidget ); init(); } void XineControl::init() { connect( &mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); connect( this, SIGNAL( positionChanged(long) ), &mediaPlayerState, SLOT( updatePosition(long) ) ); connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( stop(bool) ) ); connect( &mediaPlayerState, SIGNAL( fullscreenToggled(bool) ), this, SLOT( setFullscreen(bool) ) ); connect( &mediaPlayerState, SIGNAL( positionChanged(long) ), this, SLOT( seekTo(long) ) ); connect( &mediaPlayerState, SIGNAL( videoGammaChanged(int) ), this, SLOT( setGamma(int) ) ); connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); |