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