raspi: clean up cAudio header

This commit is contained in:
Stefan Seyfried
2013-11-01 21:09:27 +01:00
parent 9563559afb
commit 50b1d46af1
2 changed files with 15 additions and 38 deletions

View File

@@ -43,23 +43,24 @@ cAudio::~cAudio(void)
lt_debug("%s\n", __func__); lt_debug("%s\n", __func__);
} }
void cAudio::openDevice(void) int cAudio::mute(void)
{ {
lt_debug("%s\n", __func__); return SetMute(true);
} }
void cAudio::closeDevice(void) int cAudio::unmute(void)
{ {
lt_debug("%s\n", __func__); return SetMute(false);
} }
int cAudio::do_mute(bool enable, bool remember) int cAudio::SetMute(bool enable)
{ {
lt_debug("%s(%d, %d)\n", __func__, enable, remember); lt_debug("%s(%d)\n", __func__, enable);
if (enable) if (enable)
avdec->set_volume(0); avdec->set_volume(0);
else else
avdec->set_volume(volume); avdec->set_volume(volume);
muted = enable;
return 0; return 0;
} }
@@ -160,8 +161,3 @@ void cAudio::EnableAnalogOut(bool enable)
{ {
lt_debug("%s %d\n", __func__, enable); lt_debug("%s %d\n", __func__, enable);
}; };
void cAudio::setBypassMode(bool disable)
{
lt_debug("%s %d\n", __func__, disable);
}

View File

@@ -39,43 +39,21 @@ typedef enum
class cAudio class cAudio
{ {
friend class cPlayback;
private:
int fd;
bool Muted;
int clipfd; /* for pcm playback */
int mixer_fd; /* if we are using the OSS mixer */
int mixer_num; /* oss mixer to use, if any */
AUDIO_FORMAT StreamType;
AUDIO_SYNC_MODE SyncMode;
bool started;
bool thread_started;
int volume;
int64_t curr_pts;
void openDevice(void);
void closeDevice(void);
int do_mute(bool enable, bool remember);
void setBypassMode(bool disable);
public: public:
/* construct & destruct */ /* construct & destruct */
cAudio(void *, void *, void *); cAudio(void *, void *, void *);
~cAudio(void); ~cAudio(void);
int64_t getPts() { return curr_pts; }
void *GetHandle() { return NULL; }; void *GetHandle() { return NULL; };
/* shut up */ /* shut up */
int mute(bool remember = true) { return do_mute(true, remember); }; int mute(void);
int unmute(bool remember = true) { return do_mute(false, remember); }; int unmute(void);
int SetMute(bool enable);
/* volume, min = 0, max = 255 */ /* volume, min = 0, max = 255 */
int setVolume(unsigned int left, unsigned int right); int setVolume(unsigned int left, unsigned int right);
int getVolume(void) { return volume;} int getVolume(void) { return volume;}
bool getMuteStatus(void) { return Muted; }; bool getMuteStatus(void) { return muted; };
/* start and stop audio */ /* start and stop audio */
int Start(void); int Start(void);
@@ -96,7 +74,10 @@ class cAudio
void SetSpdifDD(bool enable); void SetSpdifDD(bool enable);
void ScheduleMute(bool On); void ScheduleMute(bool On);
void EnableAnalogOut(bool enable); void EnableAnalogOut(bool enable);
int my_read(uint8_t *buf, int buf_size); private:
bool muted;
int volume;
void *pdata;
}; };
#endif #endif