diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-16 15:06:54 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-16 15:06:54 +0200 |
commit | a4e97d871e2d85819d957f4df10ab650ef0447ab (patch) | |
tree | d02fdf273761d743c0c4afc1946f43885993566c /dvbapi.c | |
parent | 987a0e931cbd488be35fcf4d8979ea9cf7d17b63 (diff) | |
download | vdr-a4e97d871e2d85819d957f4df10ab650ef0447ab.tar.gz vdr-a4e97d871e2d85819d957f4df10ab650ef0447ab.tar.bz2 |
New keys 'Volume+', 'Volume-' and 'Mute'
Diffstat (limited to 'dvbapi.c')
-rw-r--r-- | dvbapi.c | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -7,7 +7,7 @@ * DVD support initially written by Andreas Schultz <aschultz@warp10.net> * based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si> * - * $Id: dvbapi.c 1.124 2001/09/16 10:10:28 kls Exp $ + * $Id: dvbapi.c 1.125 2001/09/16 13:55:03 kls Exp $ */ //#define DVDDEBUG 1 @@ -2539,6 +2539,8 @@ cDvbApi::cDvbApi(int n) osd = NULL; #endif currentChannel = 1; + mute = false; + volume = 255; } cDvbApi::~cDvbApi() @@ -3622,6 +3624,24 @@ bool cDvbApi::ToggleAudioTrack(void) return false; } +void cDvbApi::ToggleMute(void) +{ + int OldVolume = volume; + mute = !mute; + SetVolume(0, mute); + volume = OldVolume; +} + +void cDvbApi::SetVolume(int Volume, bool Absolute) +{ + if (fd_audio >= 0) { + volume = min(max(Absolute ? Volume : volume + Volume, 0), 255); + audioMixer_t am; + am.volume_left = am.volume_right = volume; + CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am)); + } +} + void cDvbApi::SetAudioCommand(const char *Command) { delete audioCommand; |