-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMenuGargle.cpp
53 lines (47 loc) · 1.32 KB
/
MenuGargle.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "StdAfx.h"
#include "Menu.h"
#include "MenuGargle.h"
#include "Effect.h"
#include "Console.h"
namespace Menu
{
static const char * const waveform[] = { "Triangle", "Square" };
Gargle menu_fx_gargle({ 21, page_pos.Y + 9, 21 + 18, page_pos.Y + 9 + Gargle::COUNT }, "GARGLE", Gargle::COUNT);
int rate_step[] = { 0, 1, 10, 100 };
void Gargle::Update(int index, int sign, DWORD modifiers)
{
switch (index)
{
case TITLE:
fx_active[BASS_FX_DX8_GARGLE] = sign > 0;
EnableEffect(BASS_FX_DX8_GARGLE, fx_active[BASS_FX_DX8_GARGLE]);
break;
case FREQUENCY:
UpdateProperty(*reinterpret_cast<int *>(&fx_gargle.dwRateHz), sign, modifiers, 1, rate_step, 0, 1000);
break;
case WAVEFORM:
fx_gargle.dwWaveShape = !fx_gargle.dwWaveShape;
break;
default:
__assume(0);
}
UpdateEffect(BASS_FX_DX8_GARGLE);
}
void Gargle::Print(int index, HANDLE hOut, COORD pos, DWORD flags)
{
switch (index)
{
case TITLE:
PrintTitle(hOut, fx_active[BASS_FX_DX8_GARGLE], flags, " ON", "OFF");
break;
case FREQUENCY:
PrintItemFloat(hOut, pos, flags, "Freq: %4.0fHz", float(fx_gargle.dwRateHz));
break;
case WAVEFORM:
PrintItemString(hOut, pos, flags, "Waveform: %8s", waveform[fx_gargle.dwWaveShape]);
break;
default:
__assume(0);
}
}
}