foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions
resampler_entryabstract

#include <resampler.h>

+ Inheritance diagram for resampler_entry:

Public Member Functions

virtual bool create_preset (dsp_preset &p_out, unsigned p_target_srate, float p_qualityscale)=0
 
 FB2K_MAKE_SERVICE_INTERFACE (resampler_entry, dsp_entry)
 
virtual float get_priority ()=0
 
virtual bool is_conversion_supported (unsigned p_srate_from, unsigned p_srate_to)=0
 
- Public Member Functions inherited from dsp_entry
 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (dsp_entry)
 
virtual bool get_default_preset (dsp_preset &p_out)=0
 
virtual GUID get_guid ()=0
 
virtual void get_name (pfc::string_base &p_out)=0
 
virtual bool have_config_popup ()=0
 
virtual bool instantiate (service_ptr_t< dsp > &p_out, const dsp_preset &p_preset)=0
 
virtual bool show_config_popup (dsp_preset &p_data, HWND p_parent)=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 ()
 

Static Public Member Functions

static bool g_create (service_ptr_t< dsp > &p_out, unsigned p_srate_from, unsigned p_srate_to, float p_qualityscale)
 
static bool g_create_preset (dsp_preset &p_out, unsigned p_srate_from, unsigned p_srate_to, float p_qualityscale)
 
static bool g_get_interface (service_ptr_t< resampler_entry > &p_out, unsigned p_srate_from, unsigned p_srate_to)
 
- Static Public Member Functions inherited from dsp_entry
static bool g_dsp_exists (const GUID &p_guid)
 
static bool g_get_default_preset (dsp_preset &p_out, const GUID &p_guid)
 
static bool g_get_interface (service_ptr_t< dsp_entry > &p_out, const GUID &p_guid)
 
static bool g_have_config_popup (const GUID &p_guid)
 
static bool g_have_config_popup (const dsp_preset &p_preset)
 
static bool g_instantiate (service_ptr_t< dsp > &p_out, const dsp_preset &p_preset)
 
static bool g_instantiate_default (service_ptr_t< dsp > &p_out, const GUID &p_guid)
 
static bool g_name_from_guid (pfc::string_base &p_out, const GUID &p_guid)
 
static bool g_show_config_popup (dsp_preset &p_preset, HWND p_parent)
 
static void g_show_config_popup_v2 (const dsp_preset &p_preset, HWND p_parent, dsp_preset_edit_callback &p_callback)
 

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

Definition at line 1 of file resampler.h.

Member Function Documentation

virtual bool resampler_entry::create_preset ( dsp_preset p_out,
unsigned  p_target_srate,
float  p_qualityscale 
)
pure virtual

Implemented in resampler_entry_impl_t< T >.

resampler_entry::FB2K_MAKE_SERVICE_INTERFACE ( resampler_entry  ,
dsp_entry   
)
bool resampler_entry::g_create ( service_ptr_t< dsp > &  p_out,
unsigned  p_srate_from,
unsigned  p_srate_to,
float  p_qualityscale 
)
static

Definition at line 341 of file dsp.cpp.

342 {
344  if (!g_get_interface(entry,p_srate_from,p_srate_to)) return false;
345  dsp_preset_impl preset;
346  if (!entry->create_preset(preset,p_srate_to,p_qualityscale)) return false;
347  return entry->instantiate(p_out,preset);
348 }
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
static bool g_get_interface(service_ptr_t< resampler_entry > &p_out, unsigned p_srate_from, unsigned p_srate_to)
Definition: dsp.cpp:306
bool resampler_entry::g_create_preset ( dsp_preset p_out,
unsigned  p_srate_from,
unsigned  p_srate_to,
float  p_qualityscale 
)
static

Definition at line 334 of file dsp.cpp.

335 {
337  if (!g_get_interface(entry,p_srate_from,p_srate_to)) return false;
338  return entry->create_preset(p_out,p_srate_to,p_qualityscale);
339 }
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
static bool g_get_interface(service_ptr_t< resampler_entry > &p_out, unsigned p_srate_from, unsigned p_srate_to)
Definition: dsp.cpp:306
bool resampler_entry::g_get_interface ( service_ptr_t< resampler_entry > &  p_out,
unsigned  p_srate_from,
unsigned  p_srate_to 
)
static

Definition at line 306 of file dsp.cpp.

307 {
308  service_ptr_t<dsp_entry> ptr_dsp;
309  service_ptr_t<resampler_entry> ptr_resampler;
311  e.reset();
312  float found_priority = 0;
314  while(e.next(ptr_dsp))
315  {
316  if (ptr_dsp->service_query_t(ptr_resampler))
317  {
318  if (p_srate_from == 0 || ptr_resampler->is_conversion_supported(p_srate_from,p_srate_to))
319  {
320  float priority = ptr_resampler->get_priority();
321  if (found.is_empty() || priority > found_priority)
322  {
323  found = ptr_resampler;
324  found_priority = priority;
325  }
326  }
327  }
328  }
329  if (found.is_empty()) return false;
330  p_out = found;
331  return true;
332 }
void reset()
Definition: service.h:578
bool is_empty() const
Definition: service.h:120
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
bool next(service_ptr_t< t_query > &p_out)
Definition: service.h:587
virtual float resampler_entry::get_priority ( )
pure virtual

Implemented in resampler_entry_impl_t< T >.

virtual bool resampler_entry::is_conversion_supported ( unsigned  p_srate_from,
unsigned  p_srate_to 
)
pure virtual

Implemented in resampler_entry_impl_t< T >.


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