00001 #ifndef AUDIOOUTPUTCA
00002 #define AUDIOOUTPUTCA
00003
00004 #include "audiooutputbase.h"
00005
00006 using namespace std;
00007
00008 #undef AUDBUFSIZE
00009 #define AUDBUFSIZE 512000
00010
00011
00012
00013 class CoreAudioData;
00014
00015 class AudioOutputCA : public AudioOutputBase
00016 {
00017 public:
00018 AudioOutputCA(const AudioSettings &settings);
00019 virtual ~AudioOutputCA();
00020
00021 AudioOutputSettings* GetOutputSettings(bool digital);
00022 static QMap<QString, QString> *GetDevices(const char *type = NULL);
00023
00024 virtual int64_t GetAudiotime(void);
00025
00026
00027 bool RenderAudio(unsigned char *aubuf, int size,
00028 unsigned long long timestamp);
00029
00030
00031 virtual int GetVolumeChannel(int channel) const;
00032 virtual void SetVolumeChannel(int channel, int volume);
00033
00034
00035 void Debug(QString msg)
00036 { LOG(VB_AUDIO, LOG_INFO, "AudioOutputCA::" + msg); }
00037
00038 void Error(QString msg)
00039 { LOG(VB_GENERAL, LOG_ERR, "AudioOutputCA Error: " + msg); }
00040
00041 void Warn(QString msg)
00042 { LOG(VB_GENERAL, LOG_WARNING, "AudioOutputCA Warning: " + msg); }
00043
00044 protected:
00045
00046
00047 virtual bool OpenDevice(void);
00048 virtual void CloseDevice(void);
00049 virtual void WriteAudio(unsigned char *aubuf, int size);
00050 virtual int GetBufferedOnSoundcard(void) const;
00051
00052 virtual bool StartOutputThread(void) { return true; }
00053 virtual void StopOutputThread(void) {}
00054
00055 private:
00056
00057 CoreAudioData * d;
00058 friend class CoreAudioData;
00059
00060 int bufferedBytes;
00061 long CA_audiotime_updated;
00062 };
00063
00064 #endif
00065