mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 03:36:32 +01:00
Track import is now working. Also, IO bundle setup/creation is safer.
git-svn-id: svn://localhost/ardour2/branches/3.0@4466 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
15554385d6
commit
24aab941eb
3 changed files with 22 additions and 23 deletions
|
|
@ -371,7 +371,6 @@ class IO : public SessionObject, public AutomatableControls, public Latent
|
||||||
int32_t find_input_port_hole (const char* base);
|
int32_t find_input_port_hole (const char* base);
|
||||||
int32_t find_output_port_hole (const char* base);
|
int32_t find_output_port_hole (const char* base);
|
||||||
|
|
||||||
void create_bundles_for_inputs_and_outputs ();
|
|
||||||
void setup_bundles_for_inputs_and_outputs ();
|
void setup_bundles_for_inputs_and_outputs ();
|
||||||
std::string bundle_channel_name (uint32_t, uint32_t) const;
|
std::string bundle_channel_name (uint32_t, uint32_t) const;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
#include <pbd/convert.h>
|
#include <pbd/convert.h>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
@ -154,10 +155,6 @@ AudioTrackImporter::parse_io ()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
io->remove_property ("inputs");
|
|
||||||
io->remove_property ("outputs");
|
|
||||||
|
|
||||||
XMLPropertyList const & props = io->properties();
|
XMLPropertyList const & props = io->properties();
|
||||||
|
|
||||||
for (XMLPropertyList::const_iterator it = props.begin(); it != props.end(); ++it) {
|
for (XMLPropertyList::const_iterator it = props.begin(); it != props.end(); ++it) {
|
||||||
|
|
@ -172,9 +169,18 @@ AudioTrackImporter::parse_io ()
|
||||||
(*it)->set_value (id.to_s());
|
(*it)->set_value (id.to_s());
|
||||||
id_ok = true;
|
id_ok = true;
|
||||||
} else if (!prop.compare("inputs")) {
|
} else if (!prop.compare("inputs")) {
|
||||||
// TODO Let the IO class do it's thing for now...
|
// TODO Handle this properly!
|
||||||
|
/* Input and output ports are counted and added empty, so that no in/output connecting function fails. */
|
||||||
|
uint32_t num_inputs = std::count ((*it)->value().begin(), (*it)->value().end(), '{');
|
||||||
|
std::string value;
|
||||||
|
for (uint32_t i = 0; i < num_inputs; i++) { value += "{}"; }
|
||||||
|
(*it)->set_value (value);
|
||||||
} else if (!prop.compare("outputs")) {
|
} else if (!prop.compare("outputs")) {
|
||||||
// TODO Let the IO class do it's thing for now...
|
// TODO See comments above
|
||||||
|
uint32_t num_outputs = std::count ((*it)->value().begin(), (*it)->value().end(), '{');
|
||||||
|
std::string value;
|
||||||
|
for (uint32_t i = 0; i < num_outputs; i++) { value += "{}"; }
|
||||||
|
(*it)->set_value (value);
|
||||||
} else {
|
} else {
|
||||||
std::cerr << string_compose (X_("AudioTrackImporter: did not recognise XML-property \"%1\""), prop) << endmsg;
|
std::cerr << string_compose (X_("AudioTrackImporter: did not recognise XML-property \"%1\""), prop) << endmsg;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@ IO::IO (Session& s, const string& name,
|
||||||
|
|
||||||
_session.add_controllable (_gain_control);
|
_session.add_controllable (_gain_control);
|
||||||
|
|
||||||
create_bundles_for_inputs_and_outputs ();
|
setup_bundles_for_inputs_and_outputs ();
|
||||||
}
|
}
|
||||||
|
|
||||||
IO::IO (Session& s, const XMLNode& node, DataType dt)
|
IO::IO (Session& s, const XMLNode& node, DataType dt)
|
||||||
|
|
@ -194,7 +194,7 @@ IO::IO (Session& s, const XMLNode& node, DataType dt)
|
||||||
|
|
||||||
_session.add_controllable (_gain_control);
|
_session.add_controllable (_gain_control);
|
||||||
|
|
||||||
create_bundles_for_inputs_and_outputs ();
|
setup_bundles_for_inputs_and_outputs ();
|
||||||
}
|
}
|
||||||
|
|
||||||
IO::~IO ()
|
IO::~IO ()
|
||||||
|
|
@ -2586,7 +2586,7 @@ IO::update_port_total_latencies ()
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup bundles that describe our inputs and outputs.
|
* Setup bundles that describe our inputs and outputs. Also creates bundles if necessary.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2594,6 +2594,13 @@ IO::setup_bundles_for_inputs_and_outputs ()
|
||||||
{
|
{
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
|
if (!_bundle_for_inputs) {
|
||||||
|
_bundle_for_inputs.reset (new Bundle (true));
|
||||||
|
}
|
||||||
|
if (!_bundle_for_outputs) {
|
||||||
|
_bundle_for_outputs.reset (new Bundle (false));
|
||||||
|
}
|
||||||
|
|
||||||
_bundle_for_inputs->remove_channels ();
|
_bundle_for_inputs->remove_channels ();
|
||||||
_bundle_for_outputs->remove_channels ();
|
_bundle_for_outputs->remove_channels ();
|
||||||
|
|
||||||
|
|
@ -2614,19 +2621,6 @@ IO::setup_bundles_for_inputs_and_outputs ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create and setup bundles that describe our inputs and outputs.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
|
||||||
IO::create_bundles_for_inputs_and_outputs ()
|
|
||||||
{
|
|
||||||
_bundle_for_inputs = boost::shared_ptr<Bundle> (new Bundle (true));
|
|
||||||
_bundle_for_outputs = boost::shared_ptr<Bundle> (new Bundle (false));
|
|
||||||
setup_bundles_for_inputs_and_outputs ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return Bundles connected to our inputs */
|
/** @return Bundles connected to our inputs */
|
||||||
BundleList
|
BundleList
|
||||||
IO::bundles_connected_to_inputs ()
|
IO::bundles_connected_to_inputs ()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue