summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-07-30 23:26:46 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-07-30 23:26:46 -0400
commitfbfa0acebe01e85629c415bec849ca36324c56b1 (patch)
treec2f607c09e66275d2d473cb7205d06650e83d5ec
parent5e0c6af4062a2982fb90ad318973ab1d4beed2b9 (diff)
remove compile errors (still will not link and JACKPortEngine is not close to done)
-rw-r--r--gtk2_ardour/ardour_ui.cc14
-rw-r--r--gtk2_ardour/gain_meter.cc2
-rw-r--r--gtk2_ardour/global_port_matrix.cc26
-rw-r--r--gtk2_ardour/main.cc4
-rw-r--r--gtk2_ardour/nsm.cc2
-rw-r--r--gtk2_ardour/port_group.cc12
-rw-r--r--gtk2_ardour/port_insert_ui.cc4
-rw-r--r--gtk2_ardour/rc_option_editor.cc4
-rw-r--r--gtk2_ardour/route_params_ui.cc2
-rw-r--r--gtk2_ardour/route_ui.cc2
-rw-r--r--gtk2_ardour/transcode_ffmpeg.cc2
-rw-r--r--gtk2_ardour/utils.cc2
-rw-r--r--gtk2_ardour/window_manager.cc2
-rw-r--r--libs/ardour/ardour/audioengine.h1
-rw-r--r--libs/ardour/ardour/port_engine.h2
-rw-r--r--libs/ardour/ardour/port_manager.h4
-rw-r--r--libs/ardour/audioengine.cc10
-rw-r--r--libs/ardour/bundle.cc2
-rw-r--r--libs/ardour/jack_portengine.cc14
-rw-r--r--libs/ardour/port_manager.cc18
20 files changed, 78 insertions, 51 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 155826492b..dc9018fc62 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -1049,16 +1049,16 @@ ARDOUR_UI::update_sample_rate (framecnt_t)
} else {
- framecnt_t rate = engine->frame_rate();
+ framecnt_t rate = engine->sample_rate();
if (fmod (rate, 1000.0) != 0.0) {
snprintf (buf, sizeof (buf), _("JACK: <span foreground=\"green\">%.1f kHz / %4.1f ms</span>"),
- (float) rate/1000.0f,
- (engine->frames_per_cycle() / (float) rate) * 1000.0f);
+ (float) rate / 1000.0f,
+ (engine->usecs_per_cycle() / 1000.0f));
} else {
snprintf (buf, sizeof (buf), _("JACK: <span foreground=\"green\">%" PRId64 " kHz / %4.1f ms</span>"),
rate/1000,
- (engine->frames_per_cycle() / (float) rate) * 1000.0f);
+ (engine->usecs_per_cycle() * 1000.0f));
}
}
@@ -2044,7 +2044,7 @@ ARDOUR_UI::engine_running ()
Glib::RefPtr<Action> action;
const char* action_name = 0;
- switch (engine->frames_per_cycle()) {
+ switch (engine->samples_per_cycle()) {
case 32:
action_name = X_("JACKLatency32");
break;
@@ -3817,7 +3817,7 @@ void
ARDOUR_UI::disconnect_from_jack ()
{
if (engine) {
- if (engine->disconnect_from_jack ()) {
+ if (engine->pause ()) {
MessageDialog msg (*editor, _("Could not disconnect from JACK"));
msg.run ();
}
@@ -3830,7 +3830,7 @@ void
ARDOUR_UI::reconnect_to_jack ()
{
if (engine) {
- if (engine->reconnect_to_jack ()) {
+ if (engine->start ()) {
MessageDialog msg (*editor, _("Could not reconnect to JACK"));
msg.run ();
}
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc
index f142f21641..489564ec63 100644
--- a/gtk2_ardour/gain_meter.cc
+++ b/gtk2_ardour/gain_meter.cc
@@ -861,7 +861,7 @@ GainMeterBase::update_meters()
}
}
-void GainMeterBase::color_handler(bool dpi)
+void GainMeterBase::color_handler(bool /*dpi*/)
{
setup_meters();
}
diff --git a/gtk2_ardour/global_port_matrix.cc b/gtk2_ardour/global_port_matrix.cc
index 8c1fde3082..cdba7f5c27 100644
--- a/gtk2_ardour/global_port_matrix.cc
+++ b/gtk2_ardour/global_port_matrix.cc
@@ -82,9 +82,9 @@ GlobalPortMatrix::set_state (BundleChannel c[2], bool s)
} else {
/* two non-Ardour ports */
if (s) {
- jack_connect (_session->engine().jack (), j->c_str(), i->c_str());
+ AudioEngine::instance()->connect (*j, *i);
} else {
- jack_disconnect (_session->engine().jack (), j->c_str(), i->c_str());
+ AudioEngine::instance()->disconnect (*j, *i);
}
}
}
@@ -113,33 +113,23 @@ GlobalPortMatrix::get_state (BundleChannel c[2]) const
for (Bundle::PortList::const_iterator i = in_ports.begin(); i != in_ports.end(); ++i) {
for (Bundle::PortList::const_iterator j = out_ports.begin(); j != out_ports.end(); ++j) {
- boost::shared_ptr<Port> p = _session->engine().get_port_by_name (*i);
- boost::shared_ptr<Port> q = _session->engine().get_port_by_name (*j);
+ boost::shared_ptr<Port> p = AudioEngine::instance()->get_port_by_name (*i);
+ boost::shared_ptr<Port> q = AudioEngine::instance()->get_port_by_name (*j);
if (!p && !q) {
/* two non-Ardour ports; things are slightly more involved */
/* XXX: is this the easiest way to do this? */
/* XXX: isn't this very inefficient? */
- jack_client_t* jack = _session->engine().jack ();
- jack_port_t* jp = jack_port_by_name (jack, i->c_str());
- if (jp == 0) {
+ PortEngine::PortHandle ph = AudioEngine::instance()->port_engine().get_port_by_name (*i);
+ if (!ph) {
return PortMatrixNode::NOT_ASSOCIATED;
}
- char const ** c = jack_port_get_all_connections (jack, jp);
-
- char const ** p = c;
-
- while (p && *p != 0) {
- if (strcmp (*p, j->c_str()) == 0) {
- free (c);
- return PortMatrixNode::ASSOCIATED;
- }
- ++p;
+ if (AudioEngine::instance()->port_engine().connected (ph)) {
+ return PortMatrixNode::ASSOCIATED;
}
- free (c);
return PortMatrixNode::NOT_ASSOCIATED;
}
diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc
index e5a7e8d580..e9b5da3e04 100644
--- a/gtk2_ardour/main.cc
+++ b/gtk2_ardour/main.cc
@@ -393,9 +393,9 @@ Click OK to exit %1."), PROGRAM_NAME, AudioEngine::instance()->current_backend_n
/* engine has already run, so this is a mid-session backend death */
MessageDialog msg (string_compose (_("The audio backend (%1) has failed, or terminated"), AudioEngine::instance()->current_backend_name()), false);
- msg->set_secondary_text (string_compose (_("%2 exited unexpectedly, and without notifying %1."),
+ msg.set_secondary_text (string_compose (_("%2 exited unexpectedly, and without notifying %1."),
PROGRAM_NAME, AudioEngine::instance()->current_backend_name()));
- msg->present ();
+ msg.present ();
}
return false; /* do not call again */
}
diff --git a/gtk2_ardour/nsm.cc b/gtk2_ardour/nsm.cc
index 18d88fec0a..e3ceba355f 100644
--- a/gtk2_ardour/nsm.cc
+++ b/gtk2_ardour/nsm.cc
@@ -50,7 +50,7 @@ NSM_Client::command_open(const char* name,
int r = ERR_OK;
ARDOUR_COMMAND_LINE::session_name = name;
- ARDOUR_COMMAND_LINE::jack_client_name = client_id;
+ ARDOUR_COMMAND_LINE::backend_client_name = client_id;
if (ARDOUR_UI::instance()->get_session_parameters(true, false, "")) {
return ERR_GENERAL;
diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc
index 925bebc307..24c603fa0a 100644
--- a/gtk2_ardour/port_group.cc
+++ b/gtk2_ardour/port_group.cc
@@ -500,11 +500,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
lpnc += ':';
const char ** ports = 0;
- if (type == DataType::NIL) {
- ports = session->engine().get_ports ("", "", inputs ? JackPortIsInput : JackPortIsOutput);
- } else {
- ports = session->engine().get_ports ("", type.to_jack_type(), inputs ? JackPortIsInput : JackPortIsOutput);
- }
+ ports = AudioEngine::instance()->get_ports ("", type, inputs ? IsInput : IsOutput);
if (ports) {
@@ -545,9 +541,9 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
/* 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));
+ PortEngine::PortHandle ph = AudioEngine::instance()->port_engine().get_port_by_name (p);
+ if (ph) {
+ DataType t (AudioEngine::instance()->port_engine().port_data_type (ph));
if (t != DataType::NIL) {
if (port_has_prefix (p, N_("system:")) ||
port_has_prefix (p, N_("alsa_pcm")) ||
diff --git a/gtk2_ardour/port_insert_ui.cc b/gtk2_ardour/port_insert_ui.cc
index 0511b357db..3c495f0e79 100644
--- a/gtk2_ardour/port_insert_ui.cc
+++ b/gtk2_ardour/port_insert_ui.cc
@@ -66,7 +66,7 @@ PortInsertUI::PortInsertUI (Gtk::Window* parent, ARDOUR::Session* sess, boost::s
void
PortInsertUI::update_latency_display ()
{
- framecnt_t const sample_rate = input_selector.session()->engine().frame_rate();
+ framecnt_t const sample_rate = AudioEngine::instance()->sample_rate();
if (sample_rate == 0) {
latency_display.set_text (_("Disconnected from audio engine"));
} else {
@@ -93,7 +93,7 @@ PortInsertUI::check_latency_measurement ()
}
char buf[128];
- framecnt_t const sample_rate = AudioEngine::instance()->frame_rate();
+ framecnt_t const sample_rate = AudioEngine::instance()->sample_rate();
if (sample_rate == 0) {
latency_display.set_text (_("Disconnected from audio engine"));
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 501d76262b..55d1e60101 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -1460,8 +1460,8 @@ RCOptionEditor::RCOptionEditor ()
#ifndef __APPLE__
/* no JACK monitoring on CoreAudio */
- if (AudioEngine::instance()->can_request_hardware_monitoring()) {
- mm->add (HardwareMonitoring, _("JACK"));
+ if (AudioEngine::instance()->port_engine().can_monitor_input()) {
+ mm->add (HardwareMonitoring, _("via Audio Driver"));
}
#endif
mm->add (SoftwareMonitoring, _("ardour"));
diff --git a/gtk2_ardour/route_params_ui.cc b/gtk2_ardour/route_params_ui.cc
index 87ccfde3ba..bd8edde448 100644
--- a/gtk2_ardour/route_params_ui.cc
+++ b/gtk2_ardour/route_params_ui.cc
@@ -276,7 +276,7 @@ RouteParams_UI::cleanup_latency_frame ()
void
RouteParams_UI::setup_latency_frame ()
{
- latency_widget = new LatencyGUI (*(_route->output()), _session->frame_rate(), _session->engine().frames_per_cycle());
+ latency_widget = new LatencyGUI (*(_route->output()), _session->frame_rate(), AudioEngine::instance()->samples_per_cycle());
char buf[128];
snprintf (buf, sizeof (buf), _("Playback delay: %" PRId64 " samples"), _route->initial_delay());
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index bbc60ef425..9e6bebfe0e 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -1692,7 +1692,7 @@ RouteUI::map_frozen ()
void
RouteUI::adjust_latency ()
{
- LatencyDialog dialog (_route->name() + _(" latency"), *(_route->output()), _session->frame_rate(), _session->engine().frames_per_cycle());
+ LatencyDialog dialog (_route->name() + _(" latency"), *(_route->output()), _session->frame_rate(), AudioEngine::instance()->samples_per_cycle());
}
void
diff --git a/gtk2_ardour/transcode_ffmpeg.cc b/gtk2_ardour/transcode_ffmpeg.cc
index 9e4aa39fa0..b35f843d15 100644
--- a/gtk2_ardour/transcode_ffmpeg.cc
+++ b/gtk2_ardour/transcode_ffmpeg.cc
@@ -392,7 +392,7 @@ TranscodeFfmpeg::encode (std::string outfile, std::string inf_a, std::string inf
}
bool
-TranscodeFfmpeg::extract_audio (std::string outfile, ARDOUR::framecnt_t samplerate, unsigned int stream)
+TranscodeFfmpeg::extract_audio (std::string outfile, ARDOUR::framecnt_t /*samplerate*/, unsigned int stream)
{
if (!probeok) return false;
if (stream >= m_audio.size()) return false;
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index d4bc460269..6c2330414d 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -348,7 +348,7 @@ emulate_key_event (Gtk::Widget* w, unsigned int keyval)
ev.state = 0;
ev.keyval = keyval;
ev.length = 0;
- ev.string = (gchar*) "";
+ ev.string = (const gchar*) "";
ev.hardware_keycode = keymapkey[0].keycode;
ev.group = keymapkey[0].group;
g_free(keymapkey);
diff --git a/gtk2_ardour/window_manager.cc b/gtk2_ardour/window_manager.cc
index 5fa1b6c7b0..3ab9e1adff 100644
--- a/gtk2_ardour/window_manager.cc
+++ b/gtk2_ardour/window_manager.cc
@@ -410,7 +410,7 @@ ProxyBase::hide ()
}
bool
-ProxyBase::handle_win_event (GdkEventAny *ev)
+ProxyBase::handle_win_event (GdkEventAny* /*ev*/)
{
hide();
return true;
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index 4ac9221238..db1f59d19f 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -105,6 +105,7 @@ public:
bool get_sync_offset (pframes_t& offset) const;
int create_process_thread (boost::function<void()> func, pthread_t*, size_t stacksize);
bool is_realtime() const;
+ bool connected() const;
/* END BACKEND PROXY API */
diff --git a/libs/ardour/ardour/port_engine.h b/libs/ardour/ardour/port_engine.h
index 8dc35ec8f5..3044426ff9 100644
--- a/libs/ardour/ardour/port_engine.h
+++ b/libs/ardour/ardour/port_engine.h
@@ -94,6 +94,8 @@ class PortEngine {
virtual std::string get_port_name (PortHandle) const = 0;
virtual PortHandle* get_port_by_name (const std::string&) const = 0;
+ DataType port_data_type (PortHandle) const;
+
virtual std::string make_port_name_relative (const std::string& name) const = 0;
virtual std::string make_port_name_non_relative (const std::string& name) const = 0;
virtual bool port_is_mine (const std::string& fullname) const = 0;
diff --git a/libs/ardour/ardour/port_manager.h b/libs/ardour/ardour/port_manager.h
index 29a566aa2d..38c8d8bf98 100644
--- a/libs/ardour/ardour/port_manager.h
+++ b/libs/ardour/ardour/port_manager.h
@@ -58,7 +58,7 @@ class PortManager
int connect (const std::string& source, const std::string& destination);
int disconnect (const std::string& source, const std::string& destination);
int disconnect (boost::shared_ptr<Port>);
- bool connected (const std::string&);
+ bool has_connections (const std::string&);
int reestablish_ports ();
int reconnect_ports ();
@@ -71,7 +71,7 @@ class PortManager
void port_renamed (const std::string&, const std::string&);
ChanCount n_physical_outputs () const;
ChanCount n_physical_inputs () const;
- const char ** get_ports (const std::string& port_name_pattern, const std::string& type_name_pattern, uint32_t flags);
+ const char ** get_ports (const std::string& port_name_pattern, DataType type, uint32_t flags);
void remove_all_ports ();
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index 1f26e12a3b..b24008cd4e 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -668,6 +668,16 @@ AudioEngine::is_realtime() const
return _backend->is_realtime();
}
+bool
+AudioEngine::connected() const
+{
+ if (!_backend) {
+ return false;
+ }
+
+ return _backend->connected();
+}
+
void
AudioEngine::transport_start ()
{
diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc
index 9d5640491f..162db6c793 100644
--- a/libs/ardour/bundle.cc
+++ b/libs/ardour/bundle.cc
@@ -459,7 +459,7 @@ Bundle::connected_to_anything (AudioEngine& engine)
rather than doing it with Port.
*/
- if (engine.connected (ports[j])) {
+ if (engine.has_connections (ports[j])) {
return true;
}
}
diff --git a/libs/ardour/jack_portengine.cc b/libs/ardour/jack_portengine.cc
index 99b0bd2b9a..b2534d47f5 100644
--- a/libs/ardour/jack_portengine.cc
+++ b/libs/ardour/jack_portengine.cc
@@ -98,3 +98,17 @@ JACKPortEngine::physically_connected (PortHandle p)
return false;
}
+
+DataType
+JACKPortEngine::port_data_type (PortHandle p)
+{
+ const char* t = jack_port_type (p);
+
+ if (strcmp (p, JACK_DEFAULT_AUDIO_TYPE) == 0) {
+ return DataType::AUDIO;
+ } else if (strcmp (p, JACK_DEFAULT_MIDI_TYPE) == 0) {
+ return DataType::MIDI;
+ }
+
+ return DataType::NIL;
+}
diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc
index 1a08849791..0c7f4b46e5 100644
--- a/libs/ardour/port_manager.cc
+++ b/libs/ardour/port_manager.cc
@@ -263,7 +263,7 @@ AudioEngine::port_renamed (const std::string& old_relative_name, const std::stri
}
const char **
-AudioEngine::get_ports (const string& port_name_pattern, const string& type_name_pattern, uint32_t flags)
+AudioEngine::get_ports (const string& port_name_pattern, DataType type, uint32_t flags)
{
GET_PRIVATE_JACK_POINTER_RET (_jack,0);
if (!_running) {
@@ -274,7 +274,21 @@ AudioEngine::get_ports (const string& port_name_pattern, const string& type_name
return 0;
}
}
- return jack_get_ports (_priv_jack, port_name_pattern.c_str(), type_name_pattern.c_str(), flags);
+
+ const char* jack_type_string;
+
+ switch (type) {
+ case DataType::AUDIO:
+ jack_type_string = JACK_DEFAULT_AUDIO_TYPE;
+ break;
+ case DataType::AUDIO:
+ jack_type_string = JACK_DEFAULT_MIDI_TYPE;
+ break;
+ case DataType::NIL
+ return 0;
+ }
+
+ return jack_get_ports (_priv_jack, port_name_pattern.c_str(), jack_type_string, flags);
}
void