foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Data Fields
CMyDSPPopup
+ Inheritance diagram for CMyDSPPopup:

Public Types

enum  { IDD = IDD_DSP }
 
enum  { RangeMin = -20, RangeMax = 20, RangeTotal = RangeMax - RangeMin }
 

Public Member Functions

 CMyDSPPopup (const dsp_preset &initData, dsp_preset_edit_callback &callback)
 
 BEGIN_MSG_MAP (CMyDSPPopup) MSG_WM_INITDIALOG(OnInitDialog) COMMAND_HANDLER_EX(IDOK
 
OnButton COMMAND_HANDLER_EX (IDCANCEL, BN_CLICKED, OnButton) MSG_WM_HSCROLL(OnHScroll) END_MSG_MAP() private
 
void OnButton (UINT, int id, CWindow)
 
void OnHScroll (UINT nSBCode, UINT nPos, CScrollBar pScrollBar)
 
void RefreshLabel (float val)
 

Data Fields

 BN_CLICKED
 
dsp_preset_edit_callbackm_callback
 
const dsp_presetm_initData
 
CTrackBarCtrl m_slider
 

Detailed Description

Definition at line 85 of file dsp.cpp.

Member Enumeration Documentation

anonymous enum
Enumerator
IDD 

Definition at line 89 of file dsp.cpp.

89 { IDD = IDD_DSP };
anonymous enum
Enumerator
RangeMin 
RangeMax 
RangeTotal 

Definition at line 91 of file dsp.cpp.

91  {
92  RangeMin = -20,
93  RangeMax = 20,
94 
96  };

Constructor & Destructor Documentation

CMyDSPPopup::CMyDSPPopup ( const dsp_preset initData,
dsp_preset_edit_callback callback 
)
inline

Definition at line 87 of file dsp.cpp.

87 : m_initData(initData), m_callback(callback) {}
dsp_preset_edit_callback & m_callback
Definition: dsp.cpp:142
const dsp_preset & m_initData
Definition: dsp.cpp:141

Member Function Documentation

CMyDSPPopup::BEGIN_MSG_MAP ( CMyDSPPopup  )
OnButton CMyDSPPopup::COMMAND_HANDLER_EX ( IDCANCEL  ,
BN_CLICKED  ,
OnButton   
)
inline

Definition at line 101 of file dsp.cpp.

105  :
106 
107  BOOL OnInitDialog(CWindow, LPARAM) {
108  m_slider = GetDlgItem(IDC_SLIDER);
109  m_slider.SetRange(0, RangeTotal);
110 
111  {
112  float val;
114  m_slider.SetPos( pfc::clip_t<t_int32>( pfc::rint32(val), RangeMin, RangeMax ) - RangeMin );
115  RefreshLabel(val);
116  }
117  return TRUE;
118  }
CTrackBarCtrl m_slider
Definition: dsp.cpp:144
void RefreshLabel(float val)
Definition: dsp.cpp:136
typedef BOOL(WINAPI *pPowerSetRequest_t)(__in HANDLE PowerRequest
t_int32 rint32(double p_val)
Definition: other.cpp:209
static void parse_preset(float &gain, const dsp_preset &in)
Definition: dsp.cpp:72
const dsp_preset & m_initData
Definition: dsp.cpp:141
void CMyDSPPopup::OnButton ( UINT  ,
int  id,
CWindow   
)
inline

Definition at line 120 of file dsp.cpp.

120  {
121  EndDialog(id);
122  }
void CMyDSPPopup::OnHScroll ( UINT  nSBCode,
UINT  nPos,
CScrollBar  pScrollBar 
)
inline

Definition at line 124 of file dsp.cpp.

124  {
125  float val;
126  val = (float) ( m_slider.GetPos() + RangeMin );
127 
128  {
129  dsp_preset_impl preset;
130  dsp_sample::make_preset(val, preset);
132  }
133  RefreshLabel(val);
134  }
static void make_preset(float gain, dsp_preset &out)
Definition: dsp.cpp:69
virtual void on_preset_changed(const dsp_preset &)=0
dsp_preset_edit_callback & m_callback
Definition: dsp.cpp:142
CTrackBarCtrl m_slider
Definition: dsp.cpp:144
void RefreshLabel(float val)
Definition: dsp.cpp:136
void CMyDSPPopup::RefreshLabel ( float  val)
inline

Definition at line 136 of file dsp.cpp.

136  {
137  pfc::string_formatter msg; msg << pfc::format_float(val) << " dB";
138  ::uSetDlgItemText(*this, IDC_SLIDER_LABEL, msg);
139  }
BOOL SHARED_EXPORT uSetDlgItemText(HWND wnd, UINT id, const char *p_text)

Field Documentation

CMyDSPPopup::BN_CLICKED

Definition at line 100 of file dsp.cpp.

dsp_preset_edit_callback& CMyDSPPopup::m_callback

Definition at line 142 of file dsp.cpp.

const dsp_preset& CMyDSPPopup::m_initData

Definition at line 141 of file dsp.cpp.

CTrackBarCtrl CMyDSPPopup::m_slider

Definition at line 144 of file dsp.cpp.


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