-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMidiController.h
41 lines (39 loc) · 1.05 KB
/
MidiController.h
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
#pragma once
#include <Windows.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
#include "global.h"
#include "PanelMenu.h"
#include "CurrentSound.h"
#include <vector>
class MidiController {
// GMƒŠƒZƒbƒg—pƒf[ƒ^
BYTE abyGMReset[6] = { 0xf0, 0x7e, 0x7f, 0x09, 0x01, 0xf7 };
MIDIHDR mhMidi;
HMIDIOUT g_hMidi;
const int CH_MAX;
int NowProgram[16];
int currentChord, currentChordIsMinor;
PanelMenu panel;
std::vector<CurrentSound> cs;
void Stop(int ch, int note);
public:
MidiController();
~MidiController();
int Init();
void Update(double delta);
void Play(int ch, int note, int gate, int vel);
void PlayHold(int ch, int note, int vel);
void PlayChord(int ch, int baseNote, int gate, int vel, bool isMinor = false, bool isSeventh = false);
void PlayChordHold(int ch, int baseNote, int vel, bool isMinor=false, int isSeventh=0);
void AllStop();
void ProgramChange(int ch, int num);
void NextProgram();
void PreProgram();
void NextCh();
void PreCh();
int GetFocusCh() const;
void Save(FILE* fp);
void Load(FILE* fp);
void Draw() const;
};