mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 13:46:30 +01:00
Add BasicUI::make_port_name_non_relative()
Towards removing the direct use of Session by surfaces.
This commit is contained in:
parent
ece7d18baf
commit
36789f080c
12 changed files with 39 additions and 29 deletions
|
|
@ -105,13 +105,13 @@ CC121::CC121 (Session& s)
|
||||||
_input_bundle->add_channel (
|
_input_bundle->add_channel (
|
||||||
"",
|
"",
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (inp->name())
|
make_port_name_non_relative (inp->name())
|
||||||
);
|
);
|
||||||
|
|
||||||
_output_bundle->add_channel (
|
_output_bundle->add_channel (
|
||||||
"",
|
"",
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (outp->name())
|
make_port_name_non_relative (outp->name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -805,8 +805,8 @@ CC121::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boo
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_input_port)->name());
|
string ni = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_input_port)->name());
|
||||||
string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_output_port)->name());
|
string no = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_output_port)->name());
|
||||||
|
|
||||||
if (ni == name1 || ni == name2) {
|
if (ni == name1 || ni == name2) {
|
||||||
if (yn) {
|
if (yn) {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "temporal/tempo.h"
|
#include "temporal/tempo.h"
|
||||||
|
|
||||||
|
#include "ardour/audioengine.h"
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
#include "ardour/location.h"
|
#include "ardour/location.h"
|
||||||
#include "ardour/tempo.h"
|
#include "ardour/tempo.h"
|
||||||
|
|
@ -788,3 +789,8 @@ BasicUI::goto_nth_marker (int n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
BasicUI::make_port_name_non_relative (const std::string& name) const
|
||||||
|
{
|
||||||
|
return _session->engine ().make_port_name_non_relative (name);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,10 @@ class LIBCONTROLCP_API BasicUI {
|
||||||
bool rewind_button_onoff() const;
|
bool rewind_button_onoff() const;
|
||||||
bool loop_button_onoff() const;
|
bool loop_button_onoff() const;
|
||||||
|
|
||||||
|
/* Naming */
|
||||||
|
|
||||||
|
std::string make_port_name_non_relative (const std::string& name) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Session* _session;
|
Session* _session;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -99,13 +99,13 @@ FaderPort::FaderPort (Session& s)
|
||||||
_input_bundle->add_channel (
|
_input_bundle->add_channel (
|
||||||
"",
|
"",
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (inp->name())
|
make_port_name_non_relative (inp->name())
|
||||||
);
|
);
|
||||||
|
|
||||||
_output_bundle->add_channel (
|
_output_bundle->add_channel (
|
||||||
"",
|
"",
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (outp->name())
|
make_port_name_non_relative (outp->name())
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Catch port connections and disconnections */
|
/* Catch port connections and disconnections */
|
||||||
|
|
@ -837,8 +837,8 @@ FaderPort::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_input_port)->name());
|
string ni = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_input_port)->name());
|
||||||
string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_output_port)->name());
|
string no = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_output_port)->name());
|
||||||
|
|
||||||
if (ni == name1 || ni == name2) {
|
if (ni == name1 || ni == name2) {
|
||||||
if (yn) {
|
if (yn) {
|
||||||
|
|
|
||||||
|
|
@ -162,13 +162,13 @@ FaderPort8::FaderPort8 (Session& s)
|
||||||
_input_bundle->add_channel (
|
_input_bundle->add_channel (
|
||||||
"",
|
"",
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (inp->name())
|
make_port_name_non_relative (inp->name())
|
||||||
);
|
);
|
||||||
|
|
||||||
_output_bundle->add_channel (
|
_output_bundle->add_channel (
|
||||||
"",
|
"",
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (outp->name())
|
make_port_name_non_relative (outp->name())
|
||||||
);
|
);
|
||||||
|
|
||||||
ARDOUR::AudioEngine::instance()->PortConnectedOrDisconnected.connect (port_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::connection_handler, this, _2, _4), this);
|
ARDOUR::AudioEngine::instance()->PortConnectedOrDisconnected.connect (port_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::connection_handler, this, _2, _4), this);
|
||||||
|
|
@ -428,8 +428,8 @@ FaderPort8::connection_handler (std::string name1, std::string name2)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_input_port)->name());
|
string ni = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_input_port)->name());
|
||||||
string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_output_port)->name());
|
string no = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_output_port)->name());
|
||||||
|
|
||||||
if (ni == name1 || ni == name2) {
|
if (ni == name1 || ni == name2) {
|
||||||
DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("Connection notify %1 and %2\n", name1, name2));
|
DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("Connection notify %1 and %2\n", name1, name2));
|
||||||
|
|
|
||||||
|
|
@ -99,13 +99,13 @@ GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s)
|
||||||
_input_bundle->add_channel (
|
_input_bundle->add_channel (
|
||||||
"",
|
"",
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (inp->name())
|
make_port_name_non_relative (inp->name())
|
||||||
);
|
);
|
||||||
|
|
||||||
_output_bundle->add_channel (
|
_output_bundle->add_channel (
|
||||||
"",
|
"",
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (outp->name())
|
make_port_name_non_relative (outp->name())
|
||||||
);
|
);
|
||||||
|
|
||||||
_session->BundleAddedOrRemoved ();
|
_session->BundleAddedOrRemoved ();
|
||||||
|
|
@ -1559,8 +1559,8 @@ GenericMidiControlProtocol::connection_handler (boost::weak_ptr<ARDOUR::Port>, s
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("connection change: %1 and %2 connected ? %3\n", name1, name2, yn));
|
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("connection change: %1 and %2 connected ? %3\n", name1, name2, yn));
|
||||||
|
|
||||||
string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_input_port)->name());
|
string ni = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_input_port)->name());
|
||||||
string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_output_port)->name());
|
string no = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_output_port)->name());
|
||||||
|
|
||||||
if (ni == name1 || ni == name2) {
|
if (ni == name1 || ni == name2) {
|
||||||
if (yn) {
|
if (yn) {
|
||||||
|
|
|
||||||
|
|
@ -831,8 +831,8 @@ LaunchControlXL::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_async_in)->name());
|
string ni = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_async_in)->name());
|
||||||
string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_async_out)->name());
|
string no = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_async_out)->name());
|
||||||
|
|
||||||
if (ni == name1 || ni == name2) {
|
if (ni == name1 || ni == name2) {
|
||||||
if (yn) {
|
if (yn) {
|
||||||
|
|
|
||||||
|
|
@ -927,13 +927,13 @@ MackieControlProtocol::create_surfaces ()
|
||||||
_input_bundle->add_channel (
|
_input_bundle->add_channel (
|
||||||
"",
|
"",
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (surface->port().input_port().name())
|
make_port_name_non_relative (surface->port().input_port().name())
|
||||||
);
|
);
|
||||||
|
|
||||||
_output_bundle->add_channel (
|
_output_bundle->add_channel (
|
||||||
"",
|
"",
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (surface->port().output_port().name())
|
make_port_name_non_relative (surface->port().output_port().name())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -210,8 +210,8 @@ Surface::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, b
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (_port->input_name());
|
string ni = _mcp.make_port_name_non_relative (_port->input_name());
|
||||||
string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (_port->output_name());
|
string no = _mcp.make_port_name_non_relative (_port->output_name());
|
||||||
|
|
||||||
if (ni == name1 || ni == name2) {
|
if (ni == name1 || ni == name2) {
|
||||||
if (yn) {
|
if (yn) {
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ Push2::ports_acquire ()
|
||||||
_output_bundle->add_channel (
|
_output_bundle->add_channel (
|
||||||
shadow_port->name(),
|
shadow_port->name(),
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (shadow_port->name())
|
make_port_name_non_relative (shadow_port->name())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1209,8 +1209,8 @@ Push2::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boo
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_async_in)->name());
|
string ni = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_async_in)->name());
|
||||||
string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_async_out)->name());
|
string no = make_port_name_non_relative (boost::shared_ptr<ARDOUR::Port>(_async_out)->name());
|
||||||
|
|
||||||
if (ni == name1 || ni == name2) {
|
if (ni == name1 || ni == name2) {
|
||||||
if (yn) {
|
if (yn) {
|
||||||
|
|
|
||||||
|
|
@ -169,8 +169,8 @@ Surface::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, b
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string ni = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (_port->input_name());
|
string ni = _mcp.make_port_name_non_relative (_port->input_name());
|
||||||
string no = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (_port->output_name());
|
string no = _mcp.make_port_name_non_relative (_port->output_name());
|
||||||
|
|
||||||
if (ni == name1 || ni == name2) {
|
if (ni == name1 || ni == name2) {
|
||||||
if (yn) {
|
if (yn) {
|
||||||
|
|
|
||||||
|
|
@ -794,13 +794,13 @@ US2400Protocol::create_surfaces ()
|
||||||
_input_bundle->add_channel (
|
_input_bundle->add_channel (
|
||||||
surface->port().input_port().name(),
|
surface->port().input_port().name(),
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (surface->port().input_port().name())
|
make_port_name_non_relative (surface->port().input_port().name())
|
||||||
);
|
);
|
||||||
|
|
||||||
_output_bundle->add_channel (
|
_output_bundle->add_channel (
|
||||||
surface->port().output_port().name(),
|
surface->port().output_port().name(),
|
||||||
ARDOUR::DataType::MIDI,
|
ARDOUR::DataType::MIDI,
|
||||||
_session->engine().make_port_name_non_relative (surface->port().output_port().name())
|
make_port_name_non_relative (surface->port().output_port().name())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue