prepare formatting track-number for mixer (and other places)

This commit is contained in:
Robin Gareus 2014-06-26 19:08:48 +02:00
parent d100c0550f
commit 09479ad19a
2 changed files with 27 additions and 0 deletions

View File

@ -1010,3 +1010,28 @@ ARDOUR_UI_UTILS::rate_as_string (float r)
}
return buf;
}
string
ARDOUR_UI_UTILS::track_number_to_string (
int64_t tracknumber,
std::string sep,
std::string postfix
)
{
string rv;
if (tracknumber > 0) {
rv = "<span weight=\"bold\" font_family=\"ArdourMono, Mono\">";
rv += PBD::to_string (tracknumber, std::dec);
rv += "</span>";
rv += sep;
}
else if (tracknumber < 0) {
rv = "<span weight=\"bold\" font_family=\"ArdourMono, Mono\">";
rv += PBD::to_string (-tracknumber, std::dec);
rv += "</span>";
rv += sep;
}
rv += Glib::Markup::escape_text(postfix);
return rv;
}

View File

@ -98,5 +98,7 @@ Gdk::Color unique_random_color (std::list<Gdk::Color> &);
std::string rate_as_string (float r);
std::string track_number_to_string (int64_t tracknumber, std::string sep = "", std::string postfix = "");
} // namespace
#endif /* __ardour_gtk_utils_h__ */