-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/inputDialog.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/inputDialog.h | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/volumecontrol.cpp | 15 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/volumecontrol.h | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinevideowidget.cpp | 7 |
12 files changed, 45 insertions, 29 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 40e20e1..a718826 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -162,14 +162,14 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : | |||
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | } | 165 | } |
166 | 166 | ||
167 | for ( int i = 0; i < 10; i++ ) { | 167 | for ( int i = 0; i < 10; i++ ) { |
168 | buttonPixUp[i] = NULL; | 168 | buttonPixUp[i] = 0l; |
169 | buttonPixDown[i] = NULL; | 169 | buttonPixDown[i] = 0l; |
170 | } | 170 | } |
171 | 171 | ||
172 | setBackgroundPixmap( *pixBg ); | 172 | setBackgroundPixmap( *pixBg ); |
173 | 173 | ||
174 | songInfo.setFocusPolicy( QWidget::NoFocus ); | 174 | songInfo.setFocusPolicy( QWidget::NoFocus ); |
175 | changeTextColor( &songInfo ); | 175 | changeTextColor( &songInfo ); |
@@ -224,12 +224,14 @@ AudioWidget::~AudioWidget() { | |||
224 | delete imgButtonMask; | 224 | delete imgButtonMask; |
225 | for ( int i = 0; i < 10; i++ ) { | 225 | for ( int i = 0; i < 10; i++ ) { |
226 | delete masks[i]; | 226 | delete masks[i]; |
227 | } | 227 | } |
228 | } | 228 | } |
229 | 229 | ||
230 | namespace { | ||
231 | |||
230 | QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | 232 | QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { |
231 | QPixmap pix( img.width(), img.height() ); | 233 | QPixmap pix( img.width(), img.height() ); |
232 | QPainter p( &pix ); | 234 | QPainter p( &pix ); |
233 | p.drawTiledPixmap( pix.rect(), bg, offset ); | 235 | p.drawTiledPixmap( pix.rect(), bg, offset ); |
234 | p.drawImage( 0, 0, img ); | 236 | p.drawImage( 0, 0, img ); |
235 | return new QPixmap( pix ); | 237 | return new QPixmap( pix ); |
@@ -239,13 +241,13 @@ QPixmap *combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { | |||
239 | QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) { | 241 | QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) { |
240 | QPixmap *pixmap = new QPixmap( pix ); | 242 | QPixmap *pixmap = new QPixmap( pix ); |
241 | pixmap->setMask( mask ); | 243 | pixmap->setMask( mask ); |
242 | return pixmap; | 244 | return pixmap; |
243 | } | 245 | } |
244 | 246 | ||
245 | 247 | }; | |
246 | 248 | ||
247 | void AudioWidget::resizeEvent( QResizeEvent * ) { | 249 | void AudioWidget::resizeEvent( QResizeEvent * ) { |
248 | int h = height(); | 250 | int h = height(); |
249 | int w = width(); | 251 | int w = width(); |
250 | 252 | ||
251 | songInfo.setGeometry( QRect( 2, 10, w - 4, 20 ) ); | 253 | songInfo.setGeometry( QRect( 2, 10, w - 4, 20 ) ); |
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 626004a..c544882 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -43,25 +43,27 @@ | |||
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 | namespace { | ||
50 | |||
49 | enum AudioButtons { | 51 | enum AudioButtons { |
50 | AudioPlay=0, | 52 | AudioPlay=0, |
51 | AudioStop, | 53 | AudioStop, |
52 | AudioNext, | 54 | AudioNext, |
53 | AudioPrevious, | 55 | AudioPrevious, |
54 | AudioVolumeUp, | 56 | AudioVolumeUp, |
55 | AudioVolumeDown, | 57 | AudioVolumeDown, |
56 | AudioLoop, | 58 | AudioLoop, |
57 | AudioPlayList, | 59 | AudioPlayList, |
58 | AudioForward, | 60 | AudioForward, |
59 | AudioBack | 61 | AudioBack |
60 | }; | 62 | }; |
61 | 63 | }; | |
62 | 64 | ||
63 | class Ticker : public QFrame { | 65 | class Ticker : public QFrame { |
64 | Q_OBJECT | 66 | Q_OBJECT |
65 | 67 | ||
66 | public: | 68 | public: |
67 | Ticker( QWidget* parent=0 ); | 69 | Ticker( QWidget* parent=0 ); |
@@ -137,11 +139,12 @@ private: | |||
137 | 139 | ||
138 | QPixmap *pixmaps[4]; | 140 | QPixmap *pixmaps[4]; |
139 | Ticker songInfo; | 141 | Ticker songInfo; |
140 | QSlider slider; | 142 | QSlider slider; |
141 | QLineEdit time; | 143 | QLineEdit time; |
142 | int xoff, yoff; | 144 | int xoff, yoff; |
145 | bool isStreaming : 1; | ||
143 | }; | 146 | }; |
144 | 147 | ||
145 | 148 | ||
146 | #endif // AUDIO_WIDGET_H | 149 | #endif // AUDIO_WIDGET_H |
147 | 150 | ||
diff --git a/noncore/multimedia/opieplayer2/inputDialog.cpp b/noncore/multimedia/opieplayer2/inputDialog.cpp index c13ea63..9edb1d3 100644 --- a/noncore/multimedia/opieplayer2/inputDialog.cpp +++ b/noncore/multimedia/opieplayer2/inputDialog.cpp | |||
@@ -23,18 +23,22 @@ InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags | |||
23 | browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); | 23 | browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); |
24 | browserButton->setGeometry( QRect( 205, 10, 22, 22)); | 24 | browserButton->setGeometry( QRect( 205, 10, 22, 22)); |
25 | connect( browserButton, SIGNAL(released()),this,SLOT(browse())); | 25 | connect( browserButton, SIGNAL(released()),this,SLOT(browse())); |
26 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 26 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
27 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); | 27 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); |
28 | } | 28 | } |
29 | 29 | /* | |
30 | * return the current text(input) | ||
31 | */ | ||
32 | QString InputDialog::text() const { | ||
33 | return LineEdit1->text(); | ||
34 | } | ||
30 | /* | 35 | /* |
31 | * Destroys the object and frees any allocated resources | 36 | * Destroys the object and frees any allocated resources |
32 | */ | 37 | */ |
33 | InputDialog::~InputDialog() { | 38 | InputDialog::~InputDialog() { |
34 | inputText= LineEdit1->text(); | ||
35 | } | 39 | } |
36 | 40 | ||
37 | void InputDialog::browse() { | 41 | void InputDialog::browse() { |
38 | 42 | ||
39 | MimeTypes types; | 43 | MimeTypes types; |
40 | QStringList audio, video, all; | 44 | QStringList audio, video, all; |
diff --git a/noncore/multimedia/opieplayer2/inputDialog.h b/noncore/multimedia/opieplayer2/inputDialog.h index d4f5e12..0f36ea4 100644 --- a/noncore/multimedia/opieplayer2/inputDialog.h +++ b/noncore/multimedia/opieplayer2/inputDialog.h | |||
@@ -10,13 +10,16 @@ class QLineEdit; | |||
10 | class InputDialog : public QDialog { | 10 | class InputDialog : public QDialog { |
11 | Q_OBJECT | 11 | Q_OBJECT |
12 | 12 | ||
13 | public: | 13 | public: |
14 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 14 | InputDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
15 | ~InputDialog(); | 15 | ~InputDialog(); |
16 | QString inputText; | 16 | QString text()const; |
17 | |||
18 | private: | ||
17 | QLineEdit* LineEdit1; | 19 | QLineEdit* LineEdit1; |
20 | |||
18 | protected slots: | 21 | protected slots: |
19 | void browse(); | 22 | void browse(); |
20 | }; | 23 | }; |
21 | 24 | ||
22 | #endif // INPUTDIALOG_H | 25 | #endif // INPUTDIALOG_H |
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 18caaad..0f8242b 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp | |||
@@ -177,14 +177,14 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { | |||
177 | } else if ( volumeDirection == -1 ) { | 177 | } else if ( volumeDirection == -1 ) { |
178 | volControl->decVol(2); | 178 | volControl->decVol(2); |
179 | } | 179 | } |
180 | 180 | ||
181 | 181 | ||
182 | // TODO FIXME | 182 | // TODO FIXME |
183 | unsigned int v; | 183 | unsigned int v= 0; |
184 | v = volControl->getVolume(); | 184 | v = volControl->volume(); |
185 | v = v / 10; | 185 | v = v / 10; |
186 | 186 | ||
187 | if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { | 187 | if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { |
188 | return; | 188 | return; |
189 | } | 189 | } |
190 | 190 | ||
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 8366ab4..eaedaa5 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -13,13 +13,13 @@ | |||
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 | isStreaming = false; | |
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 ); |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 10f1792..251c2e5 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -586,13 +586,13 @@ void PlayListWidget::saveList() { | |||
586 | InputDialog *fileDlg = 0l; | 586 | InputDialog *fileDlg = 0l; |
587 | fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0); | 587 | fileDlg = new InputDialog(this,tr("Save Playlist"),TRUE, 0); |
588 | fileDlg->exec(); | 588 | fileDlg->exec(); |
589 | if( fileDlg->result() == 1 ) { | 589 | if( fileDlg->result() == 1 ) { |
590 | if ( d->current ) | 590 | if ( d->current ) |
591 | delete d->current; | 591 | delete d->current; |
592 | filename = fileDlg->LineEdit1->text();//+".playlist"; | 592 | filename = fileDlg->text();//+".playlist"; |
593 | // qDebug("saving playlist "+filename+".playlist"); | 593 | // qDebug("saving playlist "+filename+".playlist"); |
594 | Config cfg( filename +".playlist"); | 594 | Config cfg( filename +".playlist"); |
595 | writeConfig( cfg ); | 595 | writeConfig( cfg ); |
596 | 596 | ||
597 | DocLnk lnk; | 597 | DocLnk lnk; |
598 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property | 598 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property |
@@ -945,13 +945,13 @@ void PlayListWidget::populateVideoView() { | |||
945 | void PlayListWidget::openFile() { | 945 | void PlayListWidget::openFile() { |
946 | QString filename, name; | 946 | QString filename, name; |
947 | InputDialog *fileDlg; | 947 | InputDialog *fileDlg; |
948 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 948 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
949 | fileDlg->exec(); | 949 | fileDlg->exec(); |
950 | if( fileDlg->result() == 1 ) { | 950 | if( fileDlg->result() == 1 ) { |
951 | filename = fileDlg->LineEdit1->text(); | 951 | filename = fileDlg->text(); |
952 | 952 | ||
953 | qDebug("Selected filename is "+filename); | 953 | qDebug("Selected filename is "+filename); |
954 | if(filename.right(3) == "m3u") { | 954 | if(filename.right(3) == "m3u") { |
955 | readm3u( filename ); | 955 | readm3u( filename ); |
956 | } else if(filename.right(3) == "pls") { | 956 | } else if(filename.right(3) == "pls") { |
957 | readPls( filename ); | 957 | readPls( filename ); |
@@ -1120,13 +1120,13 @@ void PlayListWidget::writem3u() { | |||
1120 | 1120 | ||
1121 | InputDialog *fileDlg; | 1121 | InputDialog *fileDlg; |
1122 | fileDlg = new InputDialog(this,tr("Save m3u Playlist "),TRUE, 0); | 1122 | fileDlg = new InputDialog(this,tr("Save m3u Playlist "),TRUE, 0); |
1123 | fileDlg->exec(); | 1123 | fileDlg->exec(); |
1124 | QString filename,list; | 1124 | QString filename,list; |
1125 | if( fileDlg->result() == 1 ) { | 1125 | if( fileDlg->result() == 1 ) { |
1126 | filename = fileDlg->LineEdit1->text(); | 1126 | filename = fileDlg->text(); |
1127 | qDebug(filename); | 1127 | qDebug(filename); |
1128 | int noOfFiles = 0; | 1128 | int noOfFiles = 0; |
1129 | d->selectedFiles->first(); | 1129 | d->selectedFiles->first(); |
1130 | do { | 1130 | do { |
1131 | // we dont check for existance because of url's | 1131 | // we dont check for existance because of url's |
1132 | // qDebug(d->selectedFiles->current()->file()); | 1132 | // qDebug(d->selectedFiles->current()->file()); |
diff --git a/noncore/multimedia/opieplayer2/volumecontrol.cpp b/noncore/multimedia/opieplayer2/volumecontrol.cpp index a795f3b..271b84e 100644 --- a/noncore/multimedia/opieplayer2/volumecontrol.cpp +++ b/noncore/multimedia/opieplayer2/volumecontrol.cpp | |||
@@ -3,19 +3,18 @@ | |||
3 | #include <qpe/config.h> | 3 | #include <qpe/config.h> |
4 | #include "qpe/qcopenvelope_qws.h" | 4 | #include "qpe/qcopenvelope_qws.h" |
5 | #include <qmessagebox.h> | 5 | #include <qmessagebox.h> |
6 | 6 | ||
7 | #include "volumecontrol.h" | 7 | #include "volumecontrol.h" |
8 | 8 | ||
9 | int VolumeControl::getVolume() { | 9 | int VolumeControl::volume() { |
10 | int volumePerc; | ||
11 | Config cfg( "qpe" ); | 10 | Config cfg( "qpe" ); |
12 | cfg. setGroup( "Volume" ); | 11 | cfg. setGroup( "Volume" ); |
13 | volumePerc = cfg. readNumEntry( "VolumePercent", 50 ); | 12 | m_volumePerc = cfg. readNumEntry( "VolumePercent", 50 ); |
14 | m_volumePerc = volumePerc; | 13 | |
15 | return volumePerc; | 14 | return m_volumePerc; |
16 | } | 15 | } |
17 | 16 | ||
18 | 17 | ||
19 | void VolumeControl::setVolume( int volumePerc ) { | 18 | void VolumeControl::setVolume( int volumePerc ) { |
20 | Config cfg("qpe"); | 19 | Config cfg("qpe"); |
21 | cfg.setGroup("Volume"); | 20 | cfg.setGroup("Volume"); |
@@ -32,24 +31,24 @@ void VolumeControl::setVolume( int volumePerc ) { | |||
32 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; | 31 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; |
33 | // QCopEnvelope( "QPE/System", "setVolume(int,int)" ) << 0, volumePerc; | 32 | // QCopEnvelope( "QPE/System", "setVolume(int,int)" ) << 0, volumePerc; |
34 | } | 33 | } |
35 | 34 | ||
36 | 35 | ||
37 | void VolumeControl::incVol( int ammount ) { | 36 | void VolumeControl::incVol( int ammount ) { |
38 | int oldVol = getVolume(); | 37 | int oldVol = volume(); |
39 | setVolume( oldVol + ammount); | 38 | setVolume( oldVol + ammount); |
40 | } | 39 | } |
41 | 40 | ||
42 | void VolumeControl::decVol( int ammount ) { | 41 | void VolumeControl::decVol( int ammount ) { |
43 | int oldVol = getVolume(); | 42 | int oldVol = volume(); |
44 | setVolume( oldVol - ammount); | 43 | setVolume( oldVol - ammount); |
45 | } | 44 | } |
46 | 45 | ||
47 | 46 | ||
48 | VolumeControl::VolumeControl( ) { | 47 | VolumeControl::VolumeControl( ) { |
49 | getVolume(); | 48 | volume(); |
50 | } | 49 | } |
51 | 50 | ||
52 | VolumeControl::~VolumeControl() { | 51 | VolumeControl::~VolumeControl() { |
53 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; | 52 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; |
54 | } | 53 | } |
55 | 54 | ||
diff --git a/noncore/multimedia/opieplayer2/volumecontrol.h b/noncore/multimedia/opieplayer2/volumecontrol.h index d0d34a2..040f978 100644 --- a/noncore/multimedia/opieplayer2/volumecontrol.h +++ b/noncore/multimedia/opieplayer2/volumecontrol.h | |||
@@ -22,13 +22,13 @@ public: | |||
22 | void decVol( int ammount ); | 22 | void decVol( int ammount ); |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * Get the volume in percent | 25 | * Get the volume in percent |
26 | * @return volume percentage | 26 | * @return volume percentage |
27 | */ | 27 | */ |
28 | int getVolume(); | 28 | int volume(); |
29 | 29 | ||
30 | public slots: | 30 | public slots: |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * Set the volume in percent | 33 | * Set the volume in percent |
34 | * @value volumePerc between 0 and 100 | 34 | * @value volumePerc between 0 and 100 |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 766ece2..12d80ba 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp | |||
@@ -68,13 +68,15 @@ XineControl::~XineControl() { | |||
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 | |||
74 | qDebug("<<FILENAME: " + fileName + ">>>>"); | 75 | qDebug("<<FILENAME: " + fileName + ">>>>"); |
76 | |||
75 | libXine->play( fileName ); | 77 | libXine->play( fileName ); |
76 | mediaPlayerState->setPlaying( true ); | 78 | mediaPlayerState->setPlaying( true ); |
77 | // default to audio view until we know how to handle video | 79 | // default to audio view until we know how to handle video |
78 | // MediaDetect mdetect; | 80 | // MediaDetect mdetect; |
79 | char whichGui = mdetect.videoOrAudio( fileName ); | 81 | char whichGui = mdetect.videoOrAudio( fileName ); |
80 | if (whichGui == 'f') { | 82 | if (whichGui == 'f') { |
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 88458be..4263b36 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h | |||
@@ -40,13 +40,12 @@ | |||
40 | 40 | ||
41 | class XineControl : public QObject { | 41 | class XineControl : public QObject { |
42 | Q_OBJECT | 42 | Q_OBJECT |
43 | public: | 43 | public: |
44 | XineControl( QObject *parent = 0, const char *name =0 ); | 44 | XineControl( QObject *parent = 0, const char *name =0 ); |
45 | ~XineControl(); | 45 | ~XineControl(); |
46 | int m_length; | ||
47 | 46 | ||
48 | bool hasVideo() const { return hasVideoChannel; } | 47 | bool hasVideo() const { return hasVideoChannel; } |
49 | bool hasAudio() const { return hasAudioChannel; } | 48 | bool hasAudio() const { return hasAudioChannel; } |
50 | 49 | ||
51 | public slots: | 50 | public slots: |
52 | void play( const QString& fileName ); | 51 | void play( const QString& fileName ); |
@@ -61,18 +60,19 @@ public slots: | |||
61 | void nextMedia(); | 60 | void nextMedia(); |
62 | void videoResized ( const QSize &s ); | 61 | void videoResized ( const QSize &s ); |
63 | 62 | ||
64 | private: | 63 | private: |
65 | XINE::Lib *libXine; | 64 | XINE::Lib *libXine; |
66 | MediaDetect mdetect; | 65 | MediaDetect mdetect; |
67 | long m_currentTime; | 66 | long m_currentTime; |
68 | long m_position; | 67 | long m_position; |
68 | int m_length; | ||
69 | QString m_fileName; | 69 | QString m_fileName; |
70 | bool disabledSuspendScreenSaver; | 70 | bool disabledSuspendScreenSaver : 1; |
71 | bool hasVideoChannel; | 71 | bool hasVideoChannel : 1; |
72 | bool hasAudioChannel; | 72 | bool hasAudioChannel : 1; |
73 | signals: | 73 | signals: |
74 | void positionChanged( long ); | 74 | void positionChanged( long ); |
75 | 75 | ||
76 | }; | 76 | }; |
77 | 77 | ||
78 | 78 | ||
diff --git a/noncore/multimedia/opieplayer2/xinevideowidget.cpp b/noncore/multimedia/opieplayer2/xinevideowidget.cpp index 3e28e54..bc95d86 100644 --- a/noncore/multimedia/opieplayer2/xinevideowidget.cpp +++ b/noncore/multimedia/opieplayer2/xinevideowidget.cpp | |||
@@ -138,12 +138,13 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
138 | 138 | ||
139 | switch ( rot ) { | 139 | switch ( rot ) { |
140 | case 0: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) ); break; | 140 | case 0: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) ); break; |
141 | case 1: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_pixel ) ); break; | 141 | case 1: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_pixel ) ); break; |
142 | case 2: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_line_frame ) ); break; | 142 | case 2: src += ( (( clip. x ( ) - framerect. x ( )) * m_bytes_per_pixel ) + (( clip. y ( ) - framerect. y ( )) * m_bytes_per_line_frame ) + (( framerect. height ( ) - 1 ) * m_bytes_per_line_frame ) ); break; |
143 | case 3: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) ); break; | 143 | case 3: src += ( (( clip. y ( ) - framerect. y ( )) * m_bytes_per_pixel ) + (( clip. x ( ) - framerect. x ( )) * m_bytes_per_line_frame ) ); break; |
144 | default: break; | ||
144 | } | 145 | } |
145 | 146 | ||
146 | uint leftfill = 0; | 147 | uint leftfill = 0; |
147 | uint framefill = 0; | 148 | uint framefill = 0; |
148 | uint rightfill = 0; | 149 | uint rightfill = 0; |
149 | uint clipwidth = clip. width ( ) * m_bytes_per_pixel; | 150 | uint clipwidth = clip. width ( ) * m_bytes_per_pixel; |
@@ -166,12 +167,13 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
166 | if ( framefill ) { | 167 | if ( framefill ) { |
167 | switch ( rot ) { | 168 | switch ( rot ) { |
168 | case 0: memcpy ( dst + leftfill, src, framefill ); break; | 169 | case 0: memcpy ( dst + leftfill, src, framefill ); break; |
169 | case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; | 170 | case 1: memcpy_step ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; |
170 | case 2: memcpy_rev ( dst + leftfill, src, framefill ); break; | 171 | case 2: memcpy_rev ( dst + leftfill, src, framefill ); break; |
171 | case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; | 172 | case 3: memcpy_step_rev ( dst + leftfill, src, framefill, m_bytes_per_line_frame ); break; |
173 | default: break; | ||
172 | } | 174 | } |
173 | } | 175 | } |
174 | if ( rightfill ) | 176 | if ( rightfill ) |
175 | memset ( dst + leftfill + framefill, 0, rightfill ); | 177 | memset ( dst + leftfill + framefill, 0, rightfill ); |
176 | } | 178 | } |
177 | 179 | ||
@@ -179,12 +181,13 @@ void XineVideoWidget::paintEvent ( QPaintEvent * ) | |||
179 | 181 | ||
180 | switch ( rot ) { | 182 | switch ( rot ) { |
181 | case 0: src += m_bytes_per_line_frame; break; | 183 | case 0: src += m_bytes_per_line_frame; break; |
182 | case 1: src -= m_bytes_per_pixel; break; | 184 | case 1: src -= m_bytes_per_pixel; break; |
183 | case 2: src -= m_bytes_per_line_frame; break; | 185 | case 2: src -= m_bytes_per_line_frame; break; |
184 | case 3: src += m_bytes_per_pixel; break; | 186 | case 3: src += m_bytes_per_pixel; break; |
187 | default: break; | ||
185 | } | 188 | } |
186 | } | 189 | } |
187 | } | 190 | } |
188 | } | 191 | } |
189 | //qWarning ( " ||| painting |||" ); | 192 | //qWarning ( " ||| painting |||" ); |
190 | { | 193 | { |
@@ -241,25 +244,25 @@ void XineVideoWidget::resizeEvent ( QResizeEvent * ) | |||
241 | // qDebug ( "\n\nResize: %dx%d, Rot: %d", s.width(),s.height(),m_rotation ); | 244 | // qDebug ( "\n\nResize: %dx%d, Rot: %d", s.width(),s.height(),m_rotation ); |
242 | 245 | ||
243 | emit videoResized ( s ); | 246 | emit videoResized ( s ); |
244 | } | 247 | } |
245 | 248 | ||
246 | 249 | ||
247 | void XineVideoWidget::mousePressEvent ( QMouseEvent *me ) | 250 | void XineVideoWidget::mousePressEvent ( QMouseEvent * /*me*/ ) |
248 | { | 251 | { |
249 | QWidget *p = parentWidget ( ); | 252 | QWidget *p = parentWidget ( ); |
250 | 253 | ||
251 | if ( p ) { | 254 | if ( p ) { |
252 | // QMouseEvent pme ( QEvent::MouseButtonPress, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); | 255 | // QMouseEvent pme ( QEvent::MouseButtonPress, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); |
253 | 256 | ||
254 | // QApplication::sendEvent ( p, &pme ); | 257 | // QApplication::sendEvent ( p, &pme ); |
255 | // emit clicked(); | 258 | // emit clicked(); |
256 | } | 259 | } |
257 | } | 260 | } |
258 | 261 | ||
259 | void XineVideoWidget::mouseReleaseEvent ( QMouseEvent *me ) | 262 | void XineVideoWidget::mouseReleaseEvent ( QMouseEvent * /*me*/ ) |
260 | { | 263 | { |
261 | QWidget *p = parentWidget ( ); | 264 | QWidget *p = parentWidget ( ); |
262 | 265 | ||
263 | if ( p ) { | 266 | if ( p ) { |
264 | // QMouseEvent pme ( QEvent::MouseButtonRelease, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); | 267 | // QMouseEvent pme ( QEvent::MouseButtonRelease, mapToParent ( me-> pos ( )), me-> globalPos ( ), me-> button ( ), me-> state ( )); |
265 | 268 | ||