mirror of
https://github.com/Relintai/pandemonium_engine_minimal.git
synced 2024-11-10 20:12:10 +01:00
Removed winmidi and coremidi.
This commit is contained in:
parent
f39995e3b9
commit
b31bf4eaaa
@ -17,11 +17,6 @@ if env["platform"] == "windows":
|
||||
if env["xaudio2"]:
|
||||
SConscript("xaudio2/SCsub")
|
||||
|
||||
# Midi drivers
|
||||
SConscript("alsamidi/SCsub")
|
||||
SConscript("coremidi/SCsub")
|
||||
SConscript("winmidi/SCsub")
|
||||
|
||||
# Graphics drivers
|
||||
if env["platform"] != "server":
|
||||
SConscript("gles2/SCsub")
|
||||
|
@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
Import("env")
|
||||
|
||||
# Driver source files
|
||||
env.add_source_files(env.drivers_sources, "*.cpp")
|
@ -1,119 +0,0 @@
|
||||
/*************************************************************************/
|
||||
/* midi_driver_coremidi.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifdef COREMIDI_ENABLED
|
||||
|
||||
#include "midi_driver_coremidi.h"
|
||||
|
||||
#include "core/string/print_string.h"
|
||||
|
||||
#include <CoreAudio/HostTime.h>
|
||||
#include <CoreServices/CoreServices.h>
|
||||
|
||||
void MIDIDriverCoreMidi::read(const MIDIPacketList *packet_list, void *read_proc_ref_con, void *src_conn_ref_con) {
|
||||
MIDIPacket *packet = const_cast<MIDIPacket *>(packet_list->packet);
|
||||
for (UInt32 i = 0; i < packet_list->numPackets; i++) {
|
||||
receive_input_packet(packet->timeStamp, packet->data, packet->length);
|
||||
packet = MIDIPacketNext(packet);
|
||||
}
|
||||
}
|
||||
|
||||
Error MIDIDriverCoreMidi::open() {
|
||||
CFStringRef name = CFStringCreateWithCString(NULL, "Pandemonium", kCFStringEncodingASCII);
|
||||
OSStatus result = MIDIClientCreate(name, NULL, NULL, &client);
|
||||
CFRelease(name);
|
||||
if (result != noErr) {
|
||||
ERR_PRINT("MIDIClientCreate failed, code: " + itos(result));
|
||||
return ERR_CANT_OPEN;
|
||||
}
|
||||
|
||||
result = MIDIInputPortCreate(client, CFSTR("Pandemonium Input"), MIDIDriverCoreMidi::read, (void *)this, &port_in);
|
||||
if (result != noErr) {
|
||||
ERR_PRINT("MIDIInputPortCreate failed, code: " + itos(result));
|
||||
return ERR_CANT_OPEN;
|
||||
}
|
||||
|
||||
int sources = MIDIGetNumberOfSources();
|
||||
for (int i = 0; i < sources; i++) {
|
||||
MIDIEndpointRef source = MIDIGetSource(i);
|
||||
if (source) {
|
||||
MIDIPortConnectSource(port_in, source, (void *)this);
|
||||
connected_sources.insert(i, source);
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
void MIDIDriverCoreMidi::close() {
|
||||
for (int i = 0; i < connected_sources.size(); i++) {
|
||||
MIDIEndpointRef source = connected_sources[i];
|
||||
MIDIPortDisconnectSource(port_in, source);
|
||||
}
|
||||
connected_sources.clear();
|
||||
|
||||
if (port_in != 0) {
|
||||
MIDIPortDispose(port_in);
|
||||
port_in = 0;
|
||||
}
|
||||
|
||||
if (client != 0) {
|
||||
MIDIClientDispose(client);
|
||||
client = 0;
|
||||
}
|
||||
}
|
||||
|
||||
PoolStringArray MIDIDriverCoreMidi::get_connected_inputs() {
|
||||
PoolStringArray list;
|
||||
|
||||
for (int i = 0; i < connected_sources.size(); i++) {
|
||||
MIDIEndpointRef source = connected_sources[i];
|
||||
CFStringRef ref = NULL;
|
||||
char name[256];
|
||||
|
||||
MIDIObjectGetStringProperty(source, kMIDIPropertyDisplayName, &ref);
|
||||
CFStringGetCString(ref, name, sizeof(name), kCFStringEncodingUTF8);
|
||||
CFRelease(ref);
|
||||
|
||||
list.push_back(name);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
MIDIDriverCoreMidi::MIDIDriverCoreMidi() :
|
||||
client(0) {
|
||||
}
|
||||
|
||||
MIDIDriverCoreMidi::~MIDIDriverCoreMidi() {
|
||||
close();
|
||||
}
|
||||
|
||||
#endif // COREMIDI_ENABLED
|
@ -1,60 +0,0 @@
|
||||
#ifndef MIDI_DRIVER_COREMIDI_H
|
||||
#define MIDI_DRIVER_COREMIDI_H
|
||||
/*************************************************************************/
|
||||
/* midi_driver_coremidi.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifdef COREMIDI_ENABLED
|
||||
|
||||
#include "core/os/midi_driver.h"
|
||||
#include "core/containers/vector.h"
|
||||
|
||||
#include <CoreMIDI/CoreMIDI.h>
|
||||
#include <stdio.h>
|
||||
|
||||
class MIDIDriverCoreMidi : public MIDIDriver {
|
||||
MIDIClientRef client;
|
||||
MIDIPortRef port_in;
|
||||
|
||||
Vector<MIDIEndpointRef> connected_sources;
|
||||
|
||||
static void read(const MIDIPacketList *packet_list, void *read_proc_ref_con, void *src_conn_ref_con);
|
||||
|
||||
public:
|
||||
virtual Error open();
|
||||
virtual void close();
|
||||
|
||||
PoolStringArray get_connected_inputs();
|
||||
|
||||
MIDIDriverCoreMidi();
|
||||
virtual ~MIDIDriverCoreMidi();
|
||||
};
|
||||
|
||||
#endif // MIDI_DRIVER_COREMIDI_H
|
||||
#endif // COREMIDI_ENABLED
|
@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
Import("env")
|
||||
|
||||
# Driver source files
|
||||
env.add_source_files(env.drivers_sources, "*.cpp")
|
@ -1,102 +0,0 @@
|
||||
/*************************************************************************/
|
||||
/* midi_driver_winmidi.cpp */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifdef WINMIDI_ENABLED
|
||||
|
||||
#include "midi_driver_winmidi.h"
|
||||
|
||||
#include "core/string/print_string.h"
|
||||
|
||||
void MIDIDriverWinMidi::read(HMIDIIN hMidiIn, UINT wMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2) {
|
||||
if (wMsg == MIM_DATA) {
|
||||
receive_input_packet((uint64_t)dwParam2, (uint8_t *)&dwParam1, 3);
|
||||
}
|
||||
}
|
||||
|
||||
Error MIDIDriverWinMidi::open() {
|
||||
for (UINT i = 0; i < midiInGetNumDevs(); i++) {
|
||||
HMIDIIN midi_in;
|
||||
|
||||
MMRESULT res = midiInOpen(&midi_in, i, (DWORD_PTR)read, (DWORD_PTR)this, CALLBACK_FUNCTION);
|
||||
if (res == MMSYSERR_NOERROR) {
|
||||
midiInStart(midi_in);
|
||||
connected_sources.insert(i, midi_in);
|
||||
} else {
|
||||
char err[256];
|
||||
midiInGetErrorText(res, err, 256);
|
||||
ERR_PRINT("midiInOpen error: " + String(err));
|
||||
|
||||
MIDIINCAPS caps;
|
||||
res = midiInGetDevCaps(i, &caps, sizeof(MIDIINCAPS));
|
||||
if (res == MMSYSERR_NOERROR) {
|
||||
ERR_PRINT("Can't open MIDI device \"" + String(caps.szPname) + "\", is it being used by another application?");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
PoolStringArray MIDIDriverWinMidi::get_connected_inputs() {
|
||||
PoolStringArray list;
|
||||
|
||||
for (int i = 0; i < connected_sources.size(); i++) {
|
||||
HMIDIIN midi_in = connected_sources[i];
|
||||
UINT id = 0;
|
||||
MMRESULT res = midiInGetID(midi_in, &id);
|
||||
if (res == MMSYSERR_NOERROR) {
|
||||
MIDIINCAPS caps;
|
||||
res = midiInGetDevCaps(i, &caps, sizeof(MIDIINCAPS));
|
||||
if (res == MMSYSERR_NOERROR) {
|
||||
list.push_back(caps.szPname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
void MIDIDriverWinMidi::close() {
|
||||
for (int i = 0; i < connected_sources.size(); i++) {
|
||||
HMIDIIN midi_in = connected_sources[i];
|
||||
midiInStop(midi_in);
|
||||
midiInClose(midi_in);
|
||||
}
|
||||
connected_sources.clear();
|
||||
}
|
||||
|
||||
MIDIDriverWinMidi::MIDIDriverWinMidi() {
|
||||
}
|
||||
|
||||
MIDIDriverWinMidi::~MIDIDriverWinMidi() {
|
||||
close();
|
||||
}
|
||||
|
||||
#endif // WINMIDI_ENABLED
|
@ -1,60 +0,0 @@
|
||||
#ifndef MIDI_DRIVER_WINMIDI_H
|
||||
#define MIDI_DRIVER_WINMIDI_H
|
||||
/*************************************************************************/
|
||||
/* midi_driver_winmidi.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
/* https://godotengine.org */
|
||||
/*************************************************************************/
|
||||
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
||||
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
||||
/* */
|
||||
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||
/* a copy of this software and associated documentation files (the */
|
||||
/* "Software"), to deal in the Software without restriction, including */
|
||||
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||
/* the following conditions: */
|
||||
/* */
|
||||
/* The above copyright notice and this permission notice shall be */
|
||||
/* included in all copies or substantial portions of the Software. */
|
||||
/* */
|
||||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifdef WINMIDI_ENABLED
|
||||
|
||||
#include "core/os/midi_driver.h"
|
||||
#include "core/containers/vector.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#include <mmsystem.h>
|
||||
|
||||
class MIDIDriverWinMidi : public MIDIDriver {
|
||||
Vector<HMIDIIN> connected_sources;
|
||||
|
||||
static void CALLBACK read(HMIDIIN hMidiIn, UINT wMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
|
||||
|
||||
public:
|
||||
virtual Error open();
|
||||
virtual void close();
|
||||
|
||||
virtual PoolStringArray get_connected_inputs();
|
||||
|
||||
MIDIDriverWinMidi();
|
||||
virtual ~MIDIDriverWinMidi();
|
||||
};
|
||||
|
||||
#endif // MIDI_DRIVER_WINMIDI_H
|
||||
#endif // WINMIDI_ENABLED
|
@ -184,7 +184,6 @@ def configure(env):
|
||||
"GLES_ENABLED",
|
||||
"APPLE_STYLE_KEYS",
|
||||
"COREAUDIO_ENABLED",
|
||||
"COREMIDI_ENABLED",
|
||||
"GL_SILENCE_DEPRECATION",
|
||||
]
|
||||
)
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "core/input/input.h"
|
||||
#include "crash_handler_osx.h"
|
||||
#include "drivers/coreaudio/audio_driver_coreaudio.h"
|
||||
#include "drivers/coremidi/midi_driver_coremidi.h"
|
||||
#include "drivers/unix/os_unix.h"
|
||||
#include "joypad_osx.h"
|
||||
#include "main/input_default.h"
|
||||
@ -90,9 +89,6 @@ public:
|
||||
#ifdef COREAUDIO_ENABLED
|
||||
AudioDriverCoreAudio audio_driver;
|
||||
#endif
|
||||
#ifdef COREMIDI_ENABLED
|
||||
MIDIDriverCoreMidi midi_driver;
|
||||
#endif
|
||||
|
||||
InputDefault *input;
|
||||
JoypadOSX *joypad_osx;
|
||||
|
@ -1810,10 +1810,6 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
||||
}
|
||||
|
||||
void OS_OSX::finalize() {
|
||||
#ifdef COREMIDI_ENABLED
|
||||
midi_driver.close();
|
||||
#endif
|
||||
|
||||
CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), NULL, kTISNotifySelectedKeyboardInputSourceChanged, NULL);
|
||||
CGDisplayRemoveReconfigurationCallback(displays_arrangement_changed, NULL);
|
||||
|
||||
|
@ -236,7 +236,6 @@ def configure_msvc(env, manual_msvc_config):
|
||||
"WINDOWS_ENABLED",
|
||||
"OPENGL_ENABLED",
|
||||
"WASAPI_ENABLED",
|
||||
"WINMIDI_ENABLED",
|
||||
"TYPED_METHOD_BIND",
|
||||
"WIN32",
|
||||
"MSVC",
|
||||
@ -424,7 +423,7 @@ def configure_mingw(env):
|
||||
|
||||
env.Append(CCFLAGS=["-mwindows"])
|
||||
env.Append(LINKFLAGS=["-Wl,--nxcompat"]) # DEP protection. Not enabling ASLR for now, Mono crashes.
|
||||
env.Append(CPPDEFINES=["WINDOWS_ENABLED", "OPENGL_ENABLED", "WASAPI_ENABLED", "WINMIDI_ENABLED"])
|
||||
env.Append(CPPDEFINES=["WINDOWS_ENABLED", "OPENGL_ENABLED", "WASAPI_ENABLED" ])
|
||||
env.Append(CPPDEFINES=[("WINVER", env["target_win_version"]), ("_WIN32_WINNT", env["target_win_version"])])
|
||||
env.Append(
|
||||
LIBS=[
|
||||
|
@ -1735,10 +1735,6 @@ void OS_Windows::set_main_loop(MainLoop *p_main_loop) {
|
||||
}
|
||||
|
||||
void OS_Windows::finalize() {
|
||||
#ifdef WINMIDI_ENABLED
|
||||
driver_midi.close();
|
||||
#endif
|
||||
|
||||
if (main_loop)
|
||||
memdelete(main_loop);
|
||||
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "crash_handler_windows.h"
|
||||
#include "drivers/unix/ip_unix.h"
|
||||
#include "drivers/wasapi/audio_driver_wasapi.h"
|
||||
#include "drivers/winmidi/midi_driver_winmidi.h"
|
||||
#include "key_mapping_windows.h"
|
||||
#include "main/input_default.h"
|
||||
#include "power_windows.h"
|
||||
@ -380,9 +379,6 @@ class OS_Windows : public OS {
|
||||
#ifdef XAUDIO2_ENABLED
|
||||
AudioDriverXAudio2 driver_xaudio2;
|
||||
#endif
|
||||
#ifdef WINMIDI_ENABLED
|
||||
MIDIDriverWinMidi driver_midi;
|
||||
#endif
|
||||
|
||||
CrashHandler crash_handler;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user