summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/portmedia/pmmidi.c
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2013-01-01 16:11:32 +0000
committer R. Belmont <rb6502@users.noreply.github.com>2013-01-01 16:11:32 +0000
commitad80ff6c3f58529f95ca71d4ec397df6cb7eb25d (patch)
tree965b7d6f81b42ce36d685246ea1d067b88067111 /src/osd/portmedia/pmmidi.c
parente000eedfbbc6c8b5edd9f9e738e2ef12c9f326dc (diff)
portmidi: Initial commit. [R. Belmont]
(nw: this isn't enabled to compile yet, this is just to make it easier to run the final tests on my Mac and my Windows laptop)
Diffstat (limited to 'src/osd/portmedia/pmmidi.c')
-rw-r--r--src/osd/portmedia/pmmidi.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/osd/portmedia/pmmidi.c b/src/osd/portmedia/pmmidi.c
new file mode 100644
index 00000000000..8a9811a22eb
--- /dev/null
+++ b/src/osd/portmedia/pmmidi.c
@@ -0,0 +1,80 @@
+//============================================================
+//
+// pmmidi.c - OSD interface for PortMidi
+//
+// Copyright (c) 1996-2013, Nicola Salmoria and the MAME Team.
+// Visit http://mamedev.org for licensing and usage restrictions.
+//
+//============================================================
+
+#include "emu.h"
+#include "osdcore.h"
+#include "portmidi/portmidi.h"
+
+void osd_list_midi_devices(void)
+{
+ #ifndef DISABLE_MIDI
+ int num_devs = Pm_CountDevices();
+ const PmDeviceInfo *pmInfo;
+
+ printf("\n");
+
+ if (num_devs == 0)
+ {
+ printf("No MIDI ports were found\n");
+ return;
+ }
+
+ printf("MIDI input ports:\n");
+ for (int i = 0; i < num_devs; i++)
+ {
+ pmInfo = Pm_GetDeviceInfo(i);
+
+ if (pmInfo->input)
+ {
+ printf("%s %s\n", pmInfo->name, (i == Pm_GetDefaultInputDeviceID()) ? "(default)" : "");
+ }
+ }
+
+ printf("\nMIDI output ports:\n");
+ for (int i = 0; i < num_devs; i++)
+ {
+ pmInfo = Pm_GetDeviceInfo(i);
+
+ if (pmInfo->output)
+ {
+ printf("%s %s\n", pmInfo->name, (i == Pm_GetDefaultOutputDeviceID()) ? "(default)" : "");
+ }
+ }
+ #else
+ printf("\nMIDI is not supported in this build\n");
+ #endif
+}
+
+osd_midi_device *osd_open_midi_input(const char *devname)
+{
+ return NULL;
+}
+
+osd_midi_device *osd_open_midi_output(const char *devname)
+{
+ return NULL;
+}
+
+void osd_close_midi_channel(osd_midi_device *dev)
+{
+}
+
+void osd_init_midi(void)
+{
+ #ifndef DISABLE_MIDI
+ Pm_Initialize();
+ #endif
+}
+
+void osd_shutdown_midi(void)
+{
+ #ifndef DISABLE_MIDI
+ Pm_Terminate();
+ #endif
+}