author | harlekin <harlekin> | 2002-08-07 19:30:13 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-07 19:30:13 (UTC) |
commit | c80f0885bf402b6dd4ea637ad1b7d8b3ebd69300 (patch) (unidiff) | |
tree | 558e8528408f0ab27d644554279f646723c6dad9 /noncore/multimedia/opieplayer2/videowidget.cpp | |
parent | 7effde67fd121736ec658e690858c6c54bd6d125 (diff) | |
download | opie-c80f0885bf402b6dd4ea637ad1b7d8b3ebd69300.zip opie-c80f0885bf402b6dd4ea637ad1b7d8b3ebd69300.tar.gz opie-c80f0885bf402b6dd4ea637ad1b7d8b3ebd69300.tar.bz2 |
added volume handling for audio gui and other small fixes
Diffstat (limited to 'noncore/multimedia/opieplayer2/videowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index af06079..188b18d 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -29,13 +29,12 @@ | |||
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 <qpe/resource.h> | 34 | #include <qpe/resource.h> |
35 | #include <qpe/mediaplayerplugininterface.h> | ||
36 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
37 | 36 | ||
38 | #include <qwidget.h> | 37 | #include <qwidget.h> |
39 | #include <qpainter.h> | 38 | #include <qpainter.h> |
40 | #include <qpixmap.h> | 39 | #include <qpixmap.h> |
41 | #include <qslider.h> | 40 | #include <qslider.h> |
@@ -84,13 +83,12 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | |||
84 | QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { | 83 | QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { |
85 | setCaption( tr("OpiePlayer - Video") ); | 84 | setCaption( tr("OpiePlayer - Video") ); |
86 | Config cfg("OpiePlayer"); | 85 | Config cfg("OpiePlayer"); |
87 | cfg.setGroup("VideoWidget"); | 86 | cfg.setGroup("VideoWidget"); |
88 | 87 | ||
89 | QString Button0aPix, Button0bPix, controlsPix; | 88 | QString Button0aPix, Button0bPix, controlsPix; |
90 | //backgroundPix=cfg.readEntry( "backgroundPix", "opieplayer/metalFinish"); | ||
91 | Button0aPix=cfg.readEntry( "Button0aPix", "opieplayer/mediaButton0a"); | 89 | Button0aPix=cfg.readEntry( "Button0aPix", "opieplayer/mediaButton0a"); |
92 | Button0bPix=cfg.readEntry( "Button0bPix","opieplayer/mediaButton0b"); | 90 | Button0bPix=cfg.readEntry( "Button0bPix","opieplayer/mediaButton0b"); |
93 | controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls0" ); | 91 | controlsPix=cfg.readEntry( "controlsPix","opieplayer/mediaControls0" ); |
94 | 92 | ||
95 | cfg.setGroup("AudioWidget"); | 93 | cfg.setGroup("AudioWidget"); |
96 | QString skin = cfg.readEntry("Skin","default"); | 94 | QString skin = cfg.readEntry("Skin","default"); |
@@ -103,13 +101,15 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | |||
103 | pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix) ); | 101 | pixmaps[2] = new QPixmap( Resource::loadPixmap( controlsPix) ); |
104 | currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 ); | 102 | currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 ); |
105 | 103 | ||
106 | slider = new QSlider( Qt::Horizontal, this ); | 104 | slider = new QSlider( Qt::Horizontal, this ); |
107 | slider->setMinValue( 0 ); | 105 | slider->setMinValue( 0 ); |
108 | slider->setMaxValue( 1 ); | 106 | slider->setMaxValue( 1 ); |
109 | slider->setBackgroundPixmap( Resource::loadPixmap( backgroundPix ) ); | 107 | |
108 | slider->setBackgroundPixmap( *this->backgroundPixmap () ); //Resource::loadPixmap( backgroundPix ) ); | ||
109 | slider->setBackgroundOrigin( QWidget::ParentOrigin); | ||
110 | slider->setFocusPolicy( QWidget::NoFocus ); | 110 | slider->setFocusPolicy( QWidget::NoFocus ); |
111 | slider->setGeometry( QRect( 7, 250, 220, 20 ) ); | 111 | slider->setGeometry( QRect( 7, 250, 220, 20 ) ); |
112 | 112 | ||
113 | videoFrame = new XineVideoWidget ( this, "Video frame" ); | 113 | videoFrame = new XineVideoWidget ( this, "Video frame" ); |
114 | 114 | ||
115 | connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); | 115 | connect ( videoFrame, SIGNAL( videoResized ( const QSize & )), this, SIGNAL( videoResized ( const QSize & ))); |
@@ -241,13 +241,15 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
241 | } | 241 | } |
242 | } else { | 242 | } else { |
243 | if ( videoButtons[i].isHeld ) { | 243 | if ( videoButtons[i].isHeld ) { |
244 | videoButtons[i].isHeld = FALSE; | 244 | videoButtons[i].isHeld = FALSE; |
245 | if ( !videoButtons[i].isToggle ) | 245 | if ( !videoButtons[i].isToggle ) |
246 | setToggleButton( i, FALSE ); | 246 | setToggleButton( i, FALSE ); |
247 | qDebug("button toggled3 %d",i); | ||
247 | } | 248 | } |
249 | |||
248 | } | 250 | } |
249 | switch (i) { | 251 | switch (i) { |
250 | case VideoPlay: mediaPlayerState->setPlaying(videoButtons[i].isDown); return; | 252 | case VideoPlay: mediaPlayerState->setPlaying(videoButtons[i].isDown); return; |
251 | case VideoStop: mediaPlayerState->setPlaying(FALSE); return; | 253 | case VideoStop: mediaPlayerState->setPlaying(FALSE); return; |
252 | case VideoPause: mediaPlayerState->setPaused(videoButtons[i].isDown); return; | 254 | case VideoPause: mediaPlayerState->setPaused(videoButtons[i].isDown); return; |
253 | case VideoNext: mediaPlayerState->setNext(); return; | 255 | case VideoNext: mediaPlayerState->setNext(); return; |
@@ -316,27 +318,12 @@ void VideoWidget::paintEvent( QPaintEvent * ) { | |||
316 | 318 | ||
317 | void VideoWidget::closeEvent( QCloseEvent* ) { | 319 | void VideoWidget::closeEvent( QCloseEvent* ) { |
318 | mediaPlayerState->setList(); | 320 | mediaPlayerState->setList(); |
319 | } | 321 | } |
320 | 322 | ||
321 | 323 | ||
322 | bool VideoWidget::playVideo() { | ||
323 | bool result = FALSE; | ||
324 | |||
325 | int stream = 0; | ||
326 | |||
327 | int sw = 240; | ||
328 | int sh = 320; | ||
329 | int dd = QPixmap::defaultDepth(); | ||
330 | int w = height(); | ||
331 | int h = width(); | ||
332 | |||
333 | return true; | ||
334 | } | ||
335 | |||
336 | |||
337 | 324 | ||
338 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) | 325 | void VideoWidget::keyReleaseEvent( QKeyEvent *e) |
339 | { | 326 | { |
340 | switch ( e->key() ) { | 327 | switch ( e->key() ) { |
341 | ////////////////////////////// Zaurus keys | 328 | ////////////////////////////// Zaurus keys |
342 | case Key_Home: | 329 | case Key_Home: |