}
}
-static void audio_capture_maybe_changed (CaptureVoiceOut *cap, int enabled)
+static void audio_capture_maybe_changed(CaptureVoiceOut *cap, bool enabled)
{
if (cap->hw.enabled != enabled) {
audcnotification_e cmd;
{
HWVoiceOut *hw = &cap->hw;
SWVoiceOut *sw;
- int enabled = 0;
+ bool enabled = false;
for (sw = hw->sw_head.lh_first; sw; sw = sw->entries.le_next) {
if (sw->active) {
- enabled = 1;
+ enabled = true;
break;
}
}
sw = &sc->sw;
sw->hw = hw_cap;
sw->info = hw->info;
- sw->empty = 1;
+ sw->empty = true;
sw->active = hw->enabled;
sw->vol = nominal_volume;
sw->rate = st_rate_start (sw->info.freq, hw_cap->info.freq);
return sw->hw->samples * sw->hw->info.bytes_per_frame;
}
-void AUD_set_active_out (SWVoiceOut *sw, int on)
+void AUD_set_active_out(SWVoiceOut *sw, bool on)
{
HWVoiceOut *hw;
if (on) {
hw->pending_disable = 0;
if (!hw->enabled) {
- hw->enabled = 1;
+ hw->enabled = true;
if (s->vm_running) {
if (hw->pcm_ops->enable_out) {
hw->pcm_ops->enable_out(hw, true);
}
}
-void AUD_set_active_in (SWVoiceIn *sw, int on)
+void AUD_set_active_in(SWVoiceIn *sw, bool on)
{
HWVoiceIn *hw;
if (on) {
if (!hw->enabled) {
- hw->enabled = 1;
+ hw->enabled = true;
if (s->vm_running) {
if (hw->pcm_ops->enable_in) {
hw->pcm_ops->enable_in(hw, true);
}
if (nb_active == 1) {
- hw->enabled = 0;
+ hw->enabled = false;
if (hw->pcm_ops->enable_in) {
hw->pcm_ops->enable_in(hw, false);
}
sw = hw->sw_head.lh_first;
if (hw->pending_disable) {
- hw->enabled = 0;
- hw->pending_disable = 0;
+ hw->enabled = false;
+ hw->pending_disable = false;
if (hw->pcm_ops->enable_out) {
hw->pcm_ops->enable_out(hw, false);
}
#ifdef DEBUG_OUT
dolog ("Disabling voice\n");
#endif
- hw->enabled = 0;
- hw->pending_disable = 0;
+ hw->enabled = false;
+ hw->pending_disable = false;
if (hw->pcm_ops->enable_out) {
hw->pcm_ops->enable_out(hw, false);
}
for (sc = hw->cap_head.lh_first; sc; sc = sc->entries.le_next) {
- sc->sw.active = 0;
+ sc->sw.active = false;
audio_recalc_and_notify_capture (sc->cap);
}
continue;
sw->total_hw_samples_mixed -= played;
if (!sw->total_hw_samples_mixed) {
- sw->empty = 1;
+ sw->empty = true;
}
}
}
typedef struct HWVoiceOut {
AudioBackend *s;
- int enabled;
+ bool enabled;
int poll_mode;
- int pending_disable;
+ bool pending_disable;
struct audio_pcm_info info;
f_sample *clip;
typedef struct HWVoiceIn {
AudioBackend *s;
- int enabled;
+ bool enabled;
int poll_mode;
struct audio_pcm_info info;
STSampleBuffer resample_buf;
void *rate;
size_t total_hw_samples_mixed;
- int active;
- int empty;
+ bool active;
+ bool empty;
HWVoiceOut *hw;
char *name;
struct mixeng_volume vol;
struct SWVoiceIn {
AudioBackend *s;
- int active;
+ bool active;
struct audio_pcm_info info;
void *rate;
size_t total_hw_samples_acquired;
void AUD_close_out (AudioBackend *be, SWVoiceOut *sw);
size_t AUD_write (SWVoiceOut *sw, void *pcm_buf, size_t size);
int AUD_get_buffer_size_out (SWVoiceOut *sw);
-void AUD_set_active_out (SWVoiceOut *sw, int on);
-int AUD_is_active_out (SWVoiceOut *sw);
+void AUD_set_active_out(SWVoiceOut *sw, bool on);
+bool AUD_is_active_out(SWVoiceOut *sw);
void AUD_init_time_stamp_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts);
uint64_t AUD_get_elapsed_usec_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts);
void AUD_close_in(AudioBackend *be, SWVoiceIn *sw);
size_t AUD_read (SWVoiceIn *sw, void *pcm_buf, size_t size);
-void AUD_set_active_in (SWVoiceIn *sw, int on);
-int AUD_is_active_in (SWVoiceIn *sw);
+void AUD_set_active_in(SWVoiceIn *sw, bool on);
+bool AUD_is_active_in(SWVoiceIn *sw);
void AUD_init_time_stamp_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts);
uint64_t AUD_get_elapsed_usec_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts);