summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorLuciano Iam <lucianito@gmail.com>2019-09-11 20:09:59 +0200
committerFilipe Coelho <falktx@falktx.com>2019-09-11 19:09:59 +0100
commitc2ec4b37d4e2d6cba97a58444ebe89ec99fc8586 (patch)
tree7dc008c3df65b858217458b3c20374f4d2307d45 /windows
parent77de2e339ec430c60457ff6f309ac977b6e888c2 (diff)
downloadjack2-c2ec4b37d4e2d6cba97a58444ebe89ec99fc8586.tar.gz
MIDI port pretty names (#498)
* Set MIDI port pretty names on macOS * Set MIDI port pretty names on Windows * Set MIDI port pretty names on Linux/alsarawmidi * Update alsarawmidi port naming to match CoreMIDI and WinMME * Rename PortSetPrettyNameProperty to PortSetDeviceName * Set hardware property to MIDI port names
Diffstat (limited to 'windows')
-rw-r--r--windows/winmme/JackWinMMEDriver.cpp23
-rw-r--r--windows/winmme/JackWinMMEInputPort.cpp1
-rw-r--r--windows/winmme/JackWinMMEOutputPort.cpp1
-rw-r--r--windows/winmme/JackWinMMEPort.cpp8
-rw-r--r--windows/winmme/JackWinMMEPort.h4
5 files changed, 17 insertions, 20 deletions
diff --git a/windows/winmme/JackWinMMEDriver.cpp b/windows/winmme/JackWinMMEDriver.cpp
index ad56efd6..360b0f5f 100644
--- a/windows/winmme/JackWinMMEDriver.cpp
+++ b/windows/winmme/JackWinMMEDriver.cpp
@@ -71,6 +71,8 @@ JackWinMMEDriver::Attach()
port = fGraphManager->GetPort(index);
port->SetAlias(input_port->GetAlias());
port->SetLatencyRange(JackCaptureLatency, &latency_range);
+ fEngine->PortSetDeviceName(fClientControl.fRefNum, index,
+ input_port->GetDeviceName());
fCapturePortList[i] = index;
}
@@ -95,6 +97,8 @@ JackWinMMEDriver::Attach()
port = fGraphManager->GetPort(index);
port->SetAlias(output_port->GetAlias());
port->SetLatencyRange(JackPlaybackLatency, &latency_range);
+ fEngine->PortSetDeviceName(fClientControl.fRefNum, index,
+ output_port->GetDeviceName());
fPlaybackPortList[i] = index;
}
@@ -424,22 +428,3 @@ extern "C"
#ifdef __cplusplus
}
#endif
-
-
-/*
-jack_connect system:midi_capture_1 system_midi:playback_1
-jack_connect system:midi_capture_1 system_midi:playback_2
-
-jack_connect system:midi_capture_1 system_midi:playback_1
-
-jack_connect system:midi_capture_1 system_midi:playback_1
-
-jack_connect system:midi_capture_1 system_midi:playback_1
-
-jack_connect system_midi:capture_1 system:midi_playback_1
-jack_connect system_midi:capture_2 system:midi_playback_1
-
-jack_connect system_midi:capture_1 system_midi:playback_1
-
-*/
-
diff --git a/windows/winmme/JackWinMMEInputPort.cpp b/windows/winmme/JackWinMMEInputPort.cpp
index c1d3fa15..395980c0 100644
--- a/windows/winmme/JackWinMMEInputPort.cpp
+++ b/windows/winmme/JackWinMMEInputPort.cpp
@@ -92,6 +92,7 @@ JackWinMMEInputPort::JackWinMMEInputPort(const char *alias_name,
snprintf(alias, sizeof(alias) - 1, "%s:%s:in%d", alias_name, name_tmp,
index + 1);
snprintf(name, sizeof(name) - 1, "%s:capture_%d", client_name, index + 1);
+ strncpy(device_name, name_tmp, sizeof(device_name) - 1);
jack_event = 0;
started = false;
write_queue_ptr.release();
diff --git a/windows/winmme/JackWinMMEOutputPort.cpp b/windows/winmme/JackWinMMEOutputPort.cpp
index 20452d7e..ae9bd054 100644
--- a/windows/winmme/JackWinMMEOutputPort.cpp
+++ b/windows/winmme/JackWinMMEOutputPort.cpp
@@ -87,6 +87,7 @@ JackWinMMEOutputPort::JackWinMMEOutputPort(const char *alias_name,
snprintf(alias, sizeof(alias) - 1, "%s:%s:out%d", alias_name, name_tmp,
index + 1);
snprintf(name, sizeof(name) - 1, "%s:playback_%d", client_name, index + 1);
+ strncpy(device_name, name_tmp, sizeof(device_name) - 1);
read_queue_ptr.release();
thread_queue_ptr.release();
thread_ptr.release();
diff --git a/windows/winmme/JackWinMMEPort.cpp b/windows/winmme/JackWinMMEPort.cpp
index 6dac4a7b..1fb233fd 100644
--- a/windows/winmme/JackWinMMEPort.cpp
+++ b/windows/winmme/JackWinMMEPort.cpp
@@ -18,7 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <memory>
-#include <stdexcept>
+#include <stdexcept>
#include <stdio.h>
#include "JackWinMMEPort.h"
@@ -48,6 +48,12 @@ JackWinMMEPort::GetName()
return name;
}
+const char *
+JackWinMMEPort::GetDeviceName()
+{
+ return device_name;
+}
+
void
JackWinMMEPort::GetOSErrorString(LPTSTR text)
{
diff --git a/windows/winmme/JackWinMMEPort.h b/windows/winmme/JackWinMMEPort.h
index 882db7f9..bfe683b5 100644
--- a/windows/winmme/JackWinMMEPort.h
+++ b/windows/winmme/JackWinMMEPort.h
@@ -33,6 +33,7 @@ namespace Jack {
char alias[REAL_JACK_PORT_NAME_SIZE+1];
char name[REAL_JACK_PORT_NAME_SIZE+1];
+ char device_name[REAL_JACK_PORT_NAME_SIZE+1];
public:
@@ -46,6 +47,9 @@ namespace Jack {
const char *
GetName();
+ const char *
+ GetDeviceName();
+
void
GetOSErrorString(LPTSTR text);