- /* can't use the audio engine for this as we are looking at non-Ardour ports */
-
- jack_port_t* jp = jack_port_by_name (session->engine().jack(), p.c_str());
- if (jp) {
- DataType t (jack_port_type (jp));
- if (t != DataType::NIL) {
- if (port_has_prefix (p, N_("system:")) ||
- port_has_prefix (p, N_("alsa_pcm")) ||
- port_has_prefix (p, lpnc)) {
- extra_system[t].push_back (p);
- } else {
- extra_other[t].push_back (p);
+ /* can't use the audio engine for this as we
+ * are looking at ports not owned by the
+ * application, and the audio engine/port
+ * manager doesn't seem them.
+ */
+
+ PortEngine::PortHandle ph = AudioEngine::instance()->port_engine().get_port_by_name (p);
+
+ if (!ph) {
+ continue;
+ }
+
+ DataType t (AudioEngine::instance()->port_engine().port_data_type (ph));
+
+ if (t != DataType::NIL) {
+
+ if (port_has_prefix (p, X_("system:")) ||
+ port_has_prefix (p, X_("alsa_pcm:")) ||
+ port_has_prefix (p, X_("alsa_midi:"))) {
+ extra_system[t].push_back (p);
+
+ } else if (port_has_prefix (p, lpnc)) {
+
+ /* we own this port (named after the program) */
+
+ /* Hide scene ports from non-Tracks Live builds */
+ if (!ARDOUR::Profile->get_trx()) {
+ if (p.find (_("Scene ")) != string::npos) {
+ ++s;
+ continue;
+ }