author | harlekin <harlekin> | 2002-08-19 18:54:10 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-19 18:54:10 (UTC) |
commit | aaa640a47a707b4d4e6aff37bf78c11bfc903b3c (patch) (unidiff) | |
tree | 5aa2412688ce1c81f724e9d70ddf5cdc42e02618 | |
parent | 719dda9280813d323eebe3d2323271f953ed1144 (diff) | |
download | opie-aaa640a47a707b4d4e6aff37bf78c11bfc903b3c.zip opie-aaa640a47a707b4d4e6aff37bf78c11bfc903b3c.tar.gz opie-aaa640a47a707b4d4e6aff37bf78c11bfc903b3c.tar.bz2 |
cleanups
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 23 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/opieplayer2.pro | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 24 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 1 |
7 files changed, 15 insertions, 41 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index e7da6c5..626004a 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -38,97 +38,96 @@ | |||
38 | #include <qpainter.h> | 38 | #include <qpainter.h> |
39 | #include <qdrawutil.h> | 39 | #include <qdrawutil.h> |
40 | #include <qpixmap.h> | 40 | #include <qpixmap.h> |
41 | #include <qstring.h> | 41 | #include <qstring.h> |
42 | #include <qslider.h> | 42 | #include <qslider.h> |
43 | #include <qframe.h> | 43 | #include <qframe.h> |
44 | #include <qlineedit.h> | 44 | #include <qlineedit.h> |
45 | 45 | ||
46 | 46 | ||
47 | class QPixmap; | 47 | class QPixmap; |
48 | 48 | ||
49 | enum AudioButtons { | 49 | enum AudioButtons { |
50 | AudioPlay=0, | 50 | AudioPlay=0, |
51 | AudioStop, | 51 | AudioStop, |
52 | AudioNext, | 52 | AudioNext, |
53 | AudioPrevious, | 53 | AudioPrevious, |
54 | AudioVolumeUp, | 54 | AudioVolumeUp, |
55 | AudioVolumeDown, | 55 | AudioVolumeDown, |
56 | AudioLoop, | 56 | AudioLoop, |
57 | AudioPlayList, | 57 | AudioPlayList, |
58 | AudioForward, | 58 | AudioForward, |
59 | AudioBack | 59 | AudioBack |
60 | }; | 60 | }; |
61 | 61 | ||
62 | 62 | ||
63 | class Ticker : public QFrame { | 63 | class Ticker : public QFrame { |
64 | Q_OBJECT | 64 | Q_OBJECT |
65 | 65 | ||
66 | public: | 66 | public: |
67 | Ticker( QWidget* parent=0 ); | 67 | Ticker( QWidget* parent=0 ); |
68 | ~Ticker(); | 68 | ~Ticker(); |
69 | void setText( const QString& text ) ; | 69 | void setText( const QString& text ) ; |
70 | 70 | ||
71 | protected: | 71 | protected: |
72 | void timerEvent( QTimerEvent * ); | 72 | void timerEvent( QTimerEvent * ); |
73 | void drawContents( QPainter *p ); | 73 | void drawContents( QPainter *p ); |
74 | private: | 74 | private: |
75 | QString scrollText; | 75 | QString scrollText; |
76 | int pos, pixelLen; | 76 | int pos, pixelLen; |
77 | }; | 77 | }; |
78 | 78 | ||
79 | 79 | ||
80 | class AudioWidget : public QWidget { | 80 | class AudioWidget : public QWidget { |
81 | Q_OBJECT | 81 | Q_OBJECT |
82 | public: | 82 | public: |
83 | AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); | 83 | AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); |
84 | ~AudioWidget(); | 84 | ~AudioWidget(); |
85 | void setTickerText( const QString &text ) { songInfo.setText( text ); } | 85 | void setTickerText( const QString &text ) { songInfo.setText( text ); } |
86 | bool isStreaming; | ||
87 | public slots: | 86 | public slots: |
88 | void updateSlider( long, long ); | 87 | void updateSlider( long, long ); |
89 | void sliderPressed( ); | 88 | void sliderPressed( ); |
90 | void sliderReleased( ); | 89 | void sliderReleased( ); |
91 | // void setPaused( bool b) { setToggleButton( AudioPause, b ); } | 90 | // void setPaused( bool b) { setToggleButton( AudioPause, b ); } |
92 | void setLooping( bool b) { setToggleButton( AudioLoop, b ); } | 91 | void setLooping( bool b) { setToggleButton( AudioLoop, b ); } |
93 | void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } | 92 | void setPlaying( bool b) { setToggleButton( AudioPlay, b ); } |
94 | void setPosition( long ); | 93 | void setPosition( long ); |
95 | void setLength( long ); | 94 | void setLength( long ); |
96 | void setView( char ); | 95 | void setView( char ); |
97 | 96 | ||
98 | signals: | 97 | signals: |
99 | void moreClicked(); | 98 | void moreClicked(); |
100 | void lessClicked(); | 99 | void lessClicked(); |
101 | void moreReleased(); | 100 | void moreReleased(); |
102 | void lessReleased(); | 101 | void lessReleased(); |
103 | void forwardClicked(); | 102 | void forwardClicked(); |
104 | void backClicked(); | 103 | void backClicked(); |
105 | void forwardReleased(); | 104 | void forwardReleased(); |
106 | void backReleased(); | 105 | void backReleased(); |
107 | void sliderMoved(long); | 106 | void sliderMoved(long); |
108 | 107 | ||
109 | protected: | 108 | protected: |
110 | void doBlank(); | 109 | void doBlank(); |
111 | void doUnblank(); | 110 | void doUnblank(); |
112 | void paintEvent( QPaintEvent *pe ); | 111 | void paintEvent( QPaintEvent *pe ); |
113 | void showEvent( QShowEvent *se ); | 112 | void showEvent( QShowEvent *se ); |
114 | void resizeEvent( QResizeEvent *re ); | 113 | void resizeEvent( QResizeEvent *re ); |
115 | void mouseMoveEvent( QMouseEvent *event ); | 114 | void mouseMoveEvent( QMouseEvent *event ); |
116 | void mousePressEvent( QMouseEvent *event ); | 115 | void mousePressEvent( QMouseEvent *event ); |
117 | void mouseReleaseEvent( QMouseEvent *event ); | 116 | void mouseReleaseEvent( QMouseEvent *event ); |
118 | void timerEvent( QTimerEvent *event ); | 117 | void timerEvent( QTimerEvent *event ); |
119 | void closeEvent( QCloseEvent *event ); | 118 | void closeEvent( QCloseEvent *event ); |
120 | void keyReleaseEvent( QKeyEvent *e); | 119 | void keyReleaseEvent( QKeyEvent *e); |
121 | private slots: | 120 | private slots: |
122 | void skipFor(); | 121 | void skipFor(); |
123 | void skipBack(); | 122 | void skipBack(); |
124 | void stopSkip(); | 123 | void stopSkip(); |
125 | private: | 124 | private: |
126 | void toggleButton( int ); | 125 | void toggleButton( int ); |
127 | void setToggleButton( int, bool ); | 126 | void setToggleButton( int, bool ); |
128 | void paintButton( QPainter *p, int i ); | 127 | void paintButton( QPainter *p, int i ); |
129 | int skipDirection; | 128 | int skipDirection; |
130 | QString skin; | 129 | QString skin; |
131 | QPixmap *pixBg; | 130 | QPixmap *pixBg; |
132 | QImage *imgUp; | 131 | QImage *imgUp; |
133 | QImage *imgDn; | 132 | QImage *imgDn; |
134 | QImage *imgButtonMask; | 133 | QImage *imgButtonMask; |
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 3a82a50..c187f52 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -42,119 +42,96 @@ | |||
42 | #include <qgfx_qws.h> | 42 | #include <qgfx_qws.h> |
43 | #include <qdirectpainter_qws.h> | 43 | #include <qdirectpainter_qws.h> |
44 | 44 | ||
45 | #include "xinevideowidget.h" | 45 | #include "xinevideowidget.h" |
46 | #include "frame.h" | 46 | #include "frame.h" |
47 | #include "lib.h" | 47 | #include "lib.h" |
48 | 48 | ||
49 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, | 49 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, |
50 | int width, int height,int bytes ); | 50 | int width, int height,int bytes ); |
51 | 51 | ||
52 | extern "C" { | 52 | extern "C" { |
53 | vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video); | 53 | vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video); |
54 | int null_is_showing_video( vo_driver_t* self ); | 54 | int null_is_showing_video( vo_driver_t* self ); |
55 | void null_set_show_video( vo_driver_t* self, int show ); | 55 | void null_set_show_video( vo_driver_t* self, int show ); |
56 | int null_is_fullscreen( vo_driver_t* self ); | 56 | int null_is_fullscreen( vo_driver_t* self ); |
57 | void null_set_fullscreen( vo_driver_t* self, int screen ); | 57 | void null_set_fullscreen( vo_driver_t* self, int screen ); |
58 | int null_is_scaling( vo_driver_t* self ); | 58 | int null_is_scaling( vo_driver_t* self ); |
59 | void null_set_scaling( vo_driver_t* self, int scale ); | 59 | void null_set_scaling( vo_driver_t* self, int scale ); |
60 | void null_set_gui_width( vo_driver_t* self, int width ); | 60 | void null_set_gui_width( vo_driver_t* self, int width ); |
61 | void null_set_gui_height( vo_driver_t* self, int height ); | 61 | void null_set_gui_height( vo_driver_t* self, int height ); |
62 | void null_set_mode( vo_driver_t* self, int depth, int rgb ); | 62 | void null_set_mode( vo_driver_t* self, int depth, int rgb ); |
63 | void null_display_handler(vo_driver_t* self, display_xine_frame_t t, void* user_data); | 63 | void null_display_handler(vo_driver_t* self, display_xine_frame_t t, void* user_data); |
64 | } | 64 | } |
65 | 65 | ||
66 | using namespace XINE; | 66 | using namespace XINE; |
67 | 67 | ||
68 | Lib::Lib(XineVideoWidget* widget) { | 68 | Lib::Lib(XineVideoWidget* widget) { |
69 | m_video = false; | 69 | m_video = false; |
70 | m_wid = widget; | 70 | m_wid = widget; |
71 | printf("Lib"); | 71 | printf("Lib"); |
72 | QCString str( getenv("HOME") ); | 72 | QCString str( getenv("HOME") ); |
73 | str += "/Settings/opiexine.cf"; | 73 | str += "/Settings/opiexine.cf"; |
74 | // get the configuration | 74 | // get the configuration |
75 | 75 | ||
76 | // not really OO, should be an extra class, later | 76 | // not really OO, should be an extra class, later |
77 | if ( !QFile(str).exists() ) { | 77 | if ( !QFile(str).exists() ) { |
78 | QFile f(str); | 78 | QFile f(str); |
79 | f.open(IO_WriteOnly); | 79 | f.open(IO_WriteOnly); |
80 | QTextStream ts( &f ); | 80 | QTextStream ts( &f ); |
81 | ts << "misc.memcpy_method:glibc\n"; | 81 | ts << "misc.memcpy_method:glibc\n"; |
82 | f.close(); | 82 | f.close(); |
83 | } | 83 | } |
84 | 84 | ||
85 | m_config = xine_config_file_init( str.data() ); | 85 | m_config = xine_config_file_init( str.data() ); |
86 | 86 | ||
87 | // allocate oss for sound | 87 | // allocate oss for sound |
88 | // and fb for framebuffer | 88 | // and fb for framebuffer |
89 | m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; | 89 | m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; |
90 | if (m_audioOutput == NULL ) | ||
91 | printf("Failure\n"); | ||
92 | else | ||
93 | printf("Success\n"); | ||
94 | |||
95 | |||
96 | // test code | ||
97 | /* m_videoOutput = xine_load_video_output_plugin(m_config, "fb", | ||
98 | VISUAL_TYPE_FB, | ||
99 | 0 ); | ||
100 | */ | ||
101 | |||
102 | char** files = xine_list_video_output_plugins(3); | ||
103 | char* out; | ||
104 | int i = 0; | ||
105 | while ( ( out = files[i] ) != 0 ) { | ||
106 | printf("Video %s\n", out ); | ||
107 | i++; | ||
108 | } | ||
109 | // m_xine = xine_init( m_videoOutput, | ||
110 | // m_audioOutput, | ||
111 | // m_config ); | ||
112 | // test loading | ||
113 | m_videoOutput = ::init_video_out_plugin( m_config, NULL ); | 90 | m_videoOutput = ::init_video_out_plugin( m_config, NULL ); |
114 | if (m_wid != 0 ) { | 91 | if (m_wid != 0 ) { |
115 | printf("!0\n" ); | 92 | printf("!0\n" ); |
116 | resize ( m_wid-> size ( )); | 93 | resize ( m_wid-> size ( )); |
117 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); | 94 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); |
118 | m_wid-> setImage ( new QImage ( Resource::loadImage(""))); | 95 | m_wid-> setImage ( new QImage ( Resource::loadImage(""))); |
119 | m_wid->repaint(); | 96 | m_wid->repaint(); |
120 | } | 97 | } |
121 | null_display_handler( m_videoOutput, | 98 | null_display_handler( m_videoOutput, |
122 | xine_display_frame, | 99 | xine_display_frame, |
123 | this ); | 100 | this ); |
124 | 101 | ||
125 | m_xine = xine_init( m_videoOutput, | 102 | m_xine = xine_init( m_videoOutput, |
126 | m_audioOutput, m_config ); | 103 | m_audioOutput, m_config ); |
127 | // install the event handler | 104 | // install the event handler |
128 | xine_register_event_listener( m_xine, xine_event_handler, this ); | 105 | xine_register_event_listener( m_xine, xine_event_handler, this ); |
129 | } | 106 | } |
130 | 107 | ||
131 | Lib::~Lib() { | 108 | Lib::~Lib() { |
132 | delete m_config; | 109 | delete m_config; |
133 | xine_remove_event_listener( m_xine, xine_event_handler ); | 110 | xine_remove_event_listener( m_xine, xine_event_handler ); |
134 | xine_exit( m_xine ); | 111 | xine_exit( m_xine ); |
135 | delete m_videoOutput; | 112 | delete m_videoOutput; |
136 | //delete m_audioOutput; | 113 | //delete m_audioOutput; |
137 | 114 | ||
138 | } | 115 | } |
139 | 116 | ||
140 | void Lib::resize ( const QSize &s ) | 117 | void Lib::resize ( const QSize &s ) |
141 | { | 118 | { |
142 | if ( s. width ( ) && s. height ( )) { | 119 | if ( s. width ( ) && s. height ( )) { |
143 | ::null_set_gui_width( m_videoOutput, s. width() ); | 120 | ::null_set_gui_width( m_videoOutput, s. width() ); |
144 | ::null_set_gui_height(m_videoOutput, s. height() ); | 121 | ::null_set_gui_height(m_videoOutput, s. height() ); |
145 | } | 122 | } |
146 | } | 123 | } |
147 | 124 | ||
148 | QCString Lib::version() { | 125 | QCString Lib::version() { |
149 | QCString str( xine_get_str_version() ); | 126 | QCString str( xine_get_str_version() ); |
150 | return str; | 127 | return str; |
151 | }; | 128 | }; |
152 | 129 | ||
153 | int Lib::majorVersion() { | 130 | int Lib::majorVersion() { |
154 | return xine_get_major_version(); | 131 | return xine_get_major_version(); |
155 | } | 132 | } |
156 | int Lib::minorVersion() { | 133 | int Lib::minorVersion() { |
157 | return xine_get_minor_version(); | 134 | return xine_get_minor_version(); |
158 | }; | 135 | }; |
159 | 136 | ||
160 | int Lib::subVersion() { | 137 | int Lib::subVersion() { |
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 5531e81..18caaad 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -48,97 +48,96 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) | |||
48 | 48 | ||
49 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | 49 | connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); |
50 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | 50 | connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); |
51 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | 51 | connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); |
52 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | 52 | connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); |
53 | 53 | ||
54 | connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); | 54 | connect( videoUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); |
55 | connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); | 55 | connect( videoUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); |
56 | connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); | 56 | connect( videoUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); |
57 | connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); | 57 | connect( videoUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); |
58 | 58 | ||
59 | volControl = new VolumeControl; | 59 | volControl = new VolumeControl; |
60 | xineControl = new XineControl(); | 60 | xineControl = new XineControl(); |
61 | } | 61 | } |
62 | 62 | ||
63 | MediaPlayer::~MediaPlayer() { | 63 | MediaPlayer::~MediaPlayer() { |
64 | delete xineControl; | 64 | delete xineControl; |
65 | delete volControl; | 65 | delete volControl; |
66 | } | 66 | } |
67 | 67 | ||
68 | void MediaPlayer::pauseCheck( bool b ) { | 68 | void MediaPlayer::pauseCheck( bool b ) { |
69 | if ( b && !mediaPlayerState->playing() ) { | 69 | if ( b && !mediaPlayerState->playing() ) { |
70 | mediaPlayerState->setPaused( FALSE ); | 70 | mediaPlayerState->setPaused( FALSE ); |
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
74 | void MediaPlayer::play() { | 74 | void MediaPlayer::play() { |
75 | mediaPlayerState->setPlaying( FALSE ); | 75 | mediaPlayerState->setPlaying( FALSE ); |
76 | mediaPlayerState->setPlaying( TRUE ); | 76 | mediaPlayerState->setPlaying( TRUE ); |
77 | } | 77 | } |
78 | 78 | ||
79 | void MediaPlayer::setPlaying( bool play ) { | 79 | void MediaPlayer::setPlaying( bool play ) { |
80 | if ( !play ) { | 80 | if ( !play ) { |
81 | return; | 81 | return; |
82 | } | 82 | } |
83 | 83 | ||
84 | if ( mediaPlayerState->paused() ) { | 84 | if ( mediaPlayerState->paused() ) { |
85 | mediaPlayerState->setPaused( FALSE ); | 85 | mediaPlayerState->setPaused( FALSE ); |
86 | return; | 86 | return; |
87 | } | 87 | } |
88 | 88 | ||
89 | const DocLnk *playListCurrent = playList->current(); | 89 | const DocLnk *playListCurrent = playList->current(); |
90 | if ( playListCurrent != NULL ) { | 90 | if ( playListCurrent != NULL ) { |
91 | currentFile = playListCurrent; | 91 | currentFile = playListCurrent; |
92 | } | 92 | } |
93 | 93 | ||
94 | xineControl->play( currentFile->file() ); | 94 | xineControl->play( currentFile->file() ); |
95 | 95 | ||
96 | xineControl->length(); | ||
97 | long seconds = mediaPlayerState->length();// | 96 | long seconds = mediaPlayerState->length();// |
98 | QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); | 97 | QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); |
99 | qDebug(time); | 98 | qDebug(time); |
100 | 99 | ||
101 | QString tickerText; | 100 | QString tickerText; |
102 | if( currentFile->file().left(4) == "http" ) | 101 | if( currentFile->file().left(4) == "http" ) |
103 | tickerText= tr( " File: " ) + currentFile->name(); | 102 | tickerText= tr( " File: " ) + currentFile->name(); |
104 | else | 103 | else |
105 | tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; | 104 | tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; |
106 | 105 | ||
107 | audioUI->setTickerText( currentFile->file( ) ); | 106 | audioUI->setTickerText( currentFile->file( ) ); |
108 | 107 | ||
109 | } | 108 | } |
110 | 109 | ||
111 | 110 | ||
112 | void MediaPlayer::prev() { | 111 | void MediaPlayer::prev() { |
113 | if ( playList->prev() ) { | 112 | if ( playList->prev() ) { |
114 | play(); | 113 | play(); |
115 | } else if ( mediaPlayerState->looping() ) { | 114 | } else if ( mediaPlayerState->looping() ) { |
116 | if ( playList->last() ) { | 115 | if ( playList->last() ) { |
117 | play(); | 116 | play(); |
118 | } | 117 | } |
119 | } else { | 118 | } else { |
120 | mediaPlayerState->setList(); | 119 | mediaPlayerState->setList(); |
121 | } | 120 | } |
122 | } | 121 | } |
123 | 122 | ||
124 | 123 | ||
125 | void MediaPlayer::next() { | 124 | void MediaPlayer::next() { |
126 | if ( playList->next() ) { | 125 | if ( playList->next() ) { |
127 | play(); | 126 | play(); |
128 | } else if ( mediaPlayerState->looping() ) { | 127 | } else if ( mediaPlayerState->looping() ) { |
129 | if ( playList->first() ) { | 128 | if ( playList->first() ) { |
130 | play(); | 129 | play(); |
131 | } | 130 | } |
132 | } else { | 131 | } else { |
133 | mediaPlayerState->setList(); | 132 | mediaPlayerState->setList(); |
134 | } | 133 | } |
135 | } | 134 | } |
136 | 135 | ||
137 | 136 | ||
138 | void MediaPlayer::startDecreasingVolume() { | 137 | void MediaPlayer::startDecreasingVolume() { |
139 | volumeDirection = -1; | 138 | volumeDirection = -1; |
140 | startTimer( 100 ); | 139 | startTimer( 100 ); |
141 | volControl->decVol(2); | 140 | volControl->decVol(2); |
142 | } | 141 | } |
143 | 142 | ||
144 | 143 | ||
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 6833e07..8366ab4 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -1,86 +1,87 @@ | |||
1 | #include <qpe/qpeapplication.h> | 1 | #include <qpe/qpeapplication.h> |
2 | #include <qpe/qlibrary.h> | 2 | #include <qpe/qlibrary.h> |
3 | #include <qpe/config.h> | 3 | #include <qpe/config.h> |
4 | #include <qvaluelist.h> | 4 | #include <qvaluelist.h> |
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | #include <qdir.h> | 6 | #include <qdir.h> |
7 | #include "mediaplayerstate.h" | 7 | #include "mediaplayerstate.h" |
8 | 8 | ||
9 | 9 | ||
10 | 10 | ||
11 | //#define MediaPlayerDebug(x) qDebug x | 11 | //#define MediaPlayerDebug(x) qDebug x |
12 | #define MediaPlayerDebug(x) | 12 | #define MediaPlayerDebug(x) |
13 | 13 | ||
14 | 14 | ||
15 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) | 15 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) |
16 | : QObject( parent, name ) { | 16 | : QObject( parent, name ) { |
17 | Config cfg( "OpiePlayer" ); | 17 | Config cfg( "OpiePlayer" ); |
18 | readConfig( cfg ); | 18 | readConfig( cfg ); |
19 | 19 | ||
20 | } | 20 | } |
21 | 21 | ||
22 | 22 | ||
23 | MediaPlayerState::~MediaPlayerState() { | 23 | MediaPlayerState::~MediaPlayerState() { |
24 | Config cfg( "OpiePlayer" ); | 24 | Config cfg( "OpiePlayer" ); |
25 | writeConfig( cfg ); | 25 | writeConfig( cfg ); |
26 | 26 | ||
27 | } | 27 | } |
28 | 28 | ||
29 | 29 | ||
30 | void MediaPlayerState::readConfig( Config& cfg ) { | 30 | void MediaPlayerState::readConfig( Config& cfg ) { |
31 | cfg.setGroup("Options"); | 31 | cfg.setGroup("Options"); |
32 | isFullscreen = cfg.readBoolEntry( "FullScreen" ); | 32 | isFullscreen = cfg.readBoolEntry( "FullScreen" ); |
33 | isScaled = cfg.readBoolEntry( "Scaling" ); | 33 | isScaled = cfg.readBoolEntry( "Scaling" ); |
34 | isLooping = cfg.readBoolEntry( "Looping" ); | 34 | isLooping = cfg.readBoolEntry( "Looping" ); |
35 | isShuffled = cfg.readBoolEntry( "Shuffle" ); | 35 | isShuffled = cfg.readBoolEntry( "Shuffle" ); |
36 | usePlaylist = cfg.readBoolEntry( "UsePlayList" ); | 36 | usePlaylist = cfg.readBoolEntry( "UsePlayList" ); |
37 | usePlaylist = TRUE; | 37 | usePlaylist = TRUE; |
38 | isPlaying = FALSE; | 38 | isPlaying = FALSE; |
39 | isStreaming = FALSE; | ||
39 | isPaused = FALSE; | 40 | isPaused = FALSE; |
40 | curPosition = 0; | 41 | curPosition = 0; |
41 | curLength = 0; | 42 | curLength = 0; |
42 | curView = 'l'; | 43 | curView = 'l'; |
43 | } | 44 | } |
44 | 45 | ||
45 | 46 | ||
46 | void MediaPlayerState::writeConfig( Config& cfg ) const { | 47 | void MediaPlayerState::writeConfig( Config& cfg ) const { |
47 | cfg.setGroup("Options"); | 48 | cfg.setGroup("Options"); |
48 | cfg.writeEntry("FullScreen", isFullscreen ); | 49 | cfg.writeEntry("FullScreen", isFullscreen ); |
49 | cfg.writeEntry("Scaling", isScaled ); | 50 | cfg.writeEntry("Scaling", isScaled ); |
50 | cfg.writeEntry("Looping", isLooping ); | 51 | cfg.writeEntry("Looping", isLooping ); |
51 | cfg.writeEntry("Shuffle", isShuffled ); | 52 | cfg.writeEntry("Shuffle", isShuffled ); |
52 | cfg.writeEntry("UsePlayList", usePlaylist ); | 53 | cfg.writeEntry("UsePlayList", usePlaylist ); |
53 | } | 54 | } |
54 | 55 | ||
55 | 56 | ||
56 | // public stuff | 57 | // public stuff |
57 | 58 | ||
58 | 59 | ||
59 | bool MediaPlayerState::streaming() { | 60 | bool MediaPlayerState::streaming() { |
60 | return isStreaming; | 61 | return isStreaming; |
61 | } | 62 | } |
62 | 63 | ||
63 | bool MediaPlayerState::fullscreen() { | 64 | bool MediaPlayerState::fullscreen() { |
64 | return isFullscreen; | 65 | return isFullscreen; |
65 | } | 66 | } |
66 | 67 | ||
67 | bool MediaPlayerState::scaled() { | 68 | bool MediaPlayerState::scaled() { |
68 | return isScaled; | 69 | return isScaled; |
69 | } | 70 | } |
70 | 71 | ||
71 | bool MediaPlayerState::looping() { | 72 | bool MediaPlayerState::looping() { |
72 | return isLooping; | 73 | return isLooping; |
73 | } | 74 | } |
74 | 75 | ||
75 | bool MediaPlayerState::shuffled() { | 76 | bool MediaPlayerState::shuffled() { |
76 | return isShuffled; | 77 | return isShuffled; |
77 | } | 78 | } |
78 | 79 | ||
79 | 80 | ||
80 | bool MediaPlayerState:: playlist() { | 81 | bool MediaPlayerState:: playlist() { |
81 | return usePlaylist; | 82 | return usePlaylist; |
82 | } | 83 | } |
83 | 84 | ||
84 | bool MediaPlayerState::paused() { | 85 | bool MediaPlayerState::paused() { |
85 | return isPaused; | 86 | return isPaused; |
86 | } | 87 | } |
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro index 03540a1..8cbac06 100644 --- a/noncore/multimedia/opieplayer2/opieplayer2.pro +++ b/noncore/multimedia/opieplayer2/opieplayer2.pro | |||
@@ -1,24 +1,23 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on release | 2 | #CONFIG = qt warn_on release |
3 | #CONFIG = qt warn_on debug | 3 | CONFIG = qt warn_on debug |
4 | #release | ||
5 | DESTDIR = $(OPIEDIR)/bin | 4 | DESTDIR = $(OPIEDIR)/bin |
6 | HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\ | 5 | HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h mediadetect.h\ |
7 | videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \ | 6 | videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \ |
8 | frame.h lib.h xinevideowidget.h volumecontrol.h\ | 7 | frame.h lib.h xinevideowidget.h volumecontrol.h\ |
9 | alphablend.h yuv2rgb.h | 8 | alphablend.h yuv2rgb.h |
10 | SOURCES = main.cpp \ | 9 | SOURCES = main.cpp \ |
11 | playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp mediadetect.cpp\ | 10 | playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp mediadetect.cpp\ |
12 | videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp \ | 11 | videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp \ |
13 | frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp\ | 12 | frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp\ |
14 | alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S | 13 | alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S |
15 | TARGET = opieplayer2 | 14 | TARGET = opieplayer2 |
16 | INCLUDEPATH += $(OPIEDIR)/include | 15 | INCLUDEPATH += $(OPIEDIR)/include |
17 | DEPENDPATH += $(OPIEDIR)/include | 16 | DEPENDPATH += $(OPIEDIR)/include |
18 | LIBS += -lqpe -lpthread -lopie -lxine -lxineutils | 17 | LIBS += -lqpe -lpthread -lopie -lxine -lxineutils |
19 | MOC_DIR=qpeobj | 18 | MOC_DIR=qpeobj |
20 | OBJECTS_DIR=qpeobj | 19 | OBJECTS_DIR=qpeobj |
21 | 20 | ||
22 | INCLUDEPATH += $(OPIEDIR)/include | 21 | INCLUDEPATH += $(OPIEDIR)/include |
23 | DEPENDPATH += $(OPIEDIR)/include | 22 | DEPENDPATH += $(OPIEDIR)/include |
24 | 23 | ||
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 39f5090..262b685 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -88,163 +88,163 @@ public: | |||
88 | 88 | ||
89 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | 89 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) |
90 | : QMainWindow( parent, name, fl ) { | 90 | : QMainWindow( parent, name, fl ) { |
91 | 91 | ||
92 | d = new PlayListWidgetPrivate; | 92 | d = new PlayListWidgetPrivate; |
93 | d->setDocumentUsed = FALSE; | 93 | d->setDocumentUsed = FALSE; |
94 | d->current = NULL; | 94 | d->current = NULL; |
95 | fromSetDocument = FALSE; | 95 | fromSetDocument = FALSE; |
96 | insanityBool=FALSE; | 96 | insanityBool=FALSE; |
97 | audioScan = FALSE; | 97 | audioScan = FALSE; |
98 | videoScan = FALSE; | 98 | videoScan = FALSE; |
99 | 99 | ||
100 | setBackgroundMode( PaletteButton ); | 100 | setBackgroundMode( PaletteButton ); |
101 | 101 | ||
102 | setCaption( tr("OpiePlayer") ); | 102 | setCaption( tr("OpiePlayer") ); |
103 | setIcon( Resource::loadPixmap( "opieplayer2/MPEGPlayer" ) ); | 103 | setIcon( Resource::loadPixmap( "opieplayer2/MPEGPlayer" ) ); |
104 | 104 | ||
105 | setToolBarsMovable( FALSE ); | 105 | setToolBarsMovable( FALSE ); |
106 | 106 | ||
107 | // Create Toolbar | 107 | // Create Toolbar |
108 | QPEToolBar *toolbar = new QPEToolBar( this ); | 108 | QPEToolBar *toolbar = new QPEToolBar( this ); |
109 | toolbar->setHorizontalStretchable( TRUE ); | 109 | toolbar->setHorizontalStretchable( TRUE ); |
110 | 110 | ||
111 | // Create Menubar | 111 | // Create Menubar |
112 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); | 112 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); |
113 | menu->setMargin( 0 ); | 113 | menu->setMargin( 0 ); |
114 | 114 | ||
115 | QPEToolBar *bar = new QPEToolBar( this ); | 115 | QPEToolBar *bar = new QPEToolBar( this ); |
116 | bar->setLabel( tr( "Play Operations" ) ); | 116 | bar->setLabel( tr( "Play Operations" ) ); |
117 | 117 | ||
118 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); | 118 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet("trash"),"",bar,"close"); |
119 | tbDeletePlaylist->setFlat(TRUE); | 119 | tbDeletePlaylist->setFlat(TRUE); |
120 | tbDeletePlaylist->setFixedSize(20,20); | 120 | tbDeletePlaylist->setFixedSize(20,20); |
121 | 121 | ||
122 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer2/add_to_playlist", | 122 | d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer2/add_to_playlist", |
123 | this , SLOT(addSelected()) ); | 123 | this , SLOT(addSelected()) ); |
124 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer2/remove_from_playlist", | 124 | d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "opieplayer2/remove_from_playlist", |
125 | this , SLOT(removeSelected()) ); | 125 | this , SLOT(removeSelected()) ); |
126 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", | 126 | d->tbPlay = new ToolButton( bar, tr( "Play" ), "opieplayer2/play", |
127 | this , SLOT( btnPlay(bool) ), TRUE ); | 127 | this , SLOT( btnPlay(bool) ), TRUE ); |
128 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", | 128 | d->tbShuffle = new ToolButton( bar, tr( "Randomize" ),"opieplayer2/shuffle", |
129 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); | 129 | mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); |
130 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer2/loop", | 130 | d->tbLoop = new ToolButton( bar, tr( "Loop" ),"opieplayer2/loop", |
131 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); | 131 | mediaPlayerState, SLOT(setLooping(bool)), TRUE ); |
132 | tbDeletePlaylist->hide(); | 132 | tbDeletePlaylist->hide(); |
133 | 133 | ||
134 | QPopupMenu *pmPlayList = new QPopupMenu( this ); | 134 | QPopupMenu *pmPlayList = new QPopupMenu( this ); |
135 | menu->insertItem( tr( "File" ), pmPlayList ); | 135 | menu->insertItem( tr( "File" ), pmPlayList ); |
136 | new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); | 136 | (void)new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); |
137 | new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); | 137 | (void)new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) ); |
138 | new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); | 138 | (void)new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); |
139 | new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); | 139 | (void)new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); |
140 | pmPlayList->insertSeparator(-1); | 140 | pmPlayList->insertSeparator(-1); |
141 | new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); | 141 | (void)new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); |
142 | new MenuItem( pmPlayList, tr( "Export playlist to m3u" ), this, SLOT(writem3u() ) ); | 142 | (void)new MenuItem( pmPlayList, tr( "Export playlist to m3u" ), this, SLOT(writem3u() ) ); |
143 | pmPlayList->insertSeparator(-1); | 143 | pmPlayList->insertSeparator(-1); |
144 | new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); | 144 | (void)new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); |
145 | pmPlayList->insertSeparator(-1); | 145 | pmPlayList->insertSeparator(-1); |
146 | new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); | 146 | (void)new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) ); |
147 | new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); | 147 | (void)new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) ); |
148 | 148 | ||
149 | 149 | ||
150 | pmView = new QPopupMenu( this ); | 150 | pmView = new QPopupMenu( this ); |
151 | menu->insertItem( tr( "View" ), pmView ); | 151 | menu->insertItem( tr( "View" ), pmView ); |
152 | pmView->isCheckable(); | 152 | pmView->isCheckable(); |
153 | 153 | ||
154 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) ); | 154 | pmView->insertItem( Resource::loadPixmap("fullscreen") , tr( "Full Screen"), mediaPlayerState, SLOT( toggleFullscreen() ) ); |
155 | 155 | ||
156 | Config cfg( "OpiePlayer" ); | 156 | Config cfg( "OpiePlayer" ); |
157 | bool b= cfg.readBoolEntry("FullScreen", 0); | 157 | bool b= cfg.readBoolEntry("FullScreen", 0); |
158 | mediaPlayerState->setFullscreen( b ); | 158 | mediaPlayerState->setFullscreen( b ); |
159 | pmView->setItemChecked( -16, b ); | 159 | pmView->setItemChecked( -16, b ); |
160 | 160 | ||
161 | // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); | 161 | // pmView->insertItem( Resource::loadPixmap("opieplayer/scale") , tr( "Scale"), mediaPlayerState, SLOT(toggleScaled() ) ); |
162 | 162 | ||
163 | pmView->insertSeparator(-1); | 163 | pmView->insertSeparator(-1); |
164 | 164 | ||
165 | skinsMenu = new QPopupMenu( this ); | 165 | skinsMenu = new QPopupMenu( this ); |
166 | pmView->insertItem( tr( "Skins" ), skinsMenu ); | 166 | pmView->insertItem( tr( "Skins" ), skinsMenu ); |
167 | skinsMenu->isCheckable(); | 167 | skinsMenu->isCheckable(); |
168 | populateSkinsMenu(); | 168 | populateSkinsMenu(); |
169 | 169 | ||
170 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); | 170 | QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); |
171 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); | 171 | QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton ); |
172 | 172 | ||
173 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); | 173 | QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); |
174 | 174 | ||
175 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); | 175 | tabWidget = new QTabWidget( hbox6, "tabWidget" ); |
176 | // tabWidget->setTabShape(QTabWidget::Triangular); | 176 | // tabWidget->setTabShape(QTabWidget::Triangular); |
177 | 177 | ||
178 | QWidget *pTab; | 178 | QWidget *pTab; |
179 | pTab = new QWidget( tabWidget, "pTab" ); | 179 | pTab = new QWidget( tabWidget, "pTab" ); |
180 | tabWidget->insertTab( pTab,"Playlist"); | 180 | tabWidget->insertTab( pTab,"Playlist"); |
181 | 181 | ||
182 | 182 | ||
183 | QGridLayout *Playout = new QGridLayout( pTab ); | 183 | QGridLayout *Playout = new QGridLayout( pTab ); |
184 | Playout->setSpacing( 2); | 184 | Playout->setSpacing( 2); |
185 | Playout->setMargin( 2); | 185 | Playout->setMargin( 2); |
186 | 186 | ||
187 | // Add the playlist area | 187 | // Add the playlist area |
188 | 188 | ||
189 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); | 189 | QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton ); |
190 | d->playListFrame = vbox3; | 190 | d->playListFrame = vbox3; |
191 | 191 | ||
192 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); | 192 | QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); |
193 | 193 | ||
194 | d->selectedFiles = new PlayListSelection( hbox2); | 194 | d->selectedFiles = new PlayListSelection( hbox2); |
195 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); | 195 | QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); |
196 | 196 | ||
197 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); | 197 | QPEApplication::setStylusOperation( d->selectedFiles->viewport(),QPEApplication::RightOnHold); |
198 | 198 | ||
199 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch | 199 | QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch |
200 | new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) ); | 200 | (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp()) ); |
201 | new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", d->selectedFiles, SLOT(removeSelected()) ); | 201 | (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", d->selectedFiles, SLOT(removeSelected()) ); |
202 | new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) ); | 202 | (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown()) ); |
203 | QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch | 203 | QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch |
204 | 204 | ||
205 | 205 | ||
206 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); | 206 | Playout->addMultiCellWidget( vbox3, 0, 0, 0, 1 ); |
207 | 207 | ||
208 | QWidget *aTab; | 208 | QWidget *aTab; |
209 | aTab = new QWidget( tabWidget, "aTab" ); | 209 | aTab = new QWidget( tabWidget, "aTab" ); |
210 | 210 | ||
211 | QGridLayout *Alayout = new QGridLayout( aTab ); | 211 | QGridLayout *Alayout = new QGridLayout( aTab ); |
212 | Alayout->setSpacing( 2); | 212 | Alayout->setSpacing( 2); |
213 | Alayout->setMargin( 2); | 213 | Alayout->setMargin( 2); |
214 | 214 | ||
215 | audioView = new QListView( aTab, "Audioview" ); | 215 | audioView = new QListView( aTab, "Audioview" ); |
216 | audioView->addColumn( tr("Title"),140); | 216 | audioView->addColumn( tr("Title"),140); |
217 | audioView->addColumn(tr("Size"), -1); | 217 | audioView->addColumn(tr("Size"), -1); |
218 | audioView->addColumn(tr("Media"),-1); | 218 | audioView->addColumn(tr("Media"),-1); |
219 | audioView->setColumnAlignment(1, Qt::AlignRight); | 219 | audioView->setColumnAlignment(1, Qt::AlignRight); |
220 | audioView->setColumnAlignment(2, Qt::AlignRight); | 220 | audioView->setColumnAlignment(2, Qt::AlignRight); |
221 | audioView->setAllColumnsShowFocus(TRUE); | 221 | audioView->setAllColumnsShowFocus(TRUE); |
222 | audioView->setSorting(0,TRUE); | 222 | audioView->setSorting(0,TRUE); |
223 | 223 | ||
224 | audioView->setMultiSelection( TRUE ); | 224 | audioView->setMultiSelection( TRUE ); |
225 | audioView->setSelectionMode( QListView::Extended); | 225 | audioView->setSelectionMode( QListView::Extended); |
226 | 226 | ||
227 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | 227 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); |
228 | 228 | ||
229 | tabWidget->insertTab(aTab,tr("Audio")); | 229 | tabWidget->insertTab(aTab,tr("Audio")); |
230 | 230 | ||
231 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); | 231 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); |
232 | 232 | ||
233 | QWidget *vTab; | 233 | QWidget *vTab; |
234 | vTab = new QWidget( tabWidget, "vTab" ); | 234 | vTab = new QWidget( tabWidget, "vTab" ); |
235 | 235 | ||
236 | QGridLayout *Vlayout = new QGridLayout( vTab ); | 236 | QGridLayout *Vlayout = new QGridLayout( vTab ); |
237 | Vlayout->setSpacing( 2); | 237 | Vlayout->setSpacing( 2); |
238 | Vlayout->setMargin( 2); | 238 | Vlayout->setMargin( 2); |
239 | 239 | ||
240 | videoView = new QListView( vTab, "Videoview" ); | 240 | videoView = new QListView( vTab, "Videoview" ); |
241 | 241 | ||
242 | videoView->addColumn(tr("Title"),140); | 242 | videoView->addColumn(tr("Title"),140); |
243 | videoView->addColumn(tr("Size"),-1); | 243 | videoView->addColumn(tr("Size"),-1); |
244 | videoView->addColumn(tr("Media"),-1); | 244 | videoView->addColumn(tr("Media"),-1); |
245 | videoView->setColumnAlignment(1, Qt::AlignRight); | 245 | videoView->setColumnAlignment(1, Qt::AlignRight); |
246 | videoView->setColumnAlignment(2, Qt::AlignRight); | 246 | videoView->setColumnAlignment(2, Qt::AlignRight); |
247 | videoView->setAllColumnsShowFocus(TRUE); | 247 | videoView->setAllColumnsShowFocus(TRUE); |
248 | videoView->setSorting(0,TRUE); | 248 | videoView->setSorting(0,TRUE); |
249 | 249 | ||
250 | videoView->setMultiSelection( TRUE ); | 250 | videoView->setMultiSelection( TRUE ); |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index c03ea16..766ece2 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -46,97 +46,96 @@ XineControl::XineControl( QObject *parent, const char *name ) | |||
46 | libXine = new XINE::Lib(videoUI->vidWidget() ); | 46 | libXine = new XINE::Lib(videoUI->vidWidget() ); |
47 | 47 | ||
48 | connect ( videoUI, SIGNAL( videoResized ( const QSize & )), this, SLOT( videoResized ( const QSize & ))); | 48 | connect ( videoUI, SIGNAL( videoResized ( const QSize & )), this, SLOT( videoResized ( const QSize & ))); |
49 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); | 49 | connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); |
50 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); | 50 | connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); |
51 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); | 51 | connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); |
52 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); | 52 | connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); |
53 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); | 53 | connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); |
54 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); | 54 | connect( libXine, SIGNAL( stopped() ), this, SLOT( nextMedia() ) ); |
55 | 55 | ||
56 | disabledSuspendScreenSaver = FALSE; | 56 | disabledSuspendScreenSaver = FALSE; |
57 | } | 57 | } |
58 | 58 | ||
59 | XineControl::~XineControl() { | 59 | XineControl::~XineControl() { |
60 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 60 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
61 | if ( disabledSuspendScreenSaver ) { | 61 | if ( disabledSuspendScreenSaver ) { |
62 | disabledSuspendScreenSaver = FALSE; | 62 | disabledSuspendScreenSaver = FALSE; |
63 | // Re-enable the suspend mode | 63 | // Re-enable the suspend mode |
64 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 64 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
65 | } | 65 | } |
66 | #endif | 66 | #endif |
67 | delete libXine; | 67 | delete libXine; |
68 | } | 68 | } |
69 | 69 | ||
70 | void XineControl::play( const QString& fileName ) { | 70 | void XineControl::play( const QString& fileName ) { |
71 | hasVideoChannel=FALSE; | 71 | hasVideoChannel=FALSE; |
72 | hasAudioChannel=FALSE; | 72 | hasAudioChannel=FALSE; |
73 | m_fileName = fileName; | 73 | m_fileName = fileName; |
74 | qDebug("<<FILENAME: " + fileName + ">>>>"); | 74 | qDebug("<<FILENAME: " + fileName + ">>>>"); |
75 | libXine->play( fileName ); | 75 | libXine->play( fileName ); |
76 | mediaPlayerState->setPlaying( true ); | 76 | mediaPlayerState->setPlaying( true ); |
77 | // default to audio view until we know how to handle video | 77 | // default to audio view until we know how to handle video |
78 | // MediaDetect mdetect; | 78 | // MediaDetect mdetect; |
79 | char whichGui = mdetect.videoOrAudio( fileName ); | 79 | char whichGui = mdetect.videoOrAudio( fileName ); |
80 | if (whichGui == 'f') { | 80 | if (whichGui == 'f') { |
81 | qDebug("Nicht erkannter Dateityp"); | 81 | qDebug("Nicht erkannter Dateityp"); |
82 | return; | 82 | return; |
83 | } | 83 | } |
84 | 84 | ||
85 | if (whichGui == 'a') { | 85 | if (whichGui == 'a') { |
86 | libXine->setShowVideo( false ); | 86 | libXine->setShowVideo( false ); |
87 | hasAudioChannel=TRUE; | 87 | hasAudioChannel=TRUE; |
88 | } else { | 88 | } else { |
89 | libXine->setShowVideo( true ); | 89 | libXine->setShowVideo( true ); |
90 | hasVideoChannel=TRUE; | 90 | hasVideoChannel=TRUE; |
91 | } | 91 | } |
92 | 92 | ||
93 | // determine if slider is shown | 93 | // determine if slider is shown |
94 | // mediaPlayerState->setIsStreaming( mdetect.isStreaming( fileName ) ); | ||
95 | mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); | 94 | mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); |
96 | // which gui (video / audio) | 95 | // which gui (video / audio) |
97 | mediaPlayerState->setView( whichGui ); | 96 | mediaPlayerState->setView( whichGui ); |
98 | 97 | ||
99 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 98 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
100 | if ( !disabledSuspendScreenSaver ) { | 99 | if ( !disabledSuspendScreenSaver ) { |
101 | disabledSuspendScreenSaver = TRUE; | 100 | disabledSuspendScreenSaver = TRUE; |
102 | // Stop the screen from blanking and power saving state | 101 | // Stop the screen from blanking and power saving state |
103 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) | 102 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) |
104 | << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); | 103 | << ( whichGui == 'v' ? QPEApplication::Disable : QPEApplication::DisableSuspend ); |
105 | } | 104 | } |
106 | #endif | 105 | #endif |
107 | 106 | ||
108 | length(); | 107 | length(); |
109 | position(); | 108 | position(); |
110 | } | 109 | } |
111 | 110 | ||
112 | void XineControl::nextMedia() { | 111 | void XineControl::nextMedia() { |
113 | mediaPlayerState->setNext(); | 112 | mediaPlayerState->setNext(); |
114 | } | 113 | } |
115 | 114 | ||
116 | void XineControl::stop( bool isSet ) { | 115 | void XineControl::stop( bool isSet ) { |
117 | if ( !isSet) { | 116 | if ( !isSet) { |
118 | libXine->stop( ); | 117 | libXine->stop( ); |
119 | mediaPlayerState->setList(); | 118 | mediaPlayerState->setList(); |
120 | // mediaPlayerState->setPlaying( false ); | 119 | // mediaPlayerState->setPlaying( false ); |
121 | 120 | ||
122 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 121 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
123 | if ( disabledSuspendScreenSaver ) { | 122 | if ( disabledSuspendScreenSaver ) { |
124 | disabledSuspendScreenSaver = FALSE; | 123 | disabledSuspendScreenSaver = FALSE; |
125 | // Re-enable the suspend mode | 124 | // Re-enable the suspend mode |
126 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 125 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
127 | } | 126 | } |
128 | #endif | 127 | #endif |
129 | 128 | ||
130 | } else { | 129 | } else { |
131 | // play again | 130 | // play again |
132 | } | 131 | } |
133 | } | 132 | } |
134 | 133 | ||
135 | /** | 134 | /** |
136 | * Pause playback | 135 | * Pause playback |
137 | * @isSet | 136 | * @isSet |
138 | */ | 137 | */ |
139 | void XineControl::pause( bool isSet) { | 138 | void XineControl::pause( bool isSet) { |
140 | if (isSet) { | 139 | if (isSet) { |
141 | libXine->pause(); | 140 | libXine->pause(); |
142 | } else { | 141 | } else { |