6 return std::move(temp);
12 output_device_enum_callback_getname(
const GUID & wantID,
pfc::string_base & strOut ) : m_wantID(wantID), m_got(), m_strOut(strOut) {}
13 void on_device(
const GUID & p_guid,
const char * p_name,
unsigned p_name_length) {
14 if (!m_got && p_guid == m_wantID) {
15 m_strOut.set_string(p_name, p_name_length);
27 output_device_enum_callback_getname cb(deviceID, out);
35 if (obj->get_guid() == outputID) {
36 outObj = obj;
return true;
43 output_entry::ptr ret;
44 if (!
g_find( outputID, ret ) )
throw exception_output_module_not_found();
54 m_incoming.set_size(0);
59 m_incoming.set_size(0);
60 on_flush_changing_track();
64 if (m_incoming_spec != m_active_spec && m_incoming_ptr < m_incoming.get_size()) {
65 if (get_latency_samples() == 0) {
66 open(m_incoming_spec);
67 m_active_spec = m_incoming_spec;
72 if (m_incoming_spec == m_active_spec && m_incoming_ptr < m_incoming.get_size()) {
73 t_size cw = can_write_samples() * m_incoming_spec.m_channels;
76 write(
audio_chunk_temp_impl(m_incoming.get_ptr()+m_incoming_ptr,delta / m_incoming_spec.m_channels,m_incoming_spec.m_sample_rate,m_incoming_spec.m_channels,m_incoming_spec.m_channel_config));
77 m_incoming_ptr += delta;
80 p_ready = (m_incoming_ptr == m_incoming.get_size());
84 if (m_incoming_spec.is_valid()) {
85 ret += audio_math::samples_to_time( (m_incoming.get_size() - m_incoming_ptr) / m_incoming_spec.m_channels, m_incoming_spec.m_sample_rate );
87 if (m_active_spec.is_valid()) {
88 ret += audio_math::samples_to_time( get_latency_samples() , m_active_spec.m_sample_rate );
96 if (!spec.is_valid()) pfc::throw_exception_with_message< exception_io_data >(
"Invalid audio stream specifications");
97 m_incoming_spec = spec;
99 m_incoming.set_data_fromptr(p_chunk.
get_data(),length);
106 { 0xeeeb07de, 0xc2c8, 0x44c2, { 0x98, 0x5c, 0xc8, 0x58, 0x56, 0xd9, 0x6d, 0xa1 } };
110 { 0xd41d2423, 0xfbb0, 0x4635, { 0xb2, 0x33, 0x70, 0x54, 0xf7, 0x98, 0x14, 0xab } };
T min_t(const T &item1, const T &item2)
audio_chunk_memref_impl audio_chunk_temp_impl
void flush_changing_track()
const GUID output_id_null
void update(bool &p_ready)
Updates playback; queries whether the device is ready to receive new data.
pfc::string8 get_device_name(const GUID &deviceID)
Interface to container of a chunk of audio data. See audio_chunk_impl for an implementation.
void process_samples(const audio_chunk &p_chunk)
Sends new samples to the device. Allowed to be called only when update() indicates that the device is...
const GUID output_id_default
void fromchunk(const audio_chunk &p_chunk)
static bool g_find(const GUID &outputID, output_entry::ptr &outObj)
void flush()
Flushes queued audio data. Called after seeking.
double get_latency()
Retrieves amount of audio data queued for playback, in seconds.
void dynamic_assert(bool p_condition, const char *p_msg)
virtual void enum_devices(output_device_enum_callback &p_callback)=0
Enumerates devices supported by this output_entry implementation.
virtual audio_sample * get_data()=0
Retrieves audio data buffer pointer (non-const version). Returned pointer is for temporary use only; ...
static outputCoreConfig_t defaults()
void write(const service_ptr_t< file > &p_file, abort_callback &p_abort, const char *p_string, bool is_utf8)
bool next(service_ptr_t< t_query > &p_out)
size_t get_used_size() const
Returns actual amount of audio data contained in the buffer (sample count * channel count)...