Commit 04206f10 authored by Stéphane LETZ's avatar Stéphane LETZ
Browse files

Implement new JackPortIsActive flag for ports, ports have this status between...

Implement new JackPortIsActive flag for ports, ports have this status between client "activate" and "deactivate".
parent c08931ef
......@@ -101,7 +101,6 @@ int JackAudioDriver::Attach()
jack_port_id_t port_index;
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;
int i;
jack_log("JackAudioDriver::Attach fBufferSize = %ld fSampleRate = %ld", fEngineControl->fBufferSize, fEngineControl->fSampleRate);
......@@ -109,7 +108,7 @@ int JackAudioDriver::Attach()
for (i = 0; i < fCaptureChannels; i++) {
snprintf(alias, sizeof(alias) - 1, "%s:%s:out%d", fAliasName, fCaptureDriverName, i + 1);
snprintf(name, sizeof(name) - 1, "%s:capture_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, CaptureDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", name);
return -1;
}
......@@ -120,12 +119,10 @@ int JackAudioDriver::Attach()
jack_log("JackAudioDriver::Attach fCapturePortList[i] port_index = %ld", port_index);
}
port_flags = JackPortIsInput | JackPortIsPhysical | JackPortIsTerminal;
for (i = 0; i < fPlaybackChannels; i++) {
snprintf(alias, sizeof(alias) - 1, "%s:%s:in%d", fAliasName, fPlaybackDriverName, i + 1);
snprintf(name, sizeof(name) - 1, "%s:playback_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, PlaybackDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", name);
return -1;
}
......
......@@ -109,6 +109,10 @@ class SERVER_EXPORT JackDriverClientInterface : public JackDriverInterface, publ
/*!
\brief The base class for drivers.
*/
#define CaptureDriverFlags static_cast<JackPortFlags>(JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal | JackPortIsActive)
#define PlaybackDriverFlags static_cast<JackPortFlags>(JackPortIsInput | JackPortIsPhysical | JackPortIsTerminal | JackPortIsActive)
#define MonitorDriverFlags static_cast<JackPortFlags>(JackPortIsOutput | JackPortIsActive)
class SERVER_EXPORT JackDriver : public JackDriverClientInterface
{
......
......@@ -669,11 +669,13 @@ int JackEngine::ClientActivate(int refnum, bool is_real_time)
fGraphManager->GetInputPorts(refnum, ports);
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) {
fGraphManager->ActivatePort(ports[i]);
NotifyPortRegistation(ports[i], true);
}
fGraphManager->GetOutputPorts(refnum, ports);
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) {
fGraphManager->ActivatePort(ports[i]);
NotifyPortRegistation(ports[i], true);
}
......@@ -699,12 +701,14 @@ int JackEngine::ClientDeactivate(int refnum)
fGraphManager->GetInputPorts(refnum, ports);
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) {
PortDisconnect(refnum, ports[i], ALL_PORTS);
fGraphManager->DeactivatePort(ports[i]);
NotifyPortRegistation(ports[i], false);
}
fGraphManager->GetOutputPorts(refnum, ports);
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) {
PortDisconnect(refnum, ports[i], ALL_PORTS);
fGraphManager->DeactivatePort(ports[i]);
NotifyPortRegistation(ports[i], false);
}
......
......@@ -376,6 +376,18 @@ int JackGraphManager::ReleasePort(int refnum, jack_port_id_t port_index)
return res;
}
void JackGraphManager::ActivatePort(jack_port_id_t port_index)
{
JackPort* port = GetPort(port_index);
port->fFlags = (JackPortFlags)(port->fFlags | JackPortIsActive);
}
void JackGraphManager::DeactivatePort(jack_port_id_t port_index)
{
JackPort* port = GetPort(port_index);
port->fFlags = (JackPortFlags)(port->fFlags | ~JackPortIsActive);
}
void JackGraphManager::GetInputPorts(int refnum, jack_int_t* res)
{
JackConnectionManager* manager = WriteNextStateStart();
......
......@@ -65,6 +65,8 @@ class SERVER_EXPORT JackGraphManager : public JackShmMem, public JackAtomicState
// Ports management
jack_port_id_t AllocatePort(int refnum, const char* port_name, const char* port_type, JackPortFlags flags, jack_nframes_t buffer_size);
int ReleasePort(int refnum, jack_port_id_t port_index);
void ActivatePort(jack_port_id_t port_index);
void DeactivatePort(jack_port_id_t port_index);
void GetInputPorts(int refnum, jack_int_t* res);
void GetOutputPorts(int refnum, jack_int_t* res);
void RemoveAllPorts(int refnum);
......@@ -75,7 +77,7 @@ class SERVER_EXPORT JackGraphManager : public JackShmMem, public JackAtomicState
int ComputeTotalLatency(jack_port_id_t port_index);
int ComputeTotalLatencies();
int RequestMonitor(jack_port_id_t port_index, bool onoff);
// Connections management
int Connect(jack_port_id_t src_index, jack_port_id_t dst_index);
int Disconnect(jack_port_id_t src_index, jack_port_id_t dst_index);
......
......@@ -74,7 +74,6 @@ int JackMidiDriver::Attach()
jack_port_id_t port_index;
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;
int i;
jack_log("JackMidiDriver::Attach fBufferSize = %ld fSampleRate = %ld", fEngineControl->fBufferSize, fEngineControl->fSampleRate);
......@@ -82,7 +81,7 @@ int JackMidiDriver::Attach()
for (i = 0; i < fCaptureChannels; i++) {
snprintf(alias, sizeof(alias) - 1, "%s:%s:out%d", fAliasName, fCaptureDriverName, i + 1);
snprintf(name, sizeof(name) - 1, "%s:capture_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, CaptureDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", name);
return -1;
}
......@@ -92,12 +91,10 @@ int JackMidiDriver::Attach()
jack_log("JackMidiDriver::Attach fCapturePortList[i] port_index = %ld", port_index);
}
port_flags = JackPortIsInput | JackPortIsPhysical | JackPortIsTerminal;
for (i = 0; i < fPlaybackChannels; i++) {
snprintf(alias, sizeof(alias) - 1, "%s:%s:in%d", fAliasName, fPlaybackDriverName, i + 1);
snprintf(name, sizeof(name) - 1, "%s:playback_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, PlaybackDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", name);
return -1;
}
......
......@@ -140,19 +140,15 @@ namespace Jack
jack_port_id_t port_id;
char buf[64];
unsigned int chn;
int port_flags;
//if (netj.handle_transport_sync)
// jack_set_sync_callback(netj.client, (JackSyncCallback) net_driver_sync_cb, NULL);
port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;
for (chn = 0; chn < netj.capture_channels_audio; chn++) {
snprintf (buf, sizeof(buf) - 1, "system:capture_%u", chn + 1);
if ( ( port_id = fGraphManager->AllocatePort ( fClientControl.fRefNum, buf, JACK_DEFAULT_AUDIO_TYPE,
static_cast<JackPortFlags> ( port_flags ), fEngineControl->fBufferSize ) ) == NO_PORT )
CaptureDriverFlags, fEngineControl->fBufferSize ) ) == NO_PORT )
{
jack_error ( "driver: cannot register port for %s", buf );
return -1;
......@@ -186,7 +182,7 @@ namespace Jack
snprintf (buf, sizeof(buf) - 1, "system:capture_%u", chn + 1);
if ( ( port_id = fGraphManager->AllocatePort ( fClientControl.fRefNum, buf, JACK_DEFAULT_MIDI_TYPE,
static_cast<JackPortFlags> ( port_flags ), fEngineControl->fBufferSize ) ) == NO_PORT )
CaptureDriverFlags, fEngineControl->fBufferSize ) ) == NO_PORT )
{
jack_error ( "driver: cannot register port for %s", buf );
return -1;
......@@ -197,13 +193,11 @@ namespace Jack
jack_slist_append (netj.capture_ports, (void *)(intptr_t)port_id);
}
port_flags = JackPortIsInput | JackPortIsPhysical | JackPortIsTerminal;
for (chn = 0; chn < netj.playback_channels_audio; chn++) {
snprintf (buf, sizeof(buf) - 1, "system:playback_%u", chn + 1);
if ( ( port_id = fGraphManager->AllocatePort ( fClientControl.fRefNum, buf, JACK_DEFAULT_AUDIO_TYPE,
static_cast<JackPortFlags> ( port_flags ), fEngineControl->fBufferSize ) ) == NO_PORT )
PlaybackDriverFlags, fEngineControl->fBufferSize ) ) == NO_PORT )
{
jack_error ( "driver: cannot register port for %s", buf );
return -1;
......@@ -233,7 +227,7 @@ namespace Jack
snprintf (buf, sizeof(buf) - 1, "system:playback_%u", chn + 1);
if ( ( port_id = fGraphManager->AllocatePort ( fClientControl.fRefNum, buf, JACK_DEFAULT_MIDI_TYPE,
static_cast<JackPortFlags> ( port_flags ), fEngineControl->fBufferSize ) ) == NO_PORT )
PlaybackDriverFlags, fEngineControl->fBufferSize ) ) == NO_PORT )
{
jack_error ( "driver: cannot register port for %s", buf );
return -1;
......
......@@ -295,7 +295,15 @@ enum JackPortFlags {
* systems are examples of clients that would set this flag for
* their ports.
*/
JackPortIsTerminal = 0x10
JackPortIsTerminal = 0x10,
/**
* JackPortIsActive means the port has been registered and the
* client is "active", that is jack_activate has been called
*
* JackPortIsActive is on between jack_activate and jack_deactivate.
*/
JackPortIsActive = 0x20
};
/**
......
......@@ -208,6 +208,12 @@ main (int argc, char *argv[])
if (flags & JackPortIsTerminal) {
fputs ("terminal,", stdout);
}
if (flags & JackPortIsActive) {
fputs ("active,", stdout);
} else {
fputs ("non-active,", stdout);
}
putc ('\n', stdout);
}
}
......
......@@ -2083,7 +2083,7 @@ int JackAlsaDriver::Attach()
assert(fCaptureChannels < DRIVER_PORT_NUM);
assert(fPlaybackChannels < DRIVER_PORT_NUM);
port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;
port_flags = (unsigned long)CaptureDriverFlags;
alsa_driver_t* alsa_driver = (alsa_driver_t*)fDriver;
......@@ -2110,7 +2110,7 @@ int JackAlsaDriver::Attach()
jack_log("JackAudioDriver::Attach fCapturePortList[i] %ld ", port_index);
}
port_flags = JackPortIsInput | JackPortIsPhysical | JackPortIsTerminal;
port_flags = (unsigned long)PlaybackDriverFlags;
for (int i = 0; i < fPlaybackChannels; i++) {
snprintf(alias, sizeof(alias) - 1, "%s:playback_%u", fAliasName, i + 1);
......@@ -2131,7 +2131,7 @@ int JackAlsaDriver::Attach()
if (fWithMonitorPorts) {
jack_log("Create monitor port ");
snprintf(name, sizeof(name) - 1, "%s:monitor_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, MonitorDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error ("ALSA: cannot register monitor port for %s", name);
} else {
port = fGraphManager->GetPort(port_index);
......
......@@ -432,7 +432,7 @@ inline int midi_port_open_jack(alsa_rawmidi_t *midi, midi_port_t *port, int type
snprintf(name, sizeof(name) - 1, "system:midi_playback_%d", ++midi->midi_out_cnt);
port->jack = jack_port_register(midi->client, name, JACK_DEFAULT_MIDI_TYPE,
type | JackPortIsPhysical|JackPortIsTerminal, 0);
type | JackPortIsPhysical | JackPortIsTerminal | JackPortIsActive, 0);
if (port->jack)
jack_port_set_alias(port->jack, alias);
......
......@@ -488,7 +488,7 @@ port_t* port_create(alsa_seqmidi_t *self, int type, snd_seq_addr_t addr, const s
/* mark anything that looks like a hardware port as physical&terminal */
if (snd_seq_port_info_get_type (info) & (SND_SEQ_PORT_TYPE_HARDWARE|SND_SEQ_PORT_TYPE_PORT|SND_SEQ_PORT_TYPE_SPECIFIC)) {
jack_caps |= (JackPortIsPhysical|JackPortIsTerminal);
jack_caps |= (JackPortIsPhysical | JackPortIsTerminal | JackPortIsActive);
}
if (jack_caps & JackPortIsOutput)
......
......@@ -354,8 +354,6 @@ int JackFFADODriver::Attach()
{
JackPort* port;
int port_index;
unsigned long port_flags;
char buf[JACK_PORT_NAME_SIZE];
char portname[JACK_PORT_NAME_SIZE];
......@@ -413,8 +411,6 @@ int JackFFADODriver::Attach()
/* ports */
// capture
port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;
driver->capture_nchannels = ffado_streaming_get_nb_capture_streams(driver->dev);
driver->capture_channels = (ffado_capture_channel_t *)calloc(driver->capture_nchannels, sizeof(ffado_capture_channel_t));
if (driver->capture_channels == NULL) {
......@@ -432,7 +428,7 @@ int JackFFADODriver::Attach()
printMessage ("Registering audio capture port %s", buf);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, buf,
JACK_DEFAULT_AUDIO_TYPE,
(JackPortFlags)port_flags,
CaptureDriverFlags,
fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", buf);
return -1;
......@@ -455,7 +451,7 @@ int JackFFADODriver::Attach()
printMessage ("Registering midi capture port %s", buf);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, buf,
JACK_DEFAULT_MIDI_TYPE,
(JackPortFlags)port_flags,
CaptureDriverFlags,
fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", buf);
return -1;
......@@ -484,8 +480,6 @@ int JackFFADODriver::Attach()
}
// playback
port_flags = JackPortIsInput | JackPortIsPhysical | JackPortIsTerminal;
driver->playback_nchannels = ffado_streaming_get_nb_playback_streams(driver->dev);
driver->playback_channels = (ffado_playback_channel_t *)calloc(driver->playback_nchannels, sizeof(ffado_playback_channel_t));
if (driver->playback_channels == NULL) {
......@@ -504,7 +498,7 @@ int JackFFADODriver::Attach()
printMessage ("Registering audio playback port %s", buf);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, buf,
JACK_DEFAULT_AUDIO_TYPE,
(JackPortFlags)port_flags,
PlaybackDriverFlags,
fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", buf);
return -1;
......@@ -529,7 +523,7 @@ int JackFFADODriver::Attach()
printMessage ("Registering midi playback port %s", buf);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, buf,
JACK_DEFAULT_MIDI_TYPE,
(JackPortFlags)port_flags,
PlaybackDriverFlags
fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", buf);
return -1;
......
......@@ -667,8 +667,7 @@ int JackFreebobDriver::Attach()
{
JackPort* port;
int port_index;
unsigned long port_flags;
char buf[JACK_PORT_NAME_SIZE];
char portname[JACK_PORT_NAME_SIZE];
......@@ -717,8 +716,6 @@ int JackFreebobDriver::Attach()
/* ports */
// capture
port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;
driver->capture_nchannels = freebob_streaming_get_nb_capture_streams(driver->dev);
driver->capture_nchannels_audio = 0;
......@@ -734,7 +731,7 @@ int JackFreebobDriver::Attach()
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, buf,
JACK_DEFAULT_AUDIO_TYPE,
(JackPortFlags)port_flags,
CaptureDriverFlags,
fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", buf);
return -1;
......@@ -748,8 +745,6 @@ int JackFreebobDriver::Attach()
}
// playback
port_flags = JackPortIsInput | JackPortIsPhysical | JackPortIsTerminal;
driver->playback_nchannels = freebob_streaming_get_nb_playback_streams(driver->dev);
driver->playback_nchannels_audio = 0;
......@@ -764,7 +759,7 @@ int JackFreebobDriver::Attach()
printMessage ("Registering playback port %s", buf);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, buf,
JACK_DEFAULT_AUDIO_TYPE,
(JackPortFlags)port_flags,
PlaybackDriverFlags,
fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", buf);
return -1;
......
......@@ -1562,8 +1562,7 @@ int JackCoreAudioDriver::Attach()
char channel_name[64];
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;
jack_log("JackCoreAudioDriver::Attach fBufferSize %ld fSampleRate %ld", fEngineControl->fBufferSize, fEngineControl->fSampleRate);
for (int i = 0; i < fCaptureChannels; i++) {
......@@ -1582,7 +1581,7 @@ int JackCoreAudioDriver::Attach()
snprintf(name, sizeof(name) - 1, "%s:capture_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, CaptureDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("Cannot register port for %s", name);
return -1;
}
......@@ -1603,8 +1602,6 @@ int JackCoreAudioDriver::Attach()
fCapturePortList[i] = port_index;
}
port_flags = JackPortIsInput | JackPortIsPhysical | JackPortIsTerminal;
for (int i = 0; i < fPlaybackChannels; i++) {
err = AudioDeviceGetPropertyInfo(fDeviceID, i + 1, false, kAudioDevicePropertyChannelName, &size, &isWritable);
......@@ -1621,7 +1618,7 @@ int JackCoreAudioDriver::Attach()
snprintf(name, sizeof(name) - 1, "%s:playback_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, PlaybackDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("Cannot register port for %s", name);
return -1;
}
......@@ -1646,7 +1643,7 @@ int JackCoreAudioDriver::Attach()
if (fWithMonitorPorts) {
jack_log("Create monitor port ");
snprintf(name, sizeof(name) - 1, "%s:monitor_%u", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_AUDIO_TYPE, MonitorDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("Cannot register monitor port for %s", name);
return -1;
} else {
......
......@@ -222,7 +222,6 @@ int JackCoreMidiDriver::Attach()
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char endpoint_name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;
int i;
jack_log("JackCoreMidiDriver::Attach fBufferSize = %ld fSampleRate = %ld", fEngineControl->fBufferSize, fEngineControl->fSampleRate);
......@@ -239,7 +238,7 @@ int JackCoreMidiDriver::Attach()
}
snprintf(name, sizeof(name) - 1, "%s:capture_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, CaptureDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", name);
return -1;
}
......@@ -249,8 +248,6 @@ int JackCoreMidiDriver::Attach()
jack_log("JackCoreMidiDriver::Attach fCapturePortList[i] port_index = %ld", port_index);
}
port_flags = JackPortIsInput | JackPortIsPhysical | JackPortIsTerminal;
for (i = 0; i < fPlaybackChannels; i++) {
err = MIDIObjectGetStringProperty(fMidiSource[i], kMIDIPropertyName, &pname);
......@@ -263,7 +260,7 @@ int JackCoreMidiDriver::Attach()
}
snprintf(name, sizeof(name) - 1, "%s:playback_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, PlaybackDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", name);
return -1;
}
......
......@@ -289,7 +289,6 @@ int JackWinMMEDriver::Attach()
jack_port_id_t port_index;
char name[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
char alias[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;
MMRESULT res;
int i;
......@@ -305,7 +304,7 @@ int JackWinMMEDriver::Attach()
}
snprintf(name, sizeof(name) - 1, "%s:capture_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, CaptureDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", name);
return -1;
}
......@@ -315,8 +314,6 @@ int JackWinMMEDriver::Attach()
jack_log("JackMidiDriver::Attach fCapturePortList[i] port_index = %ld", port_index);
}
port_flags = JackPortIsInput | JackPortIsPhysical | JackPortIsTerminal;
for (i = 0; i < fPlaybackChannels; i++) {
MIDIOUTCAPS caps;
res = midiOutGetDevCaps(fMidiSource[i].fIndex, &caps, sizeof(caps));
......@@ -327,7 +324,7 @@ int JackWinMMEDriver::Attach()
}
snprintf(name, sizeof(name) - 1, "%s:playback_%d", fClientControl.fName, i + 1);
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, (JackPortFlags)port_flags, fEngineControl->fBufferSize)) == NO_PORT) {
if ((port_index = fGraphManager->AllocatePort(fClientControl.fRefNum, name, JACK_DEFAULT_MIDI_TYPE, PlaybackDriverFlags, fEngineControl->fBufferSize)) == NO_PORT) {
jack_error("driver: cannot register port for %s", name);
return -1;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment