*/
+#ifdef WAF_BUILD
+#include "libardour-config.h"
+#endif
+
#define __STDC_FORMAT_MACROS 1
#include <stdint.h>
}
-ostream&
-operator<< (ostream& o, const BBT_Time& bbt)
-{
- o << bbt.bars << '|' << bbt.beats << '|' << bbt.ticks;
- return o;
-}
-
XMLNode *
find_named_node (const XMLNode& node, string name)
{
path = path.substr(pos+1);
}
- /* remove filename suffixes etc. */
+ /* remove filename suffixes etc. */
if ((pos = path.find_last_of ('.')) != string::npos) {
path = path.substr (0, pos);
}
}
-SlaveSource
-string_to_slave_source (string str)
+SyncSource
+string_to_sync_source (string str)
{
- if (str == _("Internal")) {
- return None;
- }
-
- if (str == _("MTC")) {
+ if (str == _("MIDI Timecode")) {
return MTC;
}
return JACK;
}
- fatal << string_compose (_("programming error: unknown slave source string \"%1\""), str) << endmsg;
+ fatal << string_compose (_("programming error: unknown sync source string \"%1\""), str) << endmsg;
/*NOTREACHED*/
- return None;
+ return JACK;
}
const char*
-slave_source_to_string (SlaveSource src)
+sync_source_to_string (SyncSource src)
{
switch (src) {
case JACK:
return _("JACK");
case MTC:
- return _("MTC");
+ return _("MIDI Timecode");
case MIDIClock:
return _("MIDI Clock");
-
- default:
- case None:
- return _("Internal");
-
}
+ /* GRRRR .... stupid, stupid gcc - you can't get here from there, all enum values are handled */
+ return _("JACK");
}
-/* I don't really like hard-coding these falloff rates here
- * Probably should use a map of some kind that could be configured
- * These rates are db/sec.
-*/
-
-#define METER_FALLOFF_OFF 0.0f
-#define METER_FALLOFF_SLOWEST 6.6f // BBC standard
-#define METER_FALLOFF_SLOW 8.6f // BBC standard
-#define METER_FALLOFF_MEDIUM 20.0f
-#define METER_FALLOFF_FAST 32.0f
-#define METER_FALLOFF_FASTER 46.0f
-#define METER_FALLOFF_FASTEST 70.0f
-
float
meter_falloff_to_float (MeterFalloff falloff)
{
}
else if (val <= METER_FALLOFF_FASTER) {
return MeterFalloffFaster;
- }
+ }
else {
return MeterFalloffFastest;
}
}
-float
-meter_hold_to_float (MeterHold hold)
-{
- switch (hold) {
- case MeterHoldOff:
- return 0.0f;
- case MeterHoldShort:
- return 40.0f;
- case MeterHoldMedium:
- return 100.0f;
- case MeterHoldLong:
- default:
- return 200.0f;
- }
-}
-
AutoState
ARDOUR::string_to_auto_state (std::string str)
{
return "";
}
+std::string
+bool_as_string (bool yn)
+{
+ return (yn ? "yes" : "no");
+}
+
+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); }
}