author | harlekin <harlekin> | 2002-08-07 19:30:13 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-07 19:30:13 (UTC) |
commit | c80f0885bf402b6dd4ea637ad1b7d8b3ebd69300 (patch) (side-by-side diff) | |
tree | 558e8528408f0ab27d644554279f646723c6dad9 /noncore/multimedia/opieplayer2/mediaplayer.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/mediaplayer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 5411a64..8d8e4e5 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -13,2 +13,3 @@ #include "audiowidget.h" +#include "volumecontrol.h" @@ -41,2 +42,4 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) + volControl = new VolumeControl; + } @@ -44,2 +47,4 @@ MediaPlayer::MediaPlayer( QObject *parent, const char *name ) MediaPlayer::~MediaPlayer() { + delete xineControl; + delete volControl; } @@ -127,5 +132,3 @@ void MediaPlayer::startDecreasingVolume() { startTimer( 100 ); - // da kommt demnächst osound denk ich mal - /////////////////////////// lets just move those change volume here - // AudioDevice::decreaseVolume(); + volControl->decVol(2); } @@ -136,3 +139,3 @@ void MediaPlayer::startIncreasingVolume() { startTimer( 100 ); - // AudioDevice::increaseVolume(); + volControl->incVol(2); } @@ -156,16 +159,17 @@ void MediaPlayer::stopChangingVolume() { void MediaPlayer::timerEvent( QTimerEvent * ) { - // if ( volumeDirection == +1 ) - // AudioDevice::increaseVolume(); - // else if ( volumeDirection == -1 ) - // AudioDevice::decreaseVolume(); + if ( volumeDirection == +1 ) { + volControl->incVol(2); + } else if ( volumeDirection == -1 ) { + volControl->decVol(2); + } -// Display an on-screen display volume - unsigned int l, r, v; bool m; // TODO FIXME -// AudioDevice::getVolume( l, r, m ); -// v = ((l + r) * 11) / (2*0xFFFF); + int v; + v = volControl->getVolume(); + v = v / 10; - if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) + if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { return; + } @@ -175,5 +179,6 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { if ( drawnOnScreenDisplay ) { - if ( onScreenDisplayVolume > v ) + if ( onScreenDisplayVolume > v ) { audioUI->repaint( (w - 200) / 2 + v * 20 + 0, h - yoff + 40, (onScreenDisplayVolume - v) * 20 + 9, 30, FALSE ); } + } @@ -193,5 +198,5 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { for ( unsigned int i = 0; i < 10; i++ ) { - if ( v > i ) + if ( v > i ) { p.drawRect( (w - 200) / 2 + i * 20 + 0, h - yoff + 40, 9, 30 ); - else + } else { p.drawRect( (w - 200) / 2 + i * 20 + 3, h - yoff + 50, 3, 10 ); @@ -199,2 +204,3 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { } +} |