Fix adding multiple tracks (regression from r6711).

git-svn-id: svn://localhost/ardour2/branches/3.0@6712 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2010-02-26 23:35:58 +00:00
parent 0efd1c6f0b
commit 482f21f9dd
2 changed files with 10 additions and 11 deletions

View File

@ -78,7 +78,6 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type)
, _default_type (default_type)
{
cerr << "New route with n=" << name << " has name = " << _name.val() << endl;
init ();
/* add standard processors other than amp (added by ::init()) */

View File

@ -1568,7 +1568,7 @@ list<boost::shared_ptr<MidiTrack> >
Session::new_midi_track (TrackMode mode, RouteGroup* route_group, uint32_t how_many)
{
char track_name[32];
uint32_t track_id = 1;
uint32_t track_id = 0;
ChanCount existing_inputs;
ChanCount existing_outputs;
string port;
@ -1581,7 +1581,7 @@ Session::new_midi_track (TrackMode mode, RouteGroup* route_group, uint32_t how_m
control_id = ntracks() + nbusses();
while (how_many) {
if (!find_route_name ("Midi", track_id, track_name, sizeof(track_name))) {
if (!find_route_name ("Midi", ++track_id, track_name, sizeof(track_name))) {
error << "cannot find name for new midi track" << endmsg;
goto failed;
}
@ -1740,11 +1740,11 @@ Session::auto_connect_route (boost::shared_ptr<Route> route,
existing_outputs += route->n_outputs();
}
list<boost::shared_ptr<AudioTrack> >
Session::new_audio_track (int input_channels, int output_channels, TrackMode mode, RouteGroup* route_group, uint32_t how_many)
list< boost::shared_ptr<AudioTrack> >
Session::new_audio_track (int input_channels, int output_channels, TrackMode mode, RouteGroup* route_group, uint32_t how_many)
{
char track_name[32];
uint32_t track_id = 1;
uint32_t track_id = 0;
ChanCount existing_inputs;
ChanCount existing_outputs;
string port;
@ -1757,7 +1757,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
control_id = ntracks() + nbusses() + 1;
while (how_many) {
if (!find_route_name ("Audio", track_id, track_name, sizeof(track_name))) {
if (!find_route_name ("Audio", ++track_id, track_name, sizeof(track_name))) {
error << "cannot find name for new audio track" << endmsg;
goto failed;
}
@ -1879,7 +1879,7 @@ RouteList
Session::new_audio_route (bool aux, int input_channels, int output_channels, RouteGroup* route_group, uint32_t how_many)
{
char bus_name[32];
uint32_t bus_id = 1;
uint32_t bus_id = 0;
ChanCount existing_inputs;
ChanCount existing_outputs;
string port;
@ -1891,7 +1891,7 @@ Session::new_audio_route (bool aux, int input_channels, int output_channels, Rou
control_id = ntracks() + nbusses() + 1;
while (how_many) {
if (!find_route_name ("Bus", bus_id, bus_name, sizeof(bus_name))) {
if (!find_route_name ("Bus", ++bus_id, bus_name, sizeof(bus_name))) {
error << "cannot find name for new audio bus" << endmsg;
goto failure;
}
@ -1962,7 +1962,7 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
RouteList ret;
uint32_t control_id;
XMLTree tree;
uint32_t number = 1;
uint32_t number = 0;
if (!tree.read (template_path.c_str())) {
return ret;
@ -1979,7 +1979,7 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
std::string node_name = IO::name_from_state (*node_copy.children().front());
/* generate a new name by adding a number to the end of the template name */
if (!find_route_name (node_name.c_str(), number, name, sizeof(name))) {
if (!find_route_name (node_name.c_str(), ++number, name, sizeof(name))) {
fatal << _("Session: UINT_MAX routes? impossible!") << endmsg;
/*NOTREACHED*/
}