forked from huceke/omxplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IAudioRenderer.h
86 lines (74 loc) · 3.15 KB
/
IAudioRenderer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* XBMC Media Center
* Copyright (c) 2002 d7o3g4q and RUNTiME
* Portions Copyright (c) by the authors of ffmpeg and xvid
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// AsyncAudioRenderer.h: interface for the CAsyncDirectSound class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_IAUDIORENDERER_H__B590A94D_D15E_43A6_A41D_527BD441B5F5__INCLUDED_)
#define AFX_IAUDIORENDERER_H__B590A94D_D15E_43A6_A41D_527BD441B5F5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "utils/StdString.h"
#include "cores/IAudioCallback.h"
#include "utils/PCMRemap.h"
extern void RegisterAudioCallback(IAudioCallback* pCallback);
extern void UnRegisterAudioCallback();
typedef std::pair<CStdString, CStdString> AudioSink;
typedef std::vector<AudioSink> AudioSinkList;
class IAudioRenderer
{
public:
enum EEncoded {
ENCODED_NONE = 0,
ENCODED_IEC61937_AC3,
ENCODED_IEC61937_EAC3,
ENCODED_IEC61937_DTS,
ENCODED_IEC61937_MPEG,
ENCODED_IEC61937_UNKNOWN,
};
IAudioRenderer() {};
virtual ~IAudioRenderer() {};
virtual bool Initialize(IAudioCallback* pCallback, const CStdString& device, int iChannels, enum PCMChannels *channelMap, unsigned int downmixChannels, unsigned int uiSamplesPerSec, unsigned int uiBitsPerSample, bool bResample, bool boostOnDownmix, bool bIsMusic=false, EEncoded encoded = ENCODED_NONE, long initialVolume = 0, float fifo_size = 0.0f) = 0;
virtual void UnRegisterAudioCallback() = 0;
virtual void RegisterAudioCallback(IAudioCallback* pCallback) = 0;
virtual float GetDelay() = 0;
virtual float GetCacheTime() = 0;
virtual float GetCacheTotal() { return 1.0f; }
virtual unsigned int AddPackets(const void* data, unsigned int len) = 0;
virtual bool IsResampling() { return false;};
virtual unsigned int GetSpace() = 0;
virtual bool Deinitialize() = 0;
virtual bool Pause() = 0;
virtual bool Stop() = 0;
virtual bool Resume() = 0;
virtual unsigned int GetChunkLen() = 0;
virtual long GetCurrentVolume() const = 0;
virtual void Mute(bool bMute) = 0;
virtual bool SetCurrentVolume(long nVolume) = 0;
virtual void SetDynamicRangeCompression(long drc) {};
virtual float GetCurrentAttenuation() { return m_remap.GetCurrentAttenuation(); }
virtual int SetPlaySpeed(int iSpeed) = 0;
virtual void WaitCompletion() = 0;
virtual void SwitchChannels(int iAudioStream, bool bAudioOnAllSpeakers) = 0;
protected:
CPCMRemap m_remap;
private:
};
#endif // !defined(AFX_IAUDIORENDERER_H__B590A94D_D15E_43A6_A41D_527BD441B5F5__INCLUDED_)