diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-07-25 01:17:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-25 01:17:57 +0200 |
commit | a501678ba174f9faa1760ce26ec43d96a01adfa0 (patch) | |
tree | 11db61cd5afffbcff1977bae82b8d39182b9e766 /platform/x11 | |
parent | 4080e7ff8e992735028f18807713dd0e57c3af9c (diff) | |
parent | 7a5f9fc08ea4f25cd20e743a9a1ef5566246cf2c (diff) |
Merge pull request #20154 from marcelofg55/midi_driver
Added a new MIDIDriver class
Diffstat (limited to 'platform/x11')
-rw-r--r-- | platform/x11/detect.py | 2 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 7 | ||||
-rw-r--r-- | platform/x11/os_x11.h | 5 |
3 files changed, 13 insertions, 1 deletions
diff --git a/platform/x11/detect.py b/platform/x11/detect.py index feaa2e598f..6a7a426804 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -249,7 +249,7 @@ def configure(env): if (os.system("pkg-config --exists alsa") == 0): # 0 means found print("Enabling ALSA") - env.Append(CPPFLAGS=["-DALSA_ENABLED"]) + env.Append(CPPFLAGS=["-DALSA_ENABLED", "-DALSAMIDI_ENABLED"]) env.ParseConfig('pkg-config alsa --cflags --libs') else: print("ALSA libraries not found, disabling driver") diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index af0e02173f..260ce57732 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -342,6 +342,10 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a AudioDriverManager::initialize(p_audio_driver); +#ifdef ALSAMIDI_ENABLED + driver_alsamidi.open(); +#endif + ERR_FAIL_COND_V(!visual_server, ERR_UNAVAILABLE); ERR_FAIL_COND_V(x11_window == 0, ERR_UNAVAILABLE); @@ -606,6 +610,9 @@ void OS_X11::finalize() { memdelete(debugger_connection_console); } */ +#ifdef ALSAMIDI_ENABLED + driver_alsamidi.close(); +#endif #ifdef JOYDEV_ENABLED memdelete(joypad); diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index b67bc824be..44455a2d8d 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -38,6 +38,7 @@ #include "servers/visual_server.h" //#include "servers/visual/visual_server_wrap_mt.h" #include "drivers/alsa/audio_driver_alsa.h" +#include "drivers/alsamidi/alsa_midi.h" #include "drivers/pulseaudio/audio_driver_pulseaudio.h" #include "joypad_linux.h" #include "main/input_default.h" @@ -168,6 +169,10 @@ class OS_X11 : public OS_Unix { AudioDriverALSA driver_alsa; #endif +#ifdef ALSAMIDI_ENABLED + MIDIDriverALSAMidi driver_alsamidi; +#endif + #ifdef PULSEAUDIO_ENABLED AudioDriverPulseAudio driver_pulseaudio; #endif |