mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 12:16:30 +01:00
remove compile errors (still will not link and JACKPortEngine is not close to done)
This commit is contained in:
parent
5e0c6af406
commit
fbfa0acebe
20 changed files with 78 additions and 51 deletions
|
|
@ -1049,16 +1049,16 @@ ARDOUR_UI::update_sample_rate (framecnt_t)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
framecnt_t rate = engine->frame_rate();
|
framecnt_t rate = engine->sample_rate();
|
||||||
|
|
||||||
if (fmod (rate, 1000.0) != 0.0) {
|
if (fmod (rate, 1000.0) != 0.0) {
|
||||||
snprintf (buf, sizeof (buf), _("JACK: <span foreground=\"green\">%.1f kHz / %4.1f ms</span>"),
|
snprintf (buf, sizeof (buf), _("JACK: <span foreground=\"green\">%.1f kHz / %4.1f ms</span>"),
|
||||||
(float) rate/1000.0f,
|
(float) rate / 1000.0f,
|
||||||
(engine->frames_per_cycle() / (float) rate) * 1000.0f);
|
(engine->usecs_per_cycle() / 1000.0f));
|
||||||
} else {
|
} else {
|
||||||
snprintf (buf, sizeof (buf), _("JACK: <span foreground=\"green\">%" PRId64 " kHz / %4.1f ms</span>"),
|
snprintf (buf, sizeof (buf), _("JACK: <span foreground=\"green\">%" PRId64 " kHz / %4.1f ms</span>"),
|
||||||
rate/1000,
|
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;
|
Glib::RefPtr<Action> action;
|
||||||
const char* action_name = 0;
|
const char* action_name = 0;
|
||||||
|
|
||||||
switch (engine->frames_per_cycle()) {
|
switch (engine->samples_per_cycle()) {
|
||||||
case 32:
|
case 32:
|
||||||
action_name = X_("JACKLatency32");
|
action_name = X_("JACKLatency32");
|
||||||
break;
|
break;
|
||||||
|
|
@ -3817,7 +3817,7 @@ void
|
||||||
ARDOUR_UI::disconnect_from_jack ()
|
ARDOUR_UI::disconnect_from_jack ()
|
||||||
{
|
{
|
||||||
if (engine) {
|
if (engine) {
|
||||||
if (engine->disconnect_from_jack ()) {
|
if (engine->pause ()) {
|
||||||
MessageDialog msg (*editor, _("Could not disconnect from JACK"));
|
MessageDialog msg (*editor, _("Could not disconnect from JACK"));
|
||||||
msg.run ();
|
msg.run ();
|
||||||
}
|
}
|
||||||
|
|
@ -3830,7 +3830,7 @@ void
|
||||||
ARDOUR_UI::reconnect_to_jack ()
|
ARDOUR_UI::reconnect_to_jack ()
|
||||||
{
|
{
|
||||||
if (engine) {
|
if (engine) {
|
||||||
if (engine->reconnect_to_jack ()) {
|
if (engine->start ()) {
|
||||||
MessageDialog msg (*editor, _("Could not reconnect to JACK"));
|
MessageDialog msg (*editor, _("Could not reconnect to JACK"));
|
||||||
msg.run ();
|
msg.run ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -861,7 +861,7 @@ GainMeterBase::update_meters()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GainMeterBase::color_handler(bool dpi)
|
void GainMeterBase::color_handler(bool /*dpi*/)
|
||||||
{
|
{
|
||||||
setup_meters();
|
setup_meters();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,9 @@ GlobalPortMatrix::set_state (BundleChannel c[2], bool s)
|
||||||
} else {
|
} else {
|
||||||
/* two non-Ardour ports */
|
/* two non-Ardour ports */
|
||||||
if (s) {
|
if (s) {
|
||||||
jack_connect (_session->engine().jack (), j->c_str(), i->c_str());
|
AudioEngine::instance()->connect (*j, *i);
|
||||||
} else {
|
} 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 i = in_ports.begin(); i != in_ports.end(); ++i) {
|
||||||
for (Bundle::PortList::const_iterator j = out_ports.begin(); j != out_ports.end(); ++j) {
|
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> p = AudioEngine::instance()->get_port_by_name (*i);
|
||||||
boost::shared_ptr<Port> q = _session->engine().get_port_by_name (*j);
|
boost::shared_ptr<Port> q = AudioEngine::instance()->get_port_by_name (*j);
|
||||||
|
|
||||||
if (!p && !q) {
|
if (!p && !q) {
|
||||||
/* two non-Ardour ports; things are slightly more involved */
|
/* two non-Ardour ports; things are slightly more involved */
|
||||||
/* XXX: is this the easiest way to do this? */
|
/* XXX: is this the easiest way to do this? */
|
||||||
/* XXX: isn't this very inefficient? */
|
/* XXX: isn't this very inefficient? */
|
||||||
|
|
||||||
jack_client_t* jack = _session->engine().jack ();
|
PortEngine::PortHandle ph = AudioEngine::instance()->port_engine().get_port_by_name (*i);
|
||||||
jack_port_t* jp = jack_port_by_name (jack, i->c_str());
|
if (!ph) {
|
||||||
if (jp == 0) {
|
|
||||||
return PortMatrixNode::NOT_ASSOCIATED;
|
return PortMatrixNode::NOT_ASSOCIATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
char const ** c = jack_port_get_all_connections (jack, jp);
|
if (AudioEngine::instance()->port_engine().connected (ph)) {
|
||||||
|
return PortMatrixNode::ASSOCIATED;
|
||||||
char const ** p = c;
|
|
||||||
|
|
||||||
while (p && *p != 0) {
|
|
||||||
if (strcmp (*p, j->c_str()) == 0) {
|
|
||||||
free (c);
|
|
||||||
return PortMatrixNode::ASSOCIATED;
|
|
||||||
}
|
|
||||||
++p;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free (c);
|
|
||||||
return PortMatrixNode::NOT_ASSOCIATED;
|
return PortMatrixNode::NOT_ASSOCIATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
/* 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);
|
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()));
|
PROGRAM_NAME, AudioEngine::instance()->current_backend_name()));
|
||||||
msg->present ();
|
msg.present ();
|
||||||
}
|
}
|
||||||
return false; /* do not call again */
|
return false; /* do not call again */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ NSM_Client::command_open(const char* name,
|
||||||
int r = ERR_OK;
|
int r = ERR_OK;
|
||||||
|
|
||||||
ARDOUR_COMMAND_LINE::session_name = name;
|
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, "")) {
|
if (ARDOUR_UI::instance()->get_session_parameters(true, false, "")) {
|
||||||
return ERR_GENERAL;
|
return ERR_GENERAL;
|
||||||
|
|
|
||||||
|
|
@ -500,11 +500,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
|
||||||
lpnc += ':';
|
lpnc += ':';
|
||||||
|
|
||||||
const char ** ports = 0;
|
const char ** ports = 0;
|
||||||
if (type == DataType::NIL) {
|
ports = AudioEngine::instance()->get_ports ("", type, inputs ? IsInput : IsOutput);
|
||||||
ports = session->engine().get_ports ("", "", inputs ? JackPortIsInput : JackPortIsOutput);
|
|
||||||
} else {
|
|
||||||
ports = session->engine().get_ports ("", type.to_jack_type(), inputs ? JackPortIsInput : JackPortIsOutput);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ports) {
|
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 */
|
/* 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());
|
PortEngine::PortHandle ph = AudioEngine::instance()->port_engine().get_port_by_name (p);
|
||||||
if (jp) {
|
if (ph) {
|
||||||
DataType t (jack_port_type (jp));
|
DataType t (AudioEngine::instance()->port_engine().port_data_type (ph));
|
||||||
if (t != DataType::NIL) {
|
if (t != DataType::NIL) {
|
||||||
if (port_has_prefix (p, N_("system:")) ||
|
if (port_has_prefix (p, N_("system:")) ||
|
||||||
port_has_prefix (p, N_("alsa_pcm")) ||
|
port_has_prefix (p, N_("alsa_pcm")) ||
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ PortInsertUI::PortInsertUI (Gtk::Window* parent, ARDOUR::Session* sess, boost::s
|
||||||
void
|
void
|
||||||
PortInsertUI::update_latency_display ()
|
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) {
|
if (sample_rate == 0) {
|
||||||
latency_display.set_text (_("Disconnected from audio engine"));
|
latency_display.set_text (_("Disconnected from audio engine"));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -93,7 +93,7 @@ PortInsertUI::check_latency_measurement ()
|
||||||
}
|
}
|
||||||
|
|
||||||
char buf[128];
|
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) {
|
if (sample_rate == 0) {
|
||||||
latency_display.set_text (_("Disconnected from audio engine"));
|
latency_display.set_text (_("Disconnected from audio engine"));
|
||||||
|
|
|
||||||
|
|
@ -1460,8 +1460,8 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
/* no JACK monitoring on CoreAudio */
|
/* no JACK monitoring on CoreAudio */
|
||||||
if (AudioEngine::instance()->can_request_hardware_monitoring()) {
|
if (AudioEngine::instance()->port_engine().can_monitor_input()) {
|
||||||
mm->add (HardwareMonitoring, _("JACK"));
|
mm->add (HardwareMonitoring, _("via Audio Driver"));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
mm->add (SoftwareMonitoring, _("ardour"));
|
mm->add (SoftwareMonitoring, _("ardour"));
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ RouteParams_UI::cleanup_latency_frame ()
|
||||||
void
|
void
|
||||||
RouteParams_UI::setup_latency_frame ()
|
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];
|
char buf[128];
|
||||||
snprintf (buf, sizeof (buf), _("Playback delay: %" PRId64 " samples"), _route->initial_delay());
|
snprintf (buf, sizeof (buf), _("Playback delay: %" PRId64 " samples"), _route->initial_delay());
|
||||||
|
|
|
||||||
|
|
@ -1692,7 +1692,7 @@ RouteUI::map_frozen ()
|
||||||
void
|
void
|
||||||
RouteUI::adjust_latency ()
|
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
|
void
|
||||||
|
|
|
||||||
|
|
@ -392,7 +392,7 @@ TranscodeFfmpeg::encode (std::string outfile, std::string inf_a, std::string inf
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
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 (!probeok) return false;
|
||||||
if (stream >= m_audio.size()) return false;
|
if (stream >= m_audio.size()) return false;
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ emulate_key_event (Gtk::Widget* w, unsigned int keyval)
|
||||||
ev.state = 0;
|
ev.state = 0;
|
||||||
ev.keyval = keyval;
|
ev.keyval = keyval;
|
||||||
ev.length = 0;
|
ev.length = 0;
|
||||||
ev.string = (gchar*) "";
|
ev.string = (const gchar*) "";
|
||||||
ev.hardware_keycode = keymapkey[0].keycode;
|
ev.hardware_keycode = keymapkey[0].keycode;
|
||||||
ev.group = keymapkey[0].group;
|
ev.group = keymapkey[0].group;
|
||||||
g_free(keymapkey);
|
g_free(keymapkey);
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,7 @@ ProxyBase::hide ()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ProxyBase::handle_win_event (GdkEventAny *ev)
|
ProxyBase::handle_win_event (GdkEventAny* /*ev*/)
|
||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ public:
|
||||||
bool get_sync_offset (pframes_t& offset) const;
|
bool get_sync_offset (pframes_t& offset) const;
|
||||||
int create_process_thread (boost::function<void()> func, pthread_t*, size_t stacksize);
|
int create_process_thread (boost::function<void()> func, pthread_t*, size_t stacksize);
|
||||||
bool is_realtime() const;
|
bool is_realtime() const;
|
||||||
|
bool connected() const;
|
||||||
|
|
||||||
/* END BACKEND PROXY API */
|
/* END BACKEND PROXY API */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,8 @@ class PortEngine {
|
||||||
virtual std::string get_port_name (PortHandle) const = 0;
|
virtual std::string get_port_name (PortHandle) const = 0;
|
||||||
virtual PortHandle* get_port_by_name (const std::string&) 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_relative (const std::string& name) const = 0;
|
||||||
virtual std::string make_port_name_non_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;
|
virtual bool port_is_mine (const std::string& fullname) const = 0;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ class PortManager
|
||||||
int connect (const std::string& source, const std::string& destination);
|
int connect (const std::string& source, const std::string& destination);
|
||||||
int disconnect (const std::string& source, const std::string& destination);
|
int disconnect (const std::string& source, const std::string& destination);
|
||||||
int disconnect (boost::shared_ptr<Port>);
|
int disconnect (boost::shared_ptr<Port>);
|
||||||
bool connected (const std::string&);
|
bool has_connections (const std::string&);
|
||||||
int reestablish_ports ();
|
int reestablish_ports ();
|
||||||
int reconnect_ports ();
|
int reconnect_ports ();
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ class PortManager
|
||||||
void port_renamed (const std::string&, const std::string&);
|
void port_renamed (const std::string&, const std::string&);
|
||||||
ChanCount n_physical_outputs () const;
|
ChanCount n_physical_outputs () const;
|
||||||
ChanCount n_physical_inputs () 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 ();
|
void remove_all_ports ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -668,6 +668,16 @@ AudioEngine::is_realtime() const
|
||||||
return _backend->is_realtime();
|
return _backend->is_realtime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
AudioEngine::connected() const
|
||||||
|
{
|
||||||
|
if (!_backend) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _backend->connected();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioEngine::transport_start ()
|
AudioEngine::transport_start ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,7 @@ Bundle::connected_to_anything (AudioEngine& engine)
|
||||||
rather than doing it with Port.
|
rather than doing it with Port.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (engine.connected (ports[j])) {
|
if (engine.has_connections (ports[j])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,3 +98,17 @@ JACKPortEngine::physically_connected (PortHandle p)
|
||||||
|
|
||||||
return false;
|
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;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ AudioEngine::port_renamed (const std::string& old_relative_name, const std::stri
|
||||||
}
|
}
|
||||||
|
|
||||||
const char **
|
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);
|
GET_PRIVATE_JACK_POINTER_RET (_jack,0);
|
||||||
if (!_running) {
|
if (!_running) {
|
||||||
|
|
@ -274,7 +274,21 @@ AudioEngine::get_ports (const string& port_name_pattern, const string& type_name
|
||||||
return 0;
|
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
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue