-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.h | 43 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistfileview.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 44 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 46 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.h | 52 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 3 |
7 files changed, 100 insertions, 94 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index d885150..a64ab92 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h | |||
@@ -1,73 +1,74 @@ | |||
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 | #ifndef MEDIAWIDGET_H | 23 | #ifndef MEDIAWIDGET_H |
24 | #define MEDIAWIDGET_H | 24 | #define MEDIAWIDGET_H |
25 | 25 | ||
26 | #include <qbitmap.h> | ||
26 | #include <qwidget.h> | 27 | #include <qwidget.h> |
27 | #include <qmap.h> | 28 | #include <qmap.h> |
28 | 29 | ||
29 | #include "mediaplayerstate.h" | 30 | #include "mediaplayerstate.h" |
30 | #include "playlistwidget.h" | 31 | #include "playlistwidget.h" |
31 | 32 | ||
32 | class Skin; | 33 | class Skin; |
33 | 34 | ||
34 | class MediaWidget : public QWidget | 35 | class MediaWidget : public QWidget |
35 | { | 36 | { |
36 | Q_OBJECT | 37 | Q_OBJECT |
37 | public: | 38 | public: |
38 | enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back, FullScreen, Undefined }; | 39 | enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back, FullScreen, Undefined }; |
39 | enum ButtonType { NormalButton, ToggleButton }; | 40 | enum ButtonType { NormalButton, ToggleButton }; |
40 | 41 | ||
41 | struct Button | 42 | struct Button |
42 | { | 43 | { |
43 | Button() : command( Undefined ), type( NormalButton ), isDown( false ) {} | 44 | Button() : command( Undefined ), type( NormalButton ), isDown( false ) {} |
44 | 45 | ||
45 | Command command; | 46 | Command command; |
46 | 47 | ||
47 | ButtonType type; // this should be part of the bitfield but gcc2 is too buggy to support this :-( | 48 | ButtonType type; // this should be part of the bitfield but gcc2 is too buggy to support this :-( |
48 | bool isDown : 1; | 49 | bool isDown : 1; |
49 | 50 | ||
50 | QBitmap mask; | 51 | QBitmap mask; |
51 | QPixmap pixUp; | 52 | QPixmap pixUp; |
52 | QPixmap pixDown; | 53 | QPixmap pixDown; |
53 | }; | 54 | }; |
54 | typedef QValueList<Button> ButtonVector; | 55 | typedef QValueList<Button> ButtonVector; |
55 | 56 | ||
56 | struct SkinButtonInfo | 57 | struct SkinButtonInfo |
57 | { | 58 | { |
58 | Command command; | 59 | Command command; |
59 | const char *fileName; | 60 | const char *fileName; |
60 | ButtonType type; | 61 | ButtonType type; |
61 | }; | 62 | }; |
62 | 63 | ||
63 | struct GUIInfo | 64 | struct GUIInfo |
64 | { | 65 | { |
65 | GUIInfo() : buttonInfo( 0 ), buttonCount( 0 ) {} | 66 | GUIInfo() : buttonInfo( 0 ), buttonCount( 0 ) {} |
66 | GUIInfo( const QString &_fileNameInfix, const SkinButtonInfo *_buttonInfo, const uint _buttonCount ) | 67 | GUIInfo( const QString &_fileNameInfix, const SkinButtonInfo *_buttonInfo, const uint _buttonCount ) |
67 | : fileNameInfix( _fileNameInfix ), buttonInfo( _buttonInfo ), buttonCount( _buttonCount ) | 68 | : fileNameInfix( _fileNameInfix ), buttonInfo( _buttonInfo ), buttonCount( _buttonCount ) |
68 | {} | 69 | {} |
69 | 70 | ||
70 | QString fileNameInfix; | 71 | QString fileNameInfix; |
71 | const SkinButtonInfo *buttonInfo; | 72 | const SkinButtonInfo *buttonInfo; |
72 | const uint buttonCount; | 73 | const uint buttonCount; |
73 | }; | 74 | }; |
diff --git a/noncore/multimedia/opieplayer2/om3u.h b/noncore/multimedia/opieplayer2/om3u.h index 9c7cf9a..0e04f72 100644 --- a/noncore/multimedia/opieplayer2/om3u.h +++ b/noncore/multimedia/opieplayer2/om3u.h | |||
@@ -1,79 +1,80 @@ | |||
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 | #ifndef OM3U_H | 32 | #ifndef OM3U_H |
33 | #define OM3U_H | 33 | #define OM3U_H |
34 | 34 | ||
35 | #include "playlistwidget.h" | 35 | #include "playlistwidget.h" |
36 | 36 | ||
37 | #include <opie2/oresource.h> | ||
38 | |||
37 | #include <qpe/applnk.h> | 39 | #include <qpe/applnk.h> |
38 | #include <qpe/qpeapplication.h> | 40 | #include <qpe/qpeapplication.h> |
39 | #include <qpe/storage.h> | 41 | #include <qpe/storage.h> |
40 | #include <qpe/mimetype.h> | 42 | #include <qpe/mimetype.h> |
41 | #include <qpe/global.h> | 43 | #include <qpe/global.h> |
42 | #include <qpe/resource.h> | ||
43 | 44 | ||
44 | #include <qdir.h> | 45 | #include <qdir.h> |
45 | #include <qregexp.h> | 46 | #include <qregexp.h> |
46 | #include <qstring.h> | 47 | #include <qstring.h> |
47 | #include <qtextstream.h> | 48 | #include <qtextstream.h> |
48 | #include <qstringlist.h> | 49 | #include <qstringlist.h> |
49 | #include <qcstring.h> | 50 | #include <qcstring.h> |
50 | #include <qfile.h> | 51 | #include <qfile.h> |
51 | 52 | ||
52 | 53 | ||
53 | class Om3u : public QStringList { | 54 | class Om3u : public QStringList { |
54 | // Q_OBJECT | 55 | // Q_OBJECT |
55 | public: | 56 | public: |
56 | Om3u( const QString &filePath, int mode); | 57 | Om3u( const QString &filePath, int mode); |
57 | ~Om3u(); | 58 | ~Om3u(); |
58 | void readM3u(); | 59 | void readM3u(); |
59 | void readPls(); | 60 | void readPls(); |
60 | void write(); | 61 | void write(); |
61 | void add(const QString &); | 62 | void add(const QString &); |
62 | void remove(const QString &); | 63 | void remove(const QString &); |
63 | void deleteFile(const QString &); | 64 | void deleteFile(const QString &); |
64 | void close(); | 65 | void close(); |
65 | 66 | ||
66 | public slots: | 67 | public slots: |
67 | 68 | ||
68 | protected: | 69 | protected: |
69 | 70 | ||
70 | private: | 71 | private: |
71 | QFile f; | 72 | QFile f; |
72 | private slots: | 73 | private slots: |
73 | 74 | ||
74 | 75 | ||
75 | }; | 76 | }; |
76 | 77 | ||
77 | #endif// M3U_H | 78 | #endif// M3U_H |
78 | 79 | ||
79 | 80 | ||
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.cpp b/noncore/multimedia/opieplayer2/playlistfileview.cpp index 3094876..7ccc518 100644 --- a/noncore/multimedia/opieplayer2/playlistfileview.cpp +++ b/noncore/multimedia/opieplayer2/playlistfileview.cpp | |||
@@ -1,106 +1,107 @@ | |||
1 | 1 | ||
2 | #include "playlistfileview.h" | 2 | #include "playlistfileview.h" |
3 | 3 | ||
4 | #include <opie2/oresource.h> | ||
5 | |||
4 | #include <qfile.h> | 6 | #include <qfile.h> |
5 | #include <qpe/global.h> | 7 | #include <qpe/global.h> |
6 | #include <qpe/resource.h> | ||
7 | 8 | ||
8 | PlayListFileView::PlayListFileView( const QString &mimeTypePattern, const QString &itemPixmapName, QWidget *parent, const char *name ) | 9 | PlayListFileView::PlayListFileView( const QString &mimeTypePattern, const QString &itemPixmapName, QWidget *parent, const char *name ) |
9 | : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ), m_itemPixmapName( itemPixmapName ), m_scannedFiles( false ), | 10 | : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ), m_itemPixmapName( itemPixmapName ), m_scannedFiles( false ), |
10 | m_viewPopulated( false ) | 11 | m_viewPopulated( false ) |
11 | { | 12 | { |
12 | addColumn( tr( "Title" ), 140); | 13 | addColumn( tr( "Title" ), 140); |
13 | addColumn( tr( "Size" ), -1 ); | 14 | addColumn( tr( "Size" ), -1 ); |
14 | addColumn(tr( "Media" ), 0 ); | 15 | addColumn(tr( "Media" ), 0 ); |
15 | addColumn(tr( "Path" ), -1 ); | 16 | addColumn(tr( "Path" ), -1 ); |
16 | setColumnAlignment( 1, Qt::AlignRight ); | 17 | setColumnAlignment( 1, Qt::AlignRight ); |
17 | setColumnAlignment( 2, Qt::AlignRight ); | 18 | setColumnAlignment( 2, Qt::AlignRight ); |
18 | setAllColumnsShowFocus( TRUE ); | 19 | setAllColumnsShowFocus( TRUE ); |
19 | setSorting( 3, TRUE ); | 20 | setSorting( 3, TRUE ); |
20 | setMultiSelection( TRUE ); | 21 | setMultiSelection( TRUE ); |
21 | setSelectionMode( QListView::Extended ); | 22 | setSelectionMode( QListView::Extended ); |
22 | 23 | ||
23 | connect( this, SIGNAL( selectionChanged() ), | 24 | connect( this, SIGNAL( selectionChanged() ), |
24 | this, SLOT( checkSelection() ) ); | 25 | this, SLOT( checkSelection() ) ); |
25 | } | 26 | } |
26 | 27 | ||
27 | PlayListFileView::~PlayListFileView() | 28 | PlayListFileView::~PlayListFileView() |
28 | { | 29 | { |
29 | } | 30 | } |
30 | 31 | ||
31 | bool PlayListFileView::hasSelection() const | 32 | bool PlayListFileView::hasSelection() const |
32 | { | 33 | { |
33 | for ( QListViewItemIterator it( const_cast<PlayListFileView *>( this ) ); it.current(); ++it ) | 34 | for ( QListViewItemIterator it( const_cast<PlayListFileView *>( this ) ); it.current(); ++it ) |
34 | if ( it.current()->isSelected() ) | 35 | if ( it.current()->isSelected() ) |
35 | return true; | 36 | return true; |
36 | 37 | ||
37 | return false; | 38 | return false; |
38 | } | 39 | } |
39 | 40 | ||
40 | void PlayListFileView::scanFiles() | 41 | void PlayListFileView::scanFiles() |
41 | { | 42 | { |
42 | m_files.detachChildren(); | 43 | m_files.detachChildren(); |
43 | QListIterator<DocLnk> sdit( m_files.children() ); | 44 | QListIterator<DocLnk> sdit( m_files.children() ); |
44 | for ( ; sdit.current(); ++sdit ) | 45 | for ( ; sdit.current(); ++sdit ) |
45 | delete sdit.current(); | 46 | delete sdit.current(); |
46 | 47 | ||
47 | Global::findDocuments( &m_files, m_mimeTypePattern ); | 48 | Global::findDocuments( &m_files, m_mimeTypePattern ); |
48 | 49 | ||
49 | if ( m_viewPopulated ) { | 50 | if ( m_viewPopulated ) { |
50 | m_viewPopulated = false; | 51 | m_viewPopulated = false; |
51 | populateView(); | 52 | populateView(); |
52 | } | 53 | } |
53 | } | 54 | } |
54 | 55 | ||
55 | void PlayListFileView::populateView() | 56 | void PlayListFileView::populateView() |
56 | { | 57 | { |
57 | if ( m_viewPopulated ) | 58 | if ( m_viewPopulated ) |
58 | return; | 59 | return; |
59 | 60 | ||
60 | clear(); | 61 | clear(); |
61 | 62 | ||
62 | if( !m_scannedFiles ) { | 63 | if( !m_scannedFiles ) { |
63 | m_viewPopulated = false; // avoid a recursion :) | 64 | m_viewPopulated = false; // avoid a recursion :) |
64 | scanFiles(); | 65 | scanFiles(); |
65 | m_scannedFiles = true; | 66 | m_scannedFiles = true; |
66 | } | 67 | } |
67 | 68 | ||
68 | m_viewPopulated = true; | 69 | m_viewPopulated = true; |
69 | 70 | ||
70 | QString storage; | 71 | QString storage; |
71 | QListIterator<DocLnk> dit( m_files.children() ); | 72 | QListIterator<DocLnk> dit( m_files.children() ); |
72 | for ( ; dit.current(); ++dit ) { | 73 | for ( ; dit.current(); ++dit ) { |
73 | 74 | ||
74 | QListViewItem *newItem; | 75 | QListViewItem *newItem; |
75 | 76 | ||
76 | if ( QFile::exists( dit.current()->file() ) || | 77 | if ( QFile::exists( dit.current()->file() ) || |
77 | dit.current()->file().left( 4 ) == "http" ) { | 78 | dit.current()->file().left( 4 ) == "http" ) { |
78 | 79 | ||
79 | unsigned long size = QFile( dit.current()->file() ).size(); | 80 | unsigned long size = QFile( dit.current()->file() ).size(); |
80 | QString sizestr; | 81 | QString sizestr; |
81 | fileSize(size, sizestr); | 82 | fileSize(size, sizestr); |
82 | 83 | ||
83 | newItem = new QListViewItem( this, dit.current()->name(), | 84 | newItem = new QListViewItem( this, dit.current()->name(), |
84 | sizestr, "" /*storage*/, | 85 | sizestr, "" /*storage*/, |
85 | dit.current()->file() ); | 86 | dit.current()->file() ); |
86 | newItem->setPixmap( 0, Resource::loadPixmap( m_itemPixmapName ) ); | 87 | newItem->setPixmap( 0, Opie::Core::OResource::loadPixmap( m_itemPixmapName, Opie::Core::OResource::SmallIcon ) ); |
87 | } | 88 | } |
88 | } | 89 | } |
89 | } | 90 | } |
90 | 91 | ||
91 | void PlayListFileView::checkSelection() | 92 | void PlayListFileView::checkSelection() |
92 | { | 93 | { |
93 | emit itemsSelected( hasSelection() ); | 94 | emit itemsSelected( hasSelection() ); |
94 | } | 95 | } |
95 | 96 | ||
96 | void PlayListFileView::fileSize(unsigned long size, QString &str) { | 97 | void PlayListFileView::fileSize(unsigned long size, QString &str) { |
97 | if( size > 1048576 ) | 98 | if( size > 1048576 ) |
98 | str.sprintf( "%.0fM", size / 1048576.0 ); | 99 | str.sprintf( "%.0fM", size / 1048576.0 ); |
99 | else if( size > 1024 ) | 100 | else if( size > 1024 ) |
100 | str.sprintf( "%.0fK", size / 1024.0 ); | 101 | str.sprintf( "%.0fK", size / 1024.0 ); |
101 | else | 102 | else |
102 | str.sprintf( "%d", size ); | 103 | str.sprintf( "%d", size ); |
103 | } | 104 | } |
104 | 105 | ||
105 | /* vim: et sw=4 ts=4 | 106 | /* vim: et sw=4 ts=4 |
106 | */ | 107 | */ |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 98326a8..4178f32 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -1,147 +1,147 @@ | |||
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 "playlistselection.h" | 34 | #include "playlistselection.h" |
35 | #include "playlistwidget.h" | 35 | #include "playlistwidget.h" |
36 | #include "mediaplayer.h" | 36 | #include "mediaplayer.h" |
37 | #include "inputDialog.h" | 37 | #include "inputDialog.h" |
38 | #include "om3u.h" | 38 | #include "om3u.h" |
39 | #include "playlistfileview.h" | 39 | #include "playlistfileview.h" |
40 | 40 | ||
41 | /* OPIE */ | 41 | /* OPIE */ |
42 | #include <opie2/odebug.h> | 42 | #include <opie2/odebug.h> |
43 | #include <opie2/ofiledialog.h> | 43 | #include <opie2/ofiledialog.h> |
44 | using namespace Opie::Core; | 44 | using namespace Opie::Core; |
45 | using namespace Opie::Ui; | 45 | using namespace Opie::Ui; |
46 | 46 | ||
47 | /* QT */ | 47 | /* QT */ |
48 | #include <qmessagebox.h> | 48 | #include <qmessagebox.h> |
49 | #include <qtoolbar.h> | 49 | #include <qtoolbar.h> |
50 | 50 | ||
51 | /* STD */ | 51 | /* STD */ |
52 | #include <assert.h> | 52 | #include <assert.h> |
53 | 53 | ||
54 | PlayListWidget::PlayListWidget(QWidget* parent, const char* name, WFlags fl ) | 54 | PlayListWidget::PlayListWidget(QWidget* parent, const char* name, WFlags fl ) |
55 | : PlayListWidgetGui( parent, "playList" ) , currentFileListView( 0 ) | 55 | : PlayListWidgetGui( parent, "playList" ) , currentFileListView( 0 ) |
56 | { | 56 | { |
57 | Global::statusMessage( tr( "Loading of Skin started" ) ); | 57 | Global::statusMessage( tr( "Loading of Skin started" ) ); |
58 | mediaPlayerState = new MediaPlayerState(0, "mediaPlayerState" ); | 58 | mediaPlayerState = new MediaPlayerState(0, "mediaPlayerState" ); |
59 | m_mp = new MediaPlayer(*this, *mediaPlayerState, 0, "mediaPlayer"); | 59 | m_mp = new MediaPlayer(*this, *mediaPlayerState, 0, "mediaPlayer"); |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), | 63 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), |
64 | "opieplayer2/add_to_playlist", | 64 | "opieplayer2/add_to_playlist", |
65 | this , SLOT(addSelected() ) ); | 65 | this , SLOT(addSelected() ) ); |
66 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), | 66 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), |
67 | "opieplayer2/remove_from_playlist", | 67 | "opieplayer2/remove_from_playlist", |
68 | this , SLOT(removeSelected() ) ); | 68 | this , SLOT(removeSelected() ) ); |
69 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", | 69 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", |
70 | this , SLOT( btnPlay(bool) ), TRUE ); | 70 | this , SLOT( btnPlay(bool) ), TRUE ); |
71 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", | 71 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", |
72 | mediaPlayerState, SLOT( setShuffled(bool) ), TRUE ); | 72 | mediaPlayerState, SLOT( setShuffled(bool) ), TRUE ); |
73 | d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", | 73 | d->tbLoop = new ToolButton( bar, tr( "Loop" ), "opieplayer2/loop", |
74 | mediaPlayerState, SLOT( setLooping(bool) ), TRUE ); | 74 | mediaPlayerState, SLOT( setLooping(bool) ), TRUE ); |
75 | 75 | ||
76 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); | 76 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); |
77 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), | 77 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), |
78 | this, SLOT( addAllMusicToList() ) ); | 78 | this, SLOT( addAllMusicToList() ) ); |
79 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), | 79 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), |
80 | this, SLOT( addAllVideoToList() ) ); | 80 | this, SLOT( addAllVideoToList() ) ); |
81 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), | 81 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), |
82 | this, SLOT( addAllToList() ) ); | 82 | this, SLOT( addAllToList() ) ); |
83 | pmPlayList->insertSeparator(-1); | 83 | pmPlayList->insertSeparator(-1); |
84 | (void)new MenuItem( pmPlayList, tr( "Add File" ), | 84 | (void)new MenuItem( pmPlayList, tr( "Add File" ), |
85 | this,SLOT( openFile() ) ); | 85 | this,SLOT( openFile() ) ); |
86 | (void)new MenuItem( pmPlayList, tr("Add URL"), | 86 | (void)new MenuItem( pmPlayList, tr("Add URL"), |
87 | this,SLOT( openURL() ) ); | 87 | this,SLOT( openURL() ) ); |
88 | (void)new MenuItem( pmPlayList, tr( "Add Directory"), | 88 | (void)new MenuItem( pmPlayList, tr( "Add Directory"), |
89 | this, SLOT(openDirectory())); | 89 | this, SLOT(openDirectory())); |
90 | pmPlayList->insertSeparator(-1); | 90 | pmPlayList->insertSeparator(-1); |
91 | (void)new MenuItem( pmPlayList, tr( "Save Playlist" ), | 91 | (void)new MenuItem( pmPlayList, tr( "Save Playlist" ), |
92 | this, SLOT(writem3u() ) ); | 92 | this, SLOT(writem3u() ) ); |
93 | pmPlayList->insertSeparator(-1); | 93 | pmPlayList->insertSeparator(-1); |
94 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), | 94 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), |
95 | audioView, SLOT( scanFiles() ) ); | 95 | audioView, SLOT( scanFiles() ) ); |
96 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), | 96 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), |
97 | videoView, SLOT( scanFiles() ) ); | 97 | videoView, SLOT( scanFiles() ) ); |
98 | 98 | ||
99 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), | 99 | pmView->insertItem( Opie::Core::OResource::loadPixmap("fullscreen", Opie::Core::OResource::SmallIcon) , tr( "Full Screen"), |
100 | mediaPlayerState, SLOT( toggleFullscreen() ) ); | 100 | mediaPlayerState, SLOT( toggleFullscreen() ) ); |
101 | 101 | ||
102 | Config cfg( "OpiePlayer" ); | 102 | Config cfg( "OpiePlayer" ); |
103 | bool b= cfg.readBoolEntry("FullScreen", 0); | 103 | bool b= cfg.readBoolEntry("FullScreen", 0); |
104 | mediaPlayerState->setFullscreen( b ); | 104 | mediaPlayerState->setFullscreen( b ); |
105 | pmView->setItemChecked( -16, b ); | 105 | pmView->setItemChecked( -16, b ); |
106 | 106 | ||
107 | (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", | 107 | (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", |
108 | d->selectedFiles, SLOT(moveSelectedUp() ) ); | 108 | d->selectedFiles, SLOT(moveSelectedUp() ) ); |
109 | (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", | 109 | (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", |
110 | d->selectedFiles, SLOT(removeSelected() ) ); | 110 | d->selectedFiles, SLOT(removeSelected() ) ); |
111 | (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", | 111 | (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", |
112 | d->selectedFiles, SLOT(moveSelectedDown() ) ); | 112 | d->selectedFiles, SLOT(moveSelectedDown() ) ); |
113 | QVBox *stretch2 = new QVBox( vbox1 ); | 113 | QVBox *stretch2 = new QVBox( vbox1 ); |
114 | 114 | ||
115 | connect( tbDeletePlaylist, ( SIGNAL( released() ) ), | 115 | connect( tbDeletePlaylist, ( SIGNAL( released() ) ), |
116 | SLOT( deletePlaylist() ) ); | 116 | SLOT( deletePlaylist() ) ); |
117 | connect( pmView, SIGNAL( activated(int) ), | 117 | connect( pmView, SIGNAL( activated(int) ), |
118 | this, SLOT( pmViewActivated(int) ) ); | 118 | this, SLOT( pmViewActivated(int) ) ); |
119 | connect( skinsMenu, SIGNAL( activated(int) ) , | 119 | connect( skinsMenu, SIGNAL( activated(int) ) , |
120 | this, SLOT( skinsMenuActivated(int) ) ); | 120 | this, SLOT( skinsMenuActivated(int) ) ); |
121 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ), | 121 | connect( d->selectedFiles, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ), |
122 | this,SLOT( playlistViewPressed(int,QListViewItem*,const QPoint&,int) ) ); | 122 | this,SLOT( playlistViewPressed(int,QListViewItem*,const QPoint&,int) ) ); |
123 | connect( audioView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ), | 123 | connect( audioView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ), |
124 | this,SLOT( viewPressed(int,QListViewItem*,const QPoint&,int) ) ); | 124 | this,SLOT( viewPressed(int,QListViewItem*,const QPoint&,int) ) ); |
125 | connect( audioView, SIGNAL( returnPressed(QListViewItem*) ), | 125 | connect( audioView, SIGNAL( returnPressed(QListViewItem*) ), |
126 | this,SLOT( playIt(QListViewItem*) ) ); | 126 | this,SLOT( playIt(QListViewItem*) ) ); |
127 | connect( audioView, SIGNAL( doubleClicked(QListViewItem*) ), | 127 | connect( audioView, SIGNAL( doubleClicked(QListViewItem*) ), |
128 | this, SLOT( addToSelection(QListViewItem*) ) ); | 128 | this, SLOT( addToSelection(QListViewItem*) ) ); |
129 | connect( videoView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ), | 129 | connect( videoView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ), |
130 | this,SLOT( viewPressed(int,QListViewItem*,const QPoint&,int) ) ); | 130 | this,SLOT( viewPressed(int,QListViewItem*,const QPoint&,int) ) ); |
131 | connect( videoView, SIGNAL( returnPressed(QListViewItem*) ), | 131 | connect( videoView, SIGNAL( returnPressed(QListViewItem*) ), |
132 | this,SLOT( playIt(QListViewItem*) ) ); | 132 | this,SLOT( playIt(QListViewItem*) ) ); |
133 | connect( videoView, SIGNAL( doubleClicked(QListViewItem*) ), | 133 | connect( videoView, SIGNAL( doubleClicked(QListViewItem*) ), |
134 | this, SLOT( addToSelection(QListViewItem*) ) ); | 134 | this, SLOT( addToSelection(QListViewItem*) ) ); |
135 | connect( playLists, SIGNAL( fileSelected(const DocLnk&) ), | 135 | connect( playLists, SIGNAL( fileSelected(const DocLnk&) ), |
136 | this, SLOT( loadList(const DocLnk&) ) ); | 136 | this, SLOT( loadList(const DocLnk&) ) ); |
137 | connect( tabWidget, SIGNAL ( currentChanged(QWidget*) ), | 137 | connect( tabWidget, SIGNAL ( currentChanged(QWidget*) ), |
138 | this, SLOT( tabChanged(QWidget*) ) ); | 138 | this, SLOT( tabChanged(QWidget*) ) ); |
139 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), | 139 | connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), |
140 | d->tbPlay, SLOT( setOn(bool) ) ); | 140 | d->tbPlay, SLOT( setOn(bool) ) ); |
141 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), | 141 | connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), |
142 | d->tbLoop, SLOT( setOn(bool) ) ); | 142 | d->tbLoop, SLOT( setOn(bool) ) ); |
143 | connect( mediaPlayerState, SIGNAL( shuffledToggled(bool) ), | 143 | connect( mediaPlayerState, SIGNAL( shuffledToggled(bool) ), |
144 | d->tbShuffle, SLOT( setOn(bool) ) ); | 144 | d->tbShuffle, SLOT( setOn(bool) ) ); |
145 | connect( d->selectedFiles, SIGNAL( doubleClicked(QListViewItem*) ), | 145 | connect( d->selectedFiles, SIGNAL( doubleClicked(QListViewItem*) ), |
146 | this, SLOT( playIt(QListViewItem*) ) ); | 146 | this, SLOT( playIt(QListViewItem*) ) ); |
147 | connect ( gammaSlider, SIGNAL( valueChanged(int) ), | 147 | connect ( gammaSlider, SIGNAL( valueChanged(int) ), |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index c3c1282..589c11f 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -1,116 +1,116 @@ | |||
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 | |||
35 | #include <qtoolbar.h> | 34 | #include <qtoolbar.h> |
36 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
37 | 36 | ||
38 | #include <qlayout.h> | 37 | #include <qlayout.h> |
39 | #include <qmenubar.h> | 38 | #include <qmenubar.h> |
40 | 39 | ||
41 | #include "playlistselection.h" | 40 | #include "playlistselection.h" |
42 | #include "playlistwidget.h" | 41 | #include "playlistwidget.h" |
43 | #include "mediaplayerstate.h" | 42 | #include "mediaplayerstate.h" |
44 | #include "inputDialog.h" | 43 | #include "inputDialog.h" |
45 | #include "playlistfileview.h" | 44 | #include "playlistfileview.h" |
46 | 45 | ||
47 | 46 | ||
48 | PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) | 47 | PlayListWidgetGui::PlayListWidgetGui(QWidget* parent, const char* name ) |
49 | : QMainWindow( parent, name ) { | 48 | : QMainWindow( parent, name ) { |
50 | 49 | ||
51 | d = new PlayListWidgetPrivate; | 50 | d = new PlayListWidgetPrivate; |
52 | d->setDocumentUsed = FALSE; | 51 | d->setDocumentUsed = FALSE; |
53 | 52 | ||
54 | setBackgroundMode( PaletteButton ); | 53 | setBackgroundMode( PaletteButton ); |
55 | setToolBarsMovable( FALSE ); | 54 | setToolBarsMovable( FALSE ); |
56 | 55 | ||
57 | // Create Toolbar | 56 | // Create Toolbar |
58 | QToolBar *toolbar = new QToolBar( this ); | 57 | QToolBar *toolbar = new QToolBar( this ); |
59 | toolbar->setHorizontalStretchable( TRUE ); | 58 | toolbar->setHorizontalStretchable( TRUE ); |
60 | 59 | ||
61 | // Create Menubar | 60 | // Create Menubar |
62 | QMenuBar *menu = new QMenuBar( toolbar ); | 61 | QMenuBar *menu = new QMenuBar( toolbar ); |
63 | menu->setMargin( 0 ); | 62 | menu->setMargin( 0 ); |
64 | 63 | ||
65 | bar = new QToolBar( this ); | 64 | bar = new QToolBar( this ); |
66 | bar->setLabel( tr( "Play Operations" ) ); | 65 | bar->setLabel( tr( "Play Operations" ) ); |
67 | 66 | ||
68 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); | 67 | tbDeletePlaylist = new QPushButton( Opie::Core::OResource::loadIconSet( "trash", Opie::Core::OResource::SmallIcon ), |
68 | "", bar, "close" ); | ||
69 | tbDeletePlaylist->setFlat( TRUE ); | 69 | tbDeletePlaylist->setFlat( TRUE ); |
70 | tbDeletePlaylist->setFixedSize( 20, 20 ); | 70 | tbDeletePlaylist->setFixedSize( 20, 20 ); |
71 | 71 | ||
72 | tbDeletePlaylist->hide(); | 72 | tbDeletePlaylist->hide(); |
73 | 73 | ||
74 | pmPlayList = new QPopupMenu( this ); | 74 | pmPlayList = new QPopupMenu( this ); |
75 | menu->insertItem( tr( "File" ), pmPlayList ); | 75 | menu->insertItem( tr( "File" ), pmPlayList ); |
76 | 76 | ||
77 | pmView = new QPopupMenu( this ); | 77 | pmView = new QPopupMenu( this ); |
78 | menu->insertItem( tr( "View" ), pmView ); | 78 | menu->insertItem( tr( "View" ), pmView ); |
79 | pmView->isCheckable(); | 79 | pmView->isCheckable(); |
80 | 80 | ||
81 | skinsMenu = new QPopupMenu( this ); | 81 | skinsMenu = new QPopupMenu( this ); |
82 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 82 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
83 | skinsMenu->isCheckable(); | 83 | skinsMenu->isCheckable(); |
84 | 84 | ||
85 | gammaMenu = new QPopupMenu( this ); | 85 | gammaMenu = new QPopupMenu( this ); |
86 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); | 86 | pmView->insertItem( tr( "Gamma (Video)" ), gammaMenu ); |
87 | 87 | ||
88 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); | 88 | gammaSlider = new QSlider( QSlider::Vertical, gammaMenu ); |
89 | gammaSlider->setRange( -40, 40 ); | 89 | gammaSlider->setRange( -40, 40 ); |
90 | gammaSlider->setTickmarks( QSlider::Left ); | 90 | gammaSlider->setTickmarks( QSlider::Left ); |
91 | gammaSlider->setTickInterval( 20 ); | 91 | gammaSlider->setTickInterval( 20 ); |
92 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); | 92 | gammaSlider->setFocusPolicy( QWidget::StrongFocus ); |
93 | gammaSlider->setValue( 0 ); | 93 | gammaSlider->setValue( 0 ); |
94 | gammaSlider->setMinimumHeight( 50 ); | 94 | gammaSlider->setMinimumHeight( 50 ); |
95 | 95 | ||
96 | gammaLCD = new QLCDNumber( 3, gammaMenu ); | 96 | gammaLCD = new QLCDNumber( 3, gammaMenu ); |
97 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); | 97 | gammaLCD-> setFrameShape ( QFrame::NoFrame ); |
98 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); | 98 | gammaLCD-> setSegmentStyle ( QLCDNumber::Flat ); |
99 | 99 | ||
100 | gammaMenu->insertItem( gammaSlider ); | 100 | gammaMenu->insertItem( gammaSlider ); |
101 | gammaMenu->insertItem( gammaLCD ); | 101 | gammaMenu->insertItem( gammaLCD ); |
102 | 102 | ||
103 | connect( gammaSlider, SIGNAL( valueChanged(int) ), gammaLCD, SLOT( display(int) ) ); | 103 | connect( gammaSlider, SIGNAL( valueChanged(int) ), gammaLCD, SLOT( display(int) ) ); |
104 | 104 | ||
105 | vbox5 = new QVBox( this ); | 105 | vbox5 = new QVBox( this ); |
106 | QVBox *vbox4 = new QVBox( vbox5 ); | 106 | QVBox *vbox4 = new QVBox( vbox5 ); |
107 | QHBox *hbox6 = new QHBox( vbox4 ); | 107 | QHBox *hbox6 = new QHBox( vbox4 ); |
108 | 108 | ||
109 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 109 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
110 | 110 | ||
111 | playListTab = new QWidget( tabWidget, "PlayListTab" ); | 111 | playListTab = new QWidget( tabWidget, "PlayListTab" ); |
112 | tabWidget->insertTab( playListTab, "Playlist"); | 112 | tabWidget->insertTab( playListTab, "Playlist"); |
113 | 113 | ||
114 | QGridLayout *Playout = new QGridLayout( playListTab ); | 114 | QGridLayout *Playout = new QGridLayout( playListTab ); |
115 | Playout->setSpacing( 2); | 115 | Playout->setSpacing( 2); |
116 | Playout->setMargin( 2); | 116 | Playout->setMargin( 2); |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.h b/noncore/multimedia/opieplayer2/playlistwidgetgui.h index 5706d14..0f4a120 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.h +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.h | |||
@@ -1,123 +1,127 @@ | |||
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 | #ifndef PLAY_LIST_WIDGET_GUI_H | 34 | #ifndef PLAY_LIST_WIDGET_GUI_H |
35 | #define PLAY_LIST_WIDGET_GUI_H | 35 | #define PLAY_LIST_WIDGET_GUI_H |
36 | 36 | ||
37 | #include <qmainwindow.h> | 37 | #include <qmainwindow.h> |
38 | #include <qpe/resource.h> | ||
39 | 38 | ||
40 | #include <qtabwidget.h> | 39 | #include <opie2/oresource.h> |
40 | |||
41 | #include <qpe/qpeapplication.h> | ||
41 | #include <qpe/fileselector.h> | 42 | #include <qpe/fileselector.h> |
43 | |||
44 | #include <qtabwidget.h> | ||
42 | #include <qaction.h> | 45 | #include <qaction.h> |
43 | #include <qtoolbutton.h> | 46 | #include <qtoolbutton.h> |
44 | #include <qslider.h> | 47 | #include <qslider.h> |
45 | #include <qlcdnumber.h> | 48 | #include <qlcdnumber.h> |
46 | 49 | ||
47 | class PlayListWidgetPrivate; | 50 | class PlayListWidgetPrivate; |
48 | class PlayListSelection; | 51 | class PlayListSelection; |
49 | class MediaPlayerState; | 52 | class MediaPlayerState; |
50 | class PlayListFileView; | 53 | class PlayListFileView; |
51 | 54 | ||
52 | class Config; | 55 | class Config; |
53 | class QToolBar; | 56 | class QToolBar; |
54 | class QListViewItem; | 57 | class QListViewItem; |
55 | class QListView; | 58 | class QListView; |
56 | class QPoint; | 59 | class QPoint; |
57 | class QAction; | 60 | class QAction; |
58 | class QLabel; | 61 | class QLabel; |
59 | 62 | ||
60 | class PlayListWidgetPrivate { | 63 | class PlayListWidgetPrivate { |
61 | public: | 64 | public: |
62 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; | 65 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; |
63 | QFrame *playListFrame; | 66 | QFrame *playListFrame; |
64 | PlayListSelection *selectedFiles; | 67 | PlayListSelection *selectedFiles; |
65 | bool setDocumentUsed; | 68 | bool setDocumentUsed; |
66 | }; | 69 | }; |
67 | 70 | ||
68 | 71 | ||
69 | class ToolButton : public QToolButton { | 72 | class ToolButton : public QToolButton { |
70 | Q_OBJECT | 73 | Q_OBJECT |
71 | public: | 74 | public: |
72 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) | 75 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) |
73 | : QToolButton( parent, name ) { | 76 | : QToolButton( parent, name ) { |
74 | setTextLabel( name ); | 77 | setTextLabel( name ); |
75 | setPixmap( Resource::loadPixmap( icon ) ); | 78 | setUsesBigPixmap( qApp->desktop()->size().width() > 330 ); |
79 | setPixmap( Opie::Core::OResource::loadPixmap( icon, Opie::Core::OResource::SmallIcon ) ); | ||
76 | setAutoRaise( TRUE ); | 80 | setAutoRaise( TRUE ); |
77 | setFocusPolicy( QWidget::NoFocus ); | 81 | setFocusPolicy( QWidget::NoFocus ); |
78 | setToggleButton( t ); | 82 | setToggleButton( t ); |
79 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); | 83 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); |
80 | } | 84 | } |
81 | }; | 85 | }; |
82 | 86 | ||
83 | class MenuItem : public QAction { | 87 | class MenuItem : public QAction { |
84 | 88 | ||
85 | public: | 89 | public: |
86 | MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) | 90 | MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) |
87 | : QAction( text, QString::null, 0, 0 ) { | 91 | : QAction( text, QString::null, 0, 0 ) { |
88 | connect( this, SIGNAL( activated() ), handler, slot ); | 92 | connect( this, SIGNAL( activated() ), handler, slot ); |
89 | addTo( parent ); | 93 | addTo( parent ); |
90 | } | 94 | } |
91 | }; | 95 | }; |
92 | 96 | ||
93 | class PlayListWidgetGui : public QMainWindow { | 97 | class PlayListWidgetGui : public QMainWindow { |
94 | Q_OBJECT | 98 | Q_OBJECT |
95 | public: | 99 | public: |
96 | PlayListWidgetGui( QWidget* parent=0, const char* name=0 ); | 100 | PlayListWidgetGui( QWidget* parent=0, const char* name=0 ); |
97 | ~PlayListWidgetGui(); | 101 | ~PlayListWidgetGui(); |
98 | 102 | ||
99 | protected: | 103 | protected: |
100 | QTabWidget * tabWidget; | 104 | QTabWidget * tabWidget; |
101 | PlayListFileView *audioView, *videoView; | 105 | PlayListFileView *audioView, *videoView; |
102 | QListView *playlistView; | 106 | QListView *playlistView; |
103 | QLabel *libString; | 107 | QLabel *libString; |
104 | QPopupMenu *pmView ; | 108 | QPopupMenu *pmView ; |
105 | QPopupMenu *gammaMenu; | 109 | QPopupMenu *gammaMenu; |
106 | QSlider *gammaSlider; | 110 | QSlider *gammaSlider; |
107 | QLCDNumber *gammaLCD; | 111 | QLCDNumber *gammaLCD; |
108 | bool fromSetDocument; | 112 | bool fromSetDocument; |
109 | bool insanityBool; | 113 | bool insanityBool; |
110 | QString setDocFileRef; | 114 | QString setDocFileRef; |
111 | // retrieve the current playlist entry (media file link) | 115 | // retrieve the current playlist entry (media file link) |
112 | QPushButton *tbDeletePlaylist; | 116 | QPushButton *tbDeletePlaylist; |
113 | int selected; | 117 | int selected; |
114 | QPopupMenu *pmPlayList; | 118 | QPopupMenu *pmPlayList; |
115 | FileSelector* playLists; | 119 | FileSelector* playLists; |
116 | QPopupMenu *skinsMenu; | 120 | QPopupMenu *skinsMenu; |
117 | PlayListWidgetPrivate *d; // Private implementation data | 121 | PlayListWidgetPrivate *d; // Private implementation data |
118 | QVBox *vbox1; | 122 | QVBox *vbox1; |
119 | QVBox *vbox5; | 123 | QVBox *vbox5; |
120 | QToolBar *bar; | 124 | QToolBar *bar; |
121 | QWidget *playListTab; | 125 | QWidget *playListTab; |
122 | void setActiveWindow(); // need to handle this to show the right view | 126 | void setActiveWindow(); // need to handle this to show the right view |
123 | void setView( char ); | 127 | void setView( char ); |
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 7c98ce5..eac84dd 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -1,92 +1,91 @@ | |||
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 "xinevideowidget.h" | 34 | #include "xinevideowidget.h" |
35 | #include <opie2/odebug.h> | 35 | #include <opie2/odebug.h> |
36 | #include <opie2/oresource.h> | ||
36 | 37 | ||
37 | #include <qimage.h> | 38 | #include <qimage.h> |
38 | #include <qdirectpainter_qws.h> | 39 | #include <qdirectpainter_qws.h> |
39 | #include <qgfx_qws.h> | 40 | #include <qgfx_qws.h> |
40 | #include <qsize.h> | 41 | #include <qsize.h> |
41 | #include <qapplication.h> | 42 | #include <qapplication.h> |
42 | 43 | ||
43 | #include <qpe/resource.h> | ||
44 | |||
45 | #include <pthread.h> | 44 | #include <pthread.h> |
46 | 45 | ||
47 | 46 | ||
48 | 47 | ||
49 | // 0 deg rot: copy a line from src to dst (use libc memcpy) | 48 | // 0 deg rot: copy a line from src to dst (use libc memcpy) |
50 | 49 | ||
51 | // 180 deg rot: copy a line from src to dst reversed | 50 | // 180 deg rot: copy a line from src to dst reversed |
52 | 51 | ||
53 | /* | 52 | /* |
54 | * This code relies the len be a multiply of 16bit | 53 | * This code relies the len be a multiply of 16bit |
55 | */ | 54 | */ |
56 | static inline void memcpy_rev ( void *_dst, void *_src, size_t len ) | 55 | static inline void memcpy_rev ( void *_dst, void *_src, size_t len ) |
57 | { | 56 | { |
58 | 57 | ||
59 | /* | 58 | /* |
60 | * move the source to the end | 59 | * move the source to the end |
61 | */ | 60 | */ |
62 | char *src_c = static_cast<char*>(_src) + len; | 61 | char *src_c = static_cast<char*>(_src) + len; |
63 | 62 | ||
64 | /* | 63 | /* |
65 | * as we copy by 16bit and not 8bit | 64 | * as we copy by 16bit and not 8bit |
66 | * devide the length by two | 65 | * devide the length by two |
67 | */ | 66 | */ |
68 | len >>= 1; | 67 | len >>= 1; |
69 | 68 | ||
70 | short int* dst = static_cast<short int*>( _dst ); | 69 | short int* dst = static_cast<short int*>( _dst ); |
71 | short int* src = reinterpret_cast<short int*>( src_c ); | 70 | short int* src = reinterpret_cast<short int*>( src_c ); |
72 | 71 | ||
73 | /* | 72 | /* |
74 | * Increment dst after assigning | 73 | * Increment dst after assigning |
75 | * Decrement src before assigning becase we move backwards | 74 | * Decrement src before assigning becase we move backwards |
76 | */ | 75 | */ |
77 | while ( len-- ) | 76 | while ( len-- ) |
78 | *dst++ = *--src; | 77 | *dst++ = *--src; |
79 | 78 | ||
80 | } | 79 | } |
81 | 80 | ||
82 | // 90 deg rot: copy a column from src to dst | 81 | // 90 deg rot: copy a column from src to dst |
83 | 82 | ||
84 | static inline void memcpy_step ( void *_dst, void *_src, size_t len, size_t step ) | 83 | static inline void memcpy_step ( void *_dst, void *_src, size_t len, size_t step ) |
85 | { | 84 | { |
86 | short int *dst = static_cast<short int*>( _dst ); | 85 | short int *dst = static_cast<short int*>( _dst ); |
87 | short int *src = static_cast<short int*>( _src ); | 86 | short int *src = static_cast<short int*>( _src ); |
88 | 87 | ||
89 | len >>= 1; | 88 | len >>= 1; |
90 | 89 | ||
91 | /* | 90 | /* |
92 | * Copy 16bit from src to dst and move to the next address | 91 | * Copy 16bit from src to dst and move to the next address |