[beast: 8/31] SFI: consistently use 'SfiString' everywhere for IDL related strings
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 8/31] SFI: consistently use 'SfiString' everywhere for IDL related strings
- Date: Mon, 22 Jun 2015 14:38:49 +0000 (UTC)
commit 6507fb2eb482a79cd154f559426090ec3762364a
Author: Tim Janik <timj gnu org>
Date: Fri Jun 12 11:38:49 2015 +0200
SFI: consistently use 'SfiString' everywhere for IDL related strings
beast-gtk/bstrecords.idl | 22 +++++++-------
beast-gtk/bstutils.cc | 6 ++--
bse/bsebasics.idl | 34 +++++++++++-----------
bse/bsecxxutils.hh | 2 +-
bse/bseprocidl.cc | 2 +-
bse/bsescripthelper.cc | 2 +-
bse/bsetype.hh | 5 +--
plugins/evaluator/bseevaluator.idl | 4 +-
sfi/sficxx.hh | 55 ++++++++++++++++++-----------------
sfi/sfidl-clientcxx.cc | 8 ++--
sfi/sfidl-corecxx.cc | 6 ++--
sfi/sfidl-parser.cc | 4 +-
sfi/sfiparams.cc | 4 +-
sfi/sfiprimitives.cc | 4 +-
sfi/sfitypes.hh | 1 -
sfi/sfivalues.cc | 8 ++--
sfi/sfivalues.hh | 4 +-
sfi/tests/testcxx.cc | 10 +++---
tests/bse/testplugin.idl | 2 +-
tests/latency/bselatencytest.idl | 4 +-
20 files changed, 93 insertions(+), 94 deletions(-)
---
diff --git a/beast-gtk/bstrecords.idl b/beast-gtk/bstrecords.idl
index cb315a3..db23e08 100644
--- a/beast-gtk/bstrecords.idl
+++ b/beast-gtk/bstrecords.idl
@@ -85,7 +85,7 @@ enum RowShading {
/* BEAST Global Config */
record GConfig {
- String rc_version = ("", _("Release counter"), "", STORAGE);
+ SfiString rc_version = ("", _("Release counter"), "", STORAGE);
group "Synthesis Networks" {
Int snet_font_size = (_("Font Size"), _("Font size in pixels for labels displayed in
synthesis networks"),
10, 1, 48, 2, STANDARD);
@@ -112,9 +112,9 @@ record GConfig {
/* skin config */
record SkinConfig {
- String skin_name = (_("Skin Name"), _("Name for the current skin configuration (used for skin
selections)."), "", STANDARD);
+ SfiString skin_name = (_("Skin Name"), _("Name for the current skin configuration (used for skin
selections)."), "", STANDARD);
group "Pattern Editor" {
- String pattern_image = (_("Background Image"), _("Background image used by the pattern editor."),
"", STANDARD ":filename:image");
+ SfiString pattern_image = (_("Background Image"), _("Background image used by the pattern editor."),
"", STANDARD ":filename:image");
Real pattern_shade = (_("Image shade"), _("Percentage of background image pixel to blend over
background color."), 2.5, 0, 100, 5, STANDARD ":scale");
Int pattern_color = (_("Background Color"), "", 0xf5f3ed, 0, 0xffffff, 0x010101, STANDARD
":rgb:hex");
Int pattern_scolor1 = (_("Background Shade 1"), "", 0xd3d1cb, 0, 0xffffff, 0x010101, STANDARD
":rgb:hex");
@@ -124,7 +124,7 @@ record SkinConfig {
Int pattern_vbar1 = (_("Vertical Bar Color"), "", 0x7f7f7f, 0, 0xffffff, 0x010101, STANDARD
":rgb:hex");
};
group "Piano Roll" {
- String piano_image = (_("Background Image"), _("Background image used by the piano-roll editor."),
"", STANDARD ":filename:image");
+ SfiString piano_image = (_("Background Image"), _("Background image used by the piano-roll editor."),
"", STANDARD ":filename:image");
Real piano_shade = (_("Image shade"), _("Percentage of background image pixel to blend over
background color."), 2.5, 0, 100, 5, STANDARD ":scale");
Int piano_color = (_("Background Color"), "", 0xf5f3ed, 0, 0xffffff, 0x010101, STANDARD
":rgb:hex");
Int piano_hbar = (_("Horizontal Bar Color"), "", 0x7f7f7f, 0, 0xffffff, 0x010101, STANDARD
":rgb:hex");
@@ -134,7 +134,7 @@ record SkinConfig {
Int piano_mbar = (_("Middle Bar Color"), "", 0xa0a0a0, 0, 0xffffff, 0x010101, STANDARD
":rgb:hex");
};
group "Control Events" {
- String controls_image = (_("Background Image"), _("Background image used by the control events
editor."), "", STANDARD ":filename:image");
+ SfiString controls_image = (_("Background Image"), _("Background image used by the control events
editor."), "", STANDARD ":filename:image");
Real controls_shade = (_("Image shade"), _("Percentage of background image pixel to blend over
background color."), 2.5, 0, 100, 5, STANDARD ":scale");
Int controls_color = (_("Background Color"), "", 0xf5f3ed, 0, 0xffffff, 0x010101, STANDARD
":rgb:hex");
Int controls_hbar = (_("Horizontal Bar Color"), "", 0x7f7f7f, 0, 0xffffff, 0x010101, STANDARD
":rgb:hex");
@@ -147,9 +147,9 @@ record SkinConfig {
/* message filter */
record MsgAbsorbString {
- String version;
- String cstring;
- Bool enabled;
+ SfiString version;
+ SfiString cstring;
+ Bool enabled;
};
sequence MsgAbsorbStringSeq {
MsgAbsorbString strings;
@@ -157,9 +157,9 @@ sequence MsgAbsorbStringSeq {
/* pattern editor key bindings */
record KeyBindingItem {
- String key_name = ("", "", "", STANDARD);
- String func_name = ("", "", "", STANDARD);
- Real func_param = ("", "", 0, -1e37, 1e30, 100, STANDARD ":scale");
+ SfiString key_name = ("", "", "", STANDARD);
+ SfiString func_name = ("", "", "", STANDARD);
+ Real func_param = ("", "", 0, -1e37, 1e30, 100, STANDARD ":scale");
};
sequence KeyBindingItemSeq {
KeyBindingItem items;
diff --git a/beast-gtk/bstutils.cc b/beast-gtk/bstutils.cc
index 055be4f..c5f28de 100644
--- a/beast-gtk/bstutils.cc
+++ b/beast-gtk/bstutils.cc
@@ -1430,10 +1430,10 @@ bst_file_scan_find_key (const gchar *file,
sfi_pspec_set_group (sfi_pspec_choice (name, nick, blurb, dval, cvalues, SFI_PARAM_STANDARD), group)
#define sfidl_pspec_Choice_default(group, name, cvalues) \
sfidl_pspec_Choice (group, name, NULL, NULL, NULL, SFI_PARAM_STANDARD, cvalues)
-#define sfidl_pspec_String(group, name, nick, blurb, dflt, options) \
+#define sfidl_pspec_SfiString(group, name, nick, blurb, dflt, options) \
sfi_pspec_set_group (sfi_pspec_string (name, nick, blurb, dflt, options), group)
-#define sfidl_pspec_String_default(group, name) \
- sfidl_pspec_String (group, name, NULL, NULL, NULL, SFI_PARAM_STANDARD)
+#define sfidl_pspec_SfiString_default(group, name) \
+ sfidl_pspec_SfiString (group, name, NULL, NULL, NULL, SFI_PARAM_STANDARD)
#define sfidl_pspec_BBlock(group, name, nick, blurb, options) \
sfi_pspec_set_group (sfi_pspec_bblock (name, nick, blurb, options), group)
#define sfidl_pspec_BBlock_default(group, name) \
diff --git a/bse/bsebasics.idl b/bse/bsebasics.idl
index ab63d1f..6388592 100644
--- a/bse/bsebasics.idl
+++ b/bse/bsebasics.idl
@@ -24,10 +24,10 @@ sequence IntSeq {
Int ints;
};
sequence TypeSeq {
- String types;
+ SfiString types;
};
sequence StringSeq {
- String strings;
+ SfiString strings;
};
sequence FloatSeq {
Real values;
@@ -512,8 +512,8 @@ sequence ItemSeq {
};
record PropertyCandidates {
Info blurb = ("A structure describing tentative property values.");
- String label;
- String tooltip;
+ SfiString label;
+ SfiString tooltip;
ItemSeq items;
TypeSeq partitions = SfiSeq ("Type Partitions", "List of types which may logically partition the list of
items by type discrimination", STANDARD);
};
@@ -556,7 +556,7 @@ record NoteDescription
Int semitone = SfiInt ("Semitone", "", 0, 0, 11, 1, ":readwrite");
Bool upshift;
Int letter = SfiInt ("Letter", "International abbreviation letter for this note", 64, 32, 126,
1, ":readwrite");
- String name = String ("Name", "", "", ":readwrite");
+ SfiString name = SfiString ("Name", "", "", ":readwrite");
/* constants */
Int max_fine_tune = SfiInt ("Max Fine Tune", "", MAX_FINE_TUNE, MAX_FINE_TUNE, MAX_FINE_TUNE, 0,
":readable");
Int kammer_note = SfiInt ("Kammer Note", "", KAMMER_NOTE, KAMMER_NOTE, KAMMER_NOTE, 0, ":readable");
@@ -583,10 +583,10 @@ record Icon
record Category
{
Int category_id = SfiInt ("Category ID", "", 1, 1, G_MAXINT, 1, ":readwrite");
- String category;
+ SfiString category;
Int mindex;
Int lindex;
- String type;
+ SfiString type;
Icon icon;
};
sequence CategorySeq {
@@ -638,10 +638,10 @@ record SongTiming {
Real stamp_ticks = SfiReal ("Ticks per stamp increment (valid only during playback)", "", 384, 1,
G_MAXINT, 12, STANDARD);
};
record SampleFileInfo {
- String file = SfiString ("Filename", "", "", STANDARD);
+ SfiString file = SfiString ("Filename", "", "", STANDARD);
Int size = SfiInt ("File Size", "", 0, 0, G_MAXINT, 0, STANDARD);
Num mtime = SfiNum ("Modification Time", "", 0, 0, SFI_MAXNUM, 0, STANDARD);
- String loader = SfiString ("Loader", "", "", STANDARD);
+ SfiString loader = SfiString ("Loader", "", "", STANDARD);
StringSeq waves = SfiSeq ("", "", STANDARD);
Int error = SfiInt ("BseErrorType", "", 0, 0, G_MAXINT, 0, STANDARD); // FIXME: use
BseErrorType here
};
@@ -679,29 +679,29 @@ record GConfig {
FALSE, STANDARD);
};
group _("Default Values") {
- String author_default = SfiString (_("Default Author"), _("Default value for 'Author' fields"),
+ SfiString author_default = SfiString (_("Default Author"), _("Default value for 'Author' fields"),
DEFAULT_AUTHOR, STANDARD);
- String license_default = SfiString (_("Default License"), _("Default value for 'License' fields"),
+ SfiString license_default = SfiString (_("Default License"), _("Default value for 'License' fields"),
DEFAULT_LICENSE, STANDARD);
};
group _("Search Paths") {
- String sample_path = SfiString (_("Sample Path"),
+ SfiString sample_path = SfiString (_("Sample Path"),
_("Search path of directories, seperated by \";\", used to find audio
samples."),
DEFAULT_SAMPLE_PATH, STANDARD ":searchpath");
- String effect_path = SfiString (_("Effect Path"),
+ SfiString effect_path = SfiString (_("Effect Path"),
_("Search path of directories, seperated by \";\", used to find BSE
effect files."),
DEFAULT_EFFECTS_PATH, STANDARD ":searchpath");
- String instrument_path = SfiString (_("Instrument Path"),
+ SfiString instrument_path = SfiString (_("Instrument Path"),
_("Search path of directories, seperated by \";\", used to find BSE
instrument files."),
DEFAULT_INSTRUMENTS_PATH, STANDARD ":searchpath");
- String script_path = SfiString (_("Script Path"),
+ SfiString script_path = SfiString (_("Script Path"),
_("Search path of directories, seperated by \";\", used to find BSE
scheme scripts."),
DEFAULT_SCRIPTS_PATH, STANDARD ":searchpath");
- String plugin_path = SfiString (_("Plugin Path"),
+ SfiString plugin_path = SfiString (_("Plugin Path"),
_("Search path of directories, seperated by \";\", used to find BSE
plugins. This path "
"is searched for in addition to the standard BSE plugin location on
this system."),
DEFAULT_PLUGINS_PATH, STANDARD ":searchpath");
- String ladspa_path = SfiString (_("LADSPA Path"),
+ SfiString ladspa_path = SfiString (_("LADSPA Path"),
_("Search path of directories, seperated by \";\", used to find
LADSPA plugins. This "
"path is searched for in addition to the standard LADSPA location
on this system. "
"LADSPA is the Linux Audio Developer's Simple Plugin API, more
informations about "
diff --git a/bse/bsecxxutils.hh b/bse/bsecxxutils.hh
index d0873a4..c667531 100644
--- a/bse/bsecxxutils.hh
+++ b/bse/bsecxxutils.hh
@@ -16,7 +16,7 @@ typedef SfiTime Time;
typedef SfiNote Note;
typedef SfiReal Real;
typedef SfiChoice Choice;
-typedef std::string String; /* not using SfiString resp. gchar* here */
+typedef std::string String;
typedef SfiBBlock BBlock;
typedef SfiFBlock FBlock;
typedef SfiSeq Seq;
diff --git a/bse/bseprocidl.cc b/bse/bseprocidl.cc
index bf38c48..d0452f7 100644
--- a/bse/bseprocidl.cc
+++ b/bse/bseprocidl.cc
@@ -155,7 +155,7 @@ std::string idlType (GType g)
case G_TYPE_UINT64: return "Num";
case G_TYPE_INT:
case G_TYPE_UINT: return "Int";
- case G_TYPE_STRING: return "String";
+ case G_TYPE_STRING: return "SfiString";
case G_TYPE_FLOAT:
case G_TYPE_DOUBLE: return "Real";
case G_TYPE_BOOLEAN: return "Bool";
diff --git a/bse/bsescripthelper.cc b/bse/bsescripthelper.cc
index 04be62c..e39c753 100644
--- a/bse/bsescripthelper.cc
+++ b/bse/bsescripthelper.cc
@@ -184,7 +184,7 @@ bse_script_check_client_msg (SfiGlueDecoder *decoder,
GValue *retval;
const guint vargs_pos = 8;
- if (!seq || seq->n_elements < vargs_pos || !sfi_seq_check (seq, SFI_TYPE_STRING))
+ if (!seq || seq->n_elements < vargs_pos || !sfi_seq_check (seq, SFI_TYPE_SFI_STRING))
retval = sfi_value_string ("invalid arguments supplied");
else
{
diff --git a/bse/bsetype.hh b/bse/bsetype.hh
index c589525..9627ffc 100644
--- a/bse/bsetype.hh
+++ b/bse/bsetype.hh
@@ -148,11 +148,10 @@ extern BseGConfig *bse_global_config; /* from bsegconfig.[hc] */
sfi_pspec_set_group (sfi_pspec_choice (name, nick, blurb, #dval, cvalues, SFI_PARAM_STANDARD), group)
#define sfidl_pspec_Choice_default(group, locfile, locline, name, cvalues) \
sfidl_pspec_Choice (group, locfile, locline, name, NULL, NULL, NULL, SFI_PARAM_STANDARD, cvalues)
-#define sfidl_pspec_String sfidl_pspec_SfiString
#define sfidl_pspec_SfiString(group, locfile, locline, name, nick, blurb, dflt, options) \
sfi_pspec_set_group (sfi_pspec_string (name, nick, blurb, dflt, options), group)
-#define sfidl_pspec_String_default(group, locfile, locline, name) \
- sfidl_pspec_String (group, locfile, locline, name, NULL, NULL, NULL, SFI_PARAM_STANDARD)
+#define sfidl_pspec_SfiString_default(group, locfile, locline, name) \
+ sfidl_pspec_SfiString (group, locfile, locline, name, NULL, NULL, NULL, SFI_PARAM_STANDARD)
#define sfidl_pspec_BBlock(group, locfile, locline, name, nick, blurb, options) \
sfi_pspec_set_group (sfi_pspec_bblock (name, nick, blurb, options), group)
#define sfidl_pspec_BBlock_default(group, locfile, locline, name) \
diff --git a/plugins/evaluator/bseevaluator.idl b/plugins/evaluator/bseevaluator.idl
index 561183f..5cc45da 100644
--- a/plugins/evaluator/bseevaluator.idl
+++ b/plugins/evaluator/bseevaluator.idl
@@ -13,8 +13,8 @@ interface Evaluator : Bse::Effect {
IStream input = (_("Audio In"), _("Audio input"));
OStream output = (_("Audio Out"), _("Audio output"));
group _("Parameters") {
- String source = String (_("Source code"), _("The source code"), "output = input", STANDARD);
- String status = String (_("Status"), _("Status used to output error messages"), "", GUI_RDONLY);
+ SfiString source = SfiString (_("Source code"), _("The source code"), "output = input", STANDARD);
+ SfiString status = SfiString (_("Status"), _("Status used to output error messages"), "", GUI_RDONLY);
};
};
diff --git a/sfi/sficxx.hh b/sfi/sficxx.hh
index d7c79f6..a56d789 100644
--- a/sfi/sficxx.hh
+++ b/sfi/sficxx.hh
@@ -12,7 +12,8 @@ typedef SfiBool Bool; // FIXME: use bool instead?
typedef SfiInt Int;
typedef SfiNum Num;
typedef SfiReal Real;
-class String {
+
+class SfiString {
char *cstring;
int cmp (const char *ostring) const
{
@@ -24,29 +25,30 @@ class String {
return ostring ? SFI_MININT : 0;
}
public:
- String()
+ SfiString()
{
cstring = g_strdup ("");
}
- String (const String &s)
+ SfiString (const SfiString &s)
{
cstring = g_strdup (s.cstring);
}
- String (const std::string &s)
+ SfiString (const std::string &s)
{
cstring = g_strdup (s.c_str());
}
- String (const char *cstr)
+ SfiString (const char *cstr)
{
cstring = g_strdup (cstr ? cstr : "");
}
- String& operator= (const std::string &s)
+ operator std::string () const { return cstring; }
+ SfiString& operator= (const std::string &s)
{
g_free (cstring);
cstring = g_strdup (s.c_str());
return *this;
}
- String& operator= (const gchar *cstr)
+ SfiString& operator= (const gchar *cstr)
{
if (cstr != cstring)
{
@@ -55,7 +57,7 @@ public:
}
return *this;
}
- String& operator= (const String &s)
+ SfiString& operator= (const SfiString &s)
{
if (s.cstring != cstring)
{
@@ -68,38 +70,38 @@ public:
{
return cstring;
}
- String& operator+= (const gchar *cstr)
+ SfiString& operator+= (const gchar *cstr)
{
char *old = cstring;
cstring = g_strconcat (old ? old : "", cstr, NULL);
g_free (old);
return *this;
}
- String& operator+= (const String &src)
+ SfiString& operator+= (const SfiString &src)
{
char *old = cstring;
cstring = g_strconcat (old ? old : "", src.cstring, NULL);
g_free (old);
return *this;
}
- String& operator+= (const std::string &src)
+ SfiString& operator+= (const std::string &src)
{
char *old = cstring;
cstring = g_strconcat (old ? old : "", src.c_str(), NULL);
g_free (old);
return *this;
}
- String operator+ (const gchar *cstr)
+ SfiString operator+ (const gchar *cstr)
{
- return String (cstring) += cstr;
+ return SfiString (cstring) += cstr;
}
- String operator+ (const String &src)
+ SfiString operator+ (const SfiString &src)
{
- return String (cstring) += src;
+ return SfiString (cstring) += src;
}
- String operator+ (const std::string &src)
+ SfiString operator+ (const std::string &src)
{
- return String (cstring) += src;
+ return SfiString (cstring) += src;
}
bool operator< (const char *src) const { return cmp (src) < 0; }
bool operator<= (const char *src) const { return cmp (src) <= 0; }
@@ -107,12 +109,12 @@ public:
bool operator>= (const char *src) const { return cmp (src) >= 0; }
bool operator!= (const char *src) const { return cmp (src) != 0; }
bool operator== (const char *src) const { return cmp (src) == 0; }
- bool operator< (const String &s) const { return cmp (s.cstring) < 0; }
- bool operator<= (const String &s) const { return cmp (s.cstring) <= 0; }
- bool operator> (const String &s) const { return cmp (s.cstring) > 0; }
- bool operator>= (const String &s) const { return cmp (s.cstring) >= 0; }
- bool operator!= (const String &s) const { return cmp (s.cstring) != 0; }
- bool operator== (const String &s) const { return cmp (s.cstring) == 0; }
+ bool operator< (const SfiString &s) const { return cmp (s.cstring) < 0; }
+ bool operator<= (const SfiString &s) const { return cmp (s.cstring) <= 0; }
+ bool operator> (const SfiString &s) const { return cmp (s.cstring) > 0; }
+ bool operator>= (const SfiString &s) const { return cmp (s.cstring) >= 0; }
+ bool operator!= (const SfiString &s) const { return cmp (s.cstring) != 0; }
+ bool operator== (const SfiString &s) const { return cmp (s.cstring) == 0; }
bool operator< (const std::string &s) const { return cmp (s.c_str()) < 0; }
bool operator<= (const std::string &s) const { return cmp (s.c_str()) <= 0; }
bool operator> (const std::string &s) const { return cmp (s.c_str()) > 0; }
@@ -123,17 +125,16 @@ public:
{
return cstring ? strlen (cstring) : 0;
}
- ~String()
+ ~SfiString()
{
g_free (cstring);
}
/* provide GValue accessors */
- static String value_get_string (const GValue *value)
+ static SfiString value_get_string (const GValue *value)
{
return sfi_value_get_string (value);
}
- static void value_set_string (GValue *value,
- const String& str)
+ static void value_set_string (GValue *value, const SfiString& str)
{
sfi_value_set_string (value, str.c_str());
}
diff --git a/sfi/sfidl-clientcxx.cc b/sfi/sfidl-clientcxx.cc
index 710f512..5688d33 100644
--- a/sfi/sfidl-clientcxx.cc
+++ b/sfi/sfidl-clientcxx.cc
@@ -19,7 +19,7 @@ CodeGeneratorClientCxx::typeArg (const String& type)
{
switch (parser.typeOf (type))
{
- case STRING: return "const Sfi::String&";
+ case STRING: return "const Sfi::SfiString&";
case RECORD: return "const " + type + "Handle&";
case SEQUENCE: return "const " + type + "&";
case CHOICE: return type;
@@ -33,7 +33,7 @@ CodeGeneratorClientCxx::typeField (const String& type)
{
switch (parser.typeOf (type))
{
- case STRING: return "Sfi::String";
+ case STRING: return "Sfi::SfiString";
case RECORD: return type + "Handle";
case CHOICE:
case OBJECT:
@@ -47,7 +47,7 @@ CodeGeneratorClientCxx::typeRet (const String& type)
{
switch (parser.typeOf (type))
{
- case STRING: return "Sfi::String";
+ case STRING: return "Sfi::SfiString";
case RECORD: return type + "Handle";
case CHOICE:
case OBJECT:
@@ -96,7 +96,7 @@ String CodeGeneratorClientCxx::createTypeCode (const String& type, const String&
switch (model)
{
case MODEL_TO_VALUE: return "sfi_value_string ("+name+".c_str())";
- case MODEL_FROM_VALUE: return "::Sfi::String::value_get_string ("+name+")";
+ case MODEL_FROM_VALUE: return "::Sfi::SfiString::value_get_string ("+name+")";
case MODEL_VCALL: return "sfi_glue_vcall_string";
case MODEL_VCALL_ARG: return "'" + scatId (SFI_SCAT_STRING) + "', "+name+".c_str(),";
case MODEL_VCALL_CARG: return "";
diff --git a/sfi/sfidl-corecxx.cc b/sfi/sfidl-corecxx.cc
index adeeda8..2047504 100644
--- a/sfi/sfidl-corecxx.cc
+++ b/sfi/sfidl-corecxx.cc
@@ -358,7 +358,7 @@ public:
case NUM: return "Sfi::Num";
case REAL: return "Sfi::Real";
case CHOICE: return make_fqtn (type);
- case STRING: return "Sfi::String";
+ case STRING: return "Sfi::SfiString";
case BBLOCK: return "Sfi::BBlock";
case FBLOCK: return "Sfi::FBlock";
case SFIREC: return "Sfi::Rec";
@@ -409,7 +409,7 @@ public:
case REAL: return "sfi_value_set_real";
case CHOICE: return intern (s + "sfi_value_set_enum_auto " +
"SFI_START_ARGS() " + make_TYPE_NAME (type) + ", SFI_END_ARGS2");
- case STRING: return "::Sfi::String::value_set_string";
+ case STRING: return "::Sfi::SfiString::value_set_string";
case BBLOCK: return "::Sfi::BBlock::value_set_bblock";
case FBLOCK: return "::Sfi::FBlock::value_set_fblock";
case SFIREC: return "::Sfi::Rec::value_set_rec";
@@ -435,7 +435,7 @@ public:
case REAL: return "sfi_value_get_real";
case CHOICE: return intern (s + "(" + make_fqtn (type) + ") sfi_value_get_enum_auto " +
"SFI_START_ARGS() " + make_TYPE_NAME (type) + ", SFI_END_ARGS1");
- case STRING: return "::Sfi::String::value_get_string";
+ case STRING: return "::Sfi::SfiString::value_get_string";
case BBLOCK: return "::Sfi::BBlock::value_get_bblock";
case FBLOCK: return "::Sfi::FBlock::value_get_fblock";
case SFIREC: return "::Sfi::Rec::value_get_rec";
diff --git a/sfi/sfidl-parser.cc b/sfi/sfidl-parser.cc
index 1cc4551..973bb82 100644
--- a/sfi/sfidl-parser.cc
+++ b/sfi/sfidl-parser.cc
@@ -212,7 +212,7 @@ Type Parser::typeOf (const String& type) const
if (type == "Sfi::Int") return INT;
if (type == "Sfi::Num") return NUM;
if (type == "Sfi::Real") return REAL;
- if (type == "Sfi::String") return STRING;
+ if (type == "Sfi::SfiString") return STRING;
if (isChoice (type)) return CHOICE;
if (type == "Sfi::BBlock") return BBLOCK;
if (type == "Sfi::FBlock") return FBLOCK;
@@ -795,7 +795,7 @@ bool Parser::parse (const String& filename)
defineSymbol ("Int");
defineSymbol ("Num");
defineSymbol ("Real");
- defineSymbol ("String");
+ defineSymbol ("SfiString");
// deprecated: defineSymbol ("BBlock");
// deprecated: defineSymbol ("FBlock");
defineSymbol ("Rec");
diff --git a/sfi/sfiparams.cc b/sfi/sfiparams.cc
index 59ff3db..9b7553e 100644
--- a/sfi/sfiparams.cc
+++ b/sfi/sfiparams.cc
@@ -944,7 +944,7 @@ tmp_choice_values_from_seq (SfiSeq *seq)
{
guint i, l = sfi_seq_length (seq), n = l / 3;
/* check that we got a sequence from choice_values_to_seq() */
- if (n && l == n * 3 && sfi_seq_check (seq, SFI_TYPE_STRING))
+ if (n && l == n * 3 && sfi_seq_check (seq, SFI_TYPE_SFI_STRING))
{
TmpChoiceValues *tcv = g_new0 (TmpChoiceValues, 1);
tcv->ref_count = 1;
@@ -1338,7 +1338,7 @@ sfi_category_type (SfiSCategory cat_type)
case SFI_SCAT_INT: return SFI_TYPE_INT;
case SFI_SCAT_NUM: return SFI_TYPE_NUM;
case SFI_SCAT_REAL: return SFI_TYPE_REAL;
- case SFI_SCAT_STRING: return SFI_TYPE_STRING;
+ case SFI_SCAT_STRING: return SFI_TYPE_SFI_STRING;
case SFI_SCAT_CHOICE: return SFI_TYPE_CHOICE;
case SFI_SCAT_BBLOCK: return SFI_TYPE_BBLOCK;
case SFI_SCAT_FBLOCK: return SFI_TYPE_FBLOCK;
diff --git a/sfi/sfiprimitives.cc b/sfi/sfiprimitives.cc
index bc95b1e..d92deba 100644
--- a/sfi/sfiprimitives.cc
+++ b/sfi/sfiprimitives.cc
@@ -465,7 +465,7 @@ void
sfi_seq_append_string (SfiSeq *seq,
const gchar *string)
{
- GValue *value = sfi_seq_append_empty (seq, SFI_TYPE_STRING);
+ GValue *value = sfi_seq_append_empty (seq, SFI_TYPE_SFI_STRING);
sfi_value_set_string (value, string);
}
@@ -1134,7 +1134,7 @@ sfi_rec_set_string (SfiRec *rec,
const gchar *string)
{
GValue value = { 0, };
- g_value_init (&value, SFI_TYPE_STRING);
+ g_value_init (&value, SFI_TYPE_SFI_STRING);
g_value_set_static_string (&value, string);
sfi_rec_set (rec, field_name, &value);
g_value_unset (&value);
diff --git a/sfi/sfitypes.hh b/sfi/sfitypes.hh
index f013a07..71f4854 100644
--- a/sfi/sfitypes.hh
+++ b/sfi/sfitypes.hh
@@ -23,7 +23,6 @@ typedef double SfiReal;
#define SFI_MINREAL (2.2250738585072014e-308) /* IEEE754 double */
#define SFI_MAXREAL (1.7976931348623157e+308) /* IEEE754 double */
typedef const gchar* SfiChoice;
-typedef gchar* SfiString; /* convenience for code generators */
typedef struct _SfiBBlock SfiBBlock;
typedef struct _SfiFBlock SfiFBlock;
typedef struct _SfiSeq SfiSeq;
diff --git a/sfi/sfivalues.cc b/sfi/sfivalues.cc
index c2e9108..90669fb 100644
--- a/sfi/sfivalues.cc
+++ b/sfi/sfivalues.cc
@@ -120,12 +120,12 @@ sfi_check_value (const GValue *value)
case SFI_TYPE_INT:
case SFI_TYPE_NUM:
case SFI_TYPE_REAL:
- case SFI_TYPE_STRING:
+ case SFI_TYPE_SFI_STRING:
case SFI_TYPE_PSPEC:
return TRUE;
}
/* non fundamentals */
- /* SFI_TYPE_CHOICE is derived from SFI_TYPE_STRING */
+ /* SFI_TYPE_CHOICE is derived from SFI_TYPE_SFI_STRING */
if (ftype == G_TYPE_BOXED)
return (vtype == SFI_TYPE_REC ||
vtype == SFI_TYPE_SEQ ||
@@ -477,7 +477,7 @@ sfi_value_real (SfiReal vreal)
GValue*
sfi_value_string (const gchar *vstring)
{
- GValue *value = alloc_value (SFI_TYPE_STRING);
+ GValue *value = alloc_value (SFI_TYPE_SFI_STRING);
sfi_value_set_string (value, vstring);
return value;
}
@@ -486,7 +486,7 @@ GValue*
sfi_value_lstring (const gchar *vstring,
guint length)
{
- GValue *value = alloc_value (SFI_TYPE_STRING);
+ GValue *value = alloc_value (SFI_TYPE_SFI_STRING);
sfi_value_take_string (value, g_strndup (vstring, vstring ? length : 0));
return value;
}
diff --git a/sfi/sfivalues.hh b/sfi/sfivalues.hh
index b3eb057..3764293 100644
--- a/sfi/sfivalues.hh
+++ b/sfi/sfivalues.hh
@@ -12,7 +12,7 @@ G_BEGIN_DECLS
#define SFI_TYPE_INT G_TYPE_INT
#define SFI_TYPE_NUM G_TYPE_INT64
#define SFI_TYPE_REAL G_TYPE_DOUBLE
-#define SFI_TYPE_STRING G_TYPE_STRING
+#define SFI_TYPE_SFI_STRING G_TYPE_STRING
#define SFI_TYPE_PSPEC G_TYPE_PARAM
@@ -31,7 +31,7 @@ G_BEGIN_DECLS
#define SFI_VALUE_HOLDS_INT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), SFI_TYPE_INT))
#define SFI_VALUE_HOLDS_NUM(value) (G_TYPE_CHECK_VALUE_TYPE ((value), SFI_TYPE_NUM))
#define SFI_VALUE_HOLDS_REAL(value) (G_TYPE_CHECK_VALUE_TYPE ((value), SFI_TYPE_REAL))
-#define SFI_VALUE_HOLDS_STRING(value) (G_TYPE_CHECK_VALUE_TYPE ((value), SFI_TYPE_STRING))
+#define SFI_VALUE_HOLDS_STRING(value) (G_TYPE_CHECK_VALUE_TYPE ((value), SFI_TYPE_SFI_STRING))
#define SFI_VALUE_HOLDS_CHOICE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), SFI_TYPE_CHOICE))
#define SFI_VALUE_HOLDS_BBLOCK(value) (G_TYPE_CHECK_VALUE_TYPE ((value), SFI_TYPE_BBLOCK))
#define SFI_VALUE_HOLDS_FBLOCK(value) (G_TYPE_CHECK_VALUE_TYPE ((value), SFI_TYPE_FBLOCK))
diff --git a/sfi/tests/testcxx.cc b/sfi/tests/testcxx.cc
index 77f0169..e73c1da 100644
--- a/sfi/tests/testcxx.cc
+++ b/sfi/tests/testcxx.cc
@@ -25,17 +25,17 @@ main (int argc,
{
sfi_init_test (&argc, argv);
- TSTART ("Test String");
- TASSERT (sizeof (String) == sizeof (const char*));
- String s1 = "huhu";
- String s2;
+ TSTART ("Test SfiString");
+ TASSERT (sizeof (SfiString) == sizeof (const char*));
+ SfiString s1 = "huhu";
+ SfiString s2;
s2 += "huhu";
TASSERT (strcmp (s1.c_str(), "huhu") == 0);
TASSERT (s1 == s2);
TASSERT (s1 + "HAHA" == std::string ("huhuHAHA"));
s2 += "1";
TASSERT (s1 != s2);
- String s3 = "huhu1";
+ SfiString s3 = "huhu1";
TASSERT (s2 == s3);
TDONE();
TSTART ("Test RecordHandle<>");
diff --git a/tests/bse/testplugin.idl b/tests/bse/testplugin.idl
index c766bc5..6e25d69 100644
--- a/tests/bse/testplugin.idl
+++ b/tests/bse/testplugin.idl
@@ -11,7 +11,7 @@ enum FunkynessType {
// test record
record TestRecord {
Int i;
- String str;
+ SfiString str;
FunkynessType funky;
};
sequence TestSequence {
diff --git a/tests/latency/bselatencytest.idl b/tests/latency/bselatencytest.idl
index a9c4d1e..09e00ff 100644
--- a/tests/latency/bselatencytest.idl
+++ b/tests/latency/bselatencytest.idl
@@ -20,14 +20,14 @@ interface LatencyTest : Effect {
Real threshold_db = Gain (_("Threshold [dB]"),
_("Input signal needs to be louder than this to be counted as active"),
-24, -96, 0, 1, STANDARD ":scale");
- String logfile_name = SfiString (_("Log File Name"), _("When set, the latency information will be
written to this log file, stdout otherwise."),
+ SfiString logfile_name = SfiString (_("Log File Name"), _("When set, the latency information will be
written to this log file, stdout otherwise."),
"", STANDARD);
};
group _("MIDI setup") {
Int midi_note = Note (_("Note"), "", BSE_KAMMER_NOTE, STANDARD);
Int midi_channel = SfiInt (_("Midi Output Channel"), _("The midi output device where the tester sends
its events"),
1, 1, 16, 1, STANDARD);
- String midi_output = SfiString (_("Midi Output Device"),
+ SfiString midi_output = SfiString (_("Midi Output Device"),
_("The midi output device where the tester sends its events. "
"This may be a named pipe (see man 1 mkfifo) which can be used "
"with the OSS midi driver. If the name starts out with a \"$\", "
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]