prepare formatting track-number for mixer (and other places)
This commit is contained in:
parent
d100c0550f
commit
09479ad19a
@ -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;
|
||||
}
|
||||
|
@ -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__ */
|
||||
|
Loading…
Reference in New Issue
Block a user