From 7c30d38607f84e1255ba2de684cf945b29384d04 Mon Sep 17 00:00:00 2001 From: TonyChyi Date: Tue, 20 Mar 2018 09:23:58 +0800 Subject: [PATCH] run? --- backend/{alsa_wrapper => }/alsa_wrapper.c | 4 ++-- backend/{alsa_wrapper => }/alsa_wrapper.h | 0 backend/midiDevice_linux.go | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) rename backend/{alsa_wrapper => }/alsa_wrapper.c (91%) rename backend/{alsa_wrapper => }/alsa_wrapper.h (100%) diff --git a/backend/alsa_wrapper/alsa_wrapper.c b/backend/alsa_wrapper.c similarity index 91% rename from backend/alsa_wrapper/alsa_wrapper.c rename to backend/alsa_wrapper.c index 4cf26c5..ed57288 100644 --- a/backend/alsa_wrapper/alsa_wrapper.c +++ b/backend/alsa_wrapper.c @@ -13,7 +13,7 @@ int new_client(char* client_name) { return 2<<16|status; } - status = snd_seq_client_name(seq_handle, client_name); + status = snd_seq_set_client_name(seq_handle, client_name); if (status < 0) { return 3<<16|status; } @@ -23,7 +23,7 @@ int new_client(char* client_name) { } int new_port(char* port_name) { - seq_port = snd_seq_create_simple_port(seq_handle, portname, + seq_port = snd_seq_create_simple_port(seq_handle, port_name, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, SND_SEQ_PORT_TYPE_MIDI_GENERIC|SND_SEQ_PORT_TYPE_APPLICATION); if (seq_port < 0) { diff --git a/backend/alsa_wrapper/alsa_wrapper.h b/backend/alsa_wrapper.h similarity index 100% rename from backend/alsa_wrapper/alsa_wrapper.h rename to backend/alsa_wrapper.h diff --git a/backend/midiDevice_linux.go b/backend/midiDevice_linux.go index 78339d0..9666235 100644 --- a/backend/midiDevice_linux.go +++ b/backend/midiDevice_linux.go @@ -3,10 +3,9 @@ package backend /* #ifndef ARREMI #define ARREMI -#cgo CFLAGS: -Ialsa_wrapper #cgo LDFLAGS: -lasound #include -#include "alsa_wrapper/alsa_wrapper.h" +#include "alsa_wrapper.h" #endif */ import "C" @@ -88,6 +87,6 @@ func (midiDev *MIDIDevice) AllNoteOff() { } } -func resolveErrCode(int code) (int, int) { +func resolveErrCode(code int) (int, int) { return code >> 16, code & 0xffff }