| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h" |
| 12 |
#include "cores/AudioEngine/Interfaces/AESound.h" |
| 13 |
|
| 14 |
class DllAvUtil; |
| 15 |
|
| 16 |
namespace XFILE |
| 17 |
{ |
| 18 |
class CFile; |
| 19 |
} |
| 20 |
|
| 21 |
namespace ActiveAE |
| 22 |
{ |
| 23 |
|
| 24 |
class CActiveAE; |
| 25 |
|
| 26 |
class CActiveAESound : public IAESound |
| 27 |
{ |
| 28 |
public: |
| 29 |
CActiveAESound (const std::string &filename, CActiveAE *ae); |
| 30 |
~CActiveAESound() override; |
| 31 |
|
| 32 |
void Play() override; |
| 33 |
void Stop() override; |
| 34 |
bool IsPlaying() override; |
| 35 |
|
| 36 |
void SetChannel(AEChannel channel) override { m_channel = channel; } |
| 37 |
AEChannel GetChannel() override { return m_channel; } |
| 38 |
void SetVolume(float volume) override { m_volume = std::max(0.0f, std::min(1.0f, volume)); } |
| 39 |
float GetVolume() override { return m_volume; } |
| 40 |
|
| 41 |
uint8_t** InitSound(bool orig, SampleConfig config, int nb_samples); |
| 42 |
bool StoreSound(bool orig, uint8_t **buffer, int samples, int linesize); |
| 43 |
CSoundPacket *GetSound(bool orig); |
| 44 |
|
| 45 |
bool IsConverted() { return m_isConverted; } |
| 46 |
void SetConverted(bool state) { m_isConverted = state; } |
| 47 |
|
| 48 |
bool Prepare(); |
| 49 |
void Finish(); |
| 50 |
int GetChunkSize(); |
| 51 |
int GetFileSize() { return m_fileSize; } |
| 52 |
bool IsSeekPossible() { return m_isSeekPossible; } |
| 53 |
|
| 54 |
static int Read(void *h, uint8_t* buf, int size); |
| 55 |
static int64_t Seek(void *h, int64_t pos, int whence); |
| 56 |
|
| 57 |
protected: |
| 58 |
CActiveAE *m_activeAE; |
| 59 |
std::string m_filename; |
| 60 |
XFILE::CFile *m_pFile; |
| 61 |
bool m_isSeekPossible; |
| 62 |
int m_fileSize; |
| 63 |
float m_volume = 1.0f; |
| 64 |
AEChannel m_channel = AE_CH_NULL; |
| 65 |
|
| 66 |
CSoundPacket *m_orig_sound; |
| 67 |
CSoundPacket *m_dst_sound; |
| 68 |
|
| 69 |
bool m_isConverted; |
| 70 |
}; |
| 71 |
} |