foobar2000 SDK  2015-08-03
dsp_manager.h
Go to the documentation of this file.
1 class dsp_manager {
3 public:
5 
7  void set_config( const dsp_chain_config & p_data );
10  double run(dsp_chunk_list * p_list,const metadb_handle_ptr & p_cur_file,unsigned p_flags,abort_callback & p_abort);
12  void flush();
13 
15  void close();
16 
18  bool is_active() const;
19 
20 private:
25  };
27 
28  t_dsp_chain m_chain;
31 
32  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&);
33 
34  dsp_manager(const dsp_manager &) {throw pfc::exception_not_implemented();}
35  const dsp_manager & operator=(const dsp_manager&) {throw pfc::exception_not_implemented();}
36 };
37 
41  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(dsp_config_manager);
42 public:
44  virtual void get_core_settings(dsp_chain_config & p_out) = 0;
46  virtual void set_core_settings(const dsp_chain_config & p_data) = 0;
47 
51  virtual bool configure_popup(dsp_chain_config & p_data,HWND p_parent,const char * p_title) = 0;
52 
58  virtual HWND configure_embedded(const dsp_chain_config & p_initdata,HWND p_parent,unsigned p_id,bool p_from_modal) = 0;
60  virtual void configure_embedded_retrieve(HWND wnd,dsp_chain_config & p_data) = 0;
62  virtual void configure_embedded_change(HWND wnd,const dsp_chain_config & p_data) = 0;
63 
64 
66  void core_enable_dsp(const dsp_preset & preset);
68  void core_disable_dsp(const GUID & id);
70  bool core_query_dsp(const GUID & id, dsp_preset & out);
71 };
72 
75 class NOVTABLE dsp_config_callback : public service_base {
76  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(dsp_config_callback);
77 public:
80  virtual void on_core_settings_change(const dsp_chain_config & p_newdata) = 0;
81 };
Definition: dsp_manager.h:21
Interface to a DSP chunk list. A DSP chunk list object is passed to the DSP chain each time...
Definition: dsp.h:2
Definition: pfc.h:71
void flush()
Flushes the DSP (e.g. when seeking).
t_dsp_chain m_chain
Definition: dsp_manager.h:28
const dsp_manager & operator=(const dsp_manager &)
Definition: dsp_manager.h:35
service_ptr_t< dsp > m_dsp
Definition: dsp_manager.h:22
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
Definition: service.h:333
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 ...
Definition: dsp_manager.cpp:8
pfc::chain_list_v2_t< t_dsp_chain_entry > t_dsp_chain
Definition: dsp_manager.h:26
bool is_active() const
Returns whether there&#39;s at least one active DSP in the configuration.
Callback class for getting notified about core playback DSP settings getting altered. Register your implementations with static service_factory_single_t<myclass> g_myclass_factory;.
Definition: dsp_manager.h:75
dsp_manager(const dsp_manager &)
Definition: dsp_manager.h:34
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 &)
Definition: dsp_manager.cpp:15
Core API for accessing core playback DSP settings as well as spawning DSP configuration dialogs...
Definition: dsp_manager.h:40
dsp_chain_config_impl m_config
Definition: dsp_manager.h:29
Helper class for running audio data through a DSP chain.
Definition: dsp_manager.h:2
bool m_config_changed
Definition: dsp_manager.h:30
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.
Definition: dsp_manager.cpp:23
void close()
Equivalent to set_config() with empty configuration.
Definition: dsp_manager.cpp:3