summaryrefslogtreecommitdiff
path: root/libs/ardour/utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/utils.cc')
-rw-r--r--libs/ardour/utils.cc39
1 files changed, 38 insertions, 1 deletions
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc
index 9e8603827a..83b0c3101e 100644
--- a/libs/ardour/utils.cc
+++ b/libs/ardour/utils.cc
@@ -281,7 +281,7 @@ compute_equal_power_fades (jack_nframes_t nframes, float* in, float* out)
in[0] = 0.0f;
- for (int i = 1; i < nframes - 1; ++i) {
+ for (jack_nframes_t i = 1; i < nframes - 1; ++i) {
in[i] = in[i-1] + step;
}
@@ -297,3 +297,40 @@ compute_equal_power_fades (jack_nframes_t nframes, float* in, float* out)
in[n] = inVal * (scale * inVal + 1.0f - scale);
}
}
+
+SlaveSource
+string_to_slave_source (string str)
+{
+ if (str == _("Internal")) {
+ return None;
+ }
+
+ if (str == _("MTC")) {
+ return MTC;
+ }
+
+ if (str == _("JACK")) {
+ return JACK;
+ }
+
+ fatal << string_compose (_("programming error: unknown slave source string \"%1\""), str) << endmsg;
+ /*NOTREACHED*/
+ return None;
+}
+
+const char*
+slave_source_to_string (SlaveSource src)
+{
+ switch (src) {
+ case JACK:
+ return _("JACK");
+
+ case MTC:
+ return _("MTC");
+
+ default:
+ case None:
+ return _("Internal");
+
+ }
+}