2015-07-01 08:02:44 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Andrew Kelley
|
|
|
|
*
|
|
|
|
* This file is part of libsoundio, which is MIT licensed.
|
|
|
|
* See http://opensource.org/licenses/MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SOUNDIO_PULSEAUDIO_HPP
|
|
|
|
#define SOUNDIO_PULSEAUDIO_HPP
|
|
|
|
|
2015-07-28 00:06:12 +00:00
|
|
|
#include "soundio.h"
|
2015-07-27 23:37:45 +00:00
|
|
|
#include "atomics.hpp"
|
|
|
|
|
|
|
|
#include <pulse/pulseaudio.h>
|
|
|
|
|
2015-07-13 16:17:20 +00:00
|
|
|
int soundio_pulseaudio_init(struct SoundIoPrivate *si);
|
2015-07-01 08:02:44 +00:00
|
|
|
|
2015-07-27 23:37:45 +00:00
|
|
|
struct SoundIoDevicePulseAudio {
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SoundIoPulseAudio {
|
|
|
|
bool connection_refused;
|
|
|
|
|
|
|
|
pa_context *pulse_context;
|
|
|
|
atomic_bool device_scan_queued;
|
|
|
|
|
|
|
|
// the one that we're working on building
|
|
|
|
struct SoundIoDevicesInfo *current_devices_info;
|
|
|
|
char *default_sink_name;
|
|
|
|
char *default_source_name;
|
|
|
|
|
|
|
|
// this one is ready to be read with flush_events. protected by mutex
|
|
|
|
struct SoundIoDevicesInfo *ready_devices_info;
|
|
|
|
|
|
|
|
bool have_sink_list;
|
|
|
|
bool have_source_list;
|
|
|
|
bool have_default_sink;
|
|
|
|
|
|
|
|
atomic_bool ready_flag;
|
|
|
|
atomic_bool have_devices_flag;
|
|
|
|
|
|
|
|
pa_threaded_mainloop *main_loop;
|
|
|
|
pa_proplist *props;
|
|
|
|
};
|
|
|
|
|
2015-07-28 00:06:12 +00:00
|
|
|
struct SoundIoOutStreamPulseAudio {
|
|
|
|
pa_stream *stream;
|
|
|
|
atomic_bool stream_ready;
|
|
|
|
pa_buffer_attr buffer_attr;
|
|
|
|
char *write_ptr;
|
|
|
|
SoundIoChannelArea areas[SOUNDIO_MAX_CHANNELS];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SoundIoInStreamPulseAudio {
|
|
|
|
pa_stream *stream;
|
|
|
|
atomic_bool stream_ready;
|
|
|
|
pa_buffer_attr buffer_attr;
|
|
|
|
SoundIoChannelArea areas[SOUNDIO_MAX_CHANNELS];
|
|
|
|
};
|
|
|
|
|
2015-07-01 08:02:44 +00:00
|
|
|
#endif
|