-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainForm.h
More file actions
61 lines (52 loc) · 1.93 KB
/
MainForm.h
File metadata and controls
61 lines (52 loc) · 1.93 KB
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
54
55
56
57
58
59
60
61
//---------------------------------------------------------------------------
#ifndef MainFormH
#define MainFormH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#pragma message "End of auto-included header files"
//---------------------------------------------------------------------------
#include <vector>
#include <Endpointvolume.h>
#include "ComPtr.h"
#include "Presets.h"
#include "VolumeCallback.h"
class TFormMain : public TForm
{
__published: // IDE-managed Components
TGroupBox *GroupBoxMaster;
TTrackBar *TrackBarMaster;
TGroupBox *GroupBoxChannels;
TTrackBar *TrackBarChannel0;
TButton *ButtonPresets;
void __fastcall TrackBarMasterChange(TObject *Sender);
void __fastcall TrackBarChannelChange(TObject *Sender);
void __fastcall FormKeyPress(TObject *Sender, wchar_t &Key);
void __fastcall ButtonPresetsClick(TObject *Sender);
private: // User declarations
TComPtr<IAudioEndpointVolume> m_VolumeControl;
TComPtr<IAudioEndpointVolumeCallback> m_VolumeCallback;
void OnVolumeChange(GUID EventContext, bool bMuted, float MasterVolume, unsigned NrChannels, float ChannelVolumes[]);
std::vector<TTrackBar*> m_ChannelSliders;
void CreateChannelControls();
void InitControlPositions();
void PositionWindow();
float GetMasterVolume();
void SetMasterVolume(float Volume);
float GetChannelVolume(UINT Channel);
void SetChannelVolume(UINT Channel, float Volume);
TPreset GetCurrentSetting();
TPresets m_Presets;
void OnPreset(const TPreset &Preset);
public: // User declarations
__fastcall TFormMain(TComponent* Owner);
__fastcall ~TFormMain();
};
//---------------------------------------------------------------------------
extern PACKAGE TFormMain *FormMain;
//---------------------------------------------------------------------------
#endif