4 virtual t_size get_count()
const = 0;
6 virtual void remove_by_idx(
t_size idx) = 0;
7 virtual void remove_mask(
const bit_array & mask) = 0;
17 for(n=0;n<m;n++) rv += get_item(n)->get_duration();
23 if (dst) dst->
copy(*chunk);
26 void remove_bad_chunks();
61 virtual void flush() = 0;
65 virtual double get_latency() = 0;
69 virtual bool need_track_change_mark() = 0;
99 template<
class t_base
class>
119 PFC_ASSERT(m_list != NULL);
120 return m_list->
insert_item(m_chunk_ptr++,p_hint_size);
124 c->
copy( sourceCopy );
150 virtual void flush() = 0;
162 const t_self &
operator=(
const t_self &);
165 template<
class t_base
class>
170 for(m_chunk_ptr = 0;m_chunk_ptr<m_list->get_count();m_chunk_ptr++) {
172 if (c->
is_empty() || !on_chunk(c,p_abort))
173 m_list->remove_by_idx(m_chunk_ptr--);
177 on_endofplayback(p_abort);
179 if (need_track_change_mark()) on_endoftrack(p_abort);
188 virtual GUID get_owner()
const = 0;
189 virtual void set_owner(
const GUID & p_owner) = 0;
190 virtual const void * get_data()
const = 0;
191 virtual t_size get_data_size()
const = 0;
192 virtual void set_data(
const void * p_data,
t_size p_data_size) = 0;
204 if (get_owner() != p_other.
get_owner())
return false;
205 if (get_data_size() != p_other.
get_data_size())
return false;
206 if (memcmp(get_data(),p_other.
get_data(),get_data_size()) != 0)
return false;
210 return !(*
this == p_other);
275 virtual void on_preset_changed(
const dsp_preset &) = 0;
287 virtual bool get_default_preset(
dsp_preset & p_out) = 0;
289 virtual GUID get_guid() = 0;
290 virtual bool have_config_popup() = 0;
291 virtual bool show_config_popup(
dsp_preset & p_data,HWND p_parent) = 0;
298 static bool g_dsp_exists(
const GUID & p_guid);
299 static bool g_get_default_preset(
dsp_preset & p_out,
const GUID & p_guid);
300 static bool g_have_config_popup(
const GUID & p_guid);
301 static bool g_have_config_popup(
const dsp_preset & p_preset);
302 static bool g_show_config_popup(
dsp_preset & p_preset,HWND p_parent);
306 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(
dsp_entry);
319 template<
class T,
class t_entry = dsp_entry>
344 template<
class T,
class t_entry = dsp_entry_v2>
350 if (p_preset.
get_owner() == T::g_get_guid()) {
363 template<
class T,
class t_entry = dsp_entry_v2>
369 if (p_preset.
get_owner() == T::g_get_guid()) {
392 virtual t_size get_count()
const = 0;
396 virtual void remove_mask(
const bit_array & p_mask) = 0;
398 void remove_item(
t_size p_index);
419 value.contents_from_stream(&stream.m_stream, stream.m_abort);
return stream;
423 value.contents_to_stream(&stream.m_stream, stream.m_abort);
return stream;
void copy(const dsp_preset &p_source)
metadb_handle * m_cur_file
t_size read(void *p_buffer, t_size p_bytes, abort_callback &p_abort)
virtual bool need_track_change_mark()=0
To be overridden by a DSP implementation. Returns true if DSP needs to know exact track change point ...
void init(const dsp_preset &p_preset)
const t_item * get_ptr() const
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Interface to a DSP chunk list. A DSP chunk list object is passed to the DSP chain each time...
virtual void set_owner(const GUID &p_owner)=0
virtual bool on_chunk(audio_chunk *p_chunk, abort_callback &p_abort)=0
To be overridden by a DSP implementation. Processes a chunk of audio data. You can call insert_chunk(...
virtual void on_endofplayback(abort_callback &p_abort)=0
To be overridden by a DSP implementation. Called at the end of played stream, typically at the end of...
stream_reader_memblock_ref _m_stream
void show_config_popup_v2(const dsp_preset &p_data, HWND p_parent, dsp_preset_edit_callback &p_callback)
bool operator!=(const dsp_preset &p_other) const
unsigned insert_item(HWND p_listview, unsigned p_index, const char *p_name, LPARAM p_param)
abort_callback_impl abort_callback_dummy
void add_chunk(const audio_chunk *chunk)
void get_name(pfc::string_base &p_out)
dsp_chain_config_impl(const dsp_chain_config &p_source)
t_size get_remaining() const
void run_v2(dsp_chunk_list *p_list, const metadb_handle_ptr &p_cur_file, int p_flags, abort_callback &p_abort)
abort_callback_dummy _m_abort
t_size get_data_size() const
Bit array interface class, constant version (you can only retrieve values). Range of valid indexes d...
void set_data(const dsp_chain_config &p_data)
pfc::list_t< pfc::rcptr_t< audio_chunk > > m_data
void insert_item(const dsp_preset &p_data, t_size p_index)
Interface to container of a chunk of audio data. See audio_chunk_impl for an implementation.
FB2K_STREAM_READER_OVERLOAD(dsp_chain_config)
virtual const void * get_data() const =0
void get_name(pfc::string_base &p_out)
dsp_impl_base_t< dsp_v2 > dsp_impl_base
pfc::array_t< t_uint8 > m_data
pfc::list_t< pfc::rcptr_t< audio_chunk > > m_recycled
virtual audio_chunk * insert_item(t_size idx, t_size hint_size=0)=0
bool instantiate(service_ptr_t< dsp > &p_out, const dsp_preset &p_preset)
void replace_item(const dsp_preset &p_data, t_size p_index)
~dsp_preset_edit_callback()
void write(const void *p_buffer, t_size p_bytes, abort_callback &p_abort)
virtual void on_endoftrack(abort_callback &p_abort)=0
To be overridden by a DSP implementation. Called on track change. You can use insert_chunk() to dump ...
bool show_config_popup(dsp_preset &p_data, HWND p_parent)
virtual void flush()=0
To be overridden by a DSP implementation. Flushes the DSP (drops any buffered data). The implementation should reset the DSP to the same state it was in before receiving any audio data. Called after seeking, etc.
void remove_mask(const bit_array &mask)
dsp_chain_config_impl(const dsp_chain_config_impl &p_source)
const dsp_preset & operator=(const dsp_preset &p_source)
const dsp_preset & m_data
FB2K_STREAM_WRITER_OVERLOAD(dsp_chain_config)
const dsp_preset & get_item(t_size p_index) const
bool get_default_preset(dsp_preset &p_out)
abort_callback_dummy _m_abort
bool get_default_preset(dsp_preset &p_out)
void copy(const audio_chunk &p_source)
Helper; copies content of another audio chunk to this chunk.
const dsp_preset_impl & operator=(const dsp_preset_impl &p_source)
FB2K_MAKE_SERVICE_INTERFACE(dsp, service_base)
void assume_empty() const
Flush whatever you need to when tracks change.
Backwards-compatible extension to dsp interface, allows abortable operation. Introduced in 0...
dsp_impl_base_t< t_baseclass > t_self
audio_chunk * get_item(t_size n) const
dsp_preset_parser(const dsp_preset &in)
dsp_chain_config_impl m_data
bool get_default_preset(dsp_preset &p_out)
const dsp_preset_impl & operator=(const dsp_preset &p_source)
void set_data(const void *p_data, t_size p_data_size)
void set_data_from_stream(stream_reader *p_stream, t_size p_bytes, abort_callback &p_abort)
void set_size(t_size p_size)
virtual bool show_config_popup(dsp_preset &p_data, HWND p_parent)=0
virtual t_size get_data_size() const =0
audio_chunk * insert_item(t_size idx, t_size hint_size=0)
void get_name(pfc::string_base &p_out)
audio_chunk * add_item(t_size hint_size=0)
void run(dsp_chunk_list *p_chunk_list, const metadb_handle_ptr &p_cur_file, int p_flags)
virtual void set_data(const void *p_data, t_size p_data_size)=0
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
Instance of a DSP. Implementation: Derive from dsp_impl_base instead of deriving from dsp directly...
void append_fromptr(const t_append *p_buffer, t_size p_count)
Warning: buffer pointer must not point to buffer allocated by this array (fixme). ...
bool instantiate(service_ptr_t< dsp > &p_out, const dsp_preset &p_preset)
pfc::array_t< t_uint8 > m_data
dsp_preset_impl(const dsp_preset_impl &p_source)
void set_owner(const GUID &p_owner)
dsp_preset_edit_callback()
virtual GUID get_owner() const =0
void flush(dsp_preset &p_preset)
void set_data_fromptr(const t_source *p_buffer, t_size p_count)
Warning: buffer pointer must not point to buffer allocated by this array (fixme). ...
void finish(const GUID &id, dsp_preset &out)
void remove_by_idx(t_size idx)
dsp_preset_edit_callback(const dsp_preset_edit_callback &)
dsp_preset_reader(const dsp_preset_reader &p_source)
cfg_dsp_chain_config(const GUID &p_guid)
void remove_mask(const bit_array &p_mask)
bool get_cur_file(metadb_handle_ptr &p_out)
Call only from on_chunk / on_endoftrack (on_endoftrack will give info on track being finished)...
bool instantiate(service_ptr_t< dsp > &p_out, const dsp_preset &p_preset)
audio_chunk * insert_chunk(t_size p_hint_size=0)
Inserts a new chunk of audio data. You can call this only from on_chunk(), on_endofplayback() and on...
pfc::ptr_list_t< dsp_preset_impl > m_data
bool get_data(dsp_chain_config &p_data) const
stream_writer_buffer_simple _m_stream
const dsp_chain_config_impl & operator=(const dsp_chain_config &p_source)
void copy(const dsp_chain_config &p_source)
const t_self & operator=(const t_self &)
bool is_empty() const
Returns whether the chunk is empty (contains no audio data).
const dsp_preset & get_item(t_size p_index) const
dsp_preset_impl(const dsp_preset &p_source)
bool operator!=(const dsp_chain_config &other) const
t_size get_remaining() const
bool operator==(const dsp_preset &p_other) const
Base class for configuration variable classes; provides self-registration mechaisms and methods to se...
pfc::array_t< t_uint8, pfc::alloc_fast_aggressive > m_data
audio_chunk * insert_chunk(const audio_chunk &sourceCopy)
const dsp_chain_config & operator=(const dsp_chain_config &p_source)
const dsp_chain_config_impl & operator=(const dsp_chain_config_impl &p_source)
virtual double get_latency()=0
To be overridden by a DSP implementation. Retrieves amount of data buffered by the DSP...
const dsp_preset_edit_callback & operator=(const dsp_preset_edit_callback &)
void get_data_raw(stream_writer *p_stream, abort_callback &p_abort)
Retrieves state of the variable. Called only from main thread, when writing configuration file...
pfc::array_t< t_uint8, pfc::alloc_fast > m_buffer
size_t get_used_size() const
Returns actual amount of audio data contained in the buffer (sample count * channel count)...
void set_data_raw(stream_reader *p_stream, t_size p_sizehint, abort_callback &p_abort)
Sets state of the variable. Called only from main thread, when reading configuration file...
const void * get_data() const
bool operator==(const dsp_chain_config &other) const
bool show_config_popup(dsp_preset &p_data, HWND p_parent)
bool equals(const t1 &v1, const t2 &v2)
Helper class for implementing dsps. You should derive from dsp_impl_base instead of from dsp directly...