summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-01-10 16:07:57 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-01-10 16:07:57 -0500
commit3020b224fa2d6e1b6b8a576e8e8e211e0585f2a2 (patch)
tree314c3099bcc57d9af09d249e1e7dd8e45baca642 /gtk2_ardour
parentd15fda6d751a465d278f477923075d4783f3b1ca (diff)
parent897fbdc652434d3aa1e67223c3c3ef7ae9be2318 (diff)
Merge windows+cc branch into cairocanvas branch. Not finished, need to now merge windows branch to get changes from there
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/about.cc9
-rw-r--r--gtk2_ardour/ardour_ui.cc48
-rw-r--r--gtk2_ardour/ardour_ui.h28
-rw-r--r--gtk2_ardour/ardour_ui_dialogs.cc4
-rw-r--r--gtk2_ardour/audio_clock.cc4
-rw-r--r--gtk2_ardour/audio_region_editor.cc30
-rw-r--r--gtk2_ardour/audio_region_editor.h10
-rw-r--r--gtk2_ardour/audio_region_view.cc15
-rw-r--r--gtk2_ardour/audio_region_view.h4
-rw-r--r--gtk2_ardour/audio_time_axis.cc6
-rw-r--r--gtk2_ardour/automation_line.cc13
-rw-r--r--gtk2_ardour/automation_time_axis.cc12
-rw-r--r--gtk2_ardour/big_clock_window.cc7
-rw-r--r--gtk2_ardour/bundle_manager.cc2
-rw-r--r--gtk2_ardour/canvas-waveview.c2
-rw-r--r--gtk2_ardour/editor_canvas.cc2
-rw-r--r--gtk2_ardour/editor_drag.cc6
-rw-r--r--gtk2_ardour/editor_export_audio.cc6
-rw-r--r--gtk2_ardour/editor_markers.cc4
-rw-r--r--gtk2_ardour/editor_ops.cc2
-rw-r--r--gtk2_ardour/editor_rulers.cc8
-rw-r--r--gtk2_ardour/editor_timefx.cc5
-rw-r--r--gtk2_ardour/editor_videotimeline.cc4
-rw-r--r--gtk2_ardour/export_channel_selector.h4
-rw-r--r--gtk2_ardour/export_dialog.cc2
-rw-r--r--gtk2_ardour/export_format_dialog.h4
-rw-r--r--gtk2_ardour/export_timespan_selector.cc6
-rw-r--r--gtk2_ardour/export_timespan_selector.h5
-rw-r--r--gtk2_ardour/export_video_dialog.cc20
-rw-r--r--gtk2_ardour/export_video_infobox.cc3
-rw-r--r--gtk2_ardour/fft_graph.cc43
-rw-r--r--gtk2_ardour/fft_result.cc4
-rw-r--r--gtk2_ardour/generic_pluginui.cc7
-rw-r--r--gtk2_ardour/global_port_matrix.cc10
-rw-r--r--gtk2_ardour/global_port_matrix.h4
-rw-r--r--gtk2_ardour/gtk-custom-hruler.c2
-rw-r--r--gtk2_ardour/gtk-custom-ruler.c5
-rw-r--r--gtk2_ardour/gtk_pianokeyboard.c12
-rw-r--r--gtk2_ardour/hit.cc2
-rw-r--r--gtk2_ardour/main.cc37
-rw-r--r--gtk2_ardour/main_clock.cc2
-rw-r--r--gtk2_ardour/meter_patterns.cc2
-rw-r--r--gtk2_ardour/midi_channel_selector.cc8
-rw-r--r--gtk2_ardour/midi_region_view.cc4
-rw-r--r--gtk2_ardour/midi_time_axis.cc15
-rw-r--r--gtk2_ardour/midi_tracer.cc5
-rw-r--r--gtk2_ardour/missing_file_dialog.cc13
-rw-r--r--gtk2_ardour/mixer_strip.cc4
-rw-r--r--gtk2_ardour/note.cc4
-rw-r--r--gtk2_ardour/nsmclient.cc4
-rw-r--r--gtk2_ardour/option_editor.h24
-rw-r--r--gtk2_ardour/panner2d.cc12
-rw-r--r--gtk2_ardour/panner_ui.cc2
-rw-r--r--gtk2_ardour/patch_change_dialog.cc2
-rw-r--r--gtk2_ardour/pingback.cc6
-rw-r--r--gtk2_ardour/plugin_eq_gui.cc15
-rw-r--r--gtk2_ardour/plugin_selector.cc1
-rw-r--r--gtk2_ardour/plugin_ui.cc2
-rw-r--r--gtk2_ardour/port_matrix.cc2
-rw-r--r--gtk2_ardour/processor_box.cc2
-rw-r--r--gtk2_ardour/rc_option_editor.cc4
-rw-r--r--gtk2_ardour/rc_option_editor.h5
-rw-r--r--gtk2_ardour/region_view.h4
-rw-r--r--gtk2_ardour/return_ui.cc2
-rw-r--r--gtk2_ardour/route_time_axis.cc6
-rw-r--r--gtk2_ardour/route_ui.cc24
-rw-r--r--gtk2_ardour/send_ui.cc2
-rw-r--r--gtk2_ardour/session_metadata_dialog.h6
-rw-r--r--gtk2_ardour/session_option_editor.h5
-rw-r--r--gtk2_ardour/sfdb_freesound_mootcher.cc2
-rw-r--r--gtk2_ardour/sfdb_ui.cc8
-rw-r--r--gtk2_ardour/system_exec.cc15
-rw-r--r--gtk2_ardour/system_exec.h2
-rw-r--r--gtk2_ardour/transcode_ffmpeg.cc14
-rw-r--r--gtk2_ardour/transcode_video_dialog.cc6
-rw-r--r--gtk2_ardour/ui_config.cc2
-rw-r--r--gtk2_ardour/utils.cc6
-rw-r--r--gtk2_ardour/video_image_frame.cc6
-rw-r--r--gtk2_ardour/video_monitor.cc4
-rw-r--r--gtk2_ardour/video_server_dialog.cc6
-rw-r--r--gtk2_ardour/video_timeline.cc8
-rw-r--r--gtk2_ardour/window_manager.h2
-rw-r--r--gtk2_ardour/wscript9
83 files changed, 426 insertions, 252 deletions
diff --git a/gtk2_ardour/about.cc b/gtk2_ardour/about.cc
index 280f72a8dc..df1bd586c5 100644
--- a/gtk2_ardour/about.cc
+++ b/gtk2_ardour/about.cc
@@ -20,7 +20,6 @@
#include <algorithm>
#include <unistd.h>
#include <sys/types.h>
-#include <sys/wait.h>
#include <cstdio>
#include <ctime>
#include <cstdlib>
@@ -265,7 +264,7 @@ patent must be licensed for everyone's free use or not licensed at all.\n\
The precise terms and conditions for copying, distribution and\n\
modification follow.\n\
\n\
- GNU GENERAL PUBLIC LICENSE\n\
+"" GNU GENERAL PUBLIC LICENSE\n\
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\
\n\
0. This License applies to any program or other work which contains\n\
@@ -547,7 +546,9 @@ proprietary programs. If your program is a subroutine library, you may\n\
consider it more useful to permit linking proprietary applications with the\n\
library. If this is what you want to do, use the GNU Library General\n\
Public License instead of this License.\n\
-");
+"); /* Note that at the start of (approximately) line 265, the above license
+ text has been split into two concatenated tokens (to satisfy compilation
+ under MSVC). Hopefully this won't affect gcc */
About::About ()
: config_info (0)
@@ -561,7 +562,7 @@ About::About ()
std::string splash_file;
- SearchPath spath(ardour_data_search_path());
+ Searchpath spath(ardour_data_search_path());
if (find_file_in_search_path (spath, "splash.png", splash_file)) {
set_logo (Gdk::Pixbuf::create_from_file (splash_file));
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 6337b1919f..a2a5f0a385 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -27,15 +27,18 @@
#include <cerrno>
#include <fstream>
+#ifndef PLATFORM_WINDOWS
+#include <sys/resource.h>
+#endif
+
#include <stdint.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#include <time.h>
-#include <sys/resource.h>
-#include <sys/types.h>
-#include <sys/sysctl.h>
+#include <glib.h>
+#include <glib/gstdio.h>
#include <gtkmm/messagedialog.h>
#include <gtkmm/accelmap.h>
@@ -48,6 +51,7 @@
#include "pbd/memento_command.h"
#include "pbd/openuri.h"
#include "pbd/file_utils.h"
+#include "pbd/localtime_r.h"
#include "gtkmm2ext/application.h"
#include "gtkmm2ext/bindings.h"
@@ -293,7 +297,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
/* and ambiguous files */
- ARDOUR::FileSource::AmbiguousFileName.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::ambiguous_file, this, _1, _2, _3));
+ ARDOUR::FileSource::AmbiguousFileName.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::ambiguous_file, this, _1, _2));
/* lets get this party started */
@@ -753,8 +757,9 @@ ARDOUR_UI::starting ()
// wait for announce reply from nsm server
for ( i = 0; i < 5000; ++i) {
nsm->check ();
- usleep (i);
- if (nsm->is_active()) {
+
+ Glib::usleep (i);
+ if (nsm->is_active())
break;
}
}
@@ -765,8 +770,9 @@ ARDOUR_UI::starting ()
// wait for open command from nsm server
for ( i = 0; i < 5000; ++i) {
nsm->check ();
- usleep (1000);
- if (nsm->client_id ()) {
+
+ Glib::usleep (1000);
+ if (nsm->client_id ())
break;
}
}
@@ -848,7 +854,7 @@ ARDOUR_UI::starting ()
void
ARDOUR_UI::check_memory_locking ()
{
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(PLATFORM_WINDOWS)
/* OS X doesn't support mlockall(2), and so testing for memory locking capability there is pointless */
return;
#else // !__APPLE__
@@ -3102,13 +3108,13 @@ require some unused files to continue to exist."));
space_adjusted = rep.space;
} else if (rep.space < 1000000) {
bprefix = _("kilo");
- space_adjusted = truncf((float)rep.space / 1000.0);
+ space_adjusted = floorf((float)rep.space / 1000.0);
} else if (rep.space < 1000000 * 1000) {
bprefix = _("mega");
- space_adjusted = truncf((float)rep.space / (1000.0 * 1000.0));
+ space_adjusted = floorf((float)rep.space / (1000.0 * 1000.0));
} else {
bprefix = _("giga");
- space_adjusted = truncf((float)rep.space / (1000.0 * 1000 * 1000.0));
+ space_adjusted = floorf((float)rep.space / (1000.0 * 1000 * 1000.0));
}
if (msg_delete) {
@@ -3453,16 +3459,24 @@ ARDOUR_UI::start_video_server (Gtk::Window* float_window, bool popup_msg)
std::string icsd_docroot = video_server_dialog->get_docroot();
if (icsd_docroot.empty()) {icsd_docroot = X_("/");}
- struct stat sb;
- if (!lstat (icsd_docroot.c_str(), &sb) == 0 || !S_ISDIR(sb.st_mode)) {
+ GStatBuf sb;
+ if (!g_lstat (icsd_docroot.c_str(), &sb) == 0 || !S_ISDIR(sb.st_mode)) {
warning << _("Specified docroot is not an existing directory.") << endmsg;
continue;
}
- if ( (!lstat (icsd_exec.c_str(), &sb) == 0)
+#ifndef PLATFORM_WINDOWS
+ if ( (!g_lstat (icsd_exec.c_str(), &sb) == 0)
|| (sb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == 0 ) {
warning << _("Given Video Server is not an executable file.") << endmsg;
continue;
}
+#else
+ if ( (!g_lstat (icsd_exec.c_str(), &sb) == 0)
+ || (sb.st_mode & (S_IXUSR)) == 0 ) {
+ warning << _("Given Video Server is not an executable file.") << endmsg;
+ continue;
+ }
+#endif
char **argp;
argp=(char**) calloc(9,sizeof(char*));
@@ -3498,7 +3512,7 @@ ARDOUR_UI::start_video_server (Gtk::Window* float_window, bool popup_msg)
}
int timeout = 120; // 6 sec
while (!ARDOUR_UI::instance()->video_timeline->check_server()) {
- usleep (50000);
+ Glib::usleep (50000);
if (--timeout <= 0 || !video_server_process->is_running()) break;
}
if (timeout <= 0) {
@@ -4126,7 +4140,7 @@ ARDOUR_UI::missing_file (Session*s, std::string str, DataType type)
}
int
-ARDOUR_UI::ambiguous_file (std::string file, std::string /*path*/, std::vector<std::string> hits)
+ARDOUR_UI::ambiguous_file (std::string file, std::vector<std::string> hits)
{
AmbiguousFileDialog dialog (file, hits);
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 78cc46efb5..1561a0102c 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -66,30 +66,37 @@
#include "video_timeline.h"
+#include "about.h"
#include "ardour_button.h"
#include "ardour_dialog.h"
#include "ardour_window.h"
#include "editing.h"
+#include "engine_dialog.h"
#include "meterbridge.h"
#include "ui_config.h"
#include "enums.h"
#include "visibility_group.h"
#include "window_manager.h"
-class About;
-class AddRouteDialog;
-class AddVideoDialog;
+#include "add_route_dialog.h"
+#include "add_video_dialog.h"
+#include "big_clock_window.h"
+#include "bundle_manager.h"
+#include "global_port_matrix.h"
+#include "keyeditor.h"
+#include "location_ui.h"
+#include "rc_option_editor.h"
+#include "route_params_ui.h"
+#include "session_option_editor.h"
+#include "speaker_dialog.h"
+#include "theme_manager.h"
+
class VideoTimeLine;
class SystemExec;
class ArdourKeyboard;
class AudioClock;
-class BigClockWindow;
-class BundleManager;
class ButtonJoiner;
class ConnectionEditor;
-class EngineControl;
-class KeyEditor;
-class LocationUIWindow;
class MainClock;
class Mixer_UI;
class PublicEditor;
@@ -99,13 +106,10 @@ class SessionDialog;
class SessionOptionEditor;
class ShuttleControl;
class Splash;
-class SpeakerDialog;
-class ThemeManager;
class TimeInfoBox;
class MidiTracer;
class NSM_Client;
class LevelMeterHBox;
-class GlobalPortMatrixWindow;
class GUIObjectState;
namespace Gtkmm2ext {
@@ -721,7 +725,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void fontconfig_dialog ();
int missing_file (ARDOUR::Session*s, std::string str, ARDOUR::DataType type);
- int ambiguous_file (std::string file, std::string path, std::vector<std::string> hits);
+ int ambiguous_file (std::string file, std::vector<std::string> hits);
bool click_button_clicked (GdkEventButton *);
diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc
index d127c40343..2cfa27cbb2 100644
--- a/gtk2_ardour/ardour_ui_dialogs.cc
+++ b/gtk2_ardour/ardour_ui_dialogs.cc
@@ -27,6 +27,10 @@
#include "ardour/audioengine.h"
#include "ardour/automation_watch.h"
+#ifdef interface
+#undef interface
+#endif
+
#include "actions.h"
#include "add_route_dialog.h"
#include "add_video_dialog.h"
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index b24d22f1b9..7bbc00c267 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -1131,7 +1131,7 @@ AudioClock::set_minsec (framepos_t when, bool /*force*/)
mins = (int) floor (left / (_session->frame_rate() * 60.0f));
left -= (framecnt_t) floor (mins * _session->frame_rate() * 60.0f);
secs = (int) floor (left / (float) _session->frame_rate());
- left -= (framecnt_t) floor (secs * _session->frame_rate());
+ left -= (framecnt_t) floor ((double)(secs * _session->frame_rate()));
millisecs = floor (left * 1000.0 / (float) _session->frame_rate());
if (negative) {
@@ -1742,7 +1742,7 @@ AudioClock::on_motion_notify_event (GdkEventMotion *ev)
drag_y = ev->y;
- if (trunc (drag_accum) != 0) {
+ if (floor (drag_accum) != 0) {
framepos_t frames;
framepos_t pos;
diff --git a/gtk2_ardour/audio_region_editor.cc b/gtk2_ardour/audio_region_editor.cc
index 2aeb2dbe60..730cd99b37 100644
--- a/gtk2_ardour/audio_region_editor.cc
+++ b/gtk2_ardour/audio_region_editor.cc
@@ -54,7 +54,9 @@ AudioRegionEditor::AudioRegionEditor (Session* s, boost::shared_ptr<AudioRegion>
: RegionEditor (s, r)
, _audio_region (r)
, gain_adjustment(accurate_coefficient_to_dB(_audio_region->scale_amplitude()), -40.0, +40.0, 0.1, 1.0, 0)
+#ifndef PLATFORM_WINDOWS
, _peak_channel (false)
+#endif
{
Gtk::HBox* b = Gtk::manage (new Gtk::HBox);
@@ -91,7 +93,7 @@ AudioRegionEditor::AudioRegionEditor (Session* s, boost::shared_ptr<AudioRegion>
PeakAmplitudeFound.connect (_peak_amplitude_connection, invalidator (*this), boost::bind (&AudioRegionEditor::peak_amplitude_found, this, _1), gui_context ());
pthread_create_and_store (X_("peak-amplitude"), &_peak_amplitude_thread_handle, _peak_amplitude_thread, this);
- _peak_channel.deliver ('c');
+ signal_peak_thread ();
}
AudioRegionEditor::~AudioRegionEditor ()
@@ -112,7 +114,7 @@ AudioRegionEditor::region_changed (const PBD::PropertyChange& what_changed)
if (what_changed.contains (ARDOUR::Properties::start) || what_changed.contains (ARDOUR::Properties::length)) {
/* ask the peak thread to run again */
- _peak_channel.deliver ('c');
+ signal_peak_thread ();
}
}
void
@@ -134,12 +136,32 @@ AudioRegionEditor::gain_adjustment_changed ()
}
void
+AudioRegionEditor::signal_peak_thread ()
+{
+#ifdef PLATFORM_WINDOWS
+ m_peak_sem.post ();
+#else
+ _peak_channel.deliver ('c');
+#endif
+}
+
+void
+AudioRegionEditor::wait_for_signal ()
+{
+#ifdef PLATFORM_WINDOWS
+ m_peak_sem.wait ();
+#else
+ char msg;
+ _peak_channel.receive (msg);
+#endif
+}
+
+void
AudioRegionEditor::peak_amplitude_thread ()
{
while (1) {
/* await instructions to run */
- char msg;
- _peak_channel.receive (msg);
+ wait_for_signal ();
/* compute peak amplitude and signal the fact */
PeakAmplitudeFound (accurate_coefficient_to_dB (_audio_region->maximum_amplitude ())); /* EMIT SIGNAL */
diff --git a/gtk2_ardour/audio_region_editor.h b/gtk2_ardour/audio_region_editor.h
index b72986ecf1..3fdecc1837 100644
--- a/gtk2_ardour/audio_region_editor.h
+++ b/gtk2_ardour/audio_region_editor.h
@@ -36,7 +36,11 @@
#include "pbd/signals.h"
+#ifdef PLATFORM_WINDOWS
+#include "pbd/glib_semaphore.h"
+#else
#include "pbd/crossthread.h"
+#endif
#include "audio_clock.h"
#include "ardour_dialog.h"
@@ -73,11 +77,17 @@ class AudioRegionEditor : public RegionEditor
Gtk::Label _peak_amplitude_label;
Gtk::Entry _peak_amplitude;
+ void signal_peak_thread ();
+ void wait_for_signal ();
pthread_t _peak_amplitude_thread_handle;
void peak_amplitude_found (double);
PBD::Signal1<void, double> PeakAmplitudeFound;
PBD::ScopedConnection _peak_amplitude_connection;
+#ifdef PLATFORM_WINDOWS
+ PBD::GlibSemaphore m_peak_sem;
+#else
CrossThreadChannel _peak_channel;
+#endif
};
#endif /* __gtk_ardour_audio_region_edit_h__ */
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index f95576cd3e..d8ec2abb3c 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -19,6 +19,7 @@
#include <cmath>
#include <cassert>
#include <algorithm>
+#include <vector>
#include <boost/scoped_array.hpp>
@@ -561,9 +562,9 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
double effective_height;
- float curve[npoints];
+ std::vector<float> curve(npoints);
- audio_region()->fade_in()->curve().get_vector (0, audio_region()->fade_in()->back()->when, curve, npoints);
+ audio_region()->fade_in()->curve().get_vector (0, audio_region()->fade_in()->back()->when, &curve[0], npoints);
if (_height >= NAME_HIGHLIGHT_THRESH) {
effective_height = _height - NAME_HIGHLIGHT_SIZE - 1;
@@ -639,9 +640,9 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
double effective_height;
- float curve[npoints];
+ std::vector<float> curve(npoints);
- audio_region()->fade_out()->curve().get_vector (0, audio_region()->fade_out()->back()->when, curve, npoints);
+ audio_region()->fade_out()->curve().get_vector (0, audio_region()->fade_out()->back()->when, &curve[0], npoints);
if (_height >= NAME_HIGHLIGHT_THRESH) {
effective_height = _height - (NAME_HIGHLIGHT_SIZE + 1); /* skip the top pixel that shows the frame of this regionview */
@@ -762,8 +763,8 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
} else {
- float vec[npoints];
- inverse->curve().get_vector (0, inverse->back()->when, vec, npoints);
+ std::vector<float> vec(npoints);
+ inverse->curve().get_vector (0, inverse->back()->when, &vec[0], npoints);
for (Points::size_type i = 0, pci = 0; i < npoints; ++i, ++pci) {
ArdourCanvas::Duple &p (ipoints[pci]);
@@ -1256,7 +1257,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
}
void
-AudioRegionView::remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent */*ev*/)
+AudioRegionView::remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent* /*ev*/)
{
ControlPoint *cp = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"));
audio_region()->envelope()->erase (cp->model());
diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h
index e00c98d20f..ab3d59a235 100644
--- a/gtk2_ardour/audio_region_view.h
+++ b/gtk2_ardour/audio_region_view.h
@@ -19,6 +19,10 @@
#ifndef __gtk_ardour_audio_region_view_h__
#define __gtk_ardour_audio_region_view_h__
+#ifdef interface
+#undef interface
+#endif
+
#include <vector>
#include <sigc++/signal.h>
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index d22806a8c0..8ca04c7bdb 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -385,19 +385,19 @@ AudioTimeAxisView::build_automation_action_menu (bool for_selection)
MenuList& automation_items = automation_action_menu->items ();
automation_items.push_back (CheckMenuElem (_("Fader"), sigc::mem_fun (*this, &AudioTimeAxisView::update_gain_track_visibility)));
- gain_automation_item = dynamic_cast<CheckMenuItem*> (&automation_items.back ());
+ gain_automation_item = dynamic_cast<Gtk::CheckMenuItem*> (&automation_items.back ());
gain_automation_item->set_active ((!for_selection || _editor.get_selection().tracks.size() == 1) &&
(gain_track && string_is_affirmative (gain_track->gui_property ("visible"))));
_main_automation_menu_map[Evoral::Parameter(GainAutomation)] = gain_automation_item;
automation_items.push_back (CheckMenuElem (_("Pan"), sigc::mem_fun (*this, &AudioTimeAxisView::update_pan_track_visibility)));
- pan_automation_item = dynamic_cast<CheckMenuItem*> (&automation_items.back ());
+ pan_automation_item = dynamic_cast<Gtk::CheckMenuItem*> (&automation_items.back ());
pan_automation_item->set_active ((!for_selection || _editor.get_selection().tracks.size() == 1) &&
(!pan_tracks.empty() && string_is_affirmative (pan_tracks.front()->gui_property ("visible"))));
set<Evoral::Parameter> const & params = _route->pannable()->what_can_be_automated ();
- for (set<Evoral::Parameter>::iterator p = params.begin(); p != params.end(); ++p) {
+ for (set<Evoral::Parameter>::const_iterator p = params.begin(); p != params.end(); ++p) {
_main_automation_menu_map[*p] = pan_automation_item;
}
}
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index eee0689c35..2551b40c75 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -17,6 +17,17 @@
*/
+#ifdef COMPILER_MSVC
+#include <float.h>
+
+// 'std::isinf()' and 'std::isnan()' are not available in MSVC.
+#define isinf(val) !((bool)_finite((double)val))
+#define isnan(val) (bool)_isnan((double)val)
+#else
+using std::isnan;
+using std::isinf;
+#endif
+
#include <cmath>
#include <climits>
#include <vector>
@@ -949,7 +960,7 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
model_to_view_coord (tx, ty);
- if (std::isnan (tx) || std::isnan (ty)) {
+ if (isnan (tx) || isnan (ty)) {
warning << string_compose (_("Ignoring illegal points on AutomationLine \"%1\""),
_name) << endmsg;
continue;
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index bc91eafbd6..86f8034be3 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -489,22 +489,22 @@ AutomationTimeAxisView::build_display_menu ()
as_items.push_back (CheckMenuElem (S_("Automation|Manual"), sigc::bind (
sigc::mem_fun(*this, &AutomationTimeAxisView::set_automation_state),
(AutoState) ARDOUR::Off)));
- auto_off_item = dynamic_cast<CheckMenuItem*>(&as_items.back());
+ auto_off_item = dynamic_cast<Gtk::CheckMenuItem*>(&as_items.back());
as_items.push_back (CheckMenuElem (_("Play"), sigc::bind (
sigc::mem_fun(*this, &AutomationTimeAxisView::set_automation_state),
(AutoState) Play)));
- auto_play_item = dynamic_cast<CheckMenuItem*>(&as_items.back());
+ auto_play_item = dynamic_cast<Gtk::CheckMenuItem*>(&as_items.back());
as_items.push_back (CheckMenuElem (_("Write"), sigc::bind (
sigc::mem_fun(*this, &AutomationTimeAxisView::set_automation_state),
(AutoState) Write)));
- auto_write_item = dynamic_cast<CheckMenuItem*>(&as_items.back());
+ auto_write_item = dynamic_cast<Gtk::CheckMenuItem*>(&as_items.back());
as_items.push_back (CheckMenuElem (_("Touch"), sigc::bind (
sigc::mem_fun(*this, &AutomationTimeAxisView::set_automation_state),
(AutoState) Touch)));
- auto_touch_item = dynamic_cast<CheckMenuItem*>(&as_items.back());
+ auto_touch_item = dynamic_cast<Gtk::CheckMenuItem*>(&as_items.back());
items.push_back (MenuElem (_("State"), *auto_state_menu));
@@ -524,13 +524,13 @@ AutomationTimeAxisView::build_display_menu ()
am_items.push_back (RadioMenuElem (group, _("Discrete"), sigc::bind (
sigc::mem_fun(*this, &AutomationTimeAxisView::set_interpolation),
AutomationList::Discrete)));
- mode_discrete_item = dynamic_cast<CheckMenuItem*>(&am_items.back());
+ mode_discrete_item = dynamic_cast<Gtk::CheckMenuItem*>(&am_items.back());
mode_discrete_item->set_active (s == AutomationList::Discrete);
am_items.push_back (RadioMenuElem (group, _("Linear"), sigc::bind (
sigc::mem_fun(*this, &AutomationTimeAxisView::set_interpolation),
AutomationList::Linear)));
- mode_line_item = dynamic_cast<CheckMenuItem*>(&am_items.back());
+ mode_line_item = dynamic_cast<Gtk::CheckMenuItem*>(&am_items.back());
mode_line_item->set_active (s == AutomationList::Linear);
items.push_back (MenuElem (_("Mode"), *auto_mode_menu));
diff --git a/gtk2_ardour/big_clock_window.cc b/gtk2_ardour/big_clock_window.cc
index 5b369a68c1..c67ae38074 100644
--- a/gtk2_ardour/big_clock_window.cc
+++ b/gtk2_ardour/big_clock_window.cc
@@ -19,6 +19,7 @@
#include <algorithm>
#include <string>
+#include <vector>
#include "ardour_ui.h"
#include "audio_clock.h"
@@ -138,11 +139,11 @@ BigClockWindow::text_resizer (int, int)
if (size != current_size) {
string family = fd.get_family();
- char buf[family.length()+16];
- snprintf (buf, family.length()+16, "%s %d", family.c_str(), size);
+ std::vector<char> buf(family.length()+16);
+ snprintf (&buf[0], family.length()+16, "%s %d", family.c_str(), size);
try {
- Pango::FontDescription fd (buf);
+ Pango::FontDescription fd (&buf[0]);
Glib::RefPtr<Gtk::RcStyle> rcstyle = clock.get_modifier_style ();
rcstyle->set_font (fd);
clock.modify_style (rcstyle);
diff --git a/gtk2_ardour/bundle_manager.cc b/gtk2_ardour/bundle_manager.cc
index c7754f69cc..035046c10b 100644
--- a/gtk2_ardour/bundle_manager.cc
+++ b/gtk2_ardour/bundle_manager.cc
@@ -286,7 +286,7 @@ BundleManager::BundleManager (Session* session)
edit_button.set_image (*Gtk::manage (new Gtk::Image (Gtk::Stock::EDIT, Gtk::ICON_SIZE_BUTTON)));
edit_button.signal_clicked().connect (sigc::mem_fun (*this, &BundleManager::edit_clicked));
buttons->pack_start (edit_button, false, false);
- delete_button.set_image (*Gtk::manage (new Gtk::Image (Gtk::Stock::DELETE, Gtk::ICON_SIZE_BUTTON)));
+ delete_button.set_image (*Gtk::manage (new Gtk::Image (Gtk::StockID(GTK_STOCK_DELETE), Gtk::ICON_SIZE_BUTTON)));
delete_button.signal_clicked().connect (sigc::mem_fun (*this, &BundleManager::delete_clicked));
buttons->pack_start (delete_button, false, false);
diff --git a/gtk2_ardour/canvas-waveview.c b/gtk2_ardour/canvas-waveview.c
index 2080b208d8..6aff1be771 100644
--- a/gtk2_ardour/canvas-waveview.c
+++ b/gtk2_ardour/canvas-waveview.c
@@ -35,7 +35,7 @@
/* POSIX guarantees casting between void* and function pointers, ISO C doesn't
* We can work around warnings by going one step deeper in our casts
*/
-#ifdef _POSIX_VERSION
+#if defined(_POSIX_VERSION) || defined(COMPILER_MINGW)
#define POSIX_FUNC_PTR_CAST(type, object) *((type*) &(object))
#endif // _POSIX_VERSION
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index df9cdcf824..d0ad6d68d3 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -665,7 +665,7 @@ Editor::start_canvas_autoscroll (int dx, int dy)
autoscroll_x = dx;
autoscroll_y = dy;
autoscroll_x_distance = (framepos_t) floor (current_page_samples()/50.0);
- autoscroll_y_distance = fabs (dy * 5); /* pixels */
+ autoscroll_y_distance = fabs ((double)dy * 5); /* pixels */
autoscroll_cnt = 0;
/* do it right now, which will start the repeated callbacks */
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index f1809ec2bb..1748c39736 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -1498,7 +1498,7 @@ RegionCreateDrag::motion (GdkEvent* event, bool first_move)
place snapped notes at the start of the region.
*/
- framecnt_t const len = (framecnt_t) fabs (f - grab_frame () - 1);
+ framecnt_t const len = (framecnt_t) fabs ((double)(f - grab_frame () - 1));
_region->set_length (len < 1 ? 1 : len);
}
}
@@ -4369,7 +4369,7 @@ NoteDrag::motion (GdkEvent *, bool)
uint8_t new_note = min (max (_primary->note()->note() + note_delta, 0), 127);
snprintf (buf, sizeof (buf), "%s (%d)", Evoral::midi_note_name (new_note).c_str(),
- (int) floor (new_note));
+ (int) floor ((double)new_note));
show_verbose_cursor_text (buf);
}
@@ -4873,7 +4873,7 @@ NoteCreateDrag::finished (GdkEvent*, bool had_movement)
}
framepos_t const start = min (_note[0], _note[1]);
- framecnt_t length = (framecnt_t) fabs (_note[0] - _note[1]);
+ framecnt_t length = (framecnt_t) fabs ((double)(_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/editor_export_audio.cc b/gtk2_ardour/editor_export_audio.cc
index 877a39e773..e40030d671 100644
--- a/gtk2_ardour/editor_export_audio.cc
+++ b/gtk2_ardour/editor_export_audio.cc
@@ -25,6 +25,8 @@
#include <gtkmm/messagedialog.h>
+#include <glib/gstdio.h>
+
#include "gtkmm2ext/choice.h"
#include "pbd/pthread_utils.h"
@@ -158,11 +160,11 @@ Editor::export_region ()
switch (ret) {
case Gtk::RESPONSE_ACCEPT:
- /* force unlink because the backend code will
+ /* force ::g_unlink because the backend code will
go wrong if it tries to open an existing
file for writing.
*/
- ::unlink (path.c_str());
+ ::g_unlink (path.c_str());
break;
default:
return;
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index 41010d317e..eb82a94f6b 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -860,14 +860,14 @@ Editor::build_marker_menu (Location* loc)
items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &Editor::marker_menu_rename)));
items.push_back (CheckMenuElem (_("Lock")));
- CheckMenuItem* lock_item = static_cast<CheckMenuItem*> (&items.back());
+ Gtk::CheckMenuItem* lock_item = static_cast<Gtk::CheckMenuItem*> (&items.back());
if (loc->locked ()) {
lock_item->set_active ();
}
lock_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_lock));
items.push_back (CheckMenuElem (_("Glue to Bars and Beats")));
- CheckMenuItem* glue_item = static_cast<CheckMenuItem*> (&items.back());
+ Gtk::CheckMenuItem* glue_item = static_cast<Gtk::CheckMenuItem*> (&items.back());
if (loc->position_lock_style() == MusicTime) {
glue_item->set_active ();
}
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 7b56dc920d..f299075170 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -3477,7 +3477,7 @@ Editor::freeze_route ()
/* wait for just a little while, because the above call is asynchronous */
- ::usleep (250000);
+ Glib::usleep (250000);
if (clicked_routeview == 0 || !clicked_routeview->is_audio_track()) {
return;
diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc
index 865a555c8a..132ae8eeb1 100644
--- a/gtk2_ardour/editor_rulers.cc
+++ b/gtk2_ardour/editor_rulers.cc
@@ -388,11 +388,11 @@ Editor::popup_ruler_menu (framepos_t where, ItemType t)
ruler_items.push_back (MenuElem (_("Timeline height")));
static_cast<MenuItem*>(&ruler_items.back())->set_sensitive(false);
ruler_items.push_back (CheckMenuElem (_("Large"), sigc::bind ( sigc::mem_fun(*this, &Editor::set_video_timeline_height), 6)));
- if (videotl_bar_height == 6) { static_cast<CheckMenuItem*>(&ruler_items.back())->set_active(true);}
+ if (videotl_bar_height == 6) { static_cast<Gtk::CheckMenuItem*>(&ruler_items.back())->set_active(true);}
ruler_items.push_back (CheckMenuElem (_("Normal"), sigc::bind ( sigc::mem_fun(*this, &Editor::set_video_timeline_height), 4)));
- if (videotl_bar_height == 4) { static_cast<CheckMenuItem*>(&ruler_items.back())->set_active(true);}
+ if (videotl_bar_height == 4) { static_cast<Gtk::CheckMenuItem*>(&ruler_items.back())->set_active(true);}
ruler_items.push_back (CheckMenuElem (_("Small"), sigc::bind ( sigc::mem_fun(*this, &Editor::set_video_timeline_height), 3)));
- if (videotl_bar_height == 3) { static_cast<CheckMenuItem*>(&ruler_items.back())->set_active(true);}
+ if (videotl_bar_height == 3) { static_cast<Gtk::CheckMenuItem*>(&ruler_items.back())->set_active(true);}
ruler_items.push_back (SeparatorElem ());
ruler_items.push_back (MenuElem (_("Align Video Track")));
@@ -400,7 +400,7 @@ Editor::popup_ruler_menu (framepos_t where, ItemType t)
ruler_items.push_back (CheckMenuElem (_("Lock")));
{
- CheckMenuItem* vtl_lock = static_cast<CheckMenuItem*>(&ruler_items.back());
+ Gtk::CheckMenuItem* vtl_lock = static_cast<Gtk::CheckMenuItem*>(&ruler_items.back());
vtl_lock->set_active(is_video_timeline_locked());
vtl_lock->signal_activate().connect (sigc::mem_fun(*this, &Editor::toggle_video_timeline_locked));
}
diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc
index 06823fda19..2528c823b7 100644
--- a/gtk2_ardour/editor_timefx.cc
+++ b/gtk2_ardour/editor_timefx.cc
@@ -402,9 +402,12 @@ Editor::timefx_thread (void *arg)
by the GUI ...
*/
+#ifdef PLATFORM_WINDOWS
+ Sleep(2000);
+#else
struct timespec t = { 2, 0 };
nanosleep (&t, 0);
-
+#endif
return 0;
}
diff --git a/gtk2_ardour/editor_videotimeline.cc b/gtk2_ardour/editor_videotimeline.cc
index 458393708a..1390aa440f 100644
--- a/gtk2_ardour/editor_videotimeline.cc
+++ b/gtk2_ardour/editor_videotimeline.cc
@@ -20,6 +20,8 @@
#include <jack/types.h>
+#include <glib/gstdio.h>
+
#include "ardour/profile.h"
#include "ardour/rc_configuration.h"
#include "ardour/audio_track.h"
@@ -103,7 +105,7 @@ Editor::embed_audio_from_video (std::string path, framepos_t n, bool lock_positi
}
import_status.all_done = true;
- unlink(path.c_str());
+ ::g_unlink(path.c_str());
}
void
diff --git a/gtk2_ardour/export_channel_selector.h b/gtk2_ardour/export_channel_selector.h
index 984026a748..bc165273c7 100644
--- a/gtk2_ardour/export_channel_selector.h
+++ b/gtk2_ardour/export_channel_selector.h
@@ -25,6 +25,10 @@
#include "ardour/export_profile_manager.h"
+#ifdef interface
+#undef interface
+#endif
+
#include <gtkmm.h>
#include <sigc++/signal.h>
#include <boost/shared_ptr.hpp>
diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc
index 1458747786..6351c512c1 100644
--- a/gtk2_ardour/export_dialog.cc
+++ b/gtk2_ardour/export_dialog.cc
@@ -333,7 +333,7 @@ ExportDialog::show_progress ()
if (gtk_events_pending()) {
gtk_main_iteration ();
} else {
- usleep (10000);
+ Glib::usleep (10000);
}
}
diff --git a/gtk2_ardour/export_format_dialog.h b/gtk2_ardour/export_format_dialog.h
index 8d37ded2cd..3e38cf09d6 100644
--- a/gtk2_ardour/export_format_dialog.h
+++ b/gtk2_ardour/export_format_dialog.h
@@ -32,6 +32,10 @@
#include "ardour_dialog.h"
#include "audio_clock.h"
+#ifdef interface
+#undef interface
+#endif
+
#include <gtkmm.h>
class ExportFormatDialog : public ArdourDialog, public PBD::ScopedConnectionList {
diff --git a/gtk2_ardour/export_timespan_selector.cc b/gtk2_ardour/export_timespan_selector.cc
index f239ab194b..d6ca02fe03 100644
--- a/gtk2_ardour/export_timespan_selector.cc
+++ b/gtk2_ardour/export_timespan_selector.cc
@@ -50,7 +50,7 @@ ExportTimespanSelector::ExportTimespanSelector (ARDOUR::Session * session, Profi
option_hbox.pack_start (time_format_label, false, false, 0);
option_hbox.pack_start (time_format_combo, false, false, 6);
- Gtk::Button* b = manage (new Gtk::Button (_("Select All")));
+ Gtk::Button* b = Gtk::manage (new Gtk::Button (_("Select All")));
b->signal_clicked().connect (
sigc::bind (
sigc::mem_fun (*this, &ExportTimespanSelector::set_selection_state_of_all_timespans), true
@@ -58,7 +58,7 @@ ExportTimespanSelector::ExportTimespanSelector (ARDOUR::Session * session, Profi
);
option_hbox.pack_start (*b, false, false, 6);
- b = manage (new Gtk::Button (_("Deselect All")));
+ b = Gtk::manage (new Gtk::Button (_("Deselect All")));
b->signal_clicked().connect (
sigc::bind (
sigc::mem_fun (*this, &ExportTimespanSelector::set_selection_state_of_all_timespans), false
@@ -305,7 +305,7 @@ ExportTimespanSelector::ms_str (framecnt_t frames) const
mins = (int) floor (left / (_session->frame_rate() * 60.0f));
left -= (framecnt_t) floor (mins * _session->frame_rate() * 60.0f);
secs = (int) floor (left / (float) _session->frame_rate());
- left -= (framecnt_t) floor (secs * _session->frame_rate());
+ left -= (framecnt_t) floor ((double)(secs * _session->frame_rate()));
sec_promilles = (int) (left * 1000 / (float) _session->frame_rate() + 0.5);
oss << std::setfill('0') << std::right <<
diff --git a/gtk2_ardour/export_timespan_selector.h b/gtk2_ardour/export_timespan_selector.h
index 2118a57b83..5556f5f676 100644
--- a/gtk2_ardour/export_timespan_selector.h
+++ b/gtk2_ardour/export_timespan_selector.h
@@ -25,9 +25,14 @@
#include <list>
+#ifdef interface
+#undef interface
+#endif
+
#include <gtkmm.h>
#include <boost/shared_ptr.hpp>
+
#include "ardour/types.h"
#include "ardour/session_handle.h"
#include "ardour/export_profile_manager.h"
diff --git a/gtk2_ardour/export_video_dialog.cc b/gtk2_ardour/export_video_dialog.cc
index 2f9df2fb1c..a9d0f99ad1 100644
--- a/gtk2_ardour/export_video_dialog.cc
+++ b/gtk2_ardour/export_video_dialog.cc
@@ -29,6 +29,8 @@
#include <sigc++/bind.h>
+#include <glib/gstdio.h>
+
#include "pbd/error.h"
#include "pbd/convert.h"
#include "gtkmm2ext/utils.h"
@@ -414,8 +416,8 @@ void
ExportVideoDialog::finished ()
{
if (aborted) {
- unlink(outfn_path_entry.get_text().c_str());
- unlink (insnd.c_str());
+ ::g_unlink(outfn_path_entry.get_text().c_str());
+ ::g_unlink (insnd.c_str());
Gtk::Dialog::response(RESPONSE_CANCEL);
} else if (twopass && firstpass) {
firstpass = false;
@@ -425,9 +427,9 @@ ExportVideoDialog::finished ()
if (twopass_checkbox.get_active()) {
std::string outfn = outfn_path_entry.get_text();
std::string p2log = Glib::path_get_dirname (outfn) + G_DIR_SEPARATOR + "ffmpeg2pass";
- unlink (p2log.c_str());
+ ::g_unlink (p2log.c_str());
}
- unlink (insnd.c_str());
+ ::g_unlink (insnd.c_str());
Gtk::Dialog::response(RESPONSE_ACCEPT);
}
}
@@ -570,13 +572,13 @@ ExportVideoDialog::launch_export ()
if (gtk_events_pending()) {
gtk_main_iteration ();
} else {
- usleep (10000);
+ Glib::usleep (10000);
}
}
audio_progress_connection.disconnect();
status->finish ();
if (status->aborted()) {
- unlink (insnd.c_str());
+ ::g_unlink (insnd.c_str());
Gtk::Dialog::response(RESPONSE_CANCEL);
return;
}
@@ -593,14 +595,14 @@ ExportVideoDialog::encode_pass (int pass)
transcoder = new TranscodeFfmpeg(invid);
if (!transcoder->ffexec_ok()) {
/* ffmpeg binary was not found. TranscodeFfmpeg prints a warning */
- unlink (insnd.c_str());
+ ::g_unlink (insnd.c_str());
Gtk::Dialog::response(RESPONSE_CANCEL);
return;
}
if (!transcoder->probe_ok()) {
/* video input file can not be read */
warning << _("Export Video: Video input file cannot be read.") << endmsg;
- unlink (insnd.c_str());
+ ::g_unlink (insnd.c_str());
Gtk::Dialog::response(RESPONSE_CANCEL);
return;
}
@@ -698,7 +700,7 @@ ExportVideoDialog::encode_pass (int pass)
ffs["-an"] = "-y";
ffs["-passlogfile"] = Glib::path_get_dirname (outfn) + G_DIR_SEPARATOR + "ffmpeg2pass";
ffs["-f"] = get_file_extension(invid).empty()?"mov":get_file_extension(invid);
-#ifdef _OS_WIN32
+#ifdef PLATFORM_WINDOWS
outfn = "NUL";
#else
outfn = "/dev/null";
diff --git a/gtk2_ardour/export_video_infobox.cc b/gtk2_ardour/export_video_infobox.cc
index fbe28bd821..a3e356decc 100644
--- a/gtk2_ardour/export_video_infobox.cc
+++ b/gtk2_ardour/export_video_infobox.cc
@@ -18,6 +18,9 @@
*/
#include "ardour/session.h"
+#ifdef interface
+#undef interface
+#endif
#include "export_video_infobox.h"
#include "i18n.h"
diff --git a/gtk2_ardour/fft_graph.cc b/gtk2_ardour/fft_graph.cc
index 2b0b32a28a..1edd483dab 100644
--- a/gtk2_ardour/fft_graph.cc
+++ b/gtk2_ardour/fft_graph.cc
@@ -17,6 +17,11 @@
*/
+#ifdef COMPILER_MSVC
+#include <algorithm>
+using std::min; using std::max;
+#endif
+
#include <iostream>
#include <glibmm.h>
@@ -287,8 +292,8 @@ FFTGraph::redraw()
// Find "session wide" min & max
- float min = 1000000000000.0;
- float max = -1000000000000.0;
+ float minf = 1000000000000.0;
+ float maxf = -1000000000000.0;
TreeNodeChildren track_rows = _a_window->track_list.get_model()->children();
@@ -302,18 +307,18 @@ FFTGraph::redraw()
continue;
}
- if ( res->minimum() < min) {
- min = res->minimum();
+ if ( res->minimum() < minf) {
+ minf = res->minimum();
}
- if ( res->maximum() > max) {
- max = res->maximum();
+ if ( res->maximum() > maxf) {
+ maxf = res->maximum();
}
}
if (!_show_normalized) {
- min = -150.0f;
- max = 0.0f;
+ minf = -150.0f;
+ maxf = 0.0f;
}
//int graph_height = height - 2 * h_margin;
@@ -323,7 +328,7 @@ FFTGraph::redraw()
float fft_pane_size_w = (float)(width - 2*v_margin) - 1.0;
float fft_pane_size_h = (float)(height - 2*h_margin);
- double pixels_per_db = (double)fft_pane_size_h / (double)(max - min);
+ double pixels_per_db = (double)fft_pane_size_h / (double)(maxf - minf);
cairo_rectangle(cr, 0.0, 0.0, fft_pane_size_w, fft_pane_size_h);
cairo_clip(cr);
@@ -350,14 +355,14 @@ FFTGraph::redraw()
mpp = -1000000.0;
cairo_set_source_rgba(cr, res->get_color().get_red_p(), res->get_color().get_green_p(), res->get_color().get_blue_p(), 0.30);
- cairo_move_to(cr, 0.5f + (float)_logScale[0], 0.5f + (float)( fft_pane_size_h - (int)floor( (res->maxAt(0) - min) * pixels_per_db) ));
+ cairo_move_to(cr, 0.5f + (float)_logScale[0], 0.5f + (float)( fft_pane_size_h - (int)floor( (res->maxAt(0) - minf) * pixels_per_db) ));
// Draw the line of maximum values
for (int x = 1; x < res->length(); x++) {
if (res->maxAt(x) > mpp)
mpp = res->maxAt(x);
- mpp = fmax(mpp, min);
- mpp = fmin(mpp, max);
+ mpp = fmax(mpp, minf);
+ mpp = fmin(mpp, maxf);
// If the next point on the log scale is at the same location,
// don't draw yet
@@ -366,7 +371,7 @@ FFTGraph::redraw()
}
float X = 0.5f + (float)_logScale[x];
- float Y = 0.5f + (float)( fft_pane_size_h - (int)floor( (mpp - min) * pixels_per_db) );
+ float Y = 0.5f + (float)( fft_pane_size_h - (int)floor( (mpp - minf) * pixels_per_db) );
cairo_line_to(cr, X, Y);
@@ -378,8 +383,8 @@ FFTGraph::redraw()
for (int x = res->length()-1; x >= 0; x--) {
if (res->minAt(x) < mpp)
mpp = res->minAt(x);
- mpp = fmax(mpp, min);
- mpp = fmin(mpp, max);
+ mpp = fmax(mpp, minf);
+ mpp = fmin(mpp, maxf);
// If the next point on the log scale is at the same location,
// don't draw yet
@@ -388,7 +393,7 @@ FFTGraph::redraw()
}
float X = 0.5f + (float)_logScale[x];
- float Y = 0.5f + (float)( fft_pane_size_h - (int)floor( (mpp - min) * pixels_per_db) );
+ float Y = 0.5f + (float)( fft_pane_size_h - (int)floor( (mpp - minf) * pixels_per_db) );
cairo_line_to(cr, X, Y );
@@ -414,8 +419,8 @@ FFTGraph::redraw()
if (res->avgAt(x) > mpp)
mpp = res->avgAt(x);
- mpp = fmax(mpp, min);
- mpp = fmin(mpp, max);
+ mpp = fmax(mpp, minf);
+ mpp = fmin(mpp, maxf);
// If the next point on the log scale is at the same location,
// don't draw yet
@@ -423,7 +428,7 @@ FFTGraph::redraw()
continue;
}
- cairo_line_to(cr, 0.5f + (float)_logScale[x], 0.5f + (float)( fft_pane_size_h - (int)floor( (mpp - min) * pixels_per_db) ));
+ cairo_line_to(cr, 0.5f + (float)_logScale[x], 0.5f + (float)( fft_pane_size_h - (int)floor( (mpp - minf) * pixels_per_db) ));
mpp = -1000000.0;
}
diff --git a/gtk2_ardour/fft_result.cc b/gtk2_ardour/fft_result.cc
index 37c045b7b0..a83b65e854 100644
--- a/gtk2_ardour/fft_result.cc
+++ b/gtk2_ardour/fft_result.cc
@@ -18,8 +18,8 @@
*/
-#include <fft_result.h>
-#include <fft_graph.h>
+#include "fft_result.h"
+#include "fft_graph.h"
#include <cstdlib>
#include <cstring>
#include <string>
diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc
index ef29c01d46..faec8fb4ae 100644
--- a/gtk2_ardour/generic_pluginui.cc
+++ b/gtk2_ardour/generic_pluginui.cc
@@ -25,6 +25,7 @@
#include <cerrno>
#include <cmath>
#include <string>
+#include <vector>
#include "pbd/stl_delete.h"
#include "pbd/xml++.h"
@@ -41,8 +42,6 @@
#include "ardour/plugin_insert.h"
#include "ardour/session.h"
-#include <lrdf.h>
-
#include "ardour_ui.h"
#include "prompter.h"
#include "plugin_ui.h"
@@ -311,9 +310,9 @@ GenericPluginUI::build ()
// are similar enough to be grouped together.
string label, previous_label = "";
- int numbers_in_labels[cui_controls_list.size()];
+ std::vector<int> numbers_in_labels(cui_controls_list.size());
- float similarity_scores[cui_controls_list.size()];
+ std::vector<float> similarity_scores(cui_controls_list.size());
float most_similar = 0.0, least_similar = 1.0;
i = 0;
diff --git a/gtk2_ardour/global_port_matrix.cc b/gtk2_ardour/global_port_matrix.cc
index 80e2616bd8..218cfe7a1c 100644
--- a/gtk2_ardour/global_port_matrix.cc
+++ b/gtk2_ardour/global_port_matrix.cc
@@ -48,7 +48,7 @@ GlobalPortMatrix::setup_ports (int dim)
}
_ports[dim].suspend_signals ();
- _ports[dim].gather (_session, type(), dim == IN, false, show_only_bundles ());
+ _ports[dim].gather (_session, type(), dim == FLOW_IN, false, show_only_bundles ());
_ports[dim].resume_signals ();
}
@@ -59,8 +59,8 @@ GlobalPortMatrix::set_state (BundleChannel c[2], bool s)
return;
}
- Bundle::PortList const & in_ports = c[IN].bundle->channel_ports (c[IN].channel);
- Bundle::PortList const & out_ports = c[OUT].bundle->channel_ports (c[OUT].channel);
+ Bundle::PortList const & in_ports = c[FLOW_IN].bundle->channel_ports (c[FLOW_IN].channel);
+ Bundle::PortList const & out_ports = c[FLOW_OUT].bundle->channel_ports (c[FLOW_OUT].channel);
for (Bundle::PortList::const_iterator i = in_ports.begin(); i != in_ports.end(); ++i) {
for (Bundle::PortList::const_iterator j = out_ports.begin(); j != out_ports.end(); ++j) {
@@ -103,8 +103,8 @@ GlobalPortMatrix::get_state (BundleChannel c[2]) const
return PortMatrixNode::NOT_ASSOCIATED;
}
- Bundle::PortList const & in_ports = c[IN].bundle->channel_ports (c[IN].channel);
- Bundle::PortList const & out_ports = c[OUT].bundle->channel_ports (c[OUT].channel);
+ Bundle::PortList const & in_ports = c[FLOW_IN].bundle->channel_ports (c[FLOW_IN].channel);
+ Bundle::PortList const & out_ports = c[FLOW_OUT].bundle->channel_ports (c[FLOW_OUT].channel);
if (in_ports.empty() || out_ports.empty()) {
/* we're looking at a bundle with no parts associated with this channel,
so nothing to connect */
diff --git a/gtk2_ardour/global_port_matrix.h b/gtk2_ardour/global_port_matrix.h
index d45a639093..3def23a6a3 100644
--- a/gtk2_ardour/global_port_matrix.h
+++ b/gtk2_ardour/global_port_matrix.h
@@ -46,8 +46,8 @@ public:
private:
/* see PortMatrix: signal flow from 0 to 1 (out to in) */
enum {
- OUT = 0,
- IN = 1,
+ FLOW_OUT = 0,
+ FLOW_IN = 1,
};
};
diff --git a/gtk2_ardour/gtk-custom-hruler.c b/gtk2_ardour/gtk-custom-hruler.c
index a3745ba691..5f17ffe583 100644
--- a/gtk2_ardour/gtk-custom-hruler.c
+++ b/gtk2_ardour/gtk-custom-hruler.c
@@ -64,7 +64,7 @@ GType gtk_custom_hruler_get_type (void)
};
hruler_type = g_type_register_static (gtk_custom_ruler_get_type(), "GtkCustomHRuler",
- &hruler_info, 0);
+ &hruler_info, (GTypeFlags)0);
}
return hruler_type;
diff --git a/gtk2_ardour/gtk-custom-ruler.c b/gtk2_ardour/gtk-custom-ruler.c
index 797922f563..16097faa2e 100644
--- a/gtk2_ardour/gtk-custom-ruler.c
+++ b/gtk2_ardour/gtk-custom-ruler.c
@@ -98,7 +98,7 @@ GType gtk_custom_ruler_get_type (void)
};
ruler_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCustomRuler",
- &ruler_info, 0);
+ &ruler_info, (GTypeFlags)0);
}
return ruler_type;
@@ -198,9 +198,8 @@ gtk_custom_ruler_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- (void) pspec;
-
GtkCustomRuler *ruler = GTK_CUSTOM_RULER (object);
+ (void) pspec;
switch (prop_id)
{
diff --git a/gtk2_ardour/gtk_pianokeyboard.c b/gtk2_ardour/gtk_pianokeyboard.c
index 34bf184249..8d91626a2b 100644
--- a/gtk2_ardour/gtk_pianokeyboard.c
+++ b/gtk2_ardour/gtk_pianokeyboard.c
@@ -244,7 +244,7 @@ bind_key(PianoKeyboard *pk, const char *key, int note)
{
assert(pk->key_bindings != NULL);
- g_hash_table_insert(pk->key_bindings, key, (gpointer)((intptr_t)note));
+ g_hash_table_insert(pk->key_bindings, (const gpointer)key, (gpointer)((intptr_t)note));
}
static void
@@ -610,15 +610,15 @@ piano_keyboard_class_init(PianoKeyboardClass *klass)
/* Set up signals. */
piano_keyboard_signals[NOTE_ON_SIGNAL] = g_signal_new ("note-on",
- G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_TYPE_FROM_CLASS (klass), (GSignalFlags)(G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION),
0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
piano_keyboard_signals[NOTE_OFF_SIGNAL] = g_signal_new ("note-off",
- G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_TYPE_FROM_CLASS (klass), (GSignalFlags)(G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION),
0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
piano_keyboard_signals[REST_SIGNAL] = g_signal_new ("rest",
- G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_TYPE_FROM_CLASS (klass), (GSignalFlags)(G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION),
0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
widget_klass = (GtkWidgetClass*) klass;
@@ -659,7 +659,7 @@ piano_keyboard_get_type(void)
0, /* value_table */
};
- mk_type = g_type_register_static(GTK_TYPE_DRAWING_AREA, "PianoKeyboard", &mk_info, 0);
+ mk_type = g_type_register_static(GTK_TYPE_DRAWING_AREA, "PianoKeyboard", &mk_info, (GTypeFlags)0);
}
return mk_type;
@@ -668,7 +668,7 @@ piano_keyboard_get_type(void)
GtkWidget *
piano_keyboard_new(void)
{
- GtkWidget *widget = gtk_type_new(piano_keyboard_get_type());
+ GtkWidget *widget = (GtkWidget*)gtk_type_new(piano_keyboard_get_type());
PianoKeyboard *pk = PIANO_KEYBOARD(widget);
diff --git a/gtk2_ardour/hit.cc b/gtk2_ardour/hit.cc
index 257a3cd4f0..4d2498a0d5 100644
--- a/gtk2_ardour/hit.cc
+++ b/gtk2_ardour/hit.cc
@@ -35,7 +35,7 @@ Hit::Hit (
bool with_events)
: NoteBase (region, with_events, note)
{
- _polygon = new Polygon (group);
+ _polygon = new ArdourCanvas::Polygon (group);
set_item (_polygon);
}
diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc
index d01bca2a62..de56b1e387 100644
--- a/gtk2_ardour/main.cc
+++ b/gtk2_ardour/main.cc
@@ -31,6 +31,7 @@
#include "pbd/file_utils.h"
#include "pbd/textreceiver.h"
#include "pbd/failed_constructor.h"
+#include "pbd/pathexpand.h"
#include "pbd/pthread_utils.h"
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
#include "pbd/boost_debug.h"
@@ -101,7 +102,7 @@ gui_jack_error ()
static void export_search_path (const string& base_dir, const char* varname, const char* dir)
{
string path;
- const char * cstr = getenv (varname);
+ const char * cstr = g_getenv (varname);
if (cstr) {
path = cstr;
@@ -112,7 +113,7 @@ static void export_search_path (const string& base_dir, const char* varname, con
path += base_dir;
path += dir;
- setenv (varname, path.c_str(), 1);
+ g_setenv (varname, path.c_str(), 1);
}
#ifdef __APPLE__
@@ -125,7 +126,7 @@ extern void set_language_preference (); // cocoacarbon.mm
void
fixup_bundle_environment (int, char* [])
{
- if (!getenv ("ARDOUR_BUNDLED")) {
+ if (!g_getenv ("ARDOUR_BUNDLED")) {
return;
}
@@ -180,7 +181,7 @@ fixup_bundle_environment (int, char* [])
/* unset GTK_RC_FILES so that we only load the RC files that we define
*/
- unsetenv ("GTK_RC_FILES");
+ g_unsetenv ("GTK_RC_FILES");
/* write a pango.rc file and tell pango to use it. we'd love
to put this into the PROGRAM_NAME.app bundle and leave it there,
@@ -205,13 +206,13 @@ fixup_bundle_environment (int, char* [])
<< endl;
pangorc.close ();
- setenv ("PANGO_RC_FILE", path.c_str(), 1);
+ g_setenv ("PANGO_RC_FILE", path.c_str(), 1);
}
}
- setenv ("CHARSETALIASDIR", bundle_dir.c_str(), 1);
- setenv ("FONTCONFIG_FILE", Glib::build_filename (bundle_dir, "Resources/fonts.conf").c_str(), 1);
- setenv ("GDK_PIXBUF_MODULE_FILE", Glib::build_filename (bundle_dir, "Resources/gdk-pixbuf.loaders").c_str(), 1);
+ g_setenv ("CHARSETALIASDIR", bundle_dir.c_str(), 1);
+ g_setenv ("FONTCONFIG_FILE", Glib::build_filename (bundle_dir, "Resources/fonts.conf").c_str(), 1);
+ g_setenv ("GDK_PIXBUF_MODULE_FILE", Glib::build_filename (bundle_dir, "Resources/gdk-pixbuf.loaders").c_str(), 1);
}
static void load_custom_fonts() {
@@ -249,7 +250,7 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
* acceptable to build paths directly using '/'.
*/
- if (!getenv ("ARDOUR_BUNDLED")) {
+ if (!g_getenv ("ARDOUR_BUNDLED")) {
return;
}
@@ -268,7 +269,7 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
lpath.push_back (dir_path);
lpath.push_back ("share");
lpath.push_back ("locale");
- localedir = realpath (Glib::build_filename (lpath).c_str(), NULL);
+ localedir = canonical_path (Glib::build_filename (lpath)).c_str();
}
#endif
@@ -290,15 +291,15 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
/* unset GTK_RC_FILES so that we only load the RC files that we define
*/
- unsetenv ("GTK_RC_FILES");
+ g_unsetenv ("GTK_RC_FILES");
/* Tell fontconfig where to find fonts.conf. Use the system version
if it exists, otherwise use the stuff we included in the bundle
*/
if (Glib::file_test ("/etc/fonts/fonts.conf", Glib::FILE_TEST_EXISTS)) {
- setenv ("FONTCONFIG_FILE", "/etc/fonts/fonts.conf", 1);
- setenv ("FONTCONFIG_PATH", "/etc/fonts", 1);
+ g_setenv ("FONTCONFIG_FILE", "/etc/fonts/fonts.conf", 1);
+ g_setenv ("FONTCONFIG_PATH", "/etc/fonts", 1);
} else {
error << _("No fontconfig file found on your system. Things may looked very odd or ugly") << endmsg;
}
@@ -327,19 +328,19 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
pangorc.close ();
}
- setenv ("PANGO_RC_FILE", path.c_str(), 1);
+ g_setenv ("PANGO_RC_FILE", path.c_str(), 1);
/* similar for GDK pixbuf loaders, but there's no RC file required
to specify where it lives.
*/
- setenv ("GDK_PIXBUF_MODULE_FILE", Glib::build_filename (userconfigdir, "gdk-pixbuf.loaders").c_str(), 1);
+ g_setenv ("GDK_PIXBUF_MODULE_FILE", Glib::build_filename (userconfigdir, "gdk-pixbuf.loaders").c_str(), 1);
}
/* this doesn't do much but setting it should prevent various parts of the GTK/GNU stack
from looking outside the bundle to find the charset.alias file.
*/
- setenv ("CHARSETALIASDIR", dir_path.c_str(), 1);
+ g_setenv ("CHARSETALIASDIR", dir_path.c_str(), 1);
}
@@ -460,7 +461,7 @@ int main (int argc, char *argv[])
text_receiver.listen_to (warning);
#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
- if (getenv ("BOOST_DEBUG")) {
+ if (g_getenv ("BOOST_DEBUG")) {
boost_debug_shared_ptr_show_live_debugging (true);
}
#endif
@@ -505,9 +506,11 @@ int main (int argc, char *argv[])
return curvetest (curvetest_file);
}
+#ifndef PLATFORM_WINDOWS
if (::signal (SIGPIPE, sigpipe_handler)) {
cerr << _("Cannot xinstall SIGPIPE error handler") << endl;
}
+#endif
try {
ui = new ARDOUR_UI (&argc, &argv, localedir);
diff --git a/gtk2_ardour/main_clock.cc b/gtk2_ardour/main_clock.cc
index c9361f6091..36b398ee44 100644
--- a/gtk2_ardour/main_clock.cc
+++ b/gtk2_ardour/main_clock.cc
@@ -49,7 +49,7 @@ MainClock::build_ops_menu ()
MenuList& ops_items = ops_menu->items();
ops_items.push_back (SeparatorElem ());
ops_items.push_back (CheckMenuElem (_("Display delta to edit cursor"), sigc::mem_fun (*this, &MainClock::display_delta_to_edit_cursor)));
- CheckMenuItem* c = dynamic_cast<CheckMenuItem *> (&ops_items.back());
+ Gtk::CheckMenuItem* c = dynamic_cast<Gtk::CheckMenuItem *> (&ops_items.back());
if (_primary) {
if (ARDOUR::Config->get_primary_clock_delta_edit_cursor ()) {
ARDOUR::Config->set_primary_clock_delta_edit_cursor (false);
diff --git a/gtk2_ardour/meter_patterns.cc b/gtk2_ardour/meter_patterns.cc
index 7db2924697..2fa1d73565 100644
--- a/gtk2_ardour/meter_patterns.cc
+++ b/gtk2_ardour/meter_patterns.cc
@@ -885,7 +885,7 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
case DataType::MIDI:
align_center = false; // don't bleed into legend
fraction = (j->first) / 127.0;
- pos = 1 + height - (gint) rintf (height * fraction);
+ pos = 1 + height - (gint) lrintf (height * fraction);
pos = min (pos, height);
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
if (tickleft) {
diff --git a/gtk2_ardour/midi_channel_selector.cc b/gtk2_ardour/midi_channel_selector.cc
index 2f5ca729a6..b51584aef5 100644
--- a/gtk2_ardour/midi_channel_selector.cc
+++ b/gtk2_ardour/midi_channel_selector.cc
@@ -516,7 +516,7 @@ MidiChannelSelectorWindow::set_playback_selected_channels (uint16_t mask)
case ForceChannel:
/* only set the lowest set channel in the mask as active */
for (uint16_t i = 0; i < 16; i++) {
- playback_buttons[i]->set_active (i == (ffs (mask) - 1));
+ playback_buttons[i]->set_active (i == (PBD::ffs (mask) - 1));
}
break;
}
@@ -539,7 +539,7 @@ MidiChannelSelectorWindow::set_capture_selected_channels (uint16_t mask)
case ForceChannel:
/* only set the lowest set channel in the mask as active */
for (uint16_t i = 0; i < 16; i++) {
- capture_buttons[i]->set_active (i == (ffs (mask) - 1));
+ capture_buttons[i]->set_active (i == (PBD::ffs (mask) - 1));
}
break;
}
@@ -595,7 +595,7 @@ MidiChannelSelectorWindow::playback_mode_changed ()
case ForceChannel:
if (last_drawn_playback_mode == AllChannels || last_drawn_playback_mode == FilterChannels) {
playback_buttons.clear ();
- first_channel = ffs (track->get_playback_channel_mask()) - 1;
+ first_channel = PBD::ffs (track->get_playback_channel_mask()) - 1;
}
for (vector<Widget*>::iterator i = playback_mask_controls.begin(); i != playback_mask_controls.end(); ++i) {
(*i)->set_sensitive (false);
@@ -693,7 +693,7 @@ MidiChannelSelectorWindow::capture_mode_changed ()
case ForceChannel:
if (last_drawn_capture_mode == AllChannels || last_drawn_capture_mode == FilterChannels) {
capture_buttons.clear ();
- first_channel = ffs (track->get_capture_channel_mask()) - 1;
+ first_channel = PBD::ffs (track->get_capture_channel_mask()) - 1;
}
for (vector<Widget*>::iterator i = capture_mask_controls.begin(); i != capture_mask_controls.end(); ++i) {
(*i)->set_sensitive (false);
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index ffd09b76a8..afae96bf22 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -3080,7 +3080,7 @@ MidiRegionView::nudge_notes (bool forward)
return;
}
- Evoral::MusicalTime delta = region_frames_to_region_beats (fabs (distance));
+ Evoral::MusicalTime delta = region_frames_to_region_beats (fabs ((double)distance));
if (!forward) {
delta = -delta;
@@ -3298,7 +3298,7 @@ MidiRegionView::selection_as_cut_buffer () const
{
Notes notes;
- for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
+ for (Selection::const_iterator i = _selection.begin(); i != _selection.end(); ++i) {
NoteType* n = (*i)->note().get();
notes.insert (boost::shared_ptr<NoteType> (new NoteType (*n)));
}
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 002efb9910..4884dc34f3 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -19,8 +19,6 @@
#include <cstdlib>
#include <cmath>
-#include <strings.h> // for ffs(3)
-
#include <algorithm>
#include <string>
#include <vector>
@@ -28,6 +26,7 @@
#include <sigc++/bind.h>
#include "pbd/error.h"
+#include "pbd/ffs.h"
#include "pbd/stl_delete.h"
#include "pbd/whitespace.h"
#include "pbd/basename.h"
@@ -663,7 +662,7 @@ MidiTimeAxisView::add_channel_command_menu_item (Menu_Helpers::MenuList& items,
}
}
- CheckMenuItem* cmi = static_cast<CheckMenuItem*>(&chn_items.back());
+ Gtk::CheckMenuItem* cmi = static_cast<Gtk::CheckMenuItem*>(&chn_items.back());
_channel_command_menu_map[fully_qualified_param] = cmi;
cmi->set_active (visible);
}
@@ -695,7 +694,7 @@ MidiTimeAxisView::add_channel_command_menu_item (Menu_Helpers::MenuList& items,
}
}
- CheckMenuItem* cmi = static_cast<CheckMenuItem*>(&items.back());
+ Gtk::CheckMenuItem* cmi = static_cast<Gtk::CheckMenuItem*>(&items.back());
_channel_command_menu_map[fully_qualified_param] = cmi;
cmi->set_active (visible);
@@ -737,7 +736,7 @@ MidiTimeAxisView::add_single_channel_controller_item(Menu_Helpers::MenuList& ctl
}
}
- CheckMenuItem* cmi = static_cast<CheckMenuItem*>(&ctl_items.back());
+ Gtk::CheckMenuItem* cmi = static_cast<Gtk::CheckMenuItem*>(&ctl_items.back());
_controller_menu_map[fully_qualified_param] = cmi;
cmi->set_active (visible);
@@ -793,7 +792,7 @@ MidiTimeAxisView::add_multi_channel_controller_item(Menu_Helpers::MenuList& ctl_
}
}
- CheckMenuItem* cmi = static_cast<CheckMenuItem*>(&chn_items.back());
+ Gtk::CheckMenuItem* cmi = static_cast<Gtk::CheckMenuItem*>(&chn_items.back());
_controller_menu_map[fully_qualified_param] = cmi;
cmi->set_active (visible);
}
@@ -1489,7 +1488,7 @@ MidiTimeAxisView::playback_channel_mode_changed ()
_playback_channel_status.set_markup (string_compose ("<b>%1</b>: <i>%2</i>", _("Play"), _("some")));
break;
case ForceChannel:
- _playback_channel_status.set_markup (string_compose ("<b>%1</b>: <i>%2>%3</i>", _("Play"), _("all"), ffs (midi_track()->get_playback_channel_mask())));
+ _playback_channel_status.set_markup (string_compose ("<b>%1</b>: <i>%2>%3</i>", _("Play"), _("all"), PBD::ffs (midi_track()->get_playback_channel_mask())));
break;
}
}
@@ -1505,7 +1504,7 @@ MidiTimeAxisView::capture_channel_mode_changed ()
_capture_channel_status.set_markup (string_compose ("<b>%1</b>: <i>%2</i>", _("Rec"), _("some")));
break;
case ForceChannel:
- _capture_channel_status.set_markup (string_compose ("<b>%1</b>: <i>%2>%3</i>", _("Rec"), _("all"), ffs (midi_track()->get_capture_channel_mask())));
+ _capture_channel_status.set_markup (string_compose ("<b>%1</b>: <i>%2>%3</i>", _("Rec"), _("all"), PBD::ffs (midi_track()->get_capture_channel_mask())));
break;
}
}
diff --git a/gtk2_ardour/midi_tracer.cc b/gtk2_ardour/midi_tracer.cc
index ea4b0c2d54..a92c5a57e3 100644
--- a/gtk2_ardour/midi_tracer.cc
+++ b/gtk2_ardour/midi_tracer.cc
@@ -23,6 +23,9 @@
#include <sys/time.h>
#include <time.h>
+#include "pbd/localtime_r.h"
+#include "pbd/timersub.h"
+
#include "midi++/parser.h"
#include "ardour/async_midi_port.h"
@@ -212,7 +215,7 @@ MidiTracer::tracer (Parser&, byte* msg, size_t len)
s = snprintf (buf, bufsize, "+%02" PRId64 ":%06" PRId64, (int64_t) delta.tv_sec, (int64_t) delta.tv_usec);
bufsize -= s;
} else {
- localtime_r (&tv.tv_sec, &now);
+ localtime_r ((const time_t*)&tv.tv_sec, &now);
s = strftime (buf, bufsize, "%H:%M:%S", &now);
bufsize -= s;
s += snprintf (&buf[s], bufsize, ".%06" PRId64, (int64_t) tv.tv_usec);
diff --git a/gtk2_ardour/missing_file_dialog.cc b/gtk2_ardour/missing_file_dialog.cc
index c7cb7f5edc..37868d5572 100644
--- a/gtk2_ardour/missing_file_dialog.cc
+++ b/gtk2_ardour/missing_file_dialog.cc
@@ -19,6 +19,7 @@
#include "pbd/compose.h"
#include "pbd/replace_all.h"
#include "pbd/strsplit.h"
+#include "pbd/search_path.h"
#include "ardour/session.h"
@@ -56,14 +57,18 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT
break;
}
- string dirstr;
+ vector<string> source_dirs = s->source_search_path (type);
+ vector<string>::iterator i = source_dirs.begin();
+ ostringstream oss;
+ oss << *i << endl;
- dirstr = s->source_search_path (type);
- replace_all (dirstr, ":", "\n");
+ while (++i != source_dirs.end()) {
+ oss << *i << endl;
+ }
msg.set_justify (JUSTIFY_CENTER);
msg.set_markup (string_compose (_("%1 cannot find the %2 file\n\n<i>%3</i>\n\nin any of these folders:\n\n\
-<tt>%4</tt>\n\n"), PROGRAM_NAME, typestr, Glib::Markup::escape_text(path), Glib::Markup::escape_text (dirstr)));
+<tt>%4</tt>\n\n"), PROGRAM_NAME, typestr, Glib::Markup::escape_text(path), Glib::Markup::escape_text (oss.str())));
HBox* hbox = manage (new HBox);
hbox->pack_start (msg, false, true);
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index e7c3f138b8..a0f9f24198 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -1522,7 +1522,7 @@ MixerStrip::build_route_ops_menu ()
items.push_back (SeparatorElem());
items.push_back (CheckMenuElem (_("Active")));
- CheckMenuItem* i = dynamic_cast<CheckMenuItem *> (&items.back());
+ Gtk::CheckMenuItem* i = dynamic_cast<Gtk::CheckMenuItem *> (&items.back());
i->set_active (_route->active());
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active), !_route->active(), false));
@@ -1532,7 +1532,7 @@ MixerStrip::build_route_ops_menu ()
items.push_back (SeparatorElem());
items.push_back (CheckMenuElem (_("Protect Against Denormals"), sigc::mem_fun (*this, &RouteUI::toggle_denormal_protection)));
- denormal_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
+ denormal_menu_item = dynamic_cast<Gtk::CheckMenuItem *> (&items.back());
denormal_menu_item->set_active (_route->denormal_protection());
if (!Profile->get_sae()) {
diff --git a/gtk2_ardour/note.cc b/gtk2_ardour/note.cc
index 23358130a0..c9a60a7de9 100644
--- a/gtk2_ardour/note.cc
+++ b/gtk2_ardour/note.cc
@@ -35,8 +35,10 @@ Note::Note (
)
: NoteBase (region, with_events, note)
{
- _rectangle = new Rectangle (group);
+ _rectangle = new ArdourCanvas::Rectangle (group);
+#ifdef CANVAS_DEBUG
_rectangle->name = "note";
+#endif
set_item (_rectangle);
}
diff --git a/gtk2_ardour/nsmclient.cc b/gtk2_ardour/nsmclient.cc
index 76e18bc629..94c3e8570e 100644
--- a/gtk2_ardour/nsmclient.cc
+++ b/gtk2_ardour/nsmclient.cc
@@ -23,7 +23,11 @@
#include <unistd.h>
#include <stdlib.h>
+#ifndef COMPILER_MSVC
#pragma GCC diagnostic ignored "-Wunused-parameter"
+#else
+#include <process.h> // Needed for 'getpid()'
+#endif
namespace NSM
{
diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h
index 2073da530d..47afa77868 100644
--- a/gtk2_ardour/option_editor.h
+++ b/gtk2_ardour/option_editor.h
@@ -227,9 +227,9 @@ public:
_get (g),
_set (s)
{
- _label = manage (new Gtk::Label (n + ":"));
+ _label = Gtk::manage (new Gtk::Label (n + ":"));
_label->set_alignment (0, 0.5);
- _combo = manage (new Gtk::ComboBoxText);
+ _combo = Gtk::manage (new Gtk::ComboBoxText);
_combo->signal_changed().connect (sigc::mem_fun (*this, &ComboOption::changed));
}
@@ -305,9 +305,9 @@ public:
)
: Option (i, n)
{
- _label = manage (new Gtk::Label (n + ":"));
+ _label = Gtk::manage (new Gtk::Label (n + ":"));
_label->set_alignment (0, 0.5);
- _hscale = manage (new Gtk::HScale(adj));
+ _hscale = Gtk::manage (new Gtk::HScale(adj));
_adj = NULL;
}
@@ -323,9 +323,9 @@ public:
, _set (s)
, _adj (adj)
{
- _label = manage (new Gtk::Label (n + ":"));
+ _label = Gtk::manage (new Gtk::Label (n + ":"));
_label->set_alignment (0, 0.5);
- _hscale = manage (new Gtk::HScale(*_adj));
+ _hscale = Gtk::manage (new Gtk::HScale(*_adj));
_adj->signal_value_changed().connect (sigc::mem_fun (*this, &HSliderOption::changed));
}
@@ -379,9 +379,9 @@ public:
_get (g),
_set (s)
{
- _label = manage (new Gtk::Label (n + ":"));
+ _label = Gtk::manage (new Gtk::Label (n + ":"));
_label->set_alignment (0, 0.5);
- _combo = manage (new Gtk::ComboBoxText);
+ _combo = Gtk::manage (new Gtk::ComboBoxText);
_combo->signal_changed().connect (sigc::mem_fun (*this, &ComboStringOption::changed));
}
@@ -493,18 +493,18 @@ public:
_set (s),
_scale (scale)
{
- _label = manage (new Gtk::Label (n + ":"));
+ _label = Gtk::manage (new Gtk::Label (n + ":"));
_label->set_alignment (0, 0.5);
- _spin = manage (new Gtk::SpinButton);
+ _spin = Gtk::manage (new Gtk::SpinButton);
_spin->set_range (min, max);
_spin->set_increments (step, page);
- _box = manage (new Gtk::HBox);
+ _box = Gtk::manage (new Gtk::HBox);
_box->pack_start (*_spin, true, true);
_box->set_spacing (4);
if (unit.length()) {
- _box->pack_start (*manage (new Gtk::Label (unit)), false, false);
+ _box->pack_start (*Gtk::manage (new Gtk::Label (unit)), false, false);
}
_spin->signal_value_changed().connect (sigc::mem_fun (*this, &SpinOption::changed));
diff --git a/gtk2_ardour/panner2d.cc b/gtk2_ardour/panner2d.cc
index 64d83ab162..395cd2f5dd 100644
--- a/gtk2_ardour/panner2d.cc
+++ b/gtk2_ardour/panner2d.cc
@@ -390,7 +390,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
{
CartesianVector c;
cairo_t* cr;
- bool small = (height <= large_size_threshold);
+ bool small_size = (height <= large_size_threshold);
const double diameter = radius*2.0;
cr = gdk_cairo_create (get_window()->gobj());
@@ -473,7 +473,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
cairo_select_font_face (cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
- if (small) {
+ if (small_size) {
arc_radius = 4.0;
} else {
cairo_set_font_size (cr, 10);
@@ -498,10 +498,10 @@ Panner2d::on_expose_event (GdkEventExpose *event)
cairo_set_source_rgba (cr, 0.517, 0.772, 0.882, 1.0);
cairo_stroke (cr);
- if (!small && !signal->text.empty()) {
+ if (!small_size && !signal->text.empty()) {
cairo_set_source_rgb (cr, 0.517, 0.772, 0.882);
/* the +/- adjustments are a hack to try to center the text in the circle */
- if (small) {
+ if (small_size) {
cairo_move_to (cr, c.x - 1, c.y + 1);
} else {
cairo_move_to (cr, c.x - 4, c.y + 4);
@@ -535,7 +535,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
cairo_move_to (cr, c.x, c.y);
cairo_save (cr);
cairo_rotate (cr, -(speaker->position.azi/360.0) * (2.0 * M_PI));
- if (small) {
+ if (small_size) {
cairo_scale (cr, 0.8, 0.8);
} else {
cairo_scale (cr, 1.2, 1.2);
@@ -553,7 +553,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
cairo_fill (cr);
cairo_restore (cr);
- if (!small) {
+ if (!small_size) {
cairo_set_font_size (cr, 16);
/* move the text in just a bit */
diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc
index 3ee794e578..ce2f0aec83 100644
--- a/gtk2_ardour/panner_ui.cc
+++ b/gtk2_ardour/panner_ui.cc
@@ -369,7 +369,7 @@ PannerUI::build_pan_menu ()
items.clear ();
items.push_back (CheckMenuElem (_("Bypass"), sigc::mem_fun(*this, &PannerUI::pan_bypass_toggle)));
- bypass_menu_item = static_cast<CheckMenuItem*> (&items.back());
+ bypass_menu_item = static_cast<Gtk::CheckMenuItem*> (&items.back());
/* set state first, connect second */
diff --git a/gtk2_ardour/patch_change_dialog.cc b/gtk2_ardour/patch_change_dialog.cc
index 2ecfd4bdd7..081604344c 100644
--- a/gtk2_ardour/patch_change_dialog.cc
+++ b/gtk2_ardour/patch_change_dialog.cc
@@ -117,7 +117,7 @@ PatchChangeDialog::PatchChangeDialog (
add_button (Stock::CANCEL, RESPONSE_CANCEL);
add_button (ok, RESPONSE_ACCEPT);
if (allow_delete) {
- add_button (Stock::DELETE, RESPONSE_REJECT);
+ add_button (Gtk::StockID(GTK_STOCK_DELETE), RESPONSE_REJECT);
}
set_default_response (RESPONSE_ACCEPT);
diff --git a/gtk2_ardour/pingback.cc b/gtk2_ardour/pingback.cc
index dea7f52f01..62d9191daf 100644
--- a/gtk2_ardour/pingback.cc
+++ b/gtk2_ardour/pingback.cc
@@ -23,7 +23,10 @@
#include <fstream>
#include <cstring>
+#ifndef PLATFORM_WINDOWS
#include <sys/utsname.h>
+#endif
+
#include <curl/curl.h>
#include <glibmm/miscutils.h>
@@ -70,6 +73,7 @@ struct ping_call {
static void*
_pingback (void *arg)
{
+#ifndef PLATFORM_WINDOWS
ping_call* cm = static_cast<ping_call*> (arg);
CURL* c;
struct utsname utb;
@@ -158,6 +162,8 @@ _pingback (void *arg)
curl_easy_cleanup (c);
delete cm;
+#endif /* PLATFORM_WINDOWS */
+
return 0;
}
diff --git a/gtk2_ardour/plugin_eq_gui.cc b/gtk2_ardour/plugin_eq_gui.cc
index 631fb7be71..4bf2a5f879 100644
--- a/gtk2_ardour/plugin_eq_gui.cc
+++ b/gtk2_ardour/plugin_eq_gui.cc
@@ -18,6 +18,17 @@
*/
+#ifdef COMPILER_MSVC
+#include <float.h>
+
+// 'std::isinf()' and 'std::isnan()' are not available in MSVC.
+#define isinf(val) !((bool)_finite((double)val))
+#define isnan(val) (bool)_isnan((double)val)
+#else
+using std::isnan;
+using std::isinf;
+#endif
+
#include "plugin_eq_gui.h"
#include "fft.h"
@@ -765,13 +776,13 @@ PluginEqGui::plot_signal_amplitude_difference(Gtk::Widget *w, cairo_t *cr)
}
*/
- if (std::isinf(power)) {
+ if (isinf(power)) {
if (power < 0) {
power = _min_dB - 1.0;
} else {
power = _max_dB - 1.0;
}
- } else if (std::isnan(power)) {
+ } else if (isnan(power)) {
power = _min_dB - 1.0;
}
diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc
index bb96c7f392..f11753819a 100644
--- a/gtk2_ardour/plugin_selector.cc
+++ b/gtk2_ardour/plugin_selector.cc
@@ -21,7 +21,6 @@
#endif
#include <cstdio>
-#include <lrdf.h>
#include <map>
#include <algorithm>
diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc
index 3f523a82d2..4423e3905d 100644
--- a/gtk2_ardour/plugin_ui.cc
+++ b/gtk2_ardour/plugin_ui.cc
@@ -57,8 +57,6 @@
#include "lv2_plugin_ui.h"
#endif
-#include <lrdf.h>
-
#include "ardour_window.h"
#include "ardour_ui.h"
#include "prompter.h"
diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc
index 35e9a5cbd3..6bd9d96262 100644
--- a/gtk2_ardour/port_matrix.cc
+++ b/gtk2_ardour/port_matrix.cc
@@ -527,7 +527,7 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t)
items.push_back (MenuElem (_("Rescan"), sigc::mem_fun (*this, &PortMatrix::setup_all_ports)));
items.push_back (CheckMenuElem (_("Show individual ports"), sigc::mem_fun (*this, &PortMatrix::toggle_show_only_bundles)));
- CheckMenuItem* i = dynamic_cast<CheckMenuItem*> (&items.back());
+ Gtk::CheckMenuItem* i = dynamic_cast<Gtk::CheckMenuItem*> (&items.back());
_inhibit_toggle_show_only_bundles = true;
i->set_active (!_show_only_bundles);
_inhibit_toggle_show_only_bundles = false;
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index cd91589391..605fbbc25f 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -440,7 +440,7 @@ ProcessorEntry::build_controls_menu ()
for (list<Control*>::iterator i = _controls.begin(); i != _controls.end(); ++i) {
items.push_back (CheckMenuElem ((*i)->name ()));
- CheckMenuItem* c = dynamic_cast<CheckMenuItem*> (&items.back ());
+ Gtk::CheckMenuItem* c = dynamic_cast<Gtk::CheckMenuItem*> (&items.back ());
c->set_active ((*i)->visible ());
c->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &ProcessorEntry::toggle_control_visibility), *i));
}
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 815c7f4e7e..7c5d9a7763 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -529,7 +529,7 @@ public:
_dpi_adjustment (50, 50, 250, 1, 10),
_dpi_slider (_dpi_adjustment)
{
- _dpi_adjustment.set_value (floor (_rc_config->get_font_scale () / 1024));
+ _dpi_adjustment.set_value (floor ((double)(_rc_config->get_font_scale () / 1024)));
Label* l = manage (new Label (_("Font scaling:")));
l->set_name ("OptionsLabel");
@@ -548,7 +548,7 @@ public:
void parameter_changed (string const & p)
{
if (p == "font-scale") {
- _dpi_adjustment.set_value (floor (_rc_config->get_font_scale() / 1024));
+ _dpi_adjustment.set_value (floor ((double)(_rc_config->get_font_scale() / 1024)));
}
}
diff --git a/gtk2_ardour/rc_option_editor.h b/gtk2_ardour/rc_option_editor.h
index 7b9b29c3ff..879a9c4464 100644
--- a/gtk2_ardour/rc_option_editor.h
+++ b/gtk2_ardour/rc_option_editor.h
@@ -17,6 +17,9 @@
*/
+#ifndef __gtk_ardour_rc_option_editor_h__
+#define __gtk_ardour_rc_option_editor_h__
+
#include "option_editor.h"
#include "visibility_group.h"
@@ -54,3 +57,5 @@ private:
PBD::ScopedConnection parameter_change_connection;
};
+
+#endif /* __gtk_ardour_rc_option_editor_h__ */
diff --git a/gtk2_ardour/region_view.h b/gtk2_ardour/region_view.h
index 16df6be245..a5d5fddbd0 100644
--- a/gtk2_ardour/region_view.h
+++ b/gtk2_ardour/region_view.h
@@ -19,6 +19,10 @@
#ifndef __gtk_ardour_region_view_h__
#define __gtk_ardour_region_view_h__
+#ifdef interface
+#undef interface
+#endif
+
#include <vector>
#include <sigc++/signal.h>
diff --git a/gtk2_ardour/return_ui.cc b/gtk2_ardour/return_ui.cc
index 92846af469..775f283947 100644
--- a/gtk2_ardour/return_ui.cc
+++ b/gtk2_ardour/return_ui.cc
@@ -49,7 +49,7 @@ ReturnUI::ReturnUI (Gtk::Window* parent, boost::shared_ptr<Return> r, Session* s
_vbox.pack_start (_hbox, false, false, false);
- io = manage (new IOSelector (parent, session, r->output()));
+ io = Gtk::manage (new IOSelector (parent, session, r->output()));
pack_start (_vbox, false, false);
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index cdf844b3d9..715eec53b4 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -698,7 +698,7 @@ RouteTimeAxisView::build_display_menu ()
}
items.push_back (CheckMenuElem (_("Active")));
- CheckMenuItem* i = dynamic_cast<CheckMenuItem *> (&items.back());
+ Gtk::CheckMenuItem* i = dynamic_cast<Gtk::CheckMenuItem *> (&items.back());
bool click_sets_active = true;
if (active > 0 && inactive == 0) {
i->set_active (true);
@@ -2028,12 +2028,12 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p
for (std::set<Evoral::Parameter>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
ProcessorAutomationNode* pan;
- CheckMenuItem* mitem;
+ Gtk::CheckMenuItem* mitem;
string name = processor->describe_parameter (*i);
items.push_back (CheckMenuElem (name));
- mitem = dynamic_cast<CheckMenuItem*> (&items.back());
+ mitem = dynamic_cast<Gtk::CheckMenuItem*> (&items.back());
_subplugin_menu_map[*i] = mitem;
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index ad5e3bfd94..424e59aee4 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -784,7 +784,7 @@ RouteUI::build_record_menu ()
MenuList& items = record_menu->items();
items.push_back (CheckMenuElem (_("Step Entry"), sigc::mem_fun (*this, &RouteUI::toggle_step_edit)));
- step_edit_item = dynamic_cast<CheckMenuItem*> (&items.back());
+ step_edit_item = dynamic_cast<Gtk::CheckMenuItem*> (&items.back());
if (_route->record_enabled()) {
step_edit_item->set_sensitive (false);
@@ -1206,20 +1206,20 @@ RouteUI::build_solo_menu (void)
solo_menu = new Menu;
solo_menu->set_name ("ArdourContextMenu");
MenuList& items = solo_menu->items();
- CheckMenuItem* check;
+ Gtk::CheckMenuItem* check;
- check = new CheckMenuItem(_("Solo Isolate"));
+ check = new Gtk::CheckMenuItem(_("Solo Isolate"));
check->set_active (_route->solo_isolated());
check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_isolated), check));
items.push_back (CheckMenuElem(*check));
- solo_isolated_check = dynamic_cast<CheckMenuItem*>(&items.back());
+ solo_isolated_check = dynamic_cast<Gtk::CheckMenuItem*>(&items.back());
check->show_all();
- check = new CheckMenuItem(_("Solo Safe"));
+ check = new Gtk::CheckMenuItem(_("Solo Safe"));
check->set_active (_route->solo_safe());
check->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_solo_safe), check));
items.push_back (CheckMenuElem(*check));
- solo_safe_check = dynamic_cast<CheckMenuItem*>(&items.back());
+ solo_safe_check = dynamic_cast<Gtk::CheckMenuItem*>(&items.back());
check->show_all();
//items.push_back (SeparatorElem());
@@ -1237,25 +1237,25 @@ RouteUI::build_mute_menu(void)
MenuList& items = mute_menu->items();
- pre_fader_mute_check = manage (new CheckMenuItem(_("Pre Fader")));
+ pre_fader_mute_check = manage (new Gtk::CheckMenuItem(_("Pre Fader")));
init_mute_menu(MuteMaster::PreFader, pre_fader_mute_check);
pre_fader_mute_check->signal_toggled().connect(sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_mute_menu), MuteMaster::PreFader, pre_fader_mute_check));
items.push_back (CheckMenuElem(*pre_fader_mute_check));
pre_fader_mute_check->show_all();
- post_fader_mute_check = manage (new CheckMenuItem(_("Post Fader")));
+ post_fader_mute_check = manage (new Gtk::CheckMenuItem(_("Post Fader")));
init_mute_menu(MuteMaster::PostFader, post_fader_mute_check);
post_fader_mute_check->signal_toggled().connect(sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_mute_menu), MuteMaster::PostFader, post_fader_mute_check));
items.push_back (CheckMenuElem(*post_fader_mute_check));
post_fader_mute_check->show_all();
- listen_mute_check = manage (new CheckMenuItem(_("Control Outs")));
+ listen_mute_check = manage (new Gtk::CheckMenuItem(_("Control Outs")));
init_mute_menu(MuteMaster::Listen, listen_mute_check);
listen_mute_check->signal_toggled().connect(sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_mute_menu), MuteMaster::Listen, listen_mute_check));
items.push_back (CheckMenuElem(*listen_mute_check));
listen_mute_check->show_all();
- main_mute_check = manage (new CheckMenuItem(_("Main Outs")));
+ main_mute_check = manage (new Gtk::CheckMenuItem(_("Main Outs")));
init_mute_menu(MuteMaster::Main, main_mute_check);
main_mute_check->signal_toggled().connect(sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_mute_menu), MuteMaster::Main, main_mute_check));
items.push_back (CheckMenuElem(*main_mute_check));
@@ -1268,7 +1268,7 @@ RouteUI::build_mute_menu(void)
}
void
-RouteUI::init_mute_menu(MuteMaster::MutePoint mp, CheckMenuItem* check)
+RouteUI::init_mute_menu(MuteMaster::MutePoint mp, Gtk::CheckMenuItem* check)
{
check->set_active (_route->mute_points() & mp);
}
@@ -1957,7 +1957,7 @@ RouteUI::invert_press (GdkEventButton* ev)
for (uint32_t i = 0; i < N; ++i) {
items.push_back (CheckMenuElem (string_compose (X_("Ø%1"), i + 1), sigc::bind (sigc::mem_fun (*this, &RouteUI::invert_menu_toggled), i)));
- CheckMenuItem* e = dynamic_cast<CheckMenuItem*> (&items.back ());
+ Gtk::CheckMenuItem* e = dynamic_cast<Gtk::CheckMenuItem*> (&items.back ());
++_i_am_the_modifier;
e->set_active (_route->phase_invert (i));
--_i_am_the_modifier;
diff --git a/gtk2_ardour/send_ui.cc b/gtk2_ardour/send_ui.cc
index 1fead73084..b10bd96ea9 100644
--- a/gtk2_ardour/send_ui.cc
+++ b/gtk2_ardour/send_ui.cc
@@ -57,7 +57,7 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session
// users (among others)
// _vbox.pack_start (_panners, false, false);
- io = manage (new IOSelector (parent, session, s->output()));
+ io = Gtk::manage (new IOSelector (parent, session, s->output()));
pack_start (_vbox, false, false);
diff --git a/gtk2_ardour/session_metadata_dialog.h b/gtk2_ardour/session_metadata_dialog.h
index 9aa62ed4ca..1599e50bb3 100644
--- a/gtk2_ardour/session_metadata_dialog.h
+++ b/gtk2_ardour/session_metadata_dialog.h
@@ -22,6 +22,10 @@
#include "ardour_dialog.h"
+#ifdef interface
+#undef interface
+#endif
+
#include <gtkmm.h>
#include <boost/shared_ptr.hpp>
@@ -82,7 +86,7 @@ class TextMetadataField : public MetadataField {
Gtk::Label* value_label;
Gtk::Entry* entry;
- uint width;
+ guint width;
};
/// MetadataField that accepts only numbers
diff --git a/gtk2_ardour/session_option_editor.h b/gtk2_ardour/session_option_editor.h
index 73b9b2b033..2e7ba192b6 100644
--- a/gtk2_ardour/session_option_editor.h
+++ b/gtk2_ardour/session_option_editor.h
@@ -17,6 +17,9 @@
*/
+#ifndef __gtk_ardour_session_option_editor_h__
+#define __gtk_ardour_session_option_editor_h__
+
#include "option_editor.h"
namespace ARDOUR {
@@ -39,3 +42,5 @@ private:
ComboOption<float>* _vpu;
};
+
+#endif /* __gtk_ardour_session_option_editor_h__ */
diff --git a/gtk2_ardour/sfdb_freesound_mootcher.cc b/gtk2_ardour/sfdb_freesound_mootcher.cc
index 8e57d9a0c4..e1501460ca 100644
--- a/gtk2_ardour/sfdb_freesound_mootcher.cc
+++ b/gtk2_ardour/sfdb_freesound_mootcher.cc
@@ -91,7 +91,7 @@ void Mootcher::ensureWorkingDir ()
}
}
basePath = p;
-#ifdef __WIN32__
+#ifdef PLATFORM_WINDOWS
std::string replace = "/";
size_t pos = basePath.find("\\");
while( pos != std::string::npos ){
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc
index 9b3d78e86d..54e8ea98ab 100644
--- a/gtk2_ardour/sfdb_ui.cc
+++ b/gtk2_ardour/sfdb_ui.cc
@@ -31,6 +31,8 @@
#include <gtkmm/box.h>
#include <gtkmm/stock.h>
+
+#include <glib/gstdio.h>
#include <glibmm/fileutils.h>
#include "pbd/convert.h"
@@ -1457,6 +1459,9 @@ SoundFileOmega::check_info (const vector<string>& paths, bool& same_size, bool&
bool
SoundFileOmega::check_link_status (const Session* s, const vector<string>& paths)
{
+#ifdef PLATFORM_WINDOWS
+ return false;
+#else
std::string tmpdir(Glib::build_filename (s->session_directory().sound_path(), "linktest"));
bool ret = false;
@@ -1478,7 +1483,7 @@ SoundFileOmega::check_link_status (const Session* s, const vector<string>& paths
goto out;
}
- unlink (tmpc);
+ ::g_unlink (tmpc);
}
ret = true;
@@ -1486,6 +1491,7 @@ SoundFileOmega::check_link_status (const Session* s, const vector<string>& paths
out:
rmdir (tmpdir.c_str());
return ret;
+#endif
}
SoundFileChooser::SoundFileChooser (string title, ARDOUR::Session* s)
diff --git a/gtk2_ardour/system_exec.cc b/gtk2_ardour/system_exec.cc
index 59f3647e51..1a8399d22e 100644
--- a/gtk2_ardour/system_exec.cc
+++ b/gtk2_ardour/system_exec.cc
@@ -25,9 +25,12 @@
#include <unistd.h>
#include <assert.h>
+
+#ifndef COMPILER_MSVC
#include <dirent.h>
+#endif
-#ifdef __WIN32__
+#ifdef PLATFORM_WINDOWS
#include <windows.h>
#else
#include <fcntl.h>
@@ -47,7 +50,7 @@ void * interposer_thread (void *arg);
static void close_fd (int& fd) { if (fd >= 0) ::close (fd); fd = -1; }
-#ifndef __WIN32__
+#ifndef PLATFORM_WINDOWS
/*
* This function was part of libasyncns.
* LGPL v2.1
@@ -155,7 +158,7 @@ SystemExec::SystemExec (std::string c, std::string a)
nicelevel = 0;
envp = NULL;
argp = NULL;
-#ifdef __WIN32__
+#ifdef PLATFORM_WINDOWS
stdinP[0] = stdinP[1] = INVALID_HANDLE_VALUE;
stdoutP[0] = stdoutP[1] = INVALID_HANDLE_VALUE;
stderrP[0] = stderrP[1] = INVALID_HANDLE_VALUE;
@@ -173,7 +176,7 @@ SystemExec::SystemExec (std::string c, char **a)
pin[1] = -1;
nicelevel = 0;
envp = NULL;
-#ifdef __WIN32__
+#ifdef PLATFORM_WINDOWS
stdinP[0] = stdinP[1] = INVALID_HANDLE_VALUE;
stdoutP[0] = stdoutP[1] = INVALID_HANDLE_VALUE;
stderrP[0] = stderrP[1] = INVALID_HANDLE_VALUE;
@@ -197,7 +200,7 @@ SystemExec::~SystemExec ()
}
free (argp);
}
-#ifdef __WIN32__
+#ifdef PLATFORM_WINDOWS
if (w_args) free(w_args);
#endif
pthread_mutex_destroy(&write_lock);
@@ -211,7 +214,7 @@ interposer_thread (void *arg) {
return 0;
}
-#ifdef __WIN32__ /* Windows Process */
+#ifdef PLATFORM_WINDOWS /* Windows Process */
/* HELPER FUNCTIONS */
diff --git a/gtk2_ardour/system_exec.h b/gtk2_ardour/system_exec.h
index cf8518f547..38589bb26f 100644
--- a/gtk2_ardour/system_exec.h
+++ b/gtk2_ardour/system_exec.h
@@ -177,7 +177,7 @@ class SystemExec
char **envp;
private:
-#ifdef __WIN32__
+#ifdef PLATFORM_WINDOWS
PROCESS_INFORMATION *pid;
HANDLE stdinP[2];
HANDLE stdoutP[2];
diff --git a/gtk2_ardour/transcode_ffmpeg.cc b/gtk2_ardour/transcode_ffmpeg.cc
index ea753104db..0a622cb690 100644
--- a/gtk2_ardour/transcode_ffmpeg.cc
+++ b/gtk2_ardour/transcode_ffmpeg.cc
@@ -51,7 +51,7 @@ TranscodeFfmpeg::TranscodeFfmpeg (std::string f)
#endif
std::string ff_file_path;
- if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("ffmpeg_harvid"), ff_file_path)) { ffmpeg_exe = ff_file_path; }
+ if (find_file_in_search_path (Searchpath(Glib::getenv("PATH")), X_("ffmpeg_harvid"), ff_file_path)) { ffmpeg_exe = ff_file_path; }
else if (Glib::file_test(X_("C:\\Program Files\\harvid\\ffmpeg.exe"), Glib::FILE_TEST_EXISTS)) {
ffmpeg_exe = X_("C:\\Program Files\\ffmpeg\\ffmpeg.exe");
}
@@ -59,7 +59,7 @@ TranscodeFfmpeg::TranscodeFfmpeg (std::string f)
ffmpeg_exe = X_("C:\\Program Files\\ffmpeg\\ffmpeg.exe");
}
- if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("ffprobe_harvid"), ff_file_path)) { ffprobe_exe = ff_file_path; }
+ if (find_file_in_search_path (Searchpath(Glib::getenv("PATH")), X_("ffprobe_harvid"), ff_file_path)) { ffprobe_exe = ff_file_path; }
else if (Glib::file_test(X_("C:\\Program Files\\harvid\\ffprobe.exe"), Glib::FILE_TEST_EXISTS)) {
ffprobe_exe = X_("C:\\Program Files\\ffmpeg\\ffprobe.exe");
}
@@ -124,7 +124,7 @@ TranscodeFfmpeg::probe ()
* SystemExec::Terminated is emitted and ffcmd set to NULL */
int timeout = 300; // 1.5 sec
while (ffcmd && --timeout > 0) {
- usleep(5000);
+ Glib::usleep(5000);
}
if (timeout == 0 || ffoutput.empty()) {
return false;
@@ -192,7 +192,7 @@ TranscodeFfmpeg::probe ()
h * 3600.0
+ m * 60.0
+ s * 1.0
- + atoi(f) / pow(10, strlen(f))
+ + atoi(f) / pow((double)10, (int)strlen(f))
));
}
} else if (key == X_("duration_ts") && m_fps == 0 && timebase !=0 ) {
@@ -505,7 +505,11 @@ TranscodeFfmpeg::cancel ()
{
if (!ffcmd || !ffcmd->is_running()) { return;}
ffcmd->write_to_stdin("q");
+#ifdef PLATFORM_WINDOWS
+ Sleep(1000);
+#else
sleep (1);
+#endif
if (ffcmd) {
ffcmd->terminate();
}
@@ -539,7 +543,7 @@ TranscodeFfmpeg::ffmpegparse_a (std::string d, size_t /* s */)
h * 3600.0
+ m * 60.0
+ s * 1.0
- + atoi(f) / pow(10, strlen(f))
+ + atoi(f) / pow((double)10, (int)strlen(f))
));
p = p * m_fps / 100.0;
if (p > m_duration ) { p = m_duration; }
diff --git a/gtk2_ardour/transcode_video_dialog.cc b/gtk2_ardour/transcode_video_dialog.cc
index 6e4a1a3298..3963bb6cd3 100644
--- a/gtk2_ardour/transcode_video_dialog.cc
+++ b/gtk2_ardour/transcode_video_dialog.cc
@@ -29,6 +29,8 @@
#include <sigc++/bind.h>
+#include <glib/gstdio.h>
+
#include "pbd/error.h"
#include "pbd/convert.h"
#include "gtkmm2ext/utils.h"
@@ -301,9 +303,9 @@ void
TranscodeVideoDialog::finished ()
{
if (aborted) {
- unlink(path_entry.get_text().c_str());
+ ::g_unlink(path_entry.get_text().c_str());
if (!audiofile.empty()) {
- unlink(audiofile.c_str());
+ ::g_unlink(audiofile.c_str());
}
Gtk::Dialog::response(RESPONSE_CANCEL);
} else {
diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc
index 7cb1953390..215df25e7f 100644
--- a/gtk2_ardour/ui_config.cc
+++ b/gtk2_ardour/ui_config.cc
@@ -287,7 +287,7 @@ UIConfiguration::color_by_name (const std::string& name)
}
// cerr << string_compose (_("Color %1 not found"), name) << endl;
- return RGBA_TO_UINT (random()%256,random()%256,random()%256,0xff);
+ return RGBA_TO_UINT (g_random_int()%256,g_random_int()%256,g_random_int()%256,0xff);
}
void
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index e6dc2c5790..777eb62616 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -568,7 +568,7 @@ get_xpm (std::string name)
{
if (!xpm_map[name]) {
- SearchPath spath(ARDOUR::ardour_data_search_path());
+ Searchpath spath(ARDOUR::ardour_data_search_path());
spath.add_subdirectory_to_paths("pixmaps");
@@ -594,7 +594,7 @@ get_icon_path (const char* cname)
string name = cname;
name += X_(".png");
- SearchPath spath(ARDOUR::ardour_data_search_path());
+ Searchpath spath(ARDOUR::ardour_data_search_path());
spath.add_subdirectory_to_paths("icons");
@@ -741,7 +741,9 @@ set_pango_fontsize ()
/* FT2 rendering - used by GnomeCanvas, sigh */
+#ifndef PLATFORM_WINDOWS
pango_ft2_font_map_set_resolution ((PangoFT2FontMap*) pango_ft2_font_map_new(), val/1024, val/1024);
+#endif
/* Cairo rendering, in case there is any */
diff --git a/gtk2_ardour/video_image_frame.cc b/gtk2_ardour/video_image_frame.cc
index e5cd197782..ebcb9e6f96 100644
--- a/gtk2_ardour/video_image_frame.cc
+++ b/gtk2_ardour/video_image_frame.cc
@@ -211,7 +211,7 @@ http_get_thread (void *arg) {
char *res = NULL;
do {
res=a3_curl_http_get(url, &status);
- if (status == 503) usleep(5000); // try-again
+ if (status == 503) Glib::usleep(5000); // try-again
} while (status == 503 && --timeout > 0);
if (status != 200 || !res) {
@@ -250,8 +250,8 @@ VideoImageFrame::http_download_done (char *data){
}
exposeimg();
- /* don't request frames rapidly, wait after user has zoomed */
- usleep(20000);
+ /* don't request frames too quickly, wait after user has zoomed */
+ Glib::usleep(40000);
if (queued_request) {
http_get_again(want_video_frame_number);
diff --git a/gtk2_ardour/video_monitor.cc b/gtk2_ardour/video_monitor.cc
index 238845fb2f..c04d9bde35 100644
--- a/gtk2_ardour/video_monitor.cc
+++ b/gtk2_ardour/video_monitor.cc
@@ -94,7 +94,7 @@ VideoMonitor::query_full_state (bool wait)
process->write_to_stdin("get osdcfg\n");
int timeout = 40;
if (wait && knownstate !=127 && --timeout) {
- usleep(50000);
+ Glib::usleep(50000);
sched_yield();
}
}
@@ -113,7 +113,7 @@ VideoMonitor::quit ()
*/
int timeout = 40;
while (is_started() && --timeout) {
- usleep(50000);
+ Glib::usleep(50000);
sched_yield();
}
if (timeout <= 0) {
diff --git a/gtk2_ardour/video_server_dialog.cc b/gtk2_ardour/video_server_dialog.cc
index 18a4d21dc9..bc9e8be442 100644
--- a/gtk2_ardour/video_server_dialog.cc
+++ b/gtk2_ardour/video_server_dialog.cc
@@ -29,6 +29,10 @@
#include "ardour/template_utils.h"
#include "ardour/session.h"
+#ifdef interface
+#undef interface
+#endif
+
#include "video_server_dialog.h"
#include "utils_videotl.h"
#include "i18n.h"
@@ -80,7 +84,7 @@ VideoServerDialog::VideoServerDialog (Session* s)
listenaddr_combo.set_active(0);
std::string icsd_file_path;
- if (find_file_in_search_path (PBD::SearchPath(Glib::getenv("PATH")), X_("harvid"), icsd_file_path)) {
+ if (find_file_in_search_path (PBD::Searchpath(Glib::getenv("PATH")), X_("harvid"), icsd_file_path)) {
path_entry.set_text(icsd_file_path);
}
else if (Glib::file_test(X_("C:\\Program Files\\harvid\\harvid.exe"), Glib::FILE_TEST_EXISTS)) {
diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc
index a1a85a0243..536d57afe6 100644
--- a/gtk2_ardour/video_timeline.cc
+++ b/gtk2_ardour/video_timeline.cc
@@ -347,17 +347,17 @@ VideoTimeLine::update_video_timeline()
assert (vtl_dist > 0);
assert (apv > 0);
- leftmost_video_frame = floor (floor((leftmost_sample - video_start_offset - video_offset ) / vtl_dist) * vtl_dist / apv);
+ leftmost_video_frame = floor (floor((long double)(leftmost_sample - video_start_offset - video_offset ) / vtl_dist) * vtl_dist / apv);
vtl_start = rint (video_offset + video_start_offset + leftmost_video_frame * apv);
- visible_video_frames = 2 + ceil(editor->current_page_samples() / vtl_dist); /* +2 left+right partial frames */
+ visible_video_frames = 2 + ceil((double)editor->current_page_samples() / vtl_dist); /* +2 left+right partial frames */
/* expand timeline (cache next/prev page images) */
vtl_start -= visible_video_frames * vtl_dist;
visible_video_frames *=3;
if (vtl_start < video_offset ) {
- visible_video_frames += ceil(vtl_start/vtl_dist);
+ visible_video_frames += ceil((double)vtl_start/vtl_dist);
vtl_start = video_offset;
}
@@ -717,7 +717,7 @@ VideoTimeLine::find_xjadeo () {
std::string xjadeo_file_path;
if (getenv("XJREMOTE")) {
_xjadeo_bin = strdup(getenv("XJREMOTE")); // XXX TODO: free it?!
- } else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {
+ } else if (find_file_in_search_path (Searchpath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {
_xjadeo_bin = xjadeo_file_path;
}
else if (Glib::file_test(X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) {
diff --git a/gtk2_ardour/window_manager.h b/gtk2_ardour/window_manager.h
index 0dbe66b1b1..2dd6a2262e 100644
--- a/gtk2_ardour/window_manager.h
+++ b/gtk2_ardour/window_manager.h
@@ -159,7 +159,7 @@ class ProxyWithConstructor: public ProxyBase {
return 0;
}
- _window = creator ();
+ _window = dynamic_cast<Gtk::Window*> (creator ());
if (_window) {
setup ();
diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript
index a6ead1adb9..578409c4ae 100644
--- a/gtk2_ardour/wscript
+++ b/gtk2_ardour/wscript
@@ -260,8 +260,9 @@ def configure(conf):
'', '')
autowaf.configure(conf)
- if re.search ("linux", sys.platform) != None:
- autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
+ if Options.options.dist_target == 'auto':
+ if re.search ("linux", sys.platform) != None:
+ autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
# TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
@@ -433,6 +434,10 @@ def build(bld):
obj.use += ' libappleutility'
obj.includes += ['../libs']
+ if bld.env['build_target'] == 'mingw':
+ if bld.env['DEBUG'] == False:
+ obj.linkflags = ['-mwindows']
+
if bld.is_defined('HAVE_SUIL'):
obj.source += [ 'lv2_plugin_ui.cc' ]
obj.use += [ 'SUIL' ]