19 TRACK_CODE(
"dsp::run",p_iter->m_dsp->run_abortable(p_list,cur_file,flags,p_abort));
20 TRACK_CODE(
"dsp::get_latency",latency += p_iter->m_dsp->get_latency());
24 TRACK_CALL_TEXT(
"dsp_manager::run");
27 #if defined(_MSC_VER) && defined(_M_IX86) 36 if (iter->m_dsp->need_track_change_mark()) flush_mark = iter;
43 bool recycle_available =
true;
52 iter->m_recycle_flag =
false;
59 t_size data_mismatch_count = 0;
60 t_size owner_mismatch_count = 0;
64 if (iter_src->m_preset.get_owner() != iter_dst->m_preset.get_owner()) {
65 owner_mismatch_count++;
66 }
else if (iter_src->m_preset != iter_dst->m_preset) {
67 data_mismatch_count++;
69 ++iter_src; ++iter_dst;
71 recycle_available = (owner_mismatch_count == 0 && data_mismatch_count <= 1);
73 recycle_available =
false;
76 if (recycle_available) {
80 if (iter_src->m_preset == iter_dst->m_preset) {
81 iter_src->m_recycle_flag =
true;
82 iter_dst->m_dsp = iter_src->m_dsp;
84 ++iter_src; ++iter_dst;
89 if (iter->m_dsp.is_empty()) {
95 bool flushflag = flush_mark.
is_valid();
97 unsigned flags2 = p_flags;
98 if (iter == flush_mark) flushflag =
false;
99 if (flushflag || !iter->m_recycle_flag) flags2|=
dsp::FLUSH;
100 dsp_run(iter,p_list,p_cur_file,flags2,latency,p_abort);
111 bool flushflag = flush_mark.
is_valid();
113 unsigned flags2 = p_flags;
114 if (iter == flush_mark) flushflag =
false;
116 dsp_run(iter,p_list,p_cur_file,flags2,latency,p_abort);
133 TRACK_CODE(
"dsp::flush",iter->m_dsp->flush());
142 get_core_settings(cfg);
145 bool changed =
false;
157 if (!found) {cfg.
insert_item(preset,0); changed =
true;}
159 if (changed) set_core_settings(cfg);
163 get_core_settings(cfg);
167 bool changed =
false;
170 if (axe) changed =
true;
175 set_core_settings(cfg);
181 get_core_settings(cfg);
185 out = entry;
return true;
Interface to a DSP chunk list. A DSP chunk list object is passed to the DSP chain each time...
void flush()
Flushes the DSP (e.g. when seeking).
Generic variable bit_array implementation. Needs to be initialized with requested array size before ...
void core_disable_dsp(const GUID &id)
Helper - disables a DSP in core playback settings.
void insert_item(const dsp_preset &p_data, t_size p_index)
void set(t_size n, bool val)
void replace_item(const dsp_preset &p_data, t_size p_index)
Flush whatever you need to when tracks change.
void set_config(const dsp_chain_config &p_data)
Alters the DSP chain configuration. Should be called before the first run() to set the configuration ...
static bool g_dsp_exists(const GUID &p_guid)
bool is_active() const
Returns whether there's at least one active DSP in the configuration.
virtual GUID get_owner() const =0
static bool g_instantiate(service_ptr_t< dsp > &p_out, const dsp_preset &p_preset)
void remove_mask(const bit_array &p_mask)
bool core_query_dsp(const GUID &id, dsp_preset &out)
Helper - if a DSP with the specified identifier is present in playback settings, retrieves its config...
void core_enable_dsp(const dsp_preset &preset)
Helper - enables a DSP in core playback settings.
void dsp_run(t_dsp_chain::const_iterator p_iter, dsp_chunk_list *list, const metadb_handle_ptr &cur_file, unsigned flags, double &latency, abort_callback &)
void copy(const dsp_chain_config &p_source)
const dsp_preset & get_item(t_size p_index) const
dsp_chain_config_impl m_config
PFC_NORETURN void SHARED_EXPORT uBugCheck()
double run(dsp_chunk_list *p_list, const metadb_handle_ptr &p_cur_file, unsigned p_flags, abort_callback &p_abort)
Runs DSP on the specified chunk list.
void close()
Equivalent to set_config() with empty configuration.