3 * Copyright (C) 2010-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
22 #include "utils/StdString.h"
23 #include "Interfaces/AESound.h"
24 #include "ActiveAEResample.h"
25 #include "filesystem/File.h"
32 class CActiveAESound : public IAESound
35 CActiveAESound (const std::string &filename);
36 virtual ~CActiveAESound();
40 virtual bool IsPlaying();
42 virtual void SetVolume(float volume) { m_volume = std::max(0.0f, std::min(1.0f, volume)); }
43 virtual float GetVolume() { return m_volume; }
45 uint8_t** InitSound(bool orig, SampleConfig config, int nb_samples);
46 bool StoreSound(bool orig, uint8_t **buffer, int samples, int linesize);
47 CSoundPacket *GetSound(bool orig);
49 bool IsConverted() { return m_isConverted; }
50 void SetConverted(bool state) { m_isConverted = state; }
55 int GetFileSize() { return m_fileSize; }
56 bool IsSeekPosible() { return m_isSeekPosible; }
58 static int Read(void *h, uint8_t* buf, int size);
59 static offset_t Seek(void *h, offset_t pos, int whence);
62 std::string m_filename;
63 XFILE::CFile *m_pFile;
68 CSoundPacket *m_orig_sound;
69 CSoundPacket *m_dst_sound;