summaryrefslogtreecommitdiff
path: root/core/multimedia
Unidiff
Diffstat (limited to 'core/multimedia') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiodevice.cpp1
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp6
-rw-r--r--core/multimedia/opieplayer/mediaplayer.cpp7
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.cpp2
-rw-r--r--core/multimedia/opieplayer/modplug/load_j2b.cpp1
-rw-r--r--core/multimedia/opieplayer/om3u.cpp15
-rw-r--r--core/multimedia/opieplayer/playlistselection.cpp8
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp25
-rw-r--r--core/multimedia/opieplayer/videowidget.cpp4
9 files changed, 1 insertions, 68 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp
index d296d27..355062b 100644
--- a/core/multimedia/opieplayer/audiodevice.cpp
+++ b/core/multimedia/opieplayer/audiodevice.cpp
@@ -1,75 +1,74 @@
1/********************************************************************** 1/**********************************************************************
2 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 2 ** Copyright (C) 2000 Trolltech AS. All rights reserved.
3 ** 3 **
4 ** This file is part of Qtopia Environment. 4 ** This file is part of 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// L.J.Potter added better error code Fri 02-15-2002 14:37:47 20// L.J.Potter added better error code Fri 02-15-2002 14:37:47
21 21
22 22
23#include <stdlib.h> 23#include <stdlib.h>
24#include <stdio.h> 24#include <stdio.h>
25#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
26#include <qpe/config.h> 26#include <qpe/config.h>
27#include <qpe/custom.h>
28#include <qmessagebox.h> 27#include <qmessagebox.h>
29 28
30#include "audiodevice.h" 29#include "audiodevice.h"
31 30
32 31
33#include <errno.h> 32#include <errno.h>
34 33
35#if !defined(QT_NO_COP) 34#if !defined(QT_NO_COP)
36#include <qpe/qcopenvelope_qws.h> 35#include <qpe/qcopenvelope_qws.h>
37#endif 36#endif
38 37
39#if defined(Q_WS_X11) || defined(Q_WS_QWS) 38#if defined(Q_WS_X11) || defined(Q_WS_QWS)
40#include <fcntl.h> 39#include <fcntl.h>
41#include <sys/ioctl.h> 40#include <sys/ioctl.h>
42#include <sys/soundcard.h> 41#include <sys/soundcard.h>
43#include <sys/stat.h> 42#include <sys/stat.h>
44#include <sys/time.h> 43#include <sys/time.h>
45#include <sys/types.h> 44#include <sys/types.h>
46#include <unistd.h> 45#include <unistd.h>
47#endif 46#endif
48 47
49#ifdef OPIE_SOUND_FRAGMENT_SHIFT 48#ifdef OPIE_SOUND_FRAGMENT_SHIFT
50static const int sound_fragment_shift = OPIE_SOUND_FRAGMENT_SHIFT; 49static const int sound_fragment_shift = OPIE_SOUND_FRAGMENT_SHIFT;
51#else 50#else
52static const int sound_fragment_shift = 16; 51static const int sound_fragment_shift = 16;
53#endif 52#endif
54static const int sound_fragment_bytes = (1<<sound_fragment_shift); 53static const int sound_fragment_bytes = (1<<sound_fragment_shift);
55//#endif 54//#endif
56 55
57 56
58class AudioDevicePrivate { 57class AudioDevicePrivate {
59public: 58public:
60 int handle; 59 int handle;
61 unsigned int frequency; 60 unsigned int frequency;
62 unsigned int channels; 61 unsigned int channels;
63 unsigned int bytesPerSample; 62 unsigned int bytesPerSample;
64 unsigned int bufferSize; 63 unsigned int bufferSize;
65//#ifndef Q_OS_WIN32 64//#ifndef Q_OS_WIN32
66 bool can_GETOSPACE; 65 bool can_GETOSPACE;
67 char* unwrittenBuffer; 66 char* unwrittenBuffer;
68 unsigned int unwritten; 67 unsigned int unwritten;
69//#endif 68//#endif
70 69
71 static int dspFd; 70 static int dspFd;
72 static bool muted; 71 static bool muted;
73 static unsigned int leftVolume; 72 static unsigned int leftVolume;
74 static unsigned int rightVolume; 73 static unsigned int rightVolume;
75}; 74};
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp
index fbc5072..8bcc567 100644
--- a/core/multimedia/opieplayer/audiowidget.cpp
+++ b/core/multimedia/opieplayer/audiowidget.cpp
@@ -1,77 +1,71 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of 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 <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include <qpe/resource.h> 21#include <qpe/resource.h>
22#include <qpe/config.h> 22#include <qpe/config.h>
23 23
24#include <qwidget.h>
25#include <qpixmap.h>
26#include <qbutton.h>
27#include <qpainter.h>
28#include <qframe.h>
29#include <qlayout.h>
30#include <qdir.h> 24#include <qdir.h>
31#include "audiowidget.h" 25#include "audiowidget.h"
32#include "mediaplayerstate.h" 26#include "mediaplayerstate.h"
33 27
34#include <stdlib.h> 28#include <stdlib.h>
35#include <stdio.h> 29#include <stdio.h>
36 30
37extern MediaPlayerState *mediaPlayerState; 31extern MediaPlayerState *mediaPlayerState;
38 32
39 33
40static const int xo = -2; // movable x offset 34static const int xo = -2; // movable x offset
41static const int yo = 22; // movable y offset 35static const int yo = 22; // movable y offset
42 36
43struct MediaButton { 37struct MediaButton {
44 bool isToggle, isHeld, isDown; 38 bool isToggle, isHeld, isDown;
45}; 39};
46 40
47//Layout information for the audioButtons (and if it is a toggle button or not) 41//Layout information for the audioButtons (and if it is a toggle button or not)
48MediaButton audioButtons[] = { 42MediaButton audioButtons[] = {
49 { TRUE, FALSE, FALSE }, // play 43 { TRUE, FALSE, FALSE }, // play
50 { FALSE, FALSE, FALSE }, // stop 44 { FALSE, FALSE, FALSE }, // stop
51 { FALSE, FALSE, FALSE }, // next 45 { FALSE, FALSE, FALSE }, // next
52 { FALSE, FALSE, FALSE }, // previous 46 { FALSE, FALSE, FALSE }, // previous
53 { FALSE, FALSE, FALSE }, // volume up 47 { FALSE, FALSE, FALSE }, // volume up
54 { FALSE, FALSE, FALSE }, // volume down 48 { FALSE, FALSE, FALSE }, // volume down
55 { TRUE, FALSE, FALSE }, // repeat/loop 49 { TRUE, FALSE, FALSE }, // repeat/loop
56 { FALSE, FALSE, FALSE }, // playlist 50 { FALSE, FALSE, FALSE }, // playlist
57 { FALSE, FALSE, FALSE }, // forward 51 { FALSE, FALSE, FALSE }, // forward
58 { FALSE, FALSE, FALSE } // back 52 { FALSE, FALSE, FALSE } // back
59}; 53};
60 54
61const char *skin_mask_file_names[10] = { 55const char *skin_mask_file_names[10] = {
62 "play", "stop", "next", "prev", "up", 56 "play", "stop", "next", "prev", "up",
63 "down", "loop", "playlist", "forward", "back" 57 "down", "loop", "playlist", "forward", "back"
64}; 58};
65 59
66static void changeTextColor( QWidget *w ) { 60static void changeTextColor( QWidget *w ) {
67 QPalette p = w->palette(); 61 QPalette p = w->palette();
68 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); 62 p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) );
69 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); 63 p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) );
70 w->setPalette( p ); 64 w->setPalette( p );
71} 65}
72 66
73static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); 67static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton));
74 68
75AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : 69AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
76 QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) 70 QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this )
77{ 71{
diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp
index 753b2e3..b77708c 100644
--- a/core/multimedia/opieplayer/mediaplayer.cpp
+++ b/core/multimedia/opieplayer/mediaplayer.cpp
@@ -1,77 +1,70 @@
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 20
21#include <qpe/qpeapplication.h>
22#include <qpe/qlibrary.h>
23#include <qpe/resource.h>
24#include <qpe/config.h>
25 21
26#include <qmainwindow.h>
27#include <qmessagebox.h> 22#include <qmessagebox.h>
28#include <qwidgetstack.h>
29#include <qfile.h>
30 23
31#include "mediaplayer.h" 24#include "mediaplayer.h"
32#include "playlistwidget.h" 25#include "playlistwidget.h"
33#include "audiowidget.h" 26#include "audiowidget.h"
34#include "loopcontrol.h" 27#include "loopcontrol.h"
35#include "audiodevice.h" 28#include "audiodevice.h"
36 29
37#include "mediaplayerstate.h" 30#include "mediaplayerstate.h"
38 31
39 32
40extern AudioWidget *audioUI; 33extern AudioWidget *audioUI;
41extern PlayListWidget *playList; 34extern PlayListWidget *playList;
42extern LoopControl *loopControl; 35extern LoopControl *loopControl;
43extern MediaPlayerState *mediaPlayerState; 36extern MediaPlayerState *mediaPlayerState;
44 37
45 38
46MediaPlayer::MediaPlayer( QObject *parent, const char *name ) 39MediaPlayer::MediaPlayer( QObject *parent, const char *name )
47 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { 40 : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) {
48 41
49// QPEApplication::grabKeyboard(); 42// QPEApplication::grabKeyboard();
50 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 43 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
51 44
52 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) ); 45 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( setPlaying( bool ) ) );
53 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) ); 46 connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( pauseCheck( bool ) ) );
54 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); 47 connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) );
55 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); 48 connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) );
56 49
57 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); 50 connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) );
58 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); 51 connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) );
59 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); 52 connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) );
60 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); 53 connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) );
61} 54}
62 55
63 56
64MediaPlayer::~MediaPlayer() { 57MediaPlayer::~MediaPlayer() {
65 58
66} 59}
67 60
68 61
69void MediaPlayer::pauseCheck( bool b ) { 62void MediaPlayer::pauseCheck( bool b ) {
70 // Only pause if playing 63 // Only pause if playing
71 if ( b && !mediaPlayerState->playing() ) 64 if ( b && !mediaPlayerState->playing() )
72 mediaPlayerState->setPaused( FALSE ); 65 mediaPlayerState->setPaused( FALSE );
73} 66}
74 67
75 68
76void MediaPlayer::play() { 69void MediaPlayer::play() {
77 mediaPlayerState->setPlaying( FALSE ); 70 mediaPlayerState->setPlaying( FALSE );
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp
index 6823076..5bfb87e 100644
--- a/core/multimedia/opieplayer/mediaplayerstate.cpp
+++ b/core/multimedia/opieplayer/mediaplayerstate.cpp
@@ -1,72 +1,70 @@
1/********************************************************************** 1/**********************************************************************
2 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 2 ** Copyright (C) 2000 Trolltech AS. All rights reserved.
3 ** 3 **
4 ** This file is part of Qtopia Environment. 4 ** This file is part of 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 <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include <qpe/qlibrary.h> 21#include <qpe/qlibrary.h>
22#include <qpe/config.h> 22#include <qpe/config.h>
23#include <qvaluelist.h>
24#include <qobject.h>
25#include <qdir.h> 23#include <qdir.h>
26#include <qpe/mediaplayerplugininterface.h> 24#include <qpe/mediaplayerplugininterface.h>
27#include "mediaplayerstate.h" 25#include "mediaplayerstate.h"
28 26
29 27
30 28
31#ifdef QT_NO_COMPONENT 29#ifdef QT_NO_COMPONENT
32// Plugins which are compiled in when no plugin architecture available 30// Plugins which are compiled in when no plugin architecture available
33#include "libmad/libmadpluginimpl.h" 31#include "libmad/libmadpluginimpl.h"
34#include "libmpeg3/libmpeg3pluginimpl.h" 32#include "libmpeg3/libmpeg3pluginimpl.h"
35#include "wavplugin/wavpluginimpl.h" 33#include "wavplugin/wavpluginimpl.h"
36#endif 34#endif
37 35
38 36
39//#define MediaPlayerDebug(x) qDebug x 37//#define MediaPlayerDebug(x) qDebug x
40#define MediaPlayerDebug(x) 38#define MediaPlayerDebug(x)
41 39
42 40
43MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) 41MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
44 : QObject( parent, name ), decoder( NULL ), libmpeg3decoder( NULL ) { 42 : QObject( parent, name ), decoder( NULL ), libmpeg3decoder( NULL ) {
45 Config cfg( "OpiePlayer" ); 43 Config cfg( "OpiePlayer" );
46 readConfig( cfg ); 44 readConfig( cfg );
47 loadPlugins(); 45 loadPlugins();
48} 46}
49 47
50 48
51MediaPlayerState::~MediaPlayerState() { 49MediaPlayerState::~MediaPlayerState() {
52 Config cfg( "OpiePlayer" ); 50 Config cfg( "OpiePlayer" );
53 writeConfig( cfg ); 51 writeConfig( cfg );
54} 52}
55 53
56 54
57void MediaPlayerState::readConfig( Config& cfg ) { 55void MediaPlayerState::readConfig( Config& cfg ) {
58 cfg.setGroup("Options"); 56 cfg.setGroup("Options");
59 isFullscreen = cfg.readBoolEntry( "FullScreen" ); 57 isFullscreen = cfg.readBoolEntry( "FullScreen" );
60 isScaled = cfg.readBoolEntry( "Scaling" ); 58 isScaled = cfg.readBoolEntry( "Scaling" );
61 isLooping = cfg.readBoolEntry( "Looping" ); 59 isLooping = cfg.readBoolEntry( "Looping" );
62 isShuffled = cfg.readBoolEntry( "Shuffle" ); 60 isShuffled = cfg.readBoolEntry( "Shuffle" );
63 usePlaylist = cfg.readBoolEntry( "UsePlayList" ); 61 usePlaylist = cfg.readBoolEntry( "UsePlayList" );
64 usePlaylist = TRUE; 62 usePlaylist = TRUE;
65 isPlaying = FALSE; 63 isPlaying = FALSE;
66 isPaused = FALSE; 64 isPaused = FALSE;
67 curPosition = 0; 65 curPosition = 0;
68 curLength = 0; 66 curLength = 0;
69 curView = 'l'; 67 curView = 'l';
70} 68}
71 69
72 70
diff --git a/core/multimedia/opieplayer/modplug/load_j2b.cpp b/core/multimedia/opieplayer/modplug/load_j2b.cpp
index 4f0b85c..8b4cccd 100644
--- a/core/multimedia/opieplayer/modplug/load_j2b.cpp
+++ b/core/multimedia/opieplayer/modplug/load_j2b.cpp
@@ -1,17 +1,16 @@
1/* 1/*
2 * This program is free software; you can redistribute it and modify it 2 * This program is free software; you can redistribute it and modify it
3 * under the terms of the GNU General Public License as published by the 3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the license or (at your 4 * Free Software Foundation; either version 2 of the license or (at your
5 * option) any later version. 5 * option) any later version.
6 * 6 *
7 * Authors: Olivier Lapicque <olivierl@jps.net> 7 * Authors: Olivier Lapicque <olivierl@jps.net>
8*/ 8*/
9 9
10 10
11/////////////////////////////////////////////////// 11///////////////////////////////////////////////////
12// 12//
13// J2B module loader 13// J2B module loader
14// 14//
15/////////////////////////////////////////////////// 15///////////////////////////////////////////////////
16#include "stdafx.h"
17 16
diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp
index 778eb22..ae89518 100644
--- a/core/multimedia/opieplayer/om3u.cpp
+++ b/core/multimedia/opieplayer/om3u.cpp
@@ -1,95 +1,82 @@
1/* 1/*
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 "playlistwidget.h"
33#include "om3u.h" 32#include "om3u.h"
34 33
35#include <qpe/applnk.h> 34
36#include <qpe/qpeapplication.h>
37#include <qpe/storage.h>
38#include <qpe/mimetype.h>
39#include <qpe/global.h>
40#include <qpe/resource.h>
41
42#include <qdir.h>
43#include <qregexp.h>
44#include <qstring.h>
45#include <qtextstream.h>
46#include <qstringlist.h>
47#include <qcstring.h>
48 35
49static inline QString fullBaseName ( const QFileInfo &fi ) 36static inline QString fullBaseName ( const QFileInfo &fi )
50{ 37{
51 QString str = fi. fileName ( ); 38 QString str = fi. fileName ( );
52 return str. left ( str. findRev ( '.' )); 39 return str. left ( str. findRev ( '.' ));
53} 40}
54 41
55 42
56//extern PlayListWidget *playList; 43//extern PlayListWidget *playList;
57 44
58Om3u::Om3u( const QString &filePath, int mode) 45Om3u::Om3u( const QString &filePath, int mode)
59 : QStringList (){ 46 : QStringList (){
60//qDebug("<<<<<<<new m3u "+filePath); 47//qDebug("<<<<<<<new m3u "+filePath);
61 f.setName(filePath); 48 f.setName(filePath);
62 f.open(mode); 49 f.open(mode);
63} 50}
64 51
65Om3u::~Om3u(){} 52Om3u::~Om3u(){}
66 53
67void Om3u::readM3u() { 54void Om3u::readM3u() {
68// qDebug("<<<<<<reading m3u "+f.name()); 55// qDebug("<<<<<<reading m3u "+f.name());
69 QTextStream t(&f); 56 QTextStream t(&f);
70 t.setEncoding(QTextStream::UnicodeUTF8); 57 t.setEncoding(QTextStream::UnicodeUTF8);
71 QString s; 58 QString s;
72 while ( !t.atEnd() ) { 59 while ( !t.atEnd() ) {
73 s=t.readLine(); 60 s=t.readLine();
74 // qDebug(s); 61 // qDebug(s);
75 if( s.find( "#", 0, TRUE) == -1 ) { 62 if( s.find( "#", 0, TRUE) == -1 ) {
76 if( s.left(2) == "E:" || s.left(2) == "P:" ) { 63 if( s.left(2) == "E:" || s.left(2) == "P:" ) {
77 s = s.right( s.length() -2 ); 64 s = s.right( s.length() -2 );
78 QFileInfo f( s ); 65 QFileInfo f( s );
79 QString name = fullBaseName ( f ); 66 QString name = fullBaseName ( f );
80 name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); 67 name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 );
81 s=s.replace( QRegExp( "\\" ), "/" ); 68 s=s.replace( QRegExp( "\\" ), "/" );
82 append(s); 69 append(s);
83 // qDebug(s); 70 // qDebug(s);
84 } else { // is url 71 } else { // is url
85 s.replace( QRegExp( "%20" )," " ); 72 s.replace( QRegExp( "%20" )," " );
86 QString name; 73 QString name;
87 // if( name.left( 4 ) == "http" ) { 74 // if( name.left( 4 ) == "http" ) {
88 // name = s.right( s.length() - 7 ); 75 // name = s.right( s.length() - 7 );
89 // } else { 76 // } else {
90 name = s; 77 name = s;
91 // } 78 // }
92 append(name); 79 append(name);
93 // qDebug(name); 80 // qDebug(name);
94 } 81 }
95 } 82 }
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp
index 94567f2..ad831cf 100644
--- a/core/multimedia/opieplayer/playlistselection.cpp
+++ b/core/multimedia/opieplayer/playlistselection.cpp
@@ -1,77 +1,69 @@
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 <qpe/applnk.h>
21#include <qpe/resource.h>
22#include <qpe/config.h>
23 20
24#include <qpainter.h>
25#include <qimage.h>
26#include <qheader.h> 21#include <qheader.h>
27#include <qlistview.h>
28#include <qlist.h>
29#include <qpixmap.h>
30 22
31#include "playlistselection.h" 23#include "playlistselection.h"
32 24
33#include <stdlib.h> 25#include <stdlib.h>
34 26
35class PlayListSelectionItem : public QListViewItem { 27class PlayListSelectionItem : public QListViewItem {
36public: 28public:
37 PlayListSelectionItem( QListView *parent, const DocLnk *f ) : QListViewItem( parent ), fl( f ) { 29 PlayListSelectionItem( QListView *parent, const DocLnk *f ) : QListViewItem( parent ), fl( f ) {
38 setText( 0, f->name() ); 30 setText( 0, f->name() );
39 setPixmap( 0, f->pixmap() ); 31 setPixmap( 0, f->pixmap() );
40 } 32 }
41 33
42 ~PlayListSelectionItem() { 34 ~PlayListSelectionItem() {
43 }; 35 };
44 36
45 const DocLnk *file() const { return fl; } 37 const DocLnk *file() const { return fl; }
46 38
47private: 39private:
48 const DocLnk *fl; 40 const DocLnk *fl;
49}; 41};
50 42
51 43
52PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) 44PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
53 : QListView( parent, name ) 45 : QListView( parent, name )
54{ 46{
55// qDebug("starting playlistselector"); 47// qDebug("starting playlistselector");
56// #ifdef USE_PLAYLIST_BACKGROUND 48// #ifdef USE_PLAYLIST_BACKGROUND
57// setStaticBackground( TRUE ); 49// setStaticBackground( TRUE );
58// setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) ); 50// setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) );
59 51
60// setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); 52// setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) );
61// #endif 53// #endif
62// addColumn("Title",236); 54// addColumn("Title",236);
63// setAllColumnsShowFocus( TRUE ); 55// setAllColumnsShowFocus( TRUE );
64 addColumn( tr( "Playlist Selection" ) ); 56 addColumn( tr( "Playlist Selection" ) );
65 header()->hide(); 57 header()->hide();
66// setSorting( -1, FALSE ); 58// setSorting( -1, FALSE );
67 // FIXME 59 // FIXME
68} 60}
69 61
70 62
71PlayListSelection::~PlayListSelection() { 63PlayListSelection::~PlayListSelection() {
72} 64}
73 65
74 66
75// #ifdef USE_PLAYLIST_BACKGROUND 67// #ifdef USE_PLAYLIST_BACKGROUND
76void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { 68void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) {
77// qDebug("drawBackground"); 69// qDebug("drawBackground");
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index db99866..a359843 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -1,102 +1,77 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of 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// code added by L. J. Potter Sat 03-02-2002 06:17:54 20// code added by L. J. Potter Sat 03-02-2002 06:17:54
21#define QTOPIA_INTERNAL_FSLP 21#define QTOPIA_INTERNAL_FSLP
22#include <qpe/qcopenvelope_qws.h>
23 22
24#include <qmenubar.h>
25#include <qtoolbar.h> 23#include <qtoolbar.h>
26#include <qpe/qpemenubar.h> 24#include <qpe/qpemenubar.h>
27#include <qpe/fileselector.h>
28#include <qpe/qpeapplication.h>
29#include <qpe/lnkproperties.h> 25#include <qpe/lnkproperties.h>
30#include <qpe/storage.h>
31 26
32#include <qpe/applnk.h>
33#include <qpe/config.h>
34#include <qpe/global.h>
35#include <qpe/resource.h>
36#include <qaction.h> 27#include <qaction.h>
37#include <qcursor.h>
38#include <qimage.h>
39#include <qfile.h>
40#include <qdir.h>
41#include <qlayout.h> 28#include <qlayout.h>
42#include <qlabel.h>
43#include <qlist.h>
44#include <qlistbox.h>
45#include <qmainwindow.h>
46#include <qmessagebox.h> 29#include <qmessagebox.h>
47#include <qtoolbutton.h>
48#include <qtabwidget.h>
49#include <qlistview.h>
50#include <qpoint.h>
51#include <qlineedit.h>
52#include <qpushbutton.h>
53#include <qregexp.h>
54#include <qtextstream.h>
55 30
56//#include <qtimer.h> 31//#include <qtimer.h>
57 32
58#include "playlistselection.h" 33#include "playlistselection.h"
59#include "playlistwidget.h" 34#include "playlistwidget.h"
60#include "mediaplayerstate.h" 35#include "mediaplayerstate.h"
61 36
62#include "inputDialog.h" 37#include "inputDialog.h"
63 38
64#include <stdlib.h> 39#include <stdlib.h>
65#include "audiowidget.h" 40#include "audiowidget.h"
66#include "videowidget.h" 41#include "videowidget.h"
67 42
68#include <unistd.h> 43#include <unistd.h>
69#include <sys/file.h> 44#include <sys/file.h>
70#include <sys/ioctl.h> 45#include <sys/ioctl.h>
71#include <sys/soundcard.h> 46#include <sys/soundcard.h>
72 47
73// for setBacklight() 48// for setBacklight()
74#include <linux/fb.h> 49#include <linux/fb.h>
75#include <sys/types.h> 50#include <sys/types.h>
76#include <sys/stat.h> 51#include <sys/stat.h>
77#include <stdlib.h> 52#include <stdlib.h>
78 53
79#define BUTTONS_ON_TOOLBAR 54#define BUTTONS_ON_TOOLBAR
80#define SIDE_BUTTONS 55#define SIDE_BUTTONS
81#define CAN_SAVE_LOAD_PLAYLISTS 56#define CAN_SAVE_LOAD_PLAYLISTS
82 57
83extern AudioWidget *audioUI; 58extern AudioWidget *audioUI;
84extern VideoWidget *videoUI; 59extern VideoWidget *videoUI;
85extern MediaPlayerState *mediaPlayerState; 60extern MediaPlayerState *mediaPlayerState;
86 61
87static inline QString fullBaseName ( const QFileInfo &fi ) 62static inline QString fullBaseName ( const QFileInfo &fi )
88{ 63{
89 QString str = fi. fileName ( ); 64 QString str = fi. fileName ( );
90 return str. left ( str. findRev ( '.' )); 65 return str. left ( str. findRev ( '.' ));
91} 66}
92 67
93 68
94QString audioMimes ="audio/mpeg;audio/x-wav;application/ogg;audio/x-mod"; 69QString audioMimes ="audio/mpeg;audio/x-wav;application/ogg;audio/x-mod";
95// class myFileSelector { 70// class myFileSelector {
96 71
97// }; 72// };
98class PlayListWidgetPrivate { 73class PlayListWidgetPrivate {
99public: 74public:
100 QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; 75 QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove;
101 QFrame *playListFrame; 76 QFrame *playListFrame;
102 FileSelector *files; 77 FileSelector *files;
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp
index 5273ad3..d002c42 100644
--- a/core/multimedia/opieplayer/videowidget.cpp
+++ b/core/multimedia/opieplayer/videowidget.cpp
@@ -1,78 +1,74 @@
1/********************************************************************** 1/**********************************************************************
2 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 2 ** Copyright (C) 2000 Trolltech AS. All rights reserved.
3 ** 3 **
4 ** This file is part of Qtopia Environment. 4 ** This file is part of 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 <qpe/resource.h> 20#include <qpe/resource.h>
21#include <qpe/mediaplayerplugininterface.h> 21#include <qpe/mediaplayerplugininterface.h>
22#include <qpe/config.h> 22#include <qpe/config.h>
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24 24
25#include <qdir.h> 25#include <qdir.h>
26#include <qwidget.h>
27#include <qpainter.h>
28#include <qpixmap.h>
29#include <qslider.h> 26#include <qslider.h>
30#include <qdrawutil.h>
31#include "videowidget.h" 27#include "videowidget.h"
32#include "mediaplayerstate.h" 28#include "mediaplayerstate.h"
33 29
34 30
35#ifdef Q_WS_QWS 31#ifdef Q_WS_QWS
36# define USE_DIRECT_PAINTER 32# define USE_DIRECT_PAINTER
37# include <qdirectpainter_qws.h> 33# include <qdirectpainter_qws.h>
38# include <qgfxraster_qws.h> 34# include <qgfxraster_qws.h>
39#endif 35#endif
40 36
41 37
42extern MediaPlayerState *mediaPlayerState; 38extern MediaPlayerState *mediaPlayerState;
43 39
44 40
45static const int xo = 2; // movable x offset 41static const int xo = 2; // movable x offset
46static const int yo = 0; // movable y offset 42static const int yo = 0; // movable y offset
47 43
48 44
49struct MediaButton { 45struct MediaButton {
50// int xPos, yPos; 46// int xPos, yPos;
51 bool isToggle, isHeld, isDown; 47 bool isToggle, isHeld, isDown;
52// int controlType; 48// int controlType;
53}; 49};
54 50
55 51
56// Layout information for the videoButtons (and if it is a toggle button or not) 52// Layout information for the videoButtons (and if it is a toggle button or not)
57MediaButton videoButtons[] = { 53MediaButton videoButtons[] = {
58 { FALSE, FALSE, FALSE }, // stop 54 { FALSE, FALSE, FALSE }, // stop
59 { FALSE, FALSE, FALSE }, // play 55 { FALSE, FALSE, FALSE }, // play
60 { FALSE, FALSE, FALSE }, // previous 56 { FALSE, FALSE, FALSE }, // previous
61 { FALSE, FALSE, FALSE }, // next 57 { FALSE, FALSE, FALSE }, // next
62 { FALSE, FALSE, FALSE }, // volUp 58 { FALSE, FALSE, FALSE }, // volUp
63 { FALSE, FALSE, FALSE }, // volDown 59 { FALSE, FALSE, FALSE }, // volDown
64 { TRUE, FALSE, FALSE } // fullscreen 60 { TRUE, FALSE, FALSE } // fullscreen
65}; 61};
66 62
67//static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton)); 63//static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton));
68 64
69const char *skinV_mask_file_names[7] = { 65const char *skinV_mask_file_names[7] = {
70 "stop","play","back","fwd","up","down","full" 66 "stop","play","back","fwd","up","down","full"
71}; 67};
72 68
73static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton)); 69static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton));
74 70
75VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : 71VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
76 QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) 72 QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 )
77{ 73{
78 setCaption( tr("OpiePlayer") ); 74 setCaption( tr("OpiePlayer") );