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();
38 void remove_by_idx(
t_size idx);
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;
154 virtual double get_latency() = 0;
159 virtual bool need_track_change_mark() = 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);
221 m_data.append_fromptr((
const t_uint8 *) p_buffer,p_bytes);
224 p_preset.
set_data(m_data.get_ptr(),m_data.get_size());
241 t_size todo = pfc::min_t<t_size>(p_bytes,m_data.get_size()-m_walk);
242 memcpy(p_buffer,m_data.get_ptr()+m_walk,todo);
264 const void *
get_data()
const {
return m_data.get_ptr();}
266 void set_data(
const void * p_data,
t_size p_data_size) {m_data.set_data_fromptr((
const t_uint8*)p_data,p_data_size);}
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);
314 bool show_config_popup(
dsp_preset & p_data,HWND p_parent);
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;
436 void remove_mask(
const bit_array & p_mask);
474 if (get_remaining() != 0)
throw exception_io_data();
490 out.
set_data(_m_stream.m_buffer.get_ptr(), _m_stream.m_buffer.get_size());
493 _m_stream.m_buffer.set_size(0);
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)
void init(const dsp_preset &p_preset)
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
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)
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...
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)
~dsp_preset_edit_callback()
void write(const void *p_buffer, t_size p_bytes, abort_callback &p_abort)
bool show_config_popup(dsp_preset &p_data, HWND p_parent)
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)
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
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)
virtual t_size get_data_size() const =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...
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 finish(const GUID &id, dsp_preset &out)
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)
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
stream_writer_buffer_simple _m_stream
const dsp_chain_config_impl & operator=(const dsp_chain_config &p_source)
bool is_empty() const
Returns whether the chunk is empty (contains no audio data).
dsp_preset_impl(const dsp_preset &p_source)
bool operator!=(const dsp_chain_config &other) const
This is free and unencumbered software released into the public domain Anyone is free to copy
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)
const dsp_preset_edit_callback & operator=(const dsp_preset_edit_callback &)
size_t get_used_size() const
Returns actual amount of audio data contained in the buffer (sample count * channel count)...
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...