#include <cstdio> /* for sprintf */
#include <cmath>
#include <cctype>
-#include <string>
+#include <cstring>
#include <cerrno>
#include <iostream>
#include <sys/types.h>
ustring::size_type pos;
ustring legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=: ";
ustring legal;
-
- legal = str;
- pos = 0;
-
- while ((pos = legal.find_first_not_of (legal_chars, pos)) != string::npos) {
- legal.replace (pos, 1, "_");
- pos += 1;
- }
-
- return legal;
-}
-#if 0
-string
-legalize_for_path (string str)
-{
- string::size_type pos;
- string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=: ";
- string legal;
-
+
legal = str;
pos = 0;
return legal;
}
-#endif
string bump_name_once(std::string name)
{
{
double step;
- step = 1.0/nframes;
+ step = 1.0/(nframes-1);
in[0] = 0.0f;
return Splice;
} else if (str == _("Slide Edit")) {
return Slide;
+ } else if (str == _("Lock Edit")) {
+ return Lock;
}
fatal << string_compose (_("programming error: unknown edit mode string \"%1\""), str) << endmsg;
/*NOTREACHED*/
case Slide:
return _("Slide Edit");
+ case Lock:
+ return _("Lock Edit");
+
default:
case Splice:
return _("Splice Edit");
return "";
}
+bool
+string_is_affirmative (const std::string& str)
+{
+ /* to be used only with XML data - not intended to handle user input */
+
+ return str == "1" || str == "y" || str == "Y" || (!g_strncasecmp(str.c_str(), "yes", str.length()));
+}
+
extern "C" {
void c_stacktrace() { stacktrace (cerr); }
}