jack: Remove BROKEN_MULTI_DEVICE code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
diff --git a/src/audio/jack/SDL_jackaudio.c b/src/audio/jack/SDL_jackaudio.c
index 806e999..aa85388 100644
--- a/src/audio/jack/SDL_jackaudio.c
+++ b/src/audio/jack/SDL_jackaudio.c
@@ -32,17 +32,6 @@
#include "../../thread/SDL_systhread.h"
-/* !!! FIXME: my understanding is each JACK port is a _channel_ (like: stereo, mono...)
- !!! FIXME: and not a logical device. So we'll have to figure out:
- !!! FIXME: a) Can there be more than one device?
- !!! FIXME: b) If so, how do you decide what port goes to what?
- !!! FIXME: (code in BROKEN_MULTI_DEVICE blocks was written when I assumed
- !!! FIXME: enumerating ports meant listing separate devices. As such, it's
- !!! FIXME: incomplete, as I discovered this as I went along writing.
-*/
-#define BROKEN_MULTI_DEVICE 0 /* !!! FIXME */
-
-
static jack_client_t * (*JACK_jack_client_open) (const char *, jack_options_t, jack_status_t *, ...);
static int (*JACK_jack_client_close) (jack_client_t *);
static void (*JACK_jack_on_shutdown) (jack_client_t *, JackShutdownCallback, void *);
@@ -380,81 +369,6 @@ JACK_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
return 0;
}
-#if BROKEN_MULTI_DEVICE /* !!! FIXME */
-static void
-JackHotplugCallback(jack_port_id_t port_id, int register, void *arg)
-{
- JackPortFlags flags;
- jack_port_t *port = JACK_jack_port_by_id(JACK_client, port_id);
- SDL_bool iscapture;
- const char *name;
-
- if (!port) {
- return;
- }
-
- name = JACK_jack_port_name(port);
- if (!name) {
- return;
- }
-
- flags = JACK_jack_port_flags(port);
- if ((flags & JackPortIsPhysical) == 0) {
- return; /* not a physical device, don't care. */
- }
-
-
- if ((flags & JackPortIsInput|JackPortIsOutput) == 0) {
- return; /* no input OR output? Don't care...? */
- }
-
- /* make sure it's not both, I guess. */
- SDL_assert((flags & JackPortIsInput|JackPortIsOutput) != (JackPortIsInput|JackPortIsOutput));
-
- /* JACK uses "output" for capture devices (they output audio data to us)
- and "input" for playback (we input audio data to them) */
- iscapture = ((flags & JackPortIsOutput) != 0);
- if (register) {
- SDL_AddAudioDevice(iscapture, name, port);
- } else {
- SDL_RemoveAudioDevice(iscapture, port);
- }
-}
-
-static void
-JackEnumerateDevices(const SDL_bool iscapture)
-{
- const JackPortFlags flags = (iscapture ? JackPortIsOutput : JackPortIsInput);
- const char **ports = JACK_jack_get_ports(JACK_client, NULL, NULL,
- JackPortIsPhysical | flags);
- const char **i;
-
- if (!ports) {
- return;
- }
-
- for (i = ports; *i != NULL; i++) {
- jack_port_t *port = JACK_jack_port_by_name(JACK_client, *i);
- if (port != NULL) {
- SDL_AddAudioDevice(iscapture, *i, port);
- }
- }
-
- JACK_jack_free(ports);
-}
-
-static void
-JACK_DetectDevices()
-{
- JackEnumerateDevices(SDL_FALSE);
- JackEnumerateDevices(SDL_TRUE);
-
- /* make JACK fire this callback automatically from now on. */
- JACK_jack_set_port_registration_callback(JACK_client, JackHotplugCallback, NULL);
-}
-#endif /* BROKEN_MULTI_DEVICE */
-
-
static void
JACK_Deinitialize(void)
{
@@ -476,12 +390,8 @@ JACK_Init(SDL_AudioDriverImpl * impl)
/* Set the function pointers */
- #if BROKEN_MULTI_DEVICE /* !!! FIXME */
- impl->DetectDevices = JACK_DetectDevices;
- #else
impl->OnlyHasDefaultOutputDevice = SDL_TRUE;
// !!! FIXME impl->OnlyHasDefaultCaptureDevice = SDL_TRUE;
- #endif
impl->OpenDevice = JACK_OpenDevice;
impl->WaitDevice = JACK_WaitDevice;