From 0a2a221fa93bd4177b2a21d2499cef68b47424bd Mon Sep 17 00:00:00 2001 From: Johns Date: Sun, 12 Feb 2012 20:14:43 +0100 Subject: Add play/pause audio support. --- softhddevice.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'softhddevice.cpp') diff --git a/softhddevice.cpp b/softhddevice.cpp index 9854d97..ad9d0cb 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -657,7 +657,6 @@ class cSoftHdDevice:public cDevice virtual void Play(void); virtual void Freeze(void); virtual void Mute(void); - virtual void SetVolumeDevice(int); virtual void StillPicture(const uchar *, int); virtual bool Poll(cPoller &, int = 0); virtual bool Flush(int = 0); @@ -675,6 +674,7 @@ class cSoftHdDevice:public cDevice virtual int GetAudioChannelDevice(void); virtual void SetDigitalAudioDevice(bool); virtual void SetAudioTrackDevice(eTrackType); + virtual void SetVolumeDevice(int); virtual int PlayAudio(const uchar *, int, uchar); // Image Grab facilities @@ -700,6 +700,7 @@ cSoftHdDevice::cSoftHdDevice(void) #if 0 spuDecoder = NULL; #endif + SetVideoDisplayFormat(eVideoDisplayFormat(Setup.VideoDisplayFormat)); } cSoftHdDevice::~cSoftHdDevice(void) @@ -826,6 +827,9 @@ void cSoftHdDevice::Freeze(void) ::Freeze(); } +/** +** Turns off audio while replaying. +*/ void cSoftHdDevice::Mute(void) { dsyslog("[softhddev]%s:\n", __FUNCTION__); @@ -834,13 +838,6 @@ void cSoftHdDevice::Mute(void) ::Mute(); } -void cSoftHdDevice::SetVolumeDevice(int volume) -{ - dsyslog("[softhddev]%s: %d\n", __FUNCTION__, volume); - - ::SetVolumeDevice(volume); -} - /** ** Display the given I-frame as a still picture. */ @@ -891,8 +888,8 @@ bool cSoftHdDevice::Flush(int timeout_ms) ** ** @note FIXME: this function isn't called on the initial channel */ -void cSoftHdDevice:: SetVideoDisplayFormat(eVideoDisplayFormat - video_display_format) +void cSoftHdDevice::SetVideoDisplayFormat( + eVideoDisplayFormat video_display_format) { static int last = -1; @@ -965,6 +962,18 @@ int cSoftHdDevice::GetAudioChannelDevice(void) return 0; } +/** +** Sets the audio volume on this device (Volume = 0...255). +** +** @param volume device volume +*/ +void cSoftHdDevice::SetVolumeDevice(int volume) +{ + dsyslog("[softhddev]%s: %d\n", __FUNCTION__, volume); + + ::SetVolumeDevice(volume); +} + // ---------------------------------------------------------------------------- /** -- cgit v1.2.3