diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-02-25 07:33:21 +0100 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-02-25 07:33:21 +0100 |
commit | 80e640c072b80590b3cc818e25a80589f515f4a4 (patch) | |
tree | 981767ce2874f0640a40d20d7d07b70749319af5 /dxr3device.c | |
parent | 5ec77bd73a9de9611498893130e4e5b300b29c75 (diff) | |
download | vdr-plugin-dxr3-80e640c072b80590b3cc818e25a80589f515f4a4.tar.gz vdr-plugin-dxr3-80e640c072b80590b3cc818e25a80589f515f4a4.tar.bz2 |
factor our audio stuff from dxr3interface.h
With this commit ALSA support is only some commits away. This commit
introduces cAudioOss, which has everything needed in it to handle a oss
audio device. There are some problems, which will fixed soon.
For instance, external mode is not supported at the moment.
Diffstat (limited to 'dxr3device.c')
-rw-r--r-- | dxr3device.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/dxr3device.c b/dxr3device.c index be84138..8b50cb2 100644 --- a/dxr3device.c +++ b/dxr3device.c @@ -27,7 +27,7 @@ #include "dxr3interface.h" #include "dxr3tools.h" #include "dxr3osd.h" -#include "dxr3audio.h" +#include "dxr3audio-oss.h" // ================================== //! constructor @@ -41,7 +41,8 @@ cDxr3Device::cDxr3Device() : m_DemuxDevice(cDxr3Interface::Instance()) // TODO: this will be later the place, // where we will decide what kind of // audio output system we will use. - audioOut = new iAudio(); + audioOut = new cAudioOss(); + audioOut->openDevice(); m_DemuxDevice.setAudio(audioOut); } @@ -49,6 +50,7 @@ cDxr3Device::cDxr3Device() : m_DemuxDevice(cDxr3Interface::Instance()) // ================================== cDxr3Device::~cDxr3Device() { + audioOut->releaseDevice(); delete audioOut; if (m_spuDecoder) @@ -81,14 +83,11 @@ bool cDxr3Device::CanReplay() const // ================================== bool cDxr3Device::SetPlayMode(ePlayMode PlayMode) { - if (PlayMode == pmExtern_THIS_SHOULD_BE_AVOIDED) - { - Tools::WriteInfoToOsd(tr("DXR3: releasing devices")); - cDxr3Interface::Instance().ExternalReleaseDevices(); - } - else - { - cDxr3Interface::Instance().ExternalReopenDevices(); + if (PlayMode == pmExtern_THIS_SHOULD_BE_AVOIDED) { + Tools::WriteInfoToOsd(tr("DXR3: releasing devices")); + cDxr3Interface::Instance().ExternalReleaseDevices(); + } else { + cDxr3Interface::Instance().ExternalReopenDevices(); } // should this really be here? @@ -273,8 +272,8 @@ int cDxr3Device::PlayAudio(const uchar *Data, int Length, uchar Id) bool isAc3 = ((Id & 0xF0) == 0x80) || Id == 0xbd; - if (isAc3 && !cDxr3Interface::Instance().IsAudioModeAC3()) - cDxr3Interface::Instance().SetAudioDigitalAC3(); + if (isAc3 && !audioOut->isAudioModeAC3()) + audioOut->setAudioMode(iAudio::Ac3); if ((m_DemuxDevice.GetDemuxMode() == DXR3_DEMUX_TRICK_MODE && m_DemuxDevice.GetTrickState() == DXR3_FREEZE) || |