15 static const GUID guid = { 0x890827b, 0x67df, 0x4c27, { 0xba, 0x1a, 0x4f, 0x95, 0x8d, 0xf, 0xb5, 0xd0 } };
27 chunk->
scale( audio_math::gain_to_scale(
m_gain ) );
75 }
catch(exception_io_data) {gain = 0;}
89 enum { IDD = IDD_DSP };
95 RangeTotal = RangeMax - RangeMin
99 MSG_WM_INITDIALOG(OnInitDialog)
100 COMMAND_HANDLER_EX(IDOK, BN_CLICKED, OnButton)
101 COMMAND_HANDLER_EX(IDCANCEL, BN_CLICKED, OnButton)
102 MSG_WM_HSCROLL(OnHScroll)
107 BOOL OnInitDialog(CWindow, LPARAM) {
108 m_slider = GetDlgItem(IDC_SLIDER);
109 m_slider.SetRange(0, RangeTotal);
114 m_slider.SetPos( pfc::clip_t<t_int32>(
pfc::rint32(val), RangeMin, RangeMax ) - RangeMin );
124 void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar pScrollBar) {
126 val = (float) ( m_slider.GetPos() + RangeMin );
131 m_callback.on_preset_changed(preset);
149 if (popup.DoModal(p_parent) != IDOK) {
static void make_preset(float gain, dsp_preset &out)
virtual void on_preset_changed(const dsp_preset &)=0
BOOL SHARED_EXPORT uSetDlgItemText(HWND wnd, UINT id, const char *p_text)
bool need_track_change_mark()
To be overridden by a DSP implementation. Returns true if DSP needs to know exact track change point ...
static bool g_get_default_preset(dsp_preset &p_out)
void flush()
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.
typedef BOOL(WINAPI *pPowerSetRequest_t)(__in HANDLE PowerRequest
static void RunDSPConfigPopup(const dsp_preset &p_data, HWND p_parent, dsp_preset_edit_callback &p_callback)
void on_endofplayback(abort_callback &)
To be overridden by a DSP implementation. Called at the end of played stream, typically at the end of...
Interface to container of a chunk of audio data. See audio_chunk_impl for an implementation.
static void g_show_config_popup(const dsp_preset &p_data, HWND p_parent, dsp_preset_edit_callback &p_callback)
string8_fastalloc string_formatter
void scale(audio_sample p_value)
Helper function; scales entire chunk content by specified value.
t_int32 rint32(double p_val)
double get_latency()
To be overridden by a DSP implementation. Retrieves amount of data buffered by the DSP...
bool on_chunk(audio_chunk *chunk, abort_callback &)
To be overridden by a DSP implementation. Processes a chunk of audio data. You can call insert_chunk(...
void finish(const GUID &id, dsp_preset &out)
static bool g_have_config_popup()
void on_endoftrack(abort_callback &)
To be overridden by a DSP implementation. Called on track change. You can use insert_chunk() to dump ...
dsp_sample(dsp_preset const &in)
static void parse_preset(float &gain, const dsp_preset &in)
static void g_get_name(pfc::string_base &p_out)
static dsp_factory_t< dsp_sample > g_dsp_sample_factory
Helper class for implementing dsps. You should derive from dsp_impl_base instead of from dsp directly...