#include "libardour-config.h"
#endif
+#ifdef interface
+#undef interface
+#endif
+
#include <cstdio> // Needed so that libraptor (included in lrdf) won't complain
#include <cstdlib>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
+#ifndef PLATFORM_WINDOWS
#include <sys/resource.h>
+#endif
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include "ardour/audio_unit.h"
#endif
-#ifdef __SSE__
+#if defined(__SSE__) || defined(USE_XMMINTRIN)
#include <xmmintrin.h>
#endif
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
+#ifdef HAVE_LRDF
#include <lrdf.h>
+#endif
#include "pbd/cpus.h"
#include "pbd/error.h"
static void
lotsa_files_please ()
{
+#ifndef PLATFORM_WINDOWS
struct rlimit rl;
if (getrlimit (RLIMIT_NOFILE, &rl) == 0) {
} else {
error << string_compose (_("Could not get system open files limit (%1)"), strerror (errno)) << endmsg;
}
+#endif
}
int
// allow ardour the absolute maximum number of open files
lotsa_files_please ();
+#ifdef HAVE_LRDF
lrdf_init();
+#endif
Library = new AudioLibrary;
BootMessage (_("Loading configuration"));
ARDOUR::cleanup ()
{
delete Library;
+#ifdef HAVE_LRDF
lrdf_cleanup ();
+#endif
delete &ControlProtocolManager::instance();
#ifdef WINDOWS_VST_SUPPORT
fst_exit ();
bool
ARDOUR::translations_are_enabled ()
{
- if (Glib::file_test (translation_enable_path(), Glib::FILE_TEST_EXISTS)) {
- return true;
- }
+ int fd = ::open (ARDOUR::translation_enable_path().c_str(), O_RDONLY);
+
+ if (fd < 0) {
+ return translate_by_default;
+ }
+
+ char c;
+ bool ret = false;
- return translate_by_default;
+ if (::read (fd, &c, 1) == 1 && c == '1') {
+ ret = true;
+ }
+
+ ::close (fd);
+
+ return ret;
}
bool
ARDOUR::set_translations_enabled (bool yn)
{
string i18n_enabler = ARDOUR::translation_enable_path();
+ int fd = ::open (i18n_enabler.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0644);
- if (yn) {
- int fd = ::open (i18n_enabler.c_str(), O_RDONLY|O_CREAT, 0644);
- if (fd >= 0) {
- close (fd);
- return true;
- }
+ if (fd < 0) {
return false;
- }
+ }
+
+ char c;
+
+ if (yn) {
+ c = '1';
+ } else {
+ c = '0';
+ }
+
+ ::write (fd, &c, 1);
+ ::close (fd);
- return unlink (i18n_enabler.c_str()) == 0;
+ return true;
}