author | chicken <chicken> | 2004-03-02 15:11:14 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-03-02 15:11:14 (UTC) |
commit | b48c5437e9631094d15ec7280a9d1cf212b3eb28 (patch) (unidiff) | |
tree | 4c0095e58acc98ba6e8ba40240c491d03b99be92 /noncore/multimedia/opieplayer2 | |
parent | 12dd57c04b42d4517061ed847b1aa041dd8af841 (diff) | |
download | opie-b48c5437e9631094d15ec7280a9d1cf212b3eb28.zip opie-b48c5437e9631094d15ec7280a9d1cf212b3eb28.tar.gz opie-b48c5437e9631094d15ec7280a9d1cf212b3eb28.tar.bz2 |
fix includes
Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/inputDialog.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/main.cpp | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.cpp | 15 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistselection.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/volumecontrol.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 3 |
16 files changed, 1 insertions, 57 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index f3eafab..452117c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -1,85 +1,83 @@ | |||
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 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 | ..}^=.= = ; 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 | #include "mediaplayerstate.h" | ||
37 | #include "playlistwidget.h" | ||
38 | 36 | ||
39 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
40 | 38 | ||
41 | namespace | 39 | namespace |
42 | { | 40 | { |
43 | 41 | ||
44 | const int xo = -2; // movable x offset | 42 | const int xo = -2; // movable x offset |
45 | const int yo = 22; // movable y offset | 43 | const int yo = 22; // movable y offset |
46 | 44 | ||
47 | const MediaWidget::SkinButtonInfo skinInfo[] = | 45 | const MediaWidget::SkinButtonInfo skinInfo[] = |
48 | { | 46 | { |
49 | { MediaWidget::Play, "play", MediaWidget::ToggleButton }, | 47 | { MediaWidget::Play, "play", MediaWidget::ToggleButton }, |
50 | { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, | 48 | { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, |
51 | { MediaWidget::Next, "next", MediaWidget::NormalButton }, | 49 | { MediaWidget::Next, "next", MediaWidget::NormalButton }, |
52 | { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, | 50 | { MediaWidget::Previous, "prev", MediaWidget::NormalButton }, |
53 | { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, | 51 | { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, |
54 | { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, | 52 | { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, |
55 | { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, | 53 | { MediaWidget::Loop, "loop", MediaWidget::ToggleButton }, |
56 | { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, | 54 | { MediaWidget::PlayList, "playlist", MediaWidget::NormalButton }, |
57 | { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, | 55 | { MediaWidget::Forward, "forward", MediaWidget::NormalButton }, |
58 | { MediaWidget::Back, "back", MediaWidget::NormalButton } | 56 | { MediaWidget::Back, "back", MediaWidget::NormalButton } |
59 | }; | 57 | }; |
60 | 58 | ||
61 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); | 59 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); |
62 | 60 | ||
63 | void changeTextColor( QWidget * w) { | 61 | void changeTextColor( QWidget * w) { |
64 | QPalette p = w->palette(); | 62 | QPalette p = w->palette(); |
65 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); | 63 | p.setBrush( QColorGroup::Background, QColor( 167, 212, 167 ) ); |
66 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); | 64 | p.setBrush( QColorGroup::Base, QColor( 167, 212, 167 ) ); |
67 | w->setPalette( p ); | 65 | w->setPalette( p ); |
68 | } | 66 | } |
69 | 67 | ||
70 | } | 68 | } |
71 | 69 | ||
72 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : | 70 | AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name) : |
73 | 71 | ||
74 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), | 72 | MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), |
75 | audioSliderBeingMoved( false ) | 73 | audioSliderBeingMoved( false ) |
76 | { | 74 | { |
77 | setCaption( tr("OpiePlayer") ); | 75 | setCaption( tr("OpiePlayer") ); |
78 | 76 | ||
79 | loadSkin(); | 77 | loadSkin(); |
80 | 78 | ||
81 | connect( &mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); | 79 | connect( &mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); |
82 | connect( &mediaPlayerState, SIGNAL( isSeekableToggled(bool) ), this, SLOT( setSeekable(bool) ) ); | 80 | connect( &mediaPlayerState, SIGNAL( isSeekableToggled(bool) ), this, SLOT( setSeekable(bool) ) ); |
83 | 81 | ||
84 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); | 82 | connect( this, SIGNAL( forwardClicked() ), this, SLOT( skipFor() ) ); |
85 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); | 83 | connect( this, SIGNAL( backClicked() ), this, SLOT( skipBack() ) ); |
diff --git a/noncore/multimedia/opieplayer2/inputDialog.cpp b/noncore/multimedia/opieplayer2/inputDialog.cpp index ebde9c6..05dc2d1 100644 --- a/noncore/multimedia/opieplayer2/inputDialog.cpp +++ b/noncore/multimedia/opieplayer2/inputDialog.cpp | |||
@@ -1,74 +1,67 @@ | |||
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,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 | =. | 6 | =. |
7 | .=l. | 7 | .=l. |
8 | .>+-= | 8 | .>+-= |
9 | _;:, .> :=|. This program is free software; you can | 9 | _;:, .> :=|. This program is free software; you can |
10 | .> <`_, > . <= redistribute it and/or modify it under | 10 | .> <`_, > . <= redistribute it and/or modify it under |
11 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 11 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
12 | .="- .-=="i, .._ License as published by the Free Software | 12 | .="- .-=="i, .._ License as published by the Free Software |
13 | - . .-<_> .<> Foundation; either version 2 of the License, | 13 | - . .-<_> .<> Foundation; either version 2 of the License, |
14 | ._= =} : or (at your option) any later version. | 14 | ._= =} : or (at your option) any later version. |
15 | .%`+i> _;_. | 15 | .%`+i> _;_. |
16 | .i_,=:_. -<s. This program is distributed in the hope that | 16 | .i_,=:_. -<s. This program is distributed in the hope that |
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
18 | : .. .:, . . . without even the implied warranty of | 18 | : .. .:, . . . without even the implied warranty of |
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
21 | ..}^=.= = ; General Public License for more | 21 | ..}^=.= = ; General Public License for more |
22 | ++= -. .` .: details. | 22 | ++= -. .` .: details. |
23 | : = ...= . :.=- | 23 | : = ...= . :.=- |
24 | -. .:....=;==+<; You should have received a copy of the GNU | 24 | -. .:....=;==+<; You should have received a copy of the GNU |
25 | -_. . . )=. = General Public License along with | 25 | -_. . . )=. = General Public License along with |
26 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
27 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
28 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
29 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
30 | 30 | ||
31 | */ | 31 | */ |
32 | 32 | ||
33 | 33 | ||
34 | #include "inputDialog.h" | 34 | #include "inputDialog.h" |
35 | 35 | ||
36 | #include <qpe/resource.h> | ||
37 | #include <qpe/qpeapplication.h> | ||
38 | 36 | ||
39 | #include <qfileinfo.h> | ||
40 | #include <qlineedit.h> | 37 | #include <qlineedit.h> |
41 | #include <qlayout.h> | ||
42 | #include <qvariant.h> | ||
43 | #include <qpushbutton.h> | ||
44 | #include <qwhatsthis.h> | ||
45 | 38 | ||
46 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 39 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
47 | : QDialog( parent, name, modal, fl ) { | 40 | : QDialog( parent, name, modal, fl ) { |
48 | if ( !name ) { | 41 | if ( !name ) { |
49 | setName( "InputDialog" ); | 42 | setName( "InputDialog" ); |
50 | } | 43 | } |
51 | resize( 234, 115); | 44 | resize( 234, 115); |
52 | setMaximumSize( QSize( 240, 40)); | 45 | setMaximumSize( QSize( 240, 40)); |
53 | setCaption( tr( name ) ); | 46 | setCaption( tr( name ) ); |
54 | 47 | ||
55 | QPushButton *browserButton; | 48 | QPushButton *browserButton; |
56 | //browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); | 49 | //browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); |
57 | //browserButton->setGeometry( QRect( 205, 10, 22, 22)); | 50 | //browserButton->setGeometry( QRect( 205, 10, 22, 22)); |
58 | //connect( browserButton, SIGNAL(released()),this,SLOT(browse())); | 51 | //connect( browserButton, SIGNAL(released()),this,SLOT(browse())); |
59 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 52 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
60 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); | 53 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); |
61 | LineEdit1->setFocus(); | 54 | LineEdit1->setFocus(); |
62 | } | 55 | } |
63 | /* | 56 | /* |
64 | * return the current text(input) | 57 | * return the current text(input) |
65 | */ | 58 | */ |
66 | QString InputDialog::text() const { | 59 | QString InputDialog::text() const { |
67 | return LineEdit1->text(); | 60 | return LineEdit1->text(); |
68 | } | 61 | } |
69 | /* | 62 | /* |
70 | * Destroys the object and frees any allocated resources | 63 | * Destroys the object and frees any allocated resources |
71 | */ | 64 | */ |
72 | InputDialog::~InputDialog() { | 65 | InputDialog::~InputDialog() { |
73 | } | 66 | } |
74 | 67 | ||
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 664ec65..a42b8e5 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -1,88 +1,87 @@ | |||
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 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 | 34 | ||
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | 36 | ||
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | 38 | ||
39 | #include <qgfx_qws.h> | 39 | #include <qgfx_qws.h> |
40 | #include <qdirectpainter_qws.h> | ||
41 | 40 | ||
42 | #include <assert.h> | 41 | #include <assert.h> |
43 | 42 | ||
44 | #include "xinevideowidget.h" | 43 | #include "xinevideowidget.h" |
45 | #include "frame.h" | 44 | #include "frame.h" |
46 | #include "lib.h" | 45 | #include "lib.h" |
47 | 46 | ||
48 | 47 | ||
49 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, | 48 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, |
50 | int width, int height,int bytes ); | 49 | int width, int height,int bytes ); |
51 | 50 | ||
52 | extern "C" { | 51 | extern "C" { |
53 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * ); | 52 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * ); |
54 | int null_is_showing_video( const xine_vo_driver_t* self ); | 53 | int null_is_showing_video( const xine_vo_driver_t* self ); |
55 | void null_set_show_video( const xine_vo_driver_t* self, int show ); | 54 | void null_set_show_video( const xine_vo_driver_t* self, int show ); |
56 | int null_is_fullscreen( const xine_vo_driver_t* self ); | 55 | int null_is_fullscreen( const xine_vo_driver_t* self ); |
57 | void null_set_fullscreen( const xine_vo_driver_t* self, int screen ); | 56 | void null_set_fullscreen( const xine_vo_driver_t* self, int screen ); |
58 | int null_is_scaling( const xine_vo_driver_t* self ); | 57 | int null_is_scaling( const xine_vo_driver_t* self ); |
59 | void null_set_scaling( const xine_vo_driver_t* self, int scale ); | 58 | void null_set_scaling( const xine_vo_driver_t* self, int scale ); |
60 | void null_set_gui_width( const xine_vo_driver_t* self, int width ); | 59 | void null_set_gui_width( const xine_vo_driver_t* self, int width ); |
61 | void null_set_gui_height( const xine_vo_driver_t* self, int height ); | 60 | void null_set_gui_height( const xine_vo_driver_t* self, int height ); |
62 | void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb ); | 61 | void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb ); |
63 | void null_set_videoGamma( const xine_vo_driver_t* self , int value ); | 62 | void null_set_videoGamma( const xine_vo_driver_t* self , int value ); |
64 | void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data ); | 63 | void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data ); |
65 | 64 | ||
66 | void null_preload_decoders( xine_stream_t *stream ); | 65 | void null_preload_decoders( xine_stream_t *stream ); |
67 | } | 66 | } |
68 | 67 | ||
69 | using namespace XINE; | 68 | using namespace XINE; |
70 | 69 | ||
71 | Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) | 70 | Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) |
72 | { | 71 | { |
73 | m_initialized = false; | 72 | m_initialized = false; |
74 | m_duringInitialization = false; | 73 | m_duringInitialization = false; |
75 | m_video = false; | 74 | m_video = false; |
76 | m_wid = widget; | 75 | m_wid = widget; |
77 | printf("Lib"); | 76 | printf("Lib"); |
78 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; | 77 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; |
79 | // get the configuration | 78 | // get the configuration |
80 | 79 | ||
81 | // not really OO, should be an extra class, later | 80 | // not really OO, should be an extra class, later |
82 | if ( !QFile::exists(configPath) ) { | 81 | if ( !QFile::exists(configPath) ) { |
83 | QFile f(configPath); | 82 | QFile f(configPath); |
84 | f.open(IO_WriteOnly); | 83 | f.open(IO_WriteOnly); |
85 | QTextStream ts( &f ); | 84 | QTextStream ts( &f ); |
86 | ts << "misc.memcpy_method:glibc\n"; | 85 | ts << "misc.memcpy_method:glibc\n"; |
87 | ts << "# uncomment if you experience double speed audio \n #audio.oss_sync_method:softsync\n"; | 86 | ts << "# uncomment if you experience double speed audio \n #audio.oss_sync_method:softsync\n"; |
88 | ts << "codec.ffmpeg_pp_quality:3\n"; | 87 | ts << "codec.ffmpeg_pp_quality:3\n"; |
diff --git a/noncore/multimedia/opieplayer2/main.cpp b/noncore/multimedia/opieplayer2/main.cpp index b0a22b2..00f72d1 100644 --- a/noncore/multimedia/opieplayer2/main.cpp +++ b/noncore/multimedia/opieplayer2/main.cpp | |||
@@ -1,29 +1,26 @@ | |||
1 | 1 | ||
2 | #include <qpe/qpeapplication.h> | ||
3 | #include "mediaplayerstate.h" | ||
4 | #include "playlistwidget.h" | ||
5 | #include "mediaplayer.h" | 2 | #include "mediaplayer.h" |
6 | 3 | ||
7 | 4 | ||
8 | 5 | ||
9 | #include <opie/oapplicationfactory.h> | 6 | #include <opie/oapplicationfactory.h> |
10 | 7 | ||
11 | OPIE_EXPORT_APP( OApplicationFactory<PlayListWidget> ) | 8 | OPIE_EXPORT_APP( OApplicationFactory<PlayListWidget> ) |
12 | 9 | ||
13 | #if 0 | 10 | #if 0 |
14 | int main(int argc, char **argv) { | 11 | int main(int argc, char **argv) { |
15 | QPEApplication a(argc,argv); | 12 | QPEApplication a(argc,argv); |
16 | 13 | ||
17 | MediaPlayerState st( 0, "mediaPlayerState" ); | 14 | MediaPlayerState st( 0, "mediaPlayerState" ); |
18 | PlayListWidget pl( st, 0, "playList" ); | 15 | PlayListWidget pl( st, 0, "playList" ); |
19 | pl.showMaximized(); | 16 | pl.showMaximized(); |
20 | MediaPlayer mp( pl, st, 0, "mediaPlayer" ); | 17 | MediaPlayer mp( pl, st, 0, "mediaPlayer" ); |
21 | QObject::connect( &pl, SIGNAL( skinSelected() ), | 18 | QObject::connect( &pl, SIGNAL( skinSelected() ), |
22 | &mp, SLOT( reloadSkins() ) ); | 19 | &mp, SLOT( reloadSkins() ) ); |
23 | 20 | ||
24 | a.showMainDocumentWidget(&pl); | 21 | a.showMainDocumentWidget(&pl); |
25 | 22 | ||
26 | return a.exec(); | 23 | return a.exec(); |
27 | } | 24 | } |
28 | #endif | 25 | #endif |
29 | 26 | ||
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 1e6bc4d..a236775 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -1,61 +1,57 @@ | |||
1 | #include <qpe/qpeapplication.h> | 1 | #include <qpe/qpeapplication.h> |
2 | #include <qpe/config.h> | 2 | #include <qpe/config.h> |
3 | #include <qpe/qcopenvelope_qws.h> | ||
4 | #include <qfileinfo.h> | 3 | #include <qfileinfo.h> |
5 | 4 | ||
6 | #include "mediaplayer.h" | 5 | #include "mediaplayer.h" |
7 | #include "playlistwidget.h" | ||
8 | #include "audiowidget.h" | 6 | #include "audiowidget.h" |
9 | #include "videowidget.h" | 7 | #include "videowidget.h" |
10 | #include "volumecontrol.h" | 8 | #include "volumecontrol.h" |
11 | #include "lib.h" | ||
12 | 9 | ||
13 | #include "mediaplayerstate.h" | ||
14 | 10 | ||
15 | // for setBacklight() | 11 | // for setBacklight() |
16 | #include <linux/fb.h> | 12 | #include <linux/fb.h> |
17 | #include <sys/file.h> | 13 | #include <sys/file.h> |
18 | #include <sys/ioctl.h> | 14 | #include <sys/ioctl.h> |
19 | 15 | ||
20 | 16 | ||
21 | #define FBIOBLANK 0x4611 | 17 | #define FBIOBLANK 0x4611 |
22 | 18 | ||
23 | MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) | 19 | MediaPlayer::MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ) |
24 | : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { | 20 | : QObject( parent, name ), volumeDirection( 0 ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) { |
25 | 21 | ||
26 | m_audioUI = 0; | 22 | m_audioUI = 0; |
27 | m_videoUI = 0; | 23 | m_videoUI = 0; |
28 | m_xineControl = 0; | 24 | m_xineControl = 0; |
29 | xine = new XINE::Lib( XINE::Lib::InitializeInThread ); | 25 | xine = new XINE::Lib( XINE::Lib::InitializeInThread ); |
30 | 26 | ||
31 | fd=-1;fl=-1; | 27 | fd=-1;fl=-1; |
32 | playList.setCaption( tr( "OpiePlayer: Initializating" ) ); | 28 | playList.setCaption( tr( "OpiePlayer: Initializating" ) ); |
33 | 29 | ||
34 | qApp->processEvents(); | 30 | qApp->processEvents(); |
35 | // QPEApplication::grabKeyboard(); // EVIL | 31 | // QPEApplication::grabKeyboard(); // EVIL |
36 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 32 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
37 | 33 | ||
38 | connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); | 34 | connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); |
39 | 35 | ||
40 | // What is pauseCheck good for? (Simon) | 36 | // What is pauseCheck good for? (Simon) |
41 | // connect( &mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pauseCheck(bool) ) ); | 37 | // connect( &mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pauseCheck(bool) ) ); |
42 | 38 | ||
43 | connect( &mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); | 39 | connect( &mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); |
44 | connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); | 40 | connect( &mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); |
45 | connect( &mediaPlayerState, SIGNAL( blankToggled(bool) ), this, SLOT ( blank(bool) ) ); | 41 | connect( &mediaPlayerState, SIGNAL( blankToggled(bool) ), this, SLOT ( blank(bool) ) ); |
46 | 42 | ||
47 | volControl = new VolumeControl; | 43 | volControl = new VolumeControl; |
48 | Config cfg( "OpiePlayer" ); | 44 | Config cfg( "OpiePlayer" ); |
49 | cfg.setGroup("PlayList"); | 45 | cfg.setGroup("PlayList"); |
50 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); | 46 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); |
51 | playList.setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); | 47 | playList.setCaption( tr( "OpiePlayer: " ) + QFileInfo(currentPlaylist).baseName() ); |
52 | 48 | ||
53 | m_skinLoader = new SkinLoader; | 49 | m_skinLoader = new SkinLoader; |
54 | m_skinLoader->schedule( AudioWidget::guiInfo() ); | 50 | m_skinLoader->schedule( AudioWidget::guiInfo() ); |
55 | m_skinLoader->schedule( VideoWidget::guiInfo() ); | 51 | m_skinLoader->schedule( VideoWidget::guiInfo() ); |
56 | m_skinLoader->start(); | 52 | m_skinLoader->start(); |
57 | } | 53 | } |
58 | 54 | ||
59 | MediaPlayer::~MediaPlayer() { | 55 | MediaPlayer::~MediaPlayer() { |
60 | // this shold never happen, but one never knows... | 56 | // this shold never happen, but one never knows... |
61 | if ( xine ) { | 57 | if ( xine ) { |
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 40fa1a4..203ff91 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -1,89 +1,84 @@ | |||
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 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 | // this file is based on work by trolltech | 34 | // this file is based on work by trolltech |
35 | 35 | ||
36 | #include <qpe/qpeapplication.h> | ||
37 | #include <qpe/qlibrary.h> | ||
38 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
39 | #include <qvaluelist.h> | ||
40 | #include <qobject.h> | ||
41 | #include <qdir.h> | ||
42 | #include "mediaplayerstate.h" | 37 | #include "mediaplayerstate.h" |
43 | 38 | ||
44 | #include <assert.h> | 39 | #include <assert.h> |
45 | 40 | ||
46 | //#define MediaPlayerDebug(x) qDebug x | 41 | //#define MediaPlayerDebug(x) qDebug x |
47 | #define MediaPlayerDebug(x) | 42 | #define MediaPlayerDebug(x) |
48 | 43 | ||
49 | 44 | ||
50 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) | 45 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) |
51 | : QObject( parent, name ) { | 46 | : QObject( parent, name ) { |
52 | Config cfg( "OpiePlayer" ); | 47 | Config cfg( "OpiePlayer" ); |
53 | readConfig( cfg ); | 48 | readConfig( cfg ); |
54 | streaming = false; | 49 | streaming = false; |
55 | seekable = true; | 50 | seekable = true; |
56 | } | 51 | } |
57 | 52 | ||
58 | 53 | ||
59 | MediaPlayerState::~MediaPlayerState() { | 54 | MediaPlayerState::~MediaPlayerState() { |
60 | } | 55 | } |
61 | 56 | ||
62 | 57 | ||
63 | void MediaPlayerState::readConfig( Config& cfg ) { | 58 | void MediaPlayerState::readConfig( Config& cfg ) { |
64 | cfg.setGroup("Options"); | 59 | cfg.setGroup("Options"); |
65 | fullscreen = cfg.readBoolEntry( "FullScreen" ); | 60 | fullscreen = cfg.readBoolEntry( "FullScreen" ); |
66 | scaled = cfg.readBoolEntry( "Scaling" ); | 61 | scaled = cfg.readBoolEntry( "Scaling" ); |
67 | looping = cfg.readBoolEntry( "Looping" ); | 62 | looping = cfg.readBoolEntry( "Looping" ); |
68 | shuffled = cfg.readBoolEntry( "Shuffle" ); | 63 | shuffled = cfg.readBoolEntry( "Shuffle" ); |
69 | videoGamma = cfg.readNumEntry( "VideoGamma" ); | 64 | videoGamma = cfg.readNumEntry( "VideoGamma" ); |
70 | playing = FALSE; | 65 | playing = FALSE; |
71 | streaming = FALSE; | 66 | streaming = FALSE; |
72 | paused = FALSE; | 67 | paused = FALSE; |
73 | curPosition = 0; | 68 | curPosition = 0; |
74 | curLength = 0; | 69 | curLength = 0; |
75 | m_displayType = MediaSelection; | 70 | m_displayType = MediaSelection; |
76 | } | 71 | } |
77 | 72 | ||
78 | 73 | ||
79 | void MediaPlayerState::writeConfig( Config& cfg ) const { | 74 | void MediaPlayerState::writeConfig( Config& cfg ) const { |
80 | cfg.setGroup( "Options" ); | 75 | cfg.setGroup( "Options" ); |
81 | cfg.writeEntry( "FullScreen", fullscreen ); | 76 | cfg.writeEntry( "FullScreen", fullscreen ); |
82 | cfg.writeEntry( "Scaling", scaled ); | 77 | cfg.writeEntry( "Scaling", scaled ); |
83 | cfg.writeEntry( "Looping", looping ); | 78 | cfg.writeEntry( "Looping", looping ); |
84 | cfg.writeEntry( "Shuffle", shuffled ); | 79 | cfg.writeEntry( "Shuffle", shuffled ); |
85 | cfg.writeEntry( "VideoGamma", videoGamma ); | 80 | cfg.writeEntry( "VideoGamma", videoGamma ); |
86 | } | 81 | } |
87 | 82 | ||
88 | MediaPlayerState::DisplayType MediaPlayerState::displayType() const | 83 | MediaPlayerState::DisplayType MediaPlayerState::displayType() const |
89 | { | 84 | { |
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 08c62a2..563ccf5 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -1,74 +1,73 @@ | |||
1 | /* | 1 | /* |
2 | Copyright (C) 2002 Simon Hausmann <simon@lst.de> | 2 | Copyright (C) 2002 Simon Hausmann <simon@lst.de> |
3 | (C) 2002 Max Reiss <harlekin@handhelds.org> | 3 | (C) 2002 Max Reiss <harlekin@handhelds.org> |
4 | (C) 2002 L. Potter <ljp@llornkcor.com> | 4 | (C) 2002 L. Potter <ljp@llornkcor.com> |
5 | (C) 2002 Holger Freyther <zecke@handhelds.org> | 5 | (C) 2002 Holger Freyther <zecke@handhelds.org> |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or | 7 | This program is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU General Public | 8 | modify it under the terms of the GNU General Public |
9 | License as published by the Free Software Foundation; either | 9 | License as published by the Free Software Foundation; either |
10 | version 2 of the License, or (at your option) any later version. | 10 | version 2 of the License, or (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | General Public License for more details. | 15 | General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; see the file COPYING. If not, write to | 18 | along with this program; see the file COPYING. If not, write to |
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. | 20 | Boston, MA 02111-1307, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <assert.h> | 23 | #include <assert.h> |
24 | 24 | ||
25 | #include "mediawidget.h" | 25 | #include "mediawidget.h" |
26 | #include "playlistwidget.h" | ||
27 | #include "skin.h" | 26 | #include "skin.h" |
28 | 27 | ||
29 | MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) | 28 | MediaWidget::MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent, const char *name ) |
30 | : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) | 29 | : QWidget( parent, name ), mediaPlayerState( _mediaPlayerState ), playList( _playList ) |
31 | { | 30 | { |
32 | connect( &mediaPlayerState, SIGNAL( displayTypeChanged(MediaPlayerState::DisplayType) ), | 31 | connect( &mediaPlayerState, SIGNAL( displayTypeChanged(MediaPlayerState::DisplayType) ), |
33 | this, SLOT( setDisplayType(MediaPlayerState::DisplayType) ) ); | 32 | this, SLOT( setDisplayType(MediaPlayerState::DisplayType) ) ); |
34 | connect( &mediaPlayerState, SIGNAL( lengthChanged(long) ), | 33 | connect( &mediaPlayerState, SIGNAL( lengthChanged(long) ), |
35 | this, SLOT( setLength(long) ) ); | 34 | this, SLOT( setLength(long) ) ); |
36 | connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), | 35 | connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), |
37 | this, SLOT( setPlaying(bool) ) ); | 36 | this, SLOT( setPlaying(bool) ) ); |
38 | 37 | ||
39 | setBackgroundMode( NoBackground ); | 38 | setBackgroundMode( NoBackground ); |
40 | } | 39 | } |
41 | 40 | ||
42 | MediaWidget::~MediaWidget() | 41 | MediaWidget::~MediaWidget() |
43 | { | 42 | { |
44 | } | 43 | } |
45 | 44 | ||
46 | void MediaWidget::setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount, | 45 | void MediaWidget::setupButtons( const SkinButtonInfo *skinInfo, uint buttonCount, |
47 | const Skin &skin ) | 46 | const Skin &skin ) |
48 | { | 47 | { |
49 | buttonMask = skin.buttonMask( skinInfo, buttonCount ); | 48 | buttonMask = skin.buttonMask( skinInfo, buttonCount ); |
50 | 49 | ||
51 | buttons.clear(); | 50 | buttons.clear(); |
52 | buttons.reserve( buttonCount ); | 51 | buttons.reserve( buttonCount ); |
53 | 52 | ||
54 | for ( uint i = 0; i < buttonCount; ++i ) { | 53 | for ( uint i = 0; i < buttonCount; ++i ) { |
55 | Button button = setupButton( skinInfo[ i ], skin ); | 54 | Button button = setupButton( skinInfo[ i ], skin ); |
56 | buttons.push_back( button ); | 55 | buttons.push_back( button ); |
57 | } | 56 | } |
58 | } | 57 | } |
59 | 58 | ||
60 | MediaWidget::Button MediaWidget::setupButton( const SkinButtonInfo &buttonInfo, const Skin &skin ) | 59 | MediaWidget::Button MediaWidget::setupButton( const SkinButtonInfo &buttonInfo, const Skin &skin ) |
61 | { | 60 | { |
62 | Button button; | 61 | Button button; |
63 | button.command = buttonInfo.command; | 62 | button.command = buttonInfo.command; |
64 | button.type = buttonInfo.type; | 63 | button.type = buttonInfo.type; |
65 | button.mask = skin.buttonMaskImage( buttonInfo.fileName ); | 64 | button.mask = skin.buttonMaskImage( buttonInfo.fileName ); |
66 | 65 | ||
67 | return button; | 66 | return button; |
68 | } | 67 | } |
69 | 68 | ||
70 | void MediaWidget::loadDefaultSkin( const GUIInfo &guiInfo ) | 69 | void MediaWidget::loadDefaultSkin( const GUIInfo &guiInfo ) |
71 | { | 70 | { |
72 | Skin skin( guiInfo.fileNameInfix ); | 71 | Skin skin( guiInfo.fileNameInfix ); |
73 | skin.setCachable( false ); | 72 | skin.setCachable( false ); |
74 | loadSkin( guiInfo.buttonInfo, guiInfo.buttonCount, skin ); | 73 | loadSkin( guiInfo.buttonInfo, guiInfo.buttonCount, skin ); |
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index 69e87e7..26d5e15 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/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 | ||
49 | //extern PlayListWidget *playList; | 36 | //extern PlayListWidget *playList; |
50 | 37 | ||
51 | Om3u::Om3u( const QString &filePath, int mode) | 38 | Om3u::Om3u( const QString &filePath, int mode) |
52 | : QStringList (){ | 39 | : QStringList (){ |
53 | qDebug("<<<<<<<new m3u "+filePath); | 40 | qDebug("<<<<<<<new m3u "+filePath); |
54 | f.setName(filePath); | 41 | f.setName(filePath); |
55 | f.open(mode); | 42 | f.open(mode); |
56 | } | 43 | } |
57 | 44 | ||
58 | Om3u::~Om3u(){} | 45 | Om3u::~Om3u(){} |
59 | 46 | ||
60 | void Om3u::readM3u() { | 47 | void Om3u::readM3u() { |
61 | // qDebug("<<<<<<reading m3u "+f.name()); | 48 | // qDebug("<<<<<<reading m3u "+f.name()); |
62 | QTextStream t(&f); | 49 | QTextStream t(&f); |
63 | t.setEncoding(QTextStream::UnicodeUTF8); | 50 | t.setEncoding(QTextStream::UnicodeUTF8); |
64 | QString s; | 51 | QString s; |
65 | while ( !t.atEnd() ) { | 52 | while ( !t.atEnd() ) { |
66 | s=t.readLine(); | 53 | s=t.readLine(); |
67 | // qDebug(s); | 54 | // qDebug(s); |
68 | if( s.find( "#", 0, TRUE) == -1 ) { | 55 | if( s.find( "#", 0, TRUE) == -1 ) { |
69 | if( s.left(2) == "E:" || s.left(2) == "P:" ) { | 56 | if( s.left(2) == "E:" || s.left(2) == "P:" ) { |
70 | s = s.right( s.length() -2 ); | 57 | s = s.right( s.length() -2 ); |
71 | QFileInfo f( s ); | 58 | QFileInfo f( s ); |
72 | QString name = f.baseName(); | 59 | QString name = f.baseName(); |
73 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); | 60 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); |
74 | s=s.replace( QRegExp( "\\" ), "/" ); | 61 | s=s.replace( QRegExp( "\\" ), "/" ); |
75 | append(s); | 62 | append(s); |
76 | // qDebug(s); | 63 | // qDebug(s); |
77 | } else { // is url | 64 | } else { // is url |
78 | QString name; | 65 | QString name; |
79 | name = s; | 66 | name = s; |
80 | append(name); | 67 | append(name); |
81 | } | 68 | } |
82 | } | 69 | } |
83 | } | 70 | } |
84 | } | 71 | } |
85 | 72 | ||
86 | void Om3u::readPls() { //it's a pls file | 73 | void Om3u::readPls() { //it's a pls file |
87 | QTextStream t( &f ); | 74 | QTextStream t( &f ); |
88 | t.setEncoding(QTextStream::UnicodeUTF8); | 75 | t.setEncoding(QTextStream::UnicodeUTF8); |
89 | QString s; | 76 | QString s; |
90 | while ( !t.atEnd() ) { | 77 | while ( !t.atEnd() ) { |
91 | s = t.readLine(); | 78 | s = t.readLine(); |
92 | if( s.left(4) == "File" ) { | 79 | if( s.left(4) == "File" ) { |
93 | s = s.right( s.length() - s.find("=",0,true)-1 ); | 80 | s = s.right( s.length() - s.find("=",0,true)-1 ); |
94 | s = s.stripWhiteSpace(); | 81 | s = s.stripWhiteSpace(); |
95 | s.replace( QRegExp( "%20" )," "); | 82 | s.replace( QRegExp( "%20" )," "); |
diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp index 2019b3a..015896f 100644 --- a/noncore/multimedia/opieplayer2/playlistselection.cpp +++ b/noncore/multimedia/opieplayer2/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 | ||
35 | class PlayListSelectionItem : public QListViewItem { | 27 | class PlayListSelectionItem : public QListViewItem { |
36 | public: | 28 | public: |
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 | ||
47 | private: | 39 | private: |
48 | const DocLnk *fl; | 40 | const DocLnk *fl; |
49 | }; | 41 | }; |
50 | 42 | ||
51 | 43 | ||
52 | PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) | 44 | PlayListSelection::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 | } | 59 | } |
68 | 60 | ||
69 | 61 | ||
70 | PlayListSelection::~PlayListSelection() { | 62 | PlayListSelection::~PlayListSelection() { |
71 | } | 63 | } |
72 | 64 | ||
73 | 65 | ||
74 | // #ifdef USE_PLAYLIST_BACKGROUND | 66 | // #ifdef USE_PLAYLIST_BACKGROUND |
75 | void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { | 67 | void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { |
76 | // qDebug("drawBackground"); | 68 | // qDebug("drawBackground"); |
77 | p->fillRect( r, QBrush( white ) ); | 69 | p->fillRect( r, QBrush( white ) ); |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 0a84268..84aba55 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -1,91 +1,90 @@ | |||
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,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> | 34 | #include <qtoolbar.h> |
35 | 35 | ||
36 | #include <opie/ofiledialog.h> | 36 | #include <opie/ofiledialog.h> |
37 | 37 | ||
38 | #include <qmessagebox.h> | 38 | #include <qmessagebox.h> |
39 | 39 | ||
40 | #include "playlistselection.h" | 40 | #include "playlistselection.h" |
41 | #include "playlistwidget.h" | 41 | #include "playlistwidget.h" |
42 | #include "mediaplayer.h" | 42 | #include "mediaplayer.h" |
43 | #include "mediaplayerstate.h" | ||
44 | #include "inputDialog.h" | 43 | #include "inputDialog.h" |
45 | #include "om3u.h" | 44 | #include "om3u.h" |
46 | #include "playlistfileview.h" | 45 | #include "playlistfileview.h" |
47 | 46 | ||
48 | //only needed for the random play | 47 | //only needed for the random play |
49 | #include <assert.h> | 48 | #include <assert.h> |
50 | 49 | ||
51 | PlayListWidget::PlayListWidget(QWidget* parent, const char* name, WFlags fl ) | 50 | PlayListWidget::PlayListWidget(QWidget* parent, const char* name, WFlags fl ) |
52 | : PlayListWidgetGui( parent, "playList" ) , currentFileListView( 0 ) | 51 | : PlayListWidgetGui( parent, "playList" ) , currentFileListView( 0 ) |
53 | { | 52 | { |
54 | mediaPlayerState = new MediaPlayerState(0, "mediaPlayerState" ); | 53 | mediaPlayerState = new MediaPlayerState(0, "mediaPlayerState" ); |
55 | m_mp = new MediaPlayer(*this, *mediaPlayerState, 0, "mediaPlayer"); | 54 | m_mp = new MediaPlayer(*this, *mediaPlayerState, 0, "mediaPlayer"); |
56 | 55 | ||
57 | 56 | ||
58 | 57 | ||
59 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), | 58 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), |
60 | "opieplayer2/add_to_playlist", | 59 | "opieplayer2/add_to_playlist", |
61 | this , SLOT(addSelected() ) ); | 60 | this , SLOT(addSelected() ) ); |
62 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), | 61 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), |
63 | "opieplayer2/remove_from_playlist", | 62 | "opieplayer2/remove_from_playlist", |
64 | this , SLOT(removeSelected() ) ); | 63 | this , SLOT(removeSelected() ) ); |
65 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", | 64 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", |
66 | this , SLOT( btnPlay(bool) ), TRUE ); | 65 | this , SLOT( btnPlay(bool) ), TRUE ); |
67 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", | 66 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", |
68 | mediaPlayerState, SLOT( setShuffled(bool) ), TRUE ); | 67 | mediaPlayerState, SLOT( setShuffled(bool) ), TRUE ); |
69 | d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", | 68 | d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", |
70 | mediaPlayerState, SLOT( setLooping(bool) ), TRUE ); | 69 | mediaPlayerState, SLOT( setLooping(bool) ), TRUE ); |
71 | 70 | ||
72 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); | 71 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); |
73 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), | 72 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), |
74 | this, SLOT( addAllMusicToList() ) ); | 73 | this, SLOT( addAllMusicToList() ) ); |
75 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), | 74 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), |
76 | this, SLOT( addAllVideoToList() ) ); | 75 | this, SLOT( addAllVideoToList() ) ); |
77 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), | 76 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), |
78 | this, SLOT( addAllToList() ) ); | 77 | this, SLOT( addAllToList() ) ); |
79 | pmPlayList->insertSeparator(-1); | 78 | pmPlayList->insertSeparator(-1); |
80 | (void)new MenuItem( pmPlayList, tr( "Add File" ), | 79 | (void)new MenuItem( pmPlayList, tr( "Add File" ), |
81 | this,SLOT( openFile() ) ); | 80 | this,SLOT( openFile() ) ); |
82 | (void)new MenuItem( pmPlayList, tr("Add URL"), | 81 | (void)new MenuItem( pmPlayList, tr("Add URL"), |
83 | this,SLOT( openURL() ) ); | 82 | this,SLOT( openURL() ) ); |
84 | pmPlayList->insertSeparator(-1); | 83 | pmPlayList->insertSeparator(-1); |
85 | (void)new MenuItem( pmPlayList, tr( "Save Playlist" ), | 84 | (void)new MenuItem( pmPlayList, tr( "Save Playlist" ), |
86 | this, SLOT(writem3u() ) ); | 85 | this, SLOT(writem3u() ) ); |
87 | pmPlayList->insertSeparator(-1); | 86 | pmPlayList->insertSeparator(-1); |
88 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), | 87 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), |
89 | audioView, SLOT( scanFiles() ) ); | 88 | audioView, SLOT( scanFiles() ) ); |
90 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), | 89 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), |
91 | videoView, SLOT( scanFiles() ) ); | 90 | videoView, SLOT( scanFiles() ) ); |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 33fe188..2ff190d 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -1,95 +1,94 @@ | |||
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 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 | 34 | ||
35 | #include <qtoolbar.h> | 35 | #include <qtoolbar.h> |
36 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
37 | 37 | ||
38 | #include <qlayout.h> | 38 | #include <qlayout.h> |
39 | #include <qmenubar.h> | 39 | #include <qmenubar.h> |
40 | 40 | ||
41 | #include "playlistselection.h" | 41 | #include "playlistselection.h" |
42 | #include "playlistwidget.h" | 42 | #include "playlistwidget.h" |
43 | #include "mediaplayerstate.h" | 43 | #include "mediaplayerstate.h" |
44 | #include "inputDialog.h" | 44 | #include "inputDialog.h" |
45 | #include "playlistfileview.h" | 45 | #include "playlistfileview.h" |
46 | 46 | ||
47 | #include "mediaplayerstate.h" | ||
48 | 47 | ||
49 | PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) | 48 | PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) |
50 | : QMainWindow( parent, name ) { | 49 | : QMainWindow( parent, name ) { |
51 | 50 | ||
52 | d = new PlayListWidgetPrivate; | 51 | d = new PlayListWidgetPrivate; |
53 | d->setDocumentUsed = FALSE; | 52 | d->setDocumentUsed = FALSE; |
54 | 53 | ||
55 | setBackgroundMode( PaletteButton ); | 54 | setBackgroundMode( PaletteButton ); |
56 | setToolBarsMovable( FALSE ); | 55 | setToolBarsMovable( FALSE ); |
57 | 56 | ||
58 | // Create Toolbar | 57 | // Create Toolbar |
59 | QToolBar *toolbar = new QToolBar( this ); | 58 | QToolBar *toolbar = new QToolBar( this ); |
60 | toolbar->setHorizontalStretchable( TRUE ); | 59 | toolbar->setHorizontalStretchable( TRUE ); |
61 | 60 | ||
62 | // Create Menubar | 61 | // Create Menubar |
63 | QMenuBar *menu = new QMenuBar( toolbar ); | 62 | QMenuBar *menu = new QMenuBar( toolbar ); |
64 | menu->setMargin( 0 ); | 63 | menu->setMargin( 0 ); |
65 | 64 | ||
66 | bar = new QToolBar( this ); | 65 | bar = new QToolBar( this ); |
67 | bar->setLabel( tr( "Play Operations" ) ); | 66 | bar->setLabel( tr( "Play Operations" ) ); |
68 | 67 | ||
69 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); | 68 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); |
70 | tbDeletePlaylist->setFlat( TRUE ); | 69 | tbDeletePlaylist->setFlat( TRUE ); |
71 | tbDeletePlaylist->setFixedSize( 20, 20 ); | 70 | tbDeletePlaylist->setFixedSize( 20, 20 ); |
72 | 71 | ||
73 | tbDeletePlaylist->hide(); | 72 | tbDeletePlaylist->hide(); |
74 | 73 | ||
75 | pmPlayList = new QPopupMenu( this ); | 74 | pmPlayList = new QPopupMenu( this ); |
76 | menu->insertItem( tr( "File" ), pmPlayList ); | 75 | menu->insertItem( tr( "File" ), pmPlayList ); |
77 | 76 | ||
78 | pmView = new QPopupMenu( this ); | 77 | pmView = new QPopupMenu( this ); |
79 | menu->insertItem( tr( "View" ), pmView ); | 78 | menu->insertItem( tr( "View" ), pmView ); |
80 | pmView->isCheckable(); | 79 | pmView->isCheckable(); |
81 | 80 | ||
82 | skinsMenu = new QPopupMenu( this ); | 81 | skinsMenu = new QPopupMenu( this ); |
83 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 82 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
84 | skinsMenu->isCheckable(); | 83 | skinsMenu->isCheckable(); |
85 | 84 | ||
86 | gammaMenu = new QPopupMenu( this ); | 85 | gammaMenu = new QPopupMenu( this ); |
87 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); | 86 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); |
88 | 87 | ||
89 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); | 88 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); |
90 | gammaSlider->setRange( -40, 40 ); | 89 | gammaSlider->setRange( -40, 40 ); |
91 | gammaSlider->setTickmarks( QSlider::Left ); | 90 | gammaSlider->setTickmarks( QSlider::Left ); |
92 | gammaSlider->setTickInterval( 20 ); | 91 | gammaSlider->setTickInterval( 20 ); |
93 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); | 92 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); |
94 | gammaSlider->setValue( 0 ); | 93 | gammaSlider->setValue( 0 ); |
95 | gammaSlider->setMinimumHeight( 50 ); | 94 | gammaSlider->setMinimumHeight( 50 ); |
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp index 742e495..7c38983 100644 --- a/noncore/multimedia/opieplayer2/skin.cpp +++ b/noncore/multimedia/opieplayer2/skin.cpp | |||
@@ -1,78 +1,76 @@ | |||
1 | /* | 1 | /* |
2 | Copyright (C) 2002 Simon Hausmann <simon@lst.de> | 2 | Copyright (C) 2002 Simon Hausmann <simon@lst.de> |
3 | (C) 2002 Max Reiss <harlekin@handhelds.org> | 3 | (C) 2002 Max Reiss <harlekin@handhelds.org> |
4 | (C) 2002 L. Potter <ljp@llornkcor.com> | 4 | (C) 2002 L. Potter <ljp@llornkcor.com> |
5 | (C) 2002 Holger Freyther <zecke@handhelds.org> | 5 | (C) 2002 Holger Freyther <zecke@handhelds.org> |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or | 7 | This program is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU General Public | 8 | modify it under the terms of the GNU General Public |
9 | License as published by the Free Software Foundation; either | 9 | License as published by the Free Software Foundation; either |
10 | version 2 of the License, or (at your option) any later version. | 10 | version 2 of the License, or (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | General Public License for more details. | 15 | General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; see the file COPYING. If not, write to | 18 | along with this program; see the file COPYING. If not, write to |
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. | 20 | Boston, MA 02111-1307, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include "skin.h" | 23 | #include "skin.h" |
24 | #include "singleton.h" | 24 | #include "singleton.h" |
25 | 25 | ||
26 | #include <qcache.h> | 26 | #include <qcache.h> |
27 | #include <qmap.h> | ||
28 | #include <qtimer.h> | 27 | #include <qtimer.h> |
29 | 28 | ||
30 | #include <qpe/resource.h> | ||
31 | #include <qpe/config.h> | 29 | #include <qpe/config.h> |
32 | 30 | ||
33 | #include <assert.h> | 31 | #include <assert.h> |
34 | 32 | ||
35 | struct SkinData | 33 | struct SkinData |
36 | { | 34 | { |
37 | typedef QMap<QString, QImage> ButtonMaskImageMap; | 35 | typedef QMap<QString, QImage> ButtonMaskImageMap; |
38 | 36 | ||
39 | QPixmap backgroundPixmap; | 37 | QPixmap backgroundPixmap; |
40 | QImage buttonUpImage; | 38 | QImage buttonUpImage; |
41 | QImage buttonDownImage; | 39 | QImage buttonDownImage; |
42 | QImage buttonMask; | 40 | QImage buttonMask; |
43 | ButtonMaskImageMap buttonMasks; | 41 | ButtonMaskImageMap buttonMasks; |
44 | }; | 42 | }; |
45 | 43 | ||
46 | class SkinCache : public Singleton<SkinCache> | 44 | class SkinCache : public Singleton<SkinCache> |
47 | { | 45 | { |
48 | public: | 46 | public: |
49 | SkinCache(); | 47 | SkinCache(); |
50 | 48 | ||
51 | SkinData *lookupAndTake( const QString &skinPath, const QString &fileNameInfix ); | 49 | SkinData *lookupAndTake( const QString &skinPath, const QString &fileNameInfix ); |
52 | 50 | ||
53 | void store( const QString &skinPath, const QString &fileNameInfix, SkinData *data ); | 51 | void store( const QString &skinPath, const QString &fileNameInfix, SkinData *data ); |
54 | 52 | ||
55 | private: | 53 | private: |
56 | typedef QCache<SkinData> DataCache; | 54 | typedef QCache<SkinData> DataCache; |
57 | typedef QCache<QPixmap> BackgroundPixmapCache; | 55 | typedef QCache<QPixmap> BackgroundPixmapCache; |
58 | 56 | ||
59 | template <class CacheType> | 57 | template <class CacheType> |
60 | void store( const QCache<CacheType> &cache, const QString &key, CacheType *data ); | 58 | void store( const QCache<CacheType> &cache, const QString &key, CacheType *data ); |
61 | 59 | ||
62 | DataCache m_cache; | 60 | DataCache m_cache; |
63 | BackgroundPixmapCache m_backgroundPixmapCache; | 61 | BackgroundPixmapCache m_backgroundPixmapCache; |
64 | }; | 62 | }; |
65 | 63 | ||
66 | Skin::Skin( const QString &name, const QString &fileNameInfix ) | 64 | Skin::Skin( const QString &name, const QString &fileNameInfix ) |
67 | : m_fileNameInfix( fileNameInfix ) | 65 | : m_fileNameInfix( fileNameInfix ) |
68 | { | 66 | { |
69 | init( name ); | 67 | init( name ); |
70 | } | 68 | } |
71 | 69 | ||
72 | Skin::Skin( const QString &fileNameInfix ) | 70 | Skin::Skin( const QString &fileNameInfix ) |
73 | : m_fileNameInfix( fileNameInfix ) | 71 | : m_fileNameInfix( fileNameInfix ) |
74 | { | 72 | { |
75 | init( defaultSkinName() ); | 73 | init( defaultSkinName() ); |
76 | } | 74 | } |
77 | 75 | ||
78 | Skin::~Skin() | 76 | Skin::~Skin() |
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index a4d09f5..0625376 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -1,84 +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 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 | ..}^=.= = ; 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 "videowidget.h" | 34 | #include "videowidget.h" |
35 | #include "mediaplayerstate.h" | ||
36 | #include "playlistwidget.h" | ||
37 | 35 | ||
38 | 36 | ||
39 | #ifdef Q_WS_QWS | 37 | #ifdef Q_WS_QWS |
40 | # define USE_DIRECT_PAINTER | 38 | # define USE_DIRECT_PAINTER |
41 | # include <qdirectpainter_qws.h> | 39 | # include <qdirectpainter_qws.h> |
42 | # include <qgfxraster_qws.h> | 40 | # include <qgfxraster_qws.h> |
43 | #endif | 41 | #endif |
44 | 42 | ||
45 | 43 | ||
46 | namespace | 44 | namespace |
47 | { | 45 | { |
48 | 46 | ||
49 | const int xo = 2; // movable x offset | 47 | const int xo = 2; // movable x offset |
50 | const int yo = 0; // movable y offset | 48 | const int yo = 0; // movable y offset |
51 | 49 | ||
52 | const MediaWidget::SkinButtonInfo skinInfo[] = | 50 | const MediaWidget::SkinButtonInfo skinInfo[] = |
53 | { | 51 | { |
54 | { MediaWidget::Play, "play", MediaWidget::ToggleButton }, | 52 | { MediaWidget::Play, "play", MediaWidget::ToggleButton }, |
55 | { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, | 53 | { MediaWidget::Stop, "stop", MediaWidget::NormalButton }, |
56 | { MediaWidget::Next, "fwd", MediaWidget::NormalButton }, | 54 | { MediaWidget::Next, "fwd", MediaWidget::NormalButton }, |
57 | { MediaWidget::Previous, "back", MediaWidget::NormalButton }, | 55 | { MediaWidget::Previous, "back", MediaWidget::NormalButton }, |
58 | { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, | 56 | { MediaWidget::VolumeUp, "up", MediaWidget::NormalButton }, |
59 | { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, | 57 | { MediaWidget::VolumeDown, "down", MediaWidget::NormalButton }, |
60 | { MediaWidget::FullScreen, "full", MediaWidget::ToggleButton } | 58 | { MediaWidget::FullScreen, "full", MediaWidget::ToggleButton } |
61 | }; | 59 | }; |
62 | 60 | ||
63 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); | 61 | const uint buttonCount = sizeof( skinInfo ) / sizeof( skinInfo[ 0 ] ); |
64 | 62 | ||
65 | } | 63 | } |
66 | 64 | ||
67 | VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) | 65 | VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) |
68 | : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ), videoSliderBeingMoved( false ) | 66 | : MediaWidget( playList, mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 ), videoSliderBeingMoved( false ) |
69 | { | 67 | { |
70 | setCaption( tr("OpiePlayer - Video") ); | 68 | setCaption( tr("OpiePlayer - Video") ); |
71 | 69 | ||
72 | videoFrame = new XineVideoWidget ( this, "Video frame" ); | 70 | videoFrame = new XineVideoWidget ( this, "Video frame" ); |
73 | 71 | ||
74 | connect ( videoFrame, SIGNAL( videoResized(const QSize&)), this, SIGNAL( videoResized(const QSize&))); | 72 | connect ( videoFrame, SIGNAL( videoResized(const QSize&)), this, SIGNAL( videoResized(const QSize&))); |
75 | connect ( videoFrame, SIGNAL( clicked() ), this, SLOT ( backToNormal() ) ); | 73 | connect ( videoFrame, SIGNAL( clicked() ), this, SLOT ( backToNormal() ) ); |
76 | 74 | ||
77 | slider = 0; | 75 | slider = 0; |
78 | 76 | ||
79 | loadSkin(); | 77 | loadSkin(); |
80 | 78 | ||
81 | setLength( mediaPlayerState.length() ); | 79 | setLength( mediaPlayerState.length() ); |
82 | setPosition( mediaPlayerState.position() ); | 80 | setPosition( mediaPlayerState.position() ); |
83 | setFullscreen( mediaPlayerState.isFullscreen() ); | 81 | setFullscreen( mediaPlayerState.isFullscreen() ); |
84 | setPlaying( mediaPlayerState.isPlaying() ); | 82 | setPlaying( mediaPlayerState.isPlaying() ); |
diff --git a/noncore/multimedia/opieplayer2/volumecontrol.cpp b/noncore/multimedia/opieplayer2/volumecontrol.cpp index 271b84e..b3f5f8d 100644 --- a/noncore/multimedia/opieplayer2/volumecontrol.cpp +++ b/noncore/multimedia/opieplayer2/volumecontrol.cpp | |||
@@ -1,53 +1,51 @@ | |||
1 | 1 | ||
2 | #include <qpe/qpeapplication.h> | ||
3 | #include <qpe/config.h> | 2 | #include <qpe/config.h> |
4 | #include "qpe/qcopenvelope_qws.h" | 3 | #include "qpe/qcopenvelope_qws.h" |
5 | #include <qmessagebox.h> | ||
6 | 4 | ||
7 | #include "volumecontrol.h" | 5 | #include "volumecontrol.h" |
8 | 6 | ||
9 | int VolumeControl::volume() { | 7 | int VolumeControl::volume() { |
10 | Config cfg( "qpe" ); | 8 | Config cfg( "qpe" ); |
11 | cfg. setGroup( "Volume" ); | 9 | cfg. setGroup( "Volume" ); |
12 | m_volumePerc = cfg. readNumEntry( "VolumePercent", 50 ); | 10 | m_volumePerc = cfg. readNumEntry( "VolumePercent", 50 ); |
13 | 11 | ||
14 | return m_volumePerc; | 12 | return m_volumePerc; |
15 | } | 13 | } |
16 | 14 | ||
17 | 15 | ||
18 | void VolumeControl::setVolume( int volumePerc ) { | 16 | void VolumeControl::setVolume( int volumePerc ) { |
19 | Config cfg("qpe"); | 17 | Config cfg("qpe"); |
20 | cfg.setGroup("Volume"); | 18 | cfg.setGroup("Volume"); |
21 | 19 | ||
22 | if ( volumePerc > 100 ) { | 20 | if ( volumePerc > 100 ) { |
23 | volumePerc = 100; | 21 | volumePerc = 100; |
24 | } | 22 | } |
25 | if ( volumePerc < 0 ) { | 23 | if ( volumePerc < 0 ) { |
26 | volumePerc = 0; | 24 | volumePerc = 0; |
27 | } | 25 | } |
28 | 26 | ||
29 | m_volumePerc = volumePerc; | 27 | m_volumePerc = volumePerc; |
30 | cfg.writeEntry("VolumePercent", volumePerc ); | 28 | cfg.writeEntry("VolumePercent", volumePerc ); |
31 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; | 29 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; |
32 | // QCopEnvelope( "QPE/System", "setVolume(int,int)" ) << 0, volumePerc; | 30 | // QCopEnvelope( "QPE/System", "setVolume(int,int)" ) << 0, volumePerc; |
33 | } | 31 | } |
34 | 32 | ||
35 | 33 | ||
36 | void VolumeControl::incVol( int ammount ) { | 34 | void VolumeControl::incVol( int ammount ) { |
37 | int oldVol = volume(); | 35 | int oldVol = volume(); |
38 | setVolume( oldVol + ammount); | 36 | setVolume( oldVol + ammount); |
39 | } | 37 | } |
40 | 38 | ||
41 | void VolumeControl::decVol( int ammount ) { | 39 | void VolumeControl::decVol( int ammount ) { |
42 | int oldVol = volume(); | 40 | int oldVol = volume(); |
43 | setVolume( oldVol - ammount); | 41 | setVolume( oldVol - ammount); |
44 | } | 42 | } |
45 | 43 | ||
46 | 44 | ||
47 | VolumeControl::VolumeControl( ) { | 45 | VolumeControl::VolumeControl( ) { |
48 | volume(); | 46 | volume(); |
49 | } | 47 | } |
50 | 48 | ||
51 | VolumeControl::~VolumeControl() { | 49 | VolumeControl::~VolumeControl() { |
52 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; | 50 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; |
53 | } | 51 | } |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 70f2ffd..8f11b2e 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -1,89 +1,88 @@ | |||
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 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 | 34 | ||
35 | #include <qtimer.h> | 35 | #include <qtimer.h> |
36 | #include <qmessagebox.h> | 36 | #include <qmessagebox.h> |
37 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
38 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
39 | 39 | ||
40 | #include "xinecontrol.h" | 40 | #include "xinecontrol.h" |
41 | #include "mediaplayerstate.h" | ||
42 | #include "xinevideowidget.h" | 41 | #include "xinevideowidget.h" |
43 | 42 | ||
44 | XineControl::XineControl( XineVideoWidget *xineWidget, | 43 | XineControl::XineControl( XineVideoWidget *xineWidget, |
45 | MediaPlayerState &_mediaPlayerState, | 44 | MediaPlayerState &_mediaPlayerState, |
46 | QObject *parent, const char *name ) | 45 | QObject *parent, const char *name ) |
47 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) | 46 | : QObject( parent, name ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) |
48 | { | 47 | { |
49 | libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget ); | 48 | libXine = new XINE::Lib( XINE::Lib::InitializeImmediately, xineWidget ); |
50 | 49 | ||
51 | init(); | 50 | init(); |
52 | } | 51 | } |
53 | 52 | ||
54 | XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, | 53 | XineControl::XineControl( XINE::Lib *xine, XineVideoWidget *xineWidget, |
55 | MediaPlayerState &_mediaPlayerState, | 54 | MediaPlayerState &_mediaPlayerState, |
56 | QObject *parent, const char *name ) | 55 | QObject *parent, const char *name ) |
57 | : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) | 56 | : QObject( parent, name ), libXine( xine ), mediaPlayerState( _mediaPlayerState ), xineVideoWidget( xineWidget ) |
58 | { | 57 | { |
59 | xine->ensureInitialized(); | 58 | xine->ensureInitialized(); |
60 | 59 | ||
61 | xine->setWidget( xineWidget ); | 60 | xine->setWidget( xineWidget ); |
62 | 61 | ||
63 | init(); | 62 | init(); |
64 | } | 63 | } |
65 | 64 | ||
66 | void XineControl::init() | 65 | void XineControl::init() |
67 | { | 66 | { |
68 | connect( &mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); | 67 | connect( &mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); |
69 | connect( this, SIGNAL( positionChanged(long) ), &mediaPlayerState, SLOT( updatePosition(long) ) ); | 68 | connect( this, SIGNAL( positionChanged(long) ), &mediaPlayerState, SLOT( updatePosition(long) ) ); |
70 | connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( stop(bool) ) ); | 69 | connect( &mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( stop(bool) ) ); |
71 | connect( &mediaPlayerState, SIGNAL( fullscreenToggled(bool) ), this, SLOT( setFullscreen(bool) ) ); | 70 | connect( &mediaPlayerState, SIGNAL( fullscreenToggled(bool) ), this, SLOT( setFullscreen(bool) ) ); |
72 | connect( &mediaPlayerState, SIGNAL( positionChanged(long) ), this, SLOT( seekTo(long) ) ); | 71 | connect( &mediaPlayerState, SIGNAL( positionChanged(long) ), this, SLOT( seekTo(long) ) ); |
73 | connect( &mediaPlayerState, SIGNAL( videoGammaChanged(int) ), this, SLOT( setGamma(int) ) ); | 72 | connect( &mediaPlayerState, SIGNAL( videoGammaChanged(int) ), this, SLOT( setGamma(int) ) ); |
74 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); | 73 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); |
75 | connect( xineVideoWidget, SIGNAL( videoResized(const QSize&) ), this, SLOT( videoResized(const QSize&) ) ); | 74 | connect( xineVideoWidget, SIGNAL( videoResized(const QSize&) ), this, SLOT( videoResized(const QSize&) ) ); |
76 | 75 | ||
77 | disabledSuspendScreenSaver = FALSE; | 76 | disabledSuspendScreenSaver = FALSE; |
78 | } | 77 | } |
79 | 78 | ||
80 | XineControl::~XineControl() { | 79 | XineControl::~XineControl() { |
81 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 80 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
82 | if ( disabledSuspendScreenSaver ) { | 81 | if ( disabledSuspendScreenSaver ) { |
83 | disabledSuspendScreenSaver = FALSE; | 82 | disabledSuspendScreenSaver = FALSE; |
84 | // Re-enable the suspend mode | 83 | // Re-enable the suspend mode |
85 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 84 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
86 | } | 85 | } |
87 | #endif | 86 | #endif |
88 | delete libXine; | 87 | delete libXine; |
89 | } | 88 | } |
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 0833784..b55750a 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -1,89 +1,86 @@ | |||
1 | 1 | ||
2 | /* | 2 | /* |
3 | This file is part of the Opie Project | 3 | This file is part of the Opie Project |
4 | 4 | ||
5 | Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 5 | Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
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 <qimage.h> | 34 | #include <qimage.h> |
35 | #include <qpainter.h> | ||
36 | #include <qgfx_qws.h> | ||
37 | #include <qdirectpainter_qws.h> | 35 | #include <qdirectpainter_qws.h> |
38 | #include <qgfx_qws.h> | 36 | #include <qgfx_qws.h> |
39 | #include <qsize.h> | 37 | #include <qsize.h> |
40 | #include <qapplication.h> | 38 | #include <qapplication.h> |
41 | #include <qpainter.h> | ||
42 | 39 | ||
43 | #include <qpe/resource.h> | 40 | #include <qpe/resource.h> |
44 | 41 | ||
45 | #include "xinevideowidget.h" | 42 | #include "xinevideowidget.h" |
46 | 43 | ||
47 | 44 | ||
48 | // 0 deg rot: copy a line from src to dst (use libc memcpy) | 45 | // 0 deg rot: copy a line from src to dst (use libc memcpy) |
49 | 46 | ||
50 | // 180 deg rot: copy a line from src to dst reversed | 47 | // 180 deg rot: copy a line from src to dst reversed |
51 | 48 | ||
52 | static inline void memcpy_rev ( void *dst, void *src, size_t len ) | 49 | static inline void memcpy_rev ( void *dst, void *src, size_t len ) |
53 | { | 50 | { |
54 | len >>= 1; | 51 | len >>= 1; |
55 | 52 | ||
56 | ((char *) src ) += ( len << 1 ); | 53 | ((char *) src ) += ( len << 1 ); |
57 | 54 | ||
58 | while ( len-- ) | 55 | while ( len-- ) |
59 | *((short int *) dst )++ = *--((short int *) src ); | 56 | *((short int *) dst )++ = *--((short int *) src ); |
60 | } | 57 | } |
61 | 58 | ||
62 | // 90 deg rot: copy a column from src to dst | 59 | // 90 deg rot: copy a column from src to dst |
63 | 60 | ||
64 | static inline void memcpy_step ( void *dst, void *src, size_t len, size_t step ) | 61 | static inline void memcpy_step ( void *dst, void *src, size_t len, size_t step ) |
65 | { | 62 | { |
66 | len >>= 1; | 63 | len >>= 1; |
67 | while ( len-- ) { | 64 | while ( len-- ) { |
68 | *((short int *) dst )++ = *((short int *) src ); | 65 | *((short int *) dst )++ = *((short int *) src ); |
69 | ((char *) src ) += step; | 66 | ((char *) src ) += step; |
70 | } | 67 | } |
71 | } | 68 | } |
72 | 69 | ||
73 | // 270 deg rot: copy a column from src to dst reversed | 70 | // 270 deg rot: copy a column from src to dst reversed |
74 | 71 | ||
75 | static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t step ) | 72 | static inline void memcpy_step_rev ( void *dst, void *src, size_t len, size_t step ) |
76 | { | 73 | { |
77 | len >>= 1; | 74 | len >>= 1; |
78 | 75 | ||
79 | ((char *) src ) += ( len * step ); | 76 | ((char *) src ) += ( len * step ); |
80 | 77 | ||
81 | while ( len-- ) { | 78 | while ( len-- ) { |
82 | ((char *) src ) -= step; | 79 | ((char *) src ) -= step; |
83 | *((short int *) dst )++ = *((short int *) src ); | 80 | *((short int *) dst )++ = *((short int *) src ); |
84 | } | 81 | } |
85 | } | 82 | } |
86 | 83 | ||
87 | 84 | ||
88 | XineVideoWidget::XineVideoWidget ( QWidget* parent, const char* name ) | 85 | XineVideoWidget::XineVideoWidget ( QWidget* parent, const char* name ) |
89 | : QWidget ( parent, name, WRepaintNoErase | WResizeNoErase ) | 86 | : QWidget ( parent, name, WRepaintNoErase | WResizeNoErase ) |