summaryrefslogtreecommitdiff
path: root/dvbapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'dvbapi.c')
-rw-r--r--dvbapi.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/dvbapi.c b/dvbapi.c
index 462e1954..16b3e308 100644
--- a/dvbapi.c
+++ b/dvbapi.c
@@ -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;