mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:16:56 +02:00
Add files via upload
This commit is contained in:
parent
8d602e3669
commit
1d79a21655
2 changed files with 22 additions and 25 deletions
|
@ -27,8 +27,6 @@ const int MIDI_SHIFT_STATUS = 4;
|
||||||
const int MIDI_SHIFT_NOTE = 8;
|
const int MIDI_SHIFT_NOTE = 8;
|
||||||
const int MIDI_SHIFT_VELOCITY = 16;
|
const int MIDI_SHIFT_VELOCITY = 16;
|
||||||
const int MIDI_SHIFT_PITCH_BEND = 9;
|
const int MIDI_SHIFT_PITCH_BEND = 9;
|
||||||
|
|
||||||
#endif
|
|
||||||
// Status Decode
|
// Status Decode
|
||||||
const int MIDI_NOTE_OFF = 0x8;
|
const int MIDI_NOTE_OFF = 0x8;
|
||||||
const int MIDI_NOTE_ON = 0x9;
|
const int MIDI_NOTE_ON = 0x9;
|
||||||
|
@ -38,6 +36,8 @@ const int MIDI_PROGRAM_CHANGE = 0xc;
|
||||||
const int MIDI_CHANNEL_PRESSURE = 0xd;
|
const int MIDI_CHANNEL_PRESSURE = 0xd;
|
||||||
const int MIDI_PITCH_BEND_CHANGE = 0xe;
|
const int MIDI_PITCH_BEND_CHANGE = 0xe;
|
||||||
const int MIDI_SYSTEM_MESSAGE = 0xf;
|
const int MIDI_SYSTEM_MESSAGE = 0xf;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
const int MIDI_CHANNEL_MODE_ALL_NOTES_OFF = 0x07b;
|
const int MIDI_CHANNEL_MODE_ALL_NOTES_OFF = 0x07b;
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ static bool typeChanPressureEnabled = false;
|
||||||
static bool typePitchBendEnabled = true;
|
static bool typePitchBendEnabled = true;
|
||||||
static bool typeSystemMessageEnabled = false;
|
static bool typeSystemMessageEnabled = false;
|
||||||
|
|
||||||
std::vector<QString> Midi::midiinexclude;
|
std::vector<QString> Midi::midiInExclude;
|
||||||
std::vector<QString> Midi::midioutexclude;
|
std::vector<QString> Midi::midiOutExclude;
|
||||||
|
|
||||||
#if defined Q_OS_WIN32
|
#if defined Q_OS_WIN32
|
||||||
|
|
||||||
|
@ -191,8 +191,8 @@ void Midi::MidiSetup() {
|
||||||
midiInGetDevCaps(i, &incaps, sizeof(MIDIINCAPS));
|
midiInGetDevCaps(i, &incaps, sizeof(MIDIINCAPS));
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (int j = 0; j < midiinexclude.size(); j++) {
|
for (int j = 0; j < midiInExclude.size(); j++) {
|
||||||
if (midiinexclude[j].toStdString().compare(incaps.szPname) == 0) {
|
if (midiInExclude[j].toStdString().compare(incaps.szPname) == 0) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -210,8 +210,8 @@ void Midi::MidiSetup() {
|
||||||
midiOutGetDevCaps(i, &outcaps, sizeof(MIDIINCAPS));
|
midiOutGetDevCaps(i, &outcaps, sizeof(MIDIINCAPS));
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (int j = 0; j < midioutexclude.size(); j++) {
|
for (int j = 0; j < midiOutExclude.size(); j++) {
|
||||||
if (midioutexclude[j].toStdString().compare(outcaps.szPname) == 0) {
|
if (midiOutExclude[j].toStdString().compare(outcaps.szPname) == 0) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ void Midi::midiHardwareChange() {
|
||||||
Midi::Midi() {
|
Midi::Midi() {
|
||||||
instance = this;
|
instance = this;
|
||||||
#if defined Q_OS_WIN32
|
#if defined Q_OS_WIN32
|
||||||
midioutexclude.push_back("Microsoft GS Wavetable Synth"); // we don't want to hear this thing (Lags)
|
midiOutExclude.push_back("Microsoft GS Wavetable Synth"); // we don't want to hear this thing (Lags)
|
||||||
#endif
|
#endif
|
||||||
MidiSetup();
|
MidiSetup();
|
||||||
}
|
}
|
||||||
|
@ -338,8 +338,7 @@ QStringList Midi::listMidiDevices(bool output) {
|
||||||
midiOutGetDevCaps(i, &outcaps, sizeof(MIDIINCAPS));
|
midiOutGetDevCaps(i, &outcaps, sizeof(MIDIINCAPS));
|
||||||
rv.append(outcaps.szPname);
|
rv.append(outcaps.szPname);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
MIDIINCAPS incaps;
|
MIDIINCAPS incaps;
|
||||||
for (unsigned int i = 0; i < midiInGetNumDevs(); i++) {
|
for (unsigned int i = 0; i < midiInGetNumDevs(); i++) {
|
||||||
midiInGetDevCaps(i, &incaps, sizeof(MIDIINCAPS));
|
midiInGetDevCaps(i, &incaps, sizeof(MIDIINCAPS));
|
||||||
|
@ -352,17 +351,16 @@ QStringList Midi::listMidiDevices(bool output) {
|
||||||
|
|
||||||
void Midi::unblockMidiDevice(QString name, bool output) {
|
void Midi::unblockMidiDevice(QString name, bool output) {
|
||||||
if (output) {
|
if (output) {
|
||||||
for (unsigned long i = 0; i < midioutexclude.size(); i++) {
|
for (unsigned long i = 0; i < midiOutExclude.size(); i++) {
|
||||||
if (midioutexclude[i].toStdString().compare(name.toStdString()) == 0) {
|
if (midiOutExclude[i].toStdString().compare(name.toStdString()) == 0) {
|
||||||
midioutexclude.erase(midioutexclude.begin() + i);
|
midiOutExclude.erase(midiOutExclude.begin() + i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
for (unsigned long i = 0; i < midiInExclude.size(); i++) {
|
||||||
for (unsigned long i = 0; i < midiinexclude.size(); i++) {
|
if (midiInExclude[i].toStdString().compare(name.toStdString()) == 0) {
|
||||||
if (midiinexclude[i].toStdString().compare(name.toStdString()) == 0) {
|
midiInExclude.erase(midiInExclude.begin() + i);
|
||||||
midiinexclude.erase(midiinexclude.begin() + i);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -372,10 +370,9 @@ void Midi::unblockMidiDevice(QString name, bool output) {
|
||||||
void Midi::blockMidiDevice(QString name, bool output) {
|
void Midi::blockMidiDevice(QString name, bool output) {
|
||||||
unblockMidiDevice(name, output); // make sure it's only in there once
|
unblockMidiDevice(name, output); // make sure it's only in there once
|
||||||
if (output) {
|
if (output) {
|
||||||
midioutexclude.push_back(name);
|
midiOutExclude.push_back(name);
|
||||||
}
|
} else {
|
||||||
else {
|
midiInExclude.push_back(name);
|
||||||
midiinexclude.push_back(name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,8 +34,8 @@ public:
|
||||||
static void USBchanged();
|
static void USBchanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::vector<QString> midiinexclude;
|
static std::vector<QString> midiInExclude;
|
||||||
static std::vector<QString> midioutexclude;
|
static std::vector<QString> midiOutExclude;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void MidiSetup();
|
void MidiSetup();
|
||||||
|
|
Loading…
Reference in a new issue