foobar2000 SDK  2015-08-03
resampler.h
Go to the documentation of this file.
1 class NOVTABLE resampler_entry : public dsp_entry
2 {
3 public:
4  virtual bool is_conversion_supported(unsigned p_srate_from,unsigned p_srate_to) = 0;
5  virtual bool create_preset(dsp_preset & p_out,unsigned p_target_srate,float p_qualityscale) = 0;//p_qualityscale is 0...1
6  virtual float get_priority() = 0;//value is 0...1, where high-quality (SSRC etc) has 1
7 
8  static bool g_get_interface(service_ptr_t<resampler_entry> & p_out,unsigned p_srate_from,unsigned p_srate_to);
9  static bool g_create(service_ptr_t<dsp> & p_out,unsigned p_srate_from,unsigned p_srate_to,float p_qualityscale);
10  static bool g_create_preset(dsp_preset & p_out,unsigned p_srate_from,unsigned p_srate_to,float p_qualityscale);
11 
12  FB2K_MAKE_SERVICE_INTERFACE(resampler_entry,dsp_entry);
13 };
14 
15 template<typename T>
16 class resampler_entry_impl_t : public dsp_entry_impl_t<T,resampler_entry>
17 {
18 public:
19  bool is_conversion_supported(unsigned p_srate_from,unsigned p_srate_to) {return T::g_is_conversion_supported(p_srate_from,p_srate_to);}
20  bool create_preset(dsp_preset & p_out,unsigned p_target_srate,float p_qualityscale) {return T::g_create_preset(p_out,p_target_srate,p_qualityscale);}
21  float get_priority() {return T::g_get_priority();}
22 };
23 
24 template<typename T>
25 class resampler_factory_t : public service_factory_single_t<resampler_entry_impl_t<T> > {};
bool create_preset(dsp_preset &p_out, unsigned p_target_srate, float p_qualityscale)
Definition: resampler.h:20
Definition: dsp.h:284
Definition: resampler.h:1
Definition: dsp.h:345
static bool g_get_interface(service_ptr_t< dsp_entry > &p_out, const GUID &p_guid)
Definition: dsp.cpp:290
Definition: resampler.h:16
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
float get_priority()
Definition: resampler.h:21
bool is_conversion_supported(unsigned p_srate_from, unsigned p_srate_to)
Definition: resampler.h:19