foobar2000 SDK  2015-08-03
Public Member Functions | Private Member Functions
dsp_config_managerabstract

#include <dsp_manager.h>

+ Inheritance diagram for dsp_config_manager:

Public Member Functions

virtual HWND configure_embedded (const dsp_chain_config &p_initdata, HWND p_parent, unsigned p_id, bool p_from_modal)=0
 
virtual void configure_embedded_change (HWND wnd, const dsp_chain_config &p_data)=0
 
virtual void configure_embedded_retrieve (HWND wnd, dsp_chain_config &p_data)=0
 
virtual bool configure_popup (dsp_chain_config &p_data, HWND p_parent, const char *p_title)=0
 
void core_disable_dsp (const GUID &id)
 
void core_enable_dsp (const dsp_preset &preset)
 
bool core_query_dsp (const GUID &id, dsp_preset &out)
 
virtual void get_core_settings (dsp_chain_config &p_out)=0
 
virtual void set_core_settings (const dsp_chain_config &p_data)=0
 
- Public Member Functions inherited from service_base
template<typename outPtr_t >
bool cast (outPtr_t &outPtr)
 
virtual int service_add_ref ()=0 throw ()
 
virtual bool service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid)
 
template<class T >
bool service_query_t (service_ptr_t< T > &p_out)
 
virtual int service_release ()=0 throw ()
 

Private Member Functions

 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (dsp_config_manager)
 

Additional Inherited Members

- Public Types inherited from service_base
typedef service_base t_interface
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Core API for accessing core playback DSP settings as well as spawning DSP configuration dialogs.
Use static_api_ptr_t<dsp_config_manager>() to instantiate.

Definition at line 40 of file dsp_manager.h.

Member Function Documentation

virtual HWND dsp_config_manager::configure_embedded ( const dsp_chain_config p_initdata,
HWND  p_parent,
unsigned  p_id,
bool  p_from_modal 
)
pure virtual

Spawns an embedded DSP settings dialog.

Parameters
p_initdataInitial DSP chain configuration to put in the dialog.
p_parentParent window to contain the embedded dialog.
p_idControl ID of the embedded dialog. The parent window will receive a WM_COMMAND with BN_CLICKED and this identifier when user changes settings in the embedded dialog.
p_from_modalMust be set to true when the parent window is a modal dialog, false otherwise.
virtual void dsp_config_manager::configure_embedded_change ( HWND  wnd,
const dsp_chain_config p_data 
)
pure virtual

Changes current settings in an embedded DSP settings dialog. See also: configure_embedded().

virtual void dsp_config_manager::configure_embedded_retrieve ( HWND  wnd,
dsp_chain_config p_data 
)
pure virtual

Retrieves current settings from an embedded DSP settings dialog. See also: configure_embedded().

virtual bool dsp_config_manager::configure_popup ( dsp_chain_config p_data,
HWND  p_parent,
const char *  p_title 
)
pure virtual

Runs a modal DSP settings dialog.

Parameters
p_dataDSP chain configuration to edit - contains initial configuration to put in the dialog when called, receives the new configuration on successful edit.
Returns
True when user approved DSP configuration changes (pressed the "OK" button), false when the user cancelled them ("Cancel" button).
void dsp_config_manager::core_disable_dsp ( const GUID id)

Helper - disables a DSP in core playback settings.

Definition at line 161 of file dsp_manager.cpp.

161  {
163  get_core_settings(cfg);
164 
165  t_size n,m = cfg.get_count();
166  bit_array_bittable mask(m);
167  bool changed = false;
168  for(n=0;n<m;n++) {
169  bool axe = (cfg.get_item(n).get_owner() == id) ? true : false;
170  if (axe) changed = true;
171  mask.set(n,axe);
172  }
173  if (changed) {
174  cfg.remove_mask(mask);
175  set_core_settings(cfg);
176  }
177 }
Generic variable bit_array implementation. Needs to be initialized with requested array size before ...
size_t t_size
Definition: int_types.h:48
virtual GUID get_owner() const =0
void remove_mask(const bit_array &p_mask)
Definition: dsp.cpp:208
t_size get_count() const
Definition: dsp.cpp:188
const dsp_preset & get_item(t_size p_index) const
Definition: dsp.cpp:193
virtual void get_core_settings(dsp_chain_config &p_out)=0
Retrieves current core playback DSP settings.
virtual void set_core_settings(const dsp_chain_config &p_data)=0
Changes current core playback DSP settings.
void dsp_config_manager::core_enable_dsp ( const dsp_preset preset)

Helper - enables a DSP in core playback settings.

Definition at line 140 of file dsp_manager.cpp.

140  {
142  get_core_settings(cfg);
143 
144  bool found = false;
145  bool changed = false;
146  t_size n,m = cfg.get_count();
147  for(n=0;n<m;n++) {
148  if (cfg.get_item(n).get_owner() == preset.get_owner()) {
149  found = true;
150  if (cfg.get_item(n) != preset) {
151  cfg.replace_item(preset,n);
152  changed = true;
153  }
154  break;
155  }
156  }
157  if (!found) {cfg.insert_item(preset,0); changed = true;}
158 
159  if (changed) set_core_settings(cfg);
160 }
void insert_item(const dsp_preset &p_data, t_size p_index)
Definition: dsp.cpp:203
void replace_item(const dsp_preset &p_data, t_size p_index)
Definition: dsp.cpp:198
size_t t_size
Definition: int_types.h:48
virtual GUID get_owner() const =0
t_size get_count() const
Definition: dsp.cpp:188
const dsp_preset & get_item(t_size p_index) const
Definition: dsp.cpp:193
virtual void get_core_settings(dsp_chain_config &p_out)=0
Retrieves current core playback DSP settings.
virtual void set_core_settings(const dsp_chain_config &p_data)=0
Changes current core playback DSP settings.
bool dsp_config_manager::core_query_dsp ( const GUID id,
dsp_preset out 
)

Helper - if a DSP with the specified identifier is present in playback settings, retrieves its configuration and returns true, otherwise returns false.

Definition at line 179 of file dsp_manager.cpp.

179  {
181  get_core_settings(cfg);
182  for(t_size n=0;n<cfg.get_count();n++) {
183  const dsp_preset & entry = cfg.get_item(n);
184  if (entry.get_owner() == id) {
185  out = entry; return true;
186  }
187  }
188  return false;
189 }
size_t t_size
Definition: int_types.h:48
virtual GUID get_owner() const =0
t_size get_count() const
Definition: dsp.cpp:188
const dsp_preset & get_item(t_size p_index) const
Definition: dsp.cpp:193
virtual void get_core_settings(dsp_chain_config &p_out)=0
Retrieves current core playback DSP settings.
dsp_config_manager::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( dsp_config_manager  )
private
virtual void dsp_config_manager::get_core_settings ( dsp_chain_config p_out)
pure virtual

Retrieves current core playback DSP settings.

virtual void dsp_config_manager::set_core_settings ( const dsp_chain_config p_data)
pure virtual

Changes current core playback DSP settings.


The documentation for this class was generated from the following files: