summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.cc22
-rw-r--r--gtk2_ardour/editor_drag.cc4
-rw-r--r--gtk2_ardour/engine_dialog.cc21
3 files changed, 32 insertions, 15 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index ff65a683e0..3e76c3af5b 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -35,6 +35,8 @@
#include <iostream>
#include <sys/resource.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
#include <gtkmm/messagedialog.h>
#include <gtkmm/accelmap.h>
@@ -662,8 +664,14 @@ ARDOUR_UI::check_memory_locking ()
struct rlimit limits;
int64_t ram;
long pages, page_size;
-
- if ((page_size = sysconf (_SC_PAGESIZE)) < 0 ||(pages = sysconf (_SC_PHYS_PAGES)) < 0) {
+#ifdef __FreeBSD__
+ size_t pages_len=sizeof(pages);
+ if ((page_size = getpagesize()) < 0 ||
+ sysctlbyname("hw.availpages", &pages, &pages_len, NULL, 0))
+#else
+ if ((page_size = sysconf (_SC_PAGESIZE)) < 0 ||(pages = sysconf (_SC_PHYS_PAGES)) < 0)
+#endif
+ {
ram = 0;
} else {
ram = (int64_t) pages * (int64_t) page_size;
@@ -683,8 +691,14 @@ ARDOUR_UI::check_memory_locking ()
"This might cause %1 to run out of memory before your system "
"runs out of memory. \n\n"
"You can view the memory limit with 'ulimit -l', "
- "and it is normally controlled by /etc/security/limits.conf"),
- PROGRAM_NAME).c_str());
+ "and it is normally controlled by %2"),
+ PROGRAM_NAME).c_str(),
+#ifdef __FreeBSD__
+ X_("/etc/login.conf")
+#else
+ X_(" /etc/security/limits.conf")
+#endif
+ );
msg.set_default_response (RESPONSE_OK);
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 1cc5e97dc6..de211cbd18 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -1480,7 +1480,7 @@ RegionCreateDrag::motion (GdkEvent* event, bool first_move)
place snapped notes at the start of the region.
*/
- framecnt_t const len = abs (f - grab_frame () - 1);
+ framecnt_t const len = (int) fabs (f - grab_frame () - 1);
_region->set_length (len < 1 ? 1 : len);
}
}
@@ -4694,7 +4694,7 @@ NoteCreateDrag::finished (GdkEvent*, bool had_movement)
}
framepos_t const start = min (_note[0], _note[1]);
- framecnt_t length = abs (_note[0] - _note[1]);
+ framecnt_t length = (int) fabs (_note[0] - _note[1]);
framecnt_t const g = grid_frames (start);
double const one_tick = 1 / Timecode::BBT_Time::ticks_per_beat;
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc
index 2e51554a66..e8151f88ee 100644
--- a/gtk2_ardour/engine_dialog.cc
+++ b/gtk2_ardour/engine_dialog.cc
@@ -35,7 +35,7 @@
#include <CoreFoundation/CFString.h>
#include <sys/param.h>
#include <mach-o/dyld.h>
-#else
+#elif !defined(__FreeBSD__)
#include <alsa/asoundlib.h>
#endif
@@ -139,7 +139,9 @@ EngineControl::EngineControl ()
#ifdef __APPLE__
strings.push_back (X_("CoreAudio"));
#else
+#ifndef __FreeBSD__
strings.push_back (X_("ALSA"));
+#endif
strings.push_back (X_("OSS"));
strings.push_back (X_("FreeBoB"));
strings.push_back (X_("FFADO"));
@@ -192,7 +194,7 @@ EngineControl::EngineControl ()
basic_packer.attach (period_size_combo, 1, 2, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
row++;
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
label = manage (left_aligned_label (_("Number of buffers:")));
basic_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
basic_packer.attach (periods_spinner, 1, 2, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
@@ -212,7 +214,7 @@ EngineControl::EngineControl ()
row++;
/* no audio mode with CoreAudio, its duplex or nuthin' */
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
label = manage (left_aligned_label (_("Audio mode:")));
basic_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
basic_packer.attach (audio_mode_combo, 1, 2, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
@@ -252,7 +254,7 @@ EngineControl::EngineControl ()
#if PROVIDE_TOO_MANY_OPTIONS
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
options_packer.attach (no_memory_lock_button, 1, 2, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
++row;
options_packer.attach (unlock_memory_button, 1, 2, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
@@ -300,7 +302,7 @@ EngineControl::EngineControl ()
options_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
++row;
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
label = manage (left_aligned_label (_("Dither:")));
options_packer.attach (dither_mode_combo, 1, 2, row, row + 1, FILL|EXPAND, AttachOptions(0));
options_packer.attach (*label, 0, 1, row, row + 1, FILL|EXPAND, (AttachOptions) 0);
@@ -329,7 +331,7 @@ EngineControl::EngineControl ()
device_packer.set_spacings (6);
row = 0;
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
label = manage (left_aligned_label (_("Input device:")));
device_packer.attach (*label, 0, 1, row, row+1, FILL|EXPAND, (AttachOptions) 0);
device_packer.attach (input_device_combo, 1, 2, row, row+1, FILL|EXPAND, (AttachOptions) 0);
@@ -664,7 +666,7 @@ EngineControl::enumerate_devices (const string& driver)
devices[driver] = enumerate_coreaudio_devices ();
#endif
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
} else if (driver == "ALSA") {
devices[driver] = enumerate_alsa_devices ();
} else if (driver == "FreeBOB") {
@@ -794,7 +796,7 @@ Ardour and choose the relevant device then."
return devs;
}
-#else
+#ifndef __FreeBSD__
vector<string>
EngineControl::enumerate_alsa_devices ()
{
@@ -838,6 +840,7 @@ EngineControl::enumerate_alsa_devices ()
return devs;
}
+#endif
vector<string>
EngineControl::enumerate_ffado_devices ()
@@ -937,7 +940,7 @@ void
EngineControl::redisplay_latency ()
{
uint32_t rate = get_rate();
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__)
float periods = 2;
#else
float periods = periods_adjustment.get_value();