Indicate UTF8 literals - fixes glyph rendering with MSVC (1/2)

This commit is contained in:
Robin Gareus 2023-01-16 21:41:09 +01:00
parent c635d15cf0
commit 2c7f8eeb97
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
10 changed files with 24 additions and 24 deletions

View File

@ -123,7 +123,7 @@ Engine_TransportMaster::position_string () const
std::string
Engine_TransportMaster::delta_string () const
{
return string ("\u0394 0 ");
return string (u8"\u0394 0 ");
}
bool

View File

@ -656,7 +656,7 @@ std::string
LTC_TransportMaster::delta_string() const
{
if (!_collect || current.timestamp == 0) {
return X_("\u2012\u2012\u2012\u2012");
return X_(u8"\u2012\u2012\u2012\u2012");
} else if ((monotonic_cnt - current.timestamp) > 2 * samples_per_ltc_frame) {
return _("flywheel");
} else {

View File

@ -437,7 +437,7 @@ MIDIClock_TransportMaster::delta_string() const
current.safe_read (last);
if (last.timestamp == 0 || starting()) {
return X_("\u2012\u2012\u2012\u2012");
return X_(u8"\u2012\u2012\u2012\u2012");
} else {
return format_delta_time (_current_delta);
}

View File

@ -548,7 +548,7 @@ MTC_TransportMaster::delta_string () const
current.safe_read (last);
if (last.timestamp == 0 || reset_pending) {
return X_("\u2012\u2012\u2012\u2012");
return X_(u8"\u2012\u2012\u2012\u2012");
} else {
return format_delta_time (_current_delta);
}

View File

@ -528,7 +528,7 @@ TimecodeTransportMaster::set_fr2997 (bool yn)
}
/* used for delta_string(): (note: \u00B1 is the plus-or-minus sign) */
#define PLUSMINUS(A) (((A) < 0) ? "-" : (((A) > 0) ? "+" : "\u00B1"))
#define PLUSMINUS(A) (((A) < 0) ? "-" : (((A) > 0) ? "+" : u8"\u00B1"))
#define LEADINGZERO(A) ((A) < 10 ? " " : (A) < 100 ? " " : (A) < 1000 ? " " : (A) < 10000 ? " " : "")
std::string
@ -539,13 +539,13 @@ TransportMaster::format_delta_time (sampleoffset_t delta) const
samplecnt_t sr = _session->sample_rate();
if (abs (_current_delta) >= sr) {
int secs = rint ((double) delta / sr);
snprintf(buf, sizeof(buf), "\u0394%s%s%d s", LEADINGZERO(abs(secs)), PLUSMINUS(-secs), abs(secs));
snprintf(buf, sizeof(buf), u8"\u0394%s%s%d s", LEADINGZERO(abs(secs)), PLUSMINUS(-secs), abs(secs));
buf[63] = '\0';
return std::string(buf);
}
}
/* left-align sign, to make it readable when decimals jitter */
snprintf (buf, sizeof(buf), "\u0394%s%s%lldsm", PLUSMINUS(-delta), LEADINGZERO(::llabs(delta)), ::llabs(delta));
snprintf (buf, sizeof(buf), u8"\u0394%s%s%lldsm", PLUSMINUS(-delta), LEADINGZERO(::llabs(delta)), ::llabs(delta));
buf[63] = '\0';
return std::string(buf);
}

View File

@ -136,7 +136,7 @@ ARDOUR::cue_marker_name (int32_t index)
if (index == CueRecord::stop_all) {
/* this is a reasonable "stop" icon */
return string (X_("\u25a1"));
return string (X_(u8"\u25a1"));
}
switch (index) {

View File

@ -399,13 +399,13 @@ VBAPanner::value_as_string (boost::shared_ptr<const AutomationControl> ac) const
switch (ac->parameter ().type ()) {
case PanAzimuthAutomation: /* direction */
return string_compose (_ ("%1\u00B0"), (int(rint (val * 360.0)) + 180) % 360);
return string_compose (_ (u8"%1\u00B0"), (int(rint (val * 360.0)) + 180) % 360);
case PanWidthAutomation: /* diffusion */
return string_compose (_ ("%1%%"), (int)floor (100.0 * fabs (val)));
case PanElevationAutomation: /* elevation */
return string_compose (_ ("%1\u00B0"), (int)floor (90.0 * fabs (val)));
return string_compose (_ (u8"%1\u00B0"), (int)floor (90.0 * fabs (val)));
default:
return _ ("unused");

View File

@ -517,7 +517,7 @@ MackieControlProtocolGUI::refresh_function_key_editor ()
Glib::RefPtr<Gtk::Action> act;
string action;
const string defstring = "\u2022";
const string defstring = u8"\u2022";
/* We only allow plain bindings for Fn keys. All others are
* reserved for hard-coded actions.
@ -668,7 +668,7 @@ MackieControlProtocolGUI::action_changed (const Glib::ustring &sPath, const Tree
within the model.
*/
if (remove) {
Glib::ustring dot = "\u2022";
Glib::ustring dot = u8"\u2022";
(*row).set_value (col.index(), dot);
} else {
(*row).set_value (col.index(), act->get_label());

View File

@ -47,13 +47,13 @@ row_interval_string (const Push2::RowInterval row_interval, const bool inkey)
{
switch (row_interval) {
case Push2::Third:
return _("3rd \u2191");
return _(u8"3rd \u2191");
case Push2::Fourth:
return _("4th \u2191");
return _(u8"4th \u2191");
case Push2::Fifth:
return _("5th \u2191");
return _(u8"5th \u2191");
case Push2::Sequential:
return inkey ? _("Octave \u2191") : _("Sequential \u2191");
return inkey ? _(u8"Octave \u2191") : _(u8"Sequential \u2191");
}
return "";
@ -62,7 +62,7 @@ row_interval_string (const Push2::RowInterval row_interval, const bool inkey)
static const char*
column_interval_string (const bool inkey)
{
return inkey ? _("Scale \u2192") : _("Semitone \u2192");
return inkey ? _(u8"Scale \u2192") : _(u8"Semitone \u2192");
}
ScaleLayout::ScaleLayout (Push2& p, Session & s, std::string const & name)
@ -179,19 +179,19 @@ ScaleLayout::ScaleLayout (Push2& p, Session & s, std::string const & name)
t->set (S_("Note|F"));
break;
case 2:
t->set (S_("Note|B\u266D/A\u266F"));
t->set (S_(u8"Note|B\u266D/A\u266F"));
break;
case 3:
t->set (S_("Note|E\u266D/D\u266F"));
t->set (S_(u8"Note|E\u266D/D\u266F"));
break;
case 4:
t->set (S_("Note|A\u266D/G\u266F"));
t->set (S_(u8"Note|A\u266D/G\u266F"));
break;
case 5:
t->set (S_("Note|D\u266D/C\u266F"));
t->set (S_(u8"Note|D\u266D/C\u266F"));
break;
case 6:
t->set (S_("Note|G\u266D/F\u266F"));
t->set (S_(u8"Note|G\u266D/F\u266F"));
break;
}

View File

@ -407,7 +407,7 @@ US2400ProtocolGUI::refresh_function_key_editor ()
Glib::RefPtr<Gtk::Action> act;
string action;
const string defstring = "\u2022";
const string defstring = u8"\u2022";
/* We only allow plain bindings for Fn keys. All others are
* reserved for hard-coded actions. */
@ -470,7 +470,7 @@ US2400ProtocolGUI::action_changed (const Glib::ustring &sPath, const TreeModel::
* within the model.
*/
if (remove) {
Glib::ustring dot = "\u2022";
Glib::ustring dot = u8"\u2022";
(*row).set_value (col.index(), dot);
} else {
(*row).set_value (col.index(), act->get_label());