13
0

re-do previous commit with less variables

This commit is contained in:
Paul Davis 2015-05-08 15:33:00 -04:00
parent 024a061804
commit e7fa40762c
2 changed files with 5 additions and 10 deletions

View File

@ -148,9 +148,6 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
Recording = 2
};
static const char * default_trx_track_name_pattern;
static const char * default_ardour_track_name_pattern;
/* a new session might have non-empty mix_template, an existing session should always have an empty one.
the bus profile can be null if no master out bus is required.
*/

View File

@ -113,9 +113,6 @@ using namespace std;
using namespace ARDOUR;
using namespace PBD;
const char * Session::default_trx_track_name_pattern = "Track "; // add track number to the pattern
const char * Session::default_ardour_track_name_pattern = "Audio "; // add track number to the pattern
bool Session::_disable_all_loaded_plugins = false;
PBD::Signal1<int,uint32_t> Session::AudioEngineSetupRequired;
@ -2429,18 +2426,19 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
RouteList new_routes;
list<boost::shared_ptr<AudioTrack> > ret;
string name_pattern("");
string name_pattern;
if (Profile->get_trx() ) {
name_pattern = default_trx_track_name_pattern;
name_pattern = "Track ";
} else {
name_pattern = default_ardour_track_name_pattern;
name_pattern = "Audio ";
}
bool const use_number = (how_many != 1) || name_template.empty () || name_template == _(name_pattern.c_str() );
while (how_many) {
if (!find_route_name (name_template.empty() ? _(name_pattern.c_str() ) : name_template, ++track_id, track_name, sizeof(track_name), use_number)) {
if (!find_route_name (name_template.empty() ? _(name_pattern.c_str()) : name_template, ++track_id, track_name, sizeof(track_name), use_number)) {
error << "cannot find name for new audio track" << endmsg;
goto failed;
}