foobar2000 SDK  2015-08-03
replaygain.h
Go to the documentation of this file.
3 {
4  enum /*t_source_mode*/ {
8  // New in 1.3.8
9  // SPECIAL MODE valid only for playback settings; if set, track gain will be used for random & shuffle-tracks modes, album for shuffle albums & ordered playback.
11  };
14 
16  t_replaygain_config(t_source_mode p_source_mode,t_processing_mode p_processing_mode,float p_preamp_without_rg, float p_preamp_with_rg)
17  : m_source_mode(p_source_mode), m_processing_mode(p_processing_mode), m_preamp_without_rg(p_preamp_without_rg), m_preamp_with_rg(p_preamp_with_rg) {}
18 
19 
20  t_source_mode m_source_mode;
21  t_processing_mode m_processing_mode;
22  float m_preamp_without_rg, m_preamp_with_rg;//preamp values in dB
23 
24  void reset();
25  audio_sample query_scale(const file_info & info) const;
28 
29  void format_name(pfc::string_base & p_out) const;
30  bool is_active() const;
31 
32  static bool equals(const t_replaygain_config & v1, const t_replaygain_config & v2) {
34  }
35  bool operator==(const t_replaygain_config & other) const {return equals(*this, other);}
36  bool operator!=(const t_replaygain_config & other) const {return !equals(*this, other);}
37 };
38 
40  return stream >> value.m_source_mode >> value.m_processing_mode >> value.m_preamp_with_rg >> value.m_preamp_without_rg;
41 }
43  return stream << value.m_source_mode << value.m_processing_mode << value.m_preamp_with_rg << value.m_preamp_without_rg;
44 }
45 
47 class NOVTABLE replaygain_manager : public service_base {
48 public:
50  virtual void get_core_settings(t_replaygain_config & p_out) = 0;
51 
53  virtual HWND configure_embedded(const t_replaygain_config & p_initdata,HWND p_parent,unsigned p_id,bool p_from_modal) = 0;
55  virtual void configure_embedded_retrieve(HWND wnd,t_replaygain_config & p_data) = 0;
56 
58  virtual bool configure_popup(t_replaygain_config & p_data,HWND p_parent,const char * p_title) = 0;
59 
61  virtual void set_core_settings(const t_replaygain_config & p_config) = 0;
62 
64  virtual void configure_embedded_set(HWND wnd, t_replaygain_config const & p_data) = 0;
66  virtual void get_core_defaults(t_replaygain_config & out) = 0;
67 
69  audio_sample core_settings_query_scale(const file_info & p_info);
71  audio_sample core_settings_query_scale(const metadb_handle_ptr & info);
72 
73  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(replaygain_manager);
74 };
t_replaygain_config(t_source_mode p_source_mode, t_processing_mode p_processing_mode, float p_preamp_without_rg, float p_preamp_with_rg)
Definition: replaygain.h:16
t_uint32 t_source_mode
Definition: replaygain.h:13
void format_name(pfc::string_base &p_out) const
Definition: replaygain.cpp:100
t_source_mode m_source_mode
Definition: replaygain.h:20
void info(const char *p_message)
Definition: console.cpp:4
bool operator==(const t_replaygain_config &other) const
Definition: replaygain.h:35
float m_preamp_without_rg
Definition: replaygain.h:22
bool is_active() const
Definition: replaygain.cpp:178
Structure containing ReplayGain scan results from some playable object, also providing various helper...
Definition: file_info.h:2
Main interface class for information about some playable object.
Definition: file_info.h:73
Structure storing ReplayGain configuration: album/track source data modes, gain/peak processing modes...
Definition: replaygain.h:2
audio_sample query_scale(const file_info &info) const
Definition: replaygain.cpp:11
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
Definition: service.h:333
float audio_sample
Definition: audio_sample.h:6
Core service providing methods to retrieve/alter playback ReplayGain settings, as well as use ReplayG...
Definition: replaygain.h:47
FB2K_STREAM_READER_OVERLOAD(t_replaygain_config)
Definition: replaygain.h:39
FB2K_STREAM_WRITER_OVERLOAD(t_replaygain_config)
Definition: replaygain.h:42
bool operator!=(const t_replaygain_config &other) const
Definition: replaygain.h:36
t_uint32 t_processing_mode
Definition: replaygain.h:13
static bool equals(const t_replaygain_config &v1, const t_replaygain_config &v2)
Definition: replaygain.h:32
t_processing_mode m_processing_mode
Definition: replaygain.h:21
uint32_t t_uint32
Definition: int_types.h:5