#include <cerrno>
#include <iostream>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#ifndef COMPILER_MSVC
#include <errno.h>
#include <regex.h>
+#include "pbd/gstdio_compat.h"
+
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
* version.
*/
-string
+string
ARDOUR::legalize_for_path_2X (const string& str)
{
string::size_type pos;
string legal_chars = "abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+=: ";
Glib::ustring legal;
-
+
/* this is the one place in Ardour where we need to iterate across
* potential multibyte characters, and thus we need Glib::ustring
*/
return retval;
}
-int
-ARDOUR::touch_file (string path)
-{
- int fd = open (path.c_str(), O_RDWR|O_CREAT, 0660);
- if (fd >= 0) {
- close (fd);
- return 0;
- }
- return 1;
-}
-
string
ARDOUR::region_name_from_path (string path, bool strip_channels, bool add_channel_suffix, uint32_t total, uint32_t this_one)
{
return Splice;
} else if (str == _("Slide")) {
return Slide;
+ } else if (str == _("Ripple")) {
+ return Ripple;
} else if (str == _("Lock")) {
return Lock;
}
fatal << string_compose (_("programming error: unknown edit mode string \"%1\""), str) << endmsg;
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
return Slide;
}
case Lock:
return _("Lock");
+ case Ripple:
+ return _("Ripple");
+
default:
case Splice:
return _("Splice");
return Engine;
}
+ if (str == _("LTC")) {
+ return LTC;
+ }
+
fatal << string_compose (_("programming error: unknown sync source string \"%1\""), str) << endmsg;
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
return Engine;
}
case MeterFalloffModerate:
return METER_FALLOFF_MODERATE;
case MeterFalloffFast:
- return METER_FALLOFF_FAST;
- case MeterFalloffFaster:
- return METER_FALLOFF_FASTER;
+ case MeterFalloffFaster: // backwards compat enum MeterFalloff
case MeterFalloffFastest:
- return METER_FALLOFF_FASTEST;
default:
return METER_FALLOFF_FAST;
}
else if (val <= METER_FALLOFF_MEDIUM) {
return MeterFalloffMedium;
}
- else if (val <= METER_FALLOFF_FAST) {
- return MeterFalloffFast;
- }
- else if (val <= METER_FALLOFF_FASTER) {
- return MeterFalloffFaster;
- }
else {
- return MeterFalloffFastest;
+ return MeterFalloffFast;
}
}
}
fatal << string_compose (_("programming error: %1 %2"), "illegal AutoState string: ", str) << endmsg;
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
return Touch;
}
}
fatal << string_compose (_("programming error: %1 %2"), "illegal AutoState type: ", as) << endmsg;
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
return "";
}
}
fatal << string_compose (_("programming error: %1 %2"), "illegal AutoStyle string: ", str) << endmsg;
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
return Trim;
}
}
fatal << string_compose (_("programming error: %1 %2"), "illegal AutoStyle type: ", as) << endmsg;
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
return "";
}
case iXML:
return ".ixml";
case RF64:
+ case RF64_WAV:
+ case MBWF:
return ".rf64";
}
fatal << string_compose (_("programming error: unknown native header format: %1"), hf);
- /*NOTREACHED*/
+ abort(); /*NOTREACHED*/
return ".wav";
}
bool
ARDOUR::matching_unsuffixed_filename_exists_in (const string& dir, const string& path)
{
- string bws = basename_nosuffix (path);
+ string bws = basename_nosuffix (path);
struct dirent* dentry;
- struct stat statbuf;
+ GStatBuf statbuf;
DIR* dead;
- bool ret = false;
+ bool ret = false;
if ((dead = ::opendir (dir.c_str())) == 0) {
error << string_compose (_("cannot open directory %1 (%2)"), dir, strerror (errno)) << endl;
string fullpath = Glib::build_filename (dir, dentry->d_name);
- if (::stat (fullpath.c_str(), &statbuf)) {
+ if (g_stat (fullpath.c_str(), &statbuf)) {
continue;
}
extern "C" {
void c_stacktrace() { stacktrace (cerr); }
}
+