diff options
author | Sakari Bergen <sakari.bergen@beatwaves.net> | 2009-01-30 11:50:24 +0000 |
---|---|---|
committer | Sakari Bergen <sakari.bergen@beatwaves.net> | 2009-01-30 11:50:24 +0000 |
commit | 24aab941eb4d77e5bdf3933b11f8ce5659872b52 (patch) | |
tree | 3f19bdf5e10876e0c5e24a0858bb9b4daa88a710 /libs/ardour/audio_track_importer.cc | |
parent | 15554385d6227e46457b0ab8fa36179ce237b0fe (diff) |
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
Diffstat (limited to 'libs/ardour/audio_track_importer.cc')
-rw-r--r-- | libs/ardour/audio_track_importer.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libs/ardour/audio_track_importer.cc b/libs/ardour/audio_track_importer.cc index 0f17323dc6..32b90e00dc 100644 --- a/libs/ardour/audio_track_importer.cc +++ b/libs/ardour/audio_track_importer.cc @@ -28,6 +28,7 @@ #include <pbd/convert.h> #include <sstream> +#include <algorithm> #include "i18n.h" @@ -154,10 +155,6 @@ AudioTrackImporter::parse_io () return false; } - // TODO - io->remove_property ("inputs"); - io->remove_property ("outputs"); - XMLPropertyList const & props = io->properties(); for (XMLPropertyList::const_iterator it = props.begin(); it != props.end(); ++it) { @@ -172,9 +169,18 @@ AudioTrackImporter::parse_io () (*it)->set_value (id.to_s()); id_ok = true; } 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")) { - // 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 { std::cerr << string_compose (X_("AudioTrackImporter: did not recognise XML-property \"%1\""), prop) << endmsg; } |