- if (!physinputs.empty()) {
- uint32_t nphysical_in = physinputs.size();
-
- for (uint32_t x = 0; x < track->n_inputs().n_midi() && x < nphysical_in; ++x) {
-
- port = "";
-
- if (Config->get_input_auto_connect() & AutoConnectPhysical) {
- port = physinputs[(channels_used+x)%nphysical_in];
- }
-
- if (port.length() && track->input()->connect (track->input()->nth(x), port, this)) {
- break;
- }
- }
- }
-
- if (!physoutputs.empty()) {
- uint32_t nphysical_out = physoutputs.size();
-
- for (uint32_t x = 0; x < track->n_outputs().n_midi(); ++x) {
- port = "";
-
- if (Config->get_output_auto_connect() & AutoConnectPhysical) {
- port = physoutputs[(channels_used+x)%nphysical_out];
- } else if (Config->get_output_auto_connect() & AutoConnectMaster) {
- if (_master_out && _master_out->n_inputs().n_midi() > 0) {
- port = _master_out->input()->nth (x % _master_out->input()->n_ports().n_midi())->name();
- }
- }
-
- if (port.length() && track->output()->connect (track->output()->nth(x), port, this)) {
- break;
- }
- }
- }
-
- channels_used += track->n_inputs ().n_audio();
-
-
-
- /*
- if (nphysical_in) {
- for (uint32_t x = 0; x < track->n_inputs().n_midi() && x < nphysical_in; ++x) {
-
- port = "";
-
- if (Config->get_input_auto_connect() & AutoConnectPhysical) {
- port = physinputs[(channels_used+x)%nphysical_in];
- }
-
- if (port.length() && track->connect_input (track->input (x), port, this)) {
- break;
- }
- }
- }
-
- for (uint32_t x = 0; x < track->n_outputs().n_midi(); ++x) {
-
- port = "";
-
- if (nphysical_out && (Config->get_output_auto_connect() & AutoConnectPhysical)) {
- port = physoutputs[(channels_used+x)%nphysical_out];
- } else if (Config->get_output_auto_connect() & AutoConnectMaster) {
- if (_master_out) {
- port = _master_out->input (x%_master_out->n_inputs().n_midi())->name();
- }
- }
-
- if (port.length() && track->connect_output (track->output (x), port, this)) {
- break;
- }
- }
-
- channels_used += track->n_inputs ().n_midi();
-
- */