Merge branch 'windows' of git.ardour.org:ardour/ardour into windows

This commit is contained in:
John Emmas 2013-07-17 18:15:51 +01:00
commit 5f15bc9f9f
54 changed files with 1284 additions and 821 deletions

View file

@ -37,9 +37,8 @@
#include <unistd.h> #include <unistd.h>
#include <time.h> #include <time.h>
#include <sys/resource.h> #include <glib.h>
#include <sys/types.h> #include <glib/gstdio.h>
#include <sys/sysctl.h>
#include <gtkmm/messagedialog.h> #include <gtkmm/messagedialog.h>
#include <gtkmm/accelmap.h> #include <gtkmm/accelmap.h>
@ -3398,15 +3397,23 @@ ARDOUR_UI::start_video_server (Gtk::Window* float_window, bool popup_msg)
if (icsd_docroot.empty()) {icsd_docroot = X_("/");} if (icsd_docroot.empty()) {icsd_docroot = X_("/");}
struct stat sb; struct stat sb;
if (!lstat (icsd_docroot.c_str(), &sb) == 0 || !S_ISDIR(sb.st_mode)) { if (!g_lstat (icsd_docroot.c_str(), &sb) == 0 || !S_ISDIR(sb.st_mode)) {
warning << _("Specified docroot is not an existing directory.") << endmsg; warning << _("Specified docroot is not an existing directory.") << endmsg;
continue; continue;
} }
if ( (!lstat (icsd_exec.c_str(), &sb) == 0) #ifndef WIN32
if ( (!g_lstat (icsd_exec.c_str(), &sb) == 0)
|| (sb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == 0 ) { || (sb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == 0 ) {
warning << _("Given Video Server is not an executable file.") << endmsg; warning << _("Given Video Server is not an executable file.") << endmsg;
continue; 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; char **argp;
argp=(char**) calloc(9,sizeof(char*)); argp=(char**) calloc(9,sizeof(char*));

View file

@ -617,11 +617,10 @@ ARDOUR_UI::click_button_clicked (GdkEventButton* ev)
return false; return false;
} }
RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleRCOptionsEditor")); RefPtr<Action> act = ActionManager::get_action (X_("Window"), X_("toggle-rc-options-editor"));
assert (act); assert (act);
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act); act->activate();
tact->set_active ();
rc_option_editor->set_current_page (_("Misc")); rc_option_editor->set_current_page (_("Misc"));
return true; return true;

View file

@ -27,6 +27,10 @@
#include "ardour/audioengine.h" #include "ardour/audioengine.h"
#include "ardour/automation_watch.h" #include "ardour/automation_watch.h"
#ifdef interface
#undef interface
#endif
#include "actions.h" #include "actions.h"
#include "add_route_dialog.h" #include "add_route_dialog.h"
#include "add_video_dialog.h" #include "add_video_dialog.h"

View file

@ -658,7 +658,7 @@ AUPluginUI::parent_cocoa_window ()
/* move the au_view down so that it doesn't overlap the top_box contents */ /* move the au_view down so that it doesn't overlap the top_box contents */
NSPoint origin = { 0, a.height }; NSPoint origin = { 0, static_cast<CGFloat> (a.height) };
[au_view setFrameOrigin:origin]; [au_view setFrameOrigin:origin];
[view addSubview:au_view positioned:NSWindowBelow relativeTo:nil]; [view addSubview:au_view positioned:NSWindowBelow relativeTo:nil];

View file

@ -35,7 +35,7 @@
/* POSIX guarantees casting between void* and function pointers, ISO C doesn't /* 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 * We can work around warnings by going one step deeper in our casts
*/ */
#ifdef _POSIX_VERSION #if defined(_POSIX_VERSION) || defined(__MINGW32__)
#define POSIX_FUNC_PTR_CAST(type, object) *((type*) &(object)) #define POSIX_FUNC_PTR_CAST(type, object) *((type*) &(object))
#endif // _POSIX_VERSION #endif // _POSIX_VERSION

View file

@ -112,7 +112,7 @@ set_language_preference ()
break; break;
} }
} }
NSRange r = { 0, count }; NSRange r = { 0, static_cast<NSUInteger> (count) };
setenv ("LANGUAGE", [[[languages subarrayWithRange:r] componentsJoinedByString:@":"] UTF8String], 0); setenv ("LANGUAGE", [[[languages subarrayWithRange:r] componentsJoinedByString:@":"] UTF8String], 0);
cout << "LANGUAGE set to " << getenv ("LANGUAGE") << endl; cout << "LANGUAGE set to " << getenv ("LANGUAGE") << endl;
} }

View file

@ -373,11 +373,11 @@ Editor::popup_ruler_menu (framepos_t where, ItemType t)
ruler_items.push_back (MenuElem (_("Timeline height"))); ruler_items.push_back (MenuElem (_("Timeline height")));
static_cast<MenuItem*>(&ruler_items.back())->set_sensitive(false); 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))); 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))); 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))); 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 (SeparatorElem ());
ruler_items.push_back (MenuElem (_("Align Video Track"))); ruler_items.push_back (MenuElem (_("Align Video Track")));
@ -385,7 +385,7 @@ Editor::popup_ruler_menu (framepos_t where, ItemType t)
ruler_items.push_back (CheckMenuElem (_("Lock"))); 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->set_active(is_video_timeline_locked());
vtl_lock->signal_activate().connect (sigc::mem_fun(*this, &Editor::toggle_video_timeline_locked)); vtl_lock->signal_activate().connect (sigc::mem_fun(*this, &Editor::toggle_video_timeline_locked));
} }

View file

@ -586,7 +586,7 @@ ExportVideoDialog::encode_pass (int pass)
} }
std::string preset = preset_combo.get_active_text(); std::string preset = preset_combo.get_active_text();
FFSettings ffs ; /* = transcoder->default_encoder_settings(); */ TranscodeFfmpeg::FFSettings ffs ; /* = transcoder->default_encoder_settings(); */
ffs.clear(); ffs.clear();
if (fps_checkbox.get_active()) { if (fps_checkbox.get_active()) {
@ -742,7 +742,7 @@ ExportVideoDialog::encode_pass (int pass)
transcoder->set_avoffset(av_offset / (double)_session->nominal_frame_rate()); transcoder->set_avoffset(av_offset / (double)_session->nominal_frame_rate());
} }
FFSettings meta = transcoder->default_meta_data(); TranscodeFfmpeg::FFSettings meta = transcoder->default_meta_data();
if (meta_checkbox.get_active()) { if (meta_checkbox.get_active()) {
ARDOUR::SessionMetadata * session_data = ARDOUR::SessionMetadata::Metadata(); ARDOUR::SessionMetadata * session_data = ARDOUR::SessionMetadata::Metadata();
if (session_data->year() > 0 ) { if (session_data->year() > 0 ) {

View file

@ -60,6 +60,7 @@ using namespace Gtkmm2ext;
using namespace Gtk; using namespace Gtk;
using namespace std; using namespace std;
using Gtkmm2ext::Keyboard; using Gtkmm2ext::Keyboard;
using namespace ArdourMeter;
GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int fader_girth) GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int fader_girth)
: gain_adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0.0, 1.0, 0.01, 0.1) : gain_adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0.0, 1.0, 0.01, 0.1)

View file

@ -42,7 +42,7 @@ GroupTabs::GroupTabs ()
, _dragging (0) , _dragging (0)
, _dragging_new_tab (0) , _dragging_new_tab (0)
{ {
add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
} }
GroupTabs::~GroupTabs () GroupTabs::~GroupTabs ()
@ -175,6 +175,8 @@ GroupTabs::on_motion_notify_event (GdkEventMotion* ev)
set_dirty (); set_dirty ();
queue_draw (); queue_draw ();
gdk_event_request_motions(ev);
return true; return true;
} }

View file

@ -35,18 +35,42 @@ using namespace PBD;
using namespace Gtk; using namespace Gtk;
using namespace Gtkmm2ext; using namespace Gtkmm2ext;
using namespace std; using namespace std;
using namespace ArdourMeter;
static const int max_pattern_metric_size = 1026; static const int max_pattern_metric_size = 1026;
sigc::signal<void> ResetAllPeakDisplays; sigc::signal<void> ArdourMeter::ResetAllPeakDisplays;
sigc::signal<void,ARDOUR::Route*> ResetRoutePeakDisplays; sigc::signal<void,ARDOUR::Route*> ArdourMeter::ResetRoutePeakDisplays;
sigc::signal<void,ARDOUR::RouteGroup*> ResetGroupPeakDisplays; sigc::signal<void,ARDOUR::RouteGroup*> ArdourMeter::ResetGroupPeakDisplays;
sigc::signal<void> RedrawMetrics; sigc::signal<void> ArdourMeter::RedrawMetrics;
sigc::signal<void, int, ARDOUR::RouteGroup*, ARDOUR::MeterType> SetMeterTypeMulti; sigc::signal<void, int, ARDOUR::RouteGroup*, ARDOUR::MeterType> ArdourMeter::SetMeterTypeMulti;
cairo_pattern_t* namespace ArdourMeter {
typedef std::map<std::string,cairo_pattern_t*> TickPatterns;
typedef std::map<std::string,cairo_pattern_t*> MetricPatterns;
}
static ArdourMeter::TickPatterns ticks_patterns;
static ArdourMeter::MetricPatterns metric_patterns;
const std::string
ArdourMeter::meter_type_string (ARDOUR::MeterType mt)
{
switch (mt) {
case MeterPeak:
return _("Peak");
break;
case MeterKrms:
return _("RMS + Peak");
break;
default:
return _("???");
break;
}
}
static cairo_pattern_t*
meter_render_ticks (Gtk::Widget& w, vector<ARDOUR::DataType> types) meter_render_ticks (Gtk::Widget& w, vector<ARDOUR::DataType> types)
{ {
Glib::RefPtr<Gdk::Window> win (w.get_window()); Glib::RefPtr<Gdk::Window> win (w.get_window());
@ -195,7 +219,7 @@ meter_render_ticks (Gtk::Widget& w, vector<ARDOUR::DataType> types)
} }
cairo_pattern_t* static cairo_pattern_t*
meter_render_metrics (Gtk::Widget& w, vector<DataType> types) meter_render_metrics (Gtk::Widget& w, vector<DataType> types)
{ {
Glib::RefPtr<Gdk::Window> win (w.get_window()); Glib::RefPtr<Gdk::Window> win (w.get_window());
@ -340,11 +364,11 @@ meter_render_metrics (Gtk::Widget& w, vector<DataType> types)
snprintf (buf, sizeof (buf), "%+2d", j->first); snprintf (buf, sizeof (buf), "%+2d", j->first);
pos = height - (gint) floor (height * fraction); pos = height - (gint) floor (height * fraction);
if (tickleft) { if (tickleft) {
cairo_move_to(cr, width-2.5, pos + .5); cairo_move_to(cr, width-1.5, pos + .5);
cairo_line_to(cr, width, pos + .5); cairo_line_to(cr, width, pos + .5);
} else { } else {
cairo_move_to(cr, 0, pos + .5); cairo_move_to(cr, 0, pos + .5);
cairo_line_to(cr, 2.5, pos + .5); cairo_line_to(cr, 1.5, pos + .5);
} }
cairo_stroke (cr); cairo_stroke (cr);
break; break;
@ -374,7 +398,7 @@ meter_render_metrics (Gtk::Widget& w, vector<DataType> types)
p = min (p, height - th); p = min (p, height - th);
p = max (p, 0); p = max (p, 0);
cairo_move_to (cr, width-4-tw, p); cairo_move_to (cr, width-3-tw, p);
pango_cairo_show_layout (cr, layout->gobj()); pango_cairo_show_layout (cr, layout->gobj());
} }
} }
@ -407,10 +431,8 @@ meter_render_metrics (Gtk::Widget& w, vector<DataType> types)
} }
typedef std::map<std::string,cairo_pattern_t*> TickPatterns; gint
static TickPatterns ticks_patterns; ArdourMeter::meter_expose_ticks (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types, Gtk::DrawingArea *mta)
gint meter_expose_ticks (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types, Gtk::DrawingArea *mta)
{ {
Glib::RefPtr<Gdk::Window> win (mta->get_window()); Glib::RefPtr<Gdk::Window> win (mta->get_window());
cairo_t* cr; cairo_t* cr;
@ -446,10 +468,8 @@ gint meter_expose_ticks (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types
return true; return true;
} }
typedef std::map<std::string,cairo_pattern_t*> MetricPatterns; gint
static MetricPatterns metric_patterns; ArdourMeter::meter_expose_metrics (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types, Gtk::DrawingArea *mma)
gint meter_expose_metrics (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types, Gtk::DrawingArea *mma)
{ {
Glib::RefPtr<Gdk::Window> win (mma->get_window()); Glib::RefPtr<Gdk::Window> win (mma->get_window());
cairo_t* cr; cairo_t* cr;
@ -485,7 +505,8 @@ gint meter_expose_metrics (GdkEventExpose *ev, std::vector<ARDOUR::DataType> typ
return true; return true;
} }
void meter_clear_pattern_cache(int which) { void
ArdourMeter::meter_clear_pattern_cache(int which) {
MetricPatterns::iterator i = metric_patterns.begin(); MetricPatterns::iterator i = metric_patterns.begin();
TickPatterns::iterator j = ticks_patterns.begin(); TickPatterns::iterator j = ticks_patterns.begin();

View file

@ -27,6 +27,9 @@
#include "gtkmm2ext/cairo_widget.h" #include "gtkmm2ext/cairo_widget.h"
#include <sigc++/signal.h> #include <sigc++/signal.h>
namespace ArdourMeter {
extern sigc::signal<void> ResetAllPeakDisplays; extern sigc::signal<void> ResetAllPeakDisplays;
extern sigc::signal<void,ARDOUR::Route*> ResetRoutePeakDisplays; extern sigc::signal<void,ARDOUR::Route*> ResetRoutePeakDisplays;
extern sigc::signal<void,ARDOUR::RouteGroup*> ResetGroupPeakDisplays; extern sigc::signal<void,ARDOUR::RouteGroup*> ResetGroupPeakDisplays;
@ -34,13 +37,14 @@ extern sigc::signal<void> RedrawMetrics;
extern sigc::signal<void, int, ARDOUR::RouteGroup*, ARDOUR::MeterType> SetMeterTypeMulti; extern sigc::signal<void, int, ARDOUR::RouteGroup*, ARDOUR::MeterType> SetMeterTypeMulti;
cairo_pattern_t* meter_render_ticks (Gtk::Widget& w, std::vector<ARDOUR::DataType> types);
cairo_pattern_t* meter_render_metrics (Gtk::Widget& w, std::vector<ARDOUR::DataType> types);
gint meter_expose_ticks (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types, Gtk::DrawingArea *mta); gint meter_expose_ticks (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types, Gtk::DrawingArea *mta);
gint meter_expose_metrics (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types, Gtk::DrawingArea *mma); gint meter_expose_metrics (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types, Gtk::DrawingArea *mma);
void meter_clear_pattern_cache(int which=7); void meter_clear_pattern_cache(int which=7);
const std::string meter_type_string (ARDOUR::MeterType);
}
#endif #endif

View file

@ -52,6 +52,7 @@ using namespace PBD;
using namespace Gtk; using namespace Gtk;
using namespace Gtkmm2ext; using namespace Gtkmm2ext;
using namespace std; using namespace std;
using namespace ArdourMeter;
PBD::Signal1<void,MeterStrip*> MeterStrip::CatchDeletion; PBD::Signal1<void,MeterStrip*> MeterStrip::CatchDeletion;
PBD::Signal0<void> MeterStrip::MetricChanged; PBD::Signal0<void> MeterStrip::MetricChanged;
@ -570,16 +571,19 @@ MeterStrip::popup_level_meter_menu (GdkEventButton* ev)
RadioMenuItem::Group group; RadioMenuItem::Group group;
_suspend_menu_callbacks = true; _suspend_menu_callbacks = true;
add_level_meter_item (items, group, _("Peak"), MeterPeak); add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterPeak), MeterPeak);
add_level_meter_item (items, group, _("RMS + Peak"), MeterKrms); add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterKrms), MeterKrms);
MeterType cmt = _route->meter_type();
const std::string cmn = ArdourMeter::meter_type_string(cmt);
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Change all in Group to Peak"), sigc::bind (SetMeterTypeMulti, -1, _route->route_group(), MeterPeak))); items.push_back (MenuElem (string_compose(_("Change all in Group to %1"), cmn),
items.push_back (MenuElem (_("Change all in Group to RMS + Peak"), sigc::bind (SetMeterTypeMulti, -1, _route->route_group(), MeterKrms))); sigc::bind (SetMeterTypeMulti, -1, _route->route_group(), cmt)));
items.push_back (MenuElem (_("Change all to Peak"), sigc::bind (SetMeterTypeMulti, 0, _route->route_group(), MeterPeak))); items.push_back (MenuElem (string_compose(_("Change all to %1"), cmn),
items.push_back (MenuElem (_("Change all to RMS + Peak"), sigc::bind (SetMeterTypeMulti, 0, _route->route_group(), MeterKrms))); sigc::bind (SetMeterTypeMulti, 0, _route->route_group(), cmt)));
items.push_back (MenuElem (_("Change same track-type to Peak"), sigc::bind (SetMeterTypeMulti, _strip_type, _route->route_group(), MeterPeak))); items.push_back (MenuElem (string_compose(_("Change same track-type to %1"), cmn),
items.push_back (MenuElem (_("Change same track-type to RMS + Peak"), sigc::bind (SetMeterTypeMulti, _strip_type, _route->route_group(), MeterKrms))); sigc::bind (SetMeterTypeMulti, _strip_type, _route->route_group(), cmt)));
m->popup (ev->button, ev->time); m->popup (ev->button, ev->time);
_suspend_menu_callbacks = false; _suspend_menu_callbacks = false;

View file

@ -62,6 +62,7 @@ using namespace Gtk;
using namespace Glib; using namespace Glib;
using namespace Gtkmm2ext; using namespace Gtkmm2ext;
using namespace std; using namespace std;
using namespace ArdourMeter;
using PBD::atoi; using PBD::atoi;

View file

@ -19,8 +19,6 @@
#include <cstdlib> #include <cstdlib>
#include <cmath> #include <cmath>
#include <strings.h> // for ffs(3)
#include <algorithm> #include <algorithm>
#include <string> #include <string>
#include <vector> #include <vector>
@ -28,6 +26,7 @@
#include <sigc++/bind.h> #include <sigc++/bind.h>
#include "pbd/error.h" #include "pbd/error.h"
#include "pbd/ffs.h"
#include "pbd/stl_delete.h" #include "pbd/stl_delete.h"
#include "pbd/whitespace.h" #include "pbd/whitespace.h"
#include "pbd/basename.h" #include "pbd/basename.h"
@ -1491,7 +1490,7 @@ MidiTimeAxisView::playback_channel_mode_changed ()
_playback_channel_status.set_markup (string_compose ("<b>%1</b>: <i>%2</i>", _("Play"), _("some"))); _playback_channel_status.set_markup (string_compose ("<b>%1</b>: <i>%2</i>", _("Play"), _("some")));
break; break;
case ForceChannel: 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; break;
} }
} }
@ -1507,7 +1506,7 @@ MidiTimeAxisView::capture_channel_mode_changed ()
_capture_channel_status.set_markup (string_compose ("<b>%1</b>: <i>%2</i>", _("Rec"), _("some"))); _capture_channel_status.set_markup (string_compose ("<b>%1</b>: <i>%2</i>", _("Rec"), _("some")));
break; break;
case ForceChannel: 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; break;
} }
} }

View file

@ -71,6 +71,7 @@ using namespace PBD;
using namespace Gtk; using namespace Gtk;
using namespace Gtkmm2ext; using namespace Gtkmm2ext;
using namespace std; using namespace std;
using namespace ArdourMeter;
int MixerStrip::scrollbar_height = 0; int MixerStrip::scrollbar_height = 0;
PBD::Signal1<void,MixerStrip*> MixerStrip::CatchDeletion; PBD::Signal1<void,MixerStrip*> MixerStrip::CatchDeletion;
@ -2132,8 +2133,8 @@ MixerStrip::popup_level_meter_menu (GdkEventButton* ev)
RadioMenuItem::Group tgroup; RadioMenuItem::Group tgroup;
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
add_level_meter_item_type (items, tgroup, _("Peak"), MeterPeak); add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterPeak), MeterPeak);
add_level_meter_item_type (items, tgroup, _("RMS + Peak"), MeterKrms); add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterKrms), MeterKrms);
int _strip_type; int _strip_type;
if (_route->is_master()) { if (_route->is_master()) {
@ -2151,13 +2152,16 @@ MixerStrip::popup_level_meter_menu (GdkEventButton* ev)
_strip_type = 1; _strip_type = 1;
} }
MeterType cmt = _route->meter_type();
const std::string cmn = ArdourMeter::meter_type_string(cmt);
items.push_back (SeparatorElem()); items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Change all in Group to Peak"), sigc::bind (SetMeterTypeMulti, -1, _route->route_group(), MeterPeak))); items.push_back (MenuElem (string_compose(_("Change all in Group to %1"), cmn),
items.push_back (MenuElem (_("Change all in Group to RMS + Peak"), sigc::bind (SetMeterTypeMulti, -1, _route->route_group(), MeterKrms))); sigc::bind (SetMeterTypeMulti, -1, _route->route_group(), cmt)));
items.push_back (MenuElem (_("Change all to Peak"), sigc::bind (SetMeterTypeMulti, 0, _route->route_group(), MeterPeak))); items.push_back (MenuElem (string_compose(_("Change all to %1"), cmn),
items.push_back (MenuElem (_("Change all to RMS + Peak"), sigc::bind (SetMeterTypeMulti, 0, _route->route_group(), MeterKrms))); sigc::bind (SetMeterTypeMulti, 0, _route->route_group(), cmt)));
items.push_back (MenuElem (_("Change same track-type to Peak"), sigc::bind (SetMeterTypeMulti, _strip_type, _route->route_group(), MeterPeak))); items.push_back (MenuElem (string_compose(_("Change same track-type to %1"), cmn),
items.push_back (MenuElem (_("Change same track-type to RMS + Peak"), sigc::bind (SetMeterTypeMulti, _strip_type, _route->route_group(), MeterKrms))); sigc::bind (SetMeterTypeMulti, _strip_type, _route->route_group(), cmt)));
m->popup (ev->button, ev->time); m->popup (ev->button, ev->time);
_suspend_menu_callbacks = false; _suspend_menu_callbacks = false;

File diff suppressed because it is too large Load diff

View file

@ -655,10 +655,14 @@ PluginInsertProcessorEntry::SplittingIcon::on_expose_event (GdkEventExpose* ev)
{ {
cairo_t* cr = gdk_cairo_create (get_window()->gobj()); cairo_t* cr = gdk_cairo_create (get_window()->gobj());
cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
cairo_clip (cr);
cairo_set_line_width (cr, 1); cairo_set_line_width (cr, 1);
double const width = ev->area.width; Gtk::Allocation a = get_allocation();
double const height = ev->area.height; double const width = a.get_width();
double const height = a.get_height();
Gdk::Color const bg = get_style()->get_bg (STATE_NORMAL); Gdk::Color const bg = get_style()->get_bg (STATE_NORMAL);
cairo_set_source_rgb (cr, bg.get_red_p (), bg.get_green_p (), bg.get_blue_p ()); cairo_set_source_rgb (cr, bg.get_red_p (), bg.get_green_p (), bg.get_blue_p ());

View file

@ -191,23 +191,23 @@ ArdourStartup::setup_prerelease_page ()
{ {
VBox* vbox = manage (new VBox); VBox* vbox = manage (new VBox);
Label* label = manage (new Label); Label* label = manage (new Label);
label->set_markup (_("<b>Welcome to this BETA release of Ardour 3.0</b>\n\n\ label->set_markup (string_compose (_("<b>Welcome to this BETA release of Ardour %1</b>\n\n\
Ardour 3.0 has been released for Linux but because of the lack of testers,\n\ Ardour %1 has been released for Linux but because of the lack of testers,\n\
it is still at the beta stage on OS X. So, a few guidelines:\n\ it is still at the beta stage on OS X. So, a few guidelines:\n\
\n\ \n\
1) Please do <b>NOT</b> use this software with the expectation that it is stable or reliable\n\ 1) Please do <b>NOT</b> use this software with the expectation that it is stable or reliable\n\
though it may be so, depending on your workflow.\n\ though it may be so, depending on your workflow.\n\
3) <b>Please do NOT use the forums at ardour.org to report issues</b>.\n\ 2) <b>Please do NOT use the forums at ardour.org to report issues</b>.\n\
4) Please <b>DO</b> use the bugtracker at http://tracker.ardour.org/ to report issues\n\ 3) Please <b>DO</b> use the bugtracker at http://tracker.ardour.org/ to report issues\n\
making sure to note the product version number as 3.0-beta.\n\ making sure to note the product version number as %1-beta.\n\
5) Please <b>DO</b> use the ardour-users mailing list to discuss ideas and pass on comments.\n\ 4) Please <b>DO</b> use the ardour-users mailing list to discuss ideas and pass on comments.\n\
6) Please <b>DO</b> join us on IRC for real time discussions about ardour3. You\n\ 5) Please <b>DO</b> join us on IRC for real time discussions about ardour3. You\n\
can get there directly from Ardour via the Help->Chat menu option.\n\ can get there directly from Ardour via the Help->Chat menu option.\n\
\n\ \n\
Full information on all the above can be found on the support page at\n\ Full information on all the above can be found on the support page at\n\
\n\ \n\
http://ardour.org/support\n\ http://ardour.org/support\n\
")); "), VERSIONSTRING));
vbox->set_border_width (12); vbox->set_border_width (12);
vbox->pack_start (*label, false, false, 12); vbox->pack_start (*label, false, false, 12);
@ -917,6 +917,7 @@ ArdourStartup::setup_new_session_page ()
if (more_new_session_options_button.get_active()) { if (more_new_session_options_button.get_active()) {
set_page_type (session_vbox, ASSISTANT_PAGE_CONTENT); set_page_type (session_vbox, ASSISTANT_PAGE_CONTENT);
} }
session_hbox.show_all();
} }
void void
@ -1092,6 +1093,7 @@ ArdourStartup::setup_existing_session_page ()
set_page_title (session_vbox, _("Select a session")); set_page_title (session_vbox, _("Select a session"));
set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM); set_page_type (session_vbox, ASSISTANT_PAGE_CONFIRM);
session_hbox.show_all();
} }
void void

View file

@ -410,6 +410,7 @@ TimeAxisView::controls_ebox_motion (GdkEventMotion* ev)
maybe_set_cursor (ev->y); maybe_set_cursor (ev->y);
} }
gdk_event_request_motions(ev);
return true; return true;
} }

View file

@ -261,10 +261,10 @@ TranscodeFfmpeg::probe ()
return true; return true;
} }
FFSettings TranscodeFfmpeg::FFSettings
TranscodeFfmpeg::default_encoder_settings () TranscodeFfmpeg::default_encoder_settings ()
{ {
FFSettings ffs; TranscodeFfmpeg::FFSettings ffs;
ffs.clear(); ffs.clear();
ffs["-vcodec"] = "mpeg4"; ffs["-vcodec"] = "mpeg4";
ffs["-acodec"] = "ac3"; ffs["-acodec"] = "ac3";
@ -273,10 +273,10 @@ TranscodeFfmpeg::default_encoder_settings ()
return ffs; return ffs;
} }
FFSettings TranscodeFfmpeg::FFSettings
TranscodeFfmpeg::default_meta_data () TranscodeFfmpeg::default_meta_data ()
{ {
FFSettings ffm; TranscodeFfmpeg::FFSettings ffm;
ffm.clear(); ffm.clear();
ffm["comment"] = "Created with ardour"; ffm["comment"] = "Created with ardour";
return ffm; return ffm;
@ -308,7 +308,7 @@ TranscodeFfmpeg::format_metadata (std::string key, std::string value)
} }
bool bool
TranscodeFfmpeg::encode (std::string outfile, std::string inf_a, std::string inf_v, FFSettings ffs, FFSettings meta, bool map) TranscodeFfmpeg::encode (std::string outfile, std::string inf_a, std::string inf_v, TranscodeFfmpeg::FFSettings ffs, TranscodeFfmpeg::FFSettings meta, bool map)
{ {
#define MAX_FFMPEG_ENCODER_ARGS (100) #define MAX_FFMPEG_ENCODER_ARGS (100)
char **argp; char **argp;
@ -327,11 +327,11 @@ TranscodeFfmpeg::encode (std::string outfile, std::string inf_a, std::string inf
argp[a++] = strdup("-i"); argp[a++] = strdup("-i");
argp[a++] = strdup(inf_a.c_str()); argp[a++] = strdup(inf_a.c_str());
for(FFSettings::const_iterator it = ffs.begin(); it != ffs.end(); ++it) { for(TranscodeFfmpeg::FFSettings::const_iterator it = ffs.begin(); it != ffs.end(); ++it) {
argp[a++] = strdup(it->first.c_str()); argp[a++] = strdup(it->first.c_str());
argp[a++] = strdup(it->second.c_str()); argp[a++] = strdup(it->second.c_str());
} }
for(FFSettings::const_iterator it = meta.begin(); it != meta.end(); ++it) { for(TranscodeFfmpeg::FFSettings::const_iterator it = meta.begin(); it != meta.end(); ++it) {
argp[a++] = strdup("-metadata"); argp[a++] = strdup("-metadata");
argp[a++] = format_metadata(it->first.c_str(), it->second.c_str()); argp[a++] = format_metadata(it->first.c_str(), it->second.c_str());
} }

View file

@ -24,14 +24,6 @@
#include "ardour/types.h" #include "ardour/types.h"
#include "system_exec.h" #include "system_exec.h"
/* TODO: use a namespace here ? */
struct FFAudioStream {
std::string name;
std::string stream_id;
uint32_t channels;
};
typedef std::vector<FFAudioStream> AudioStreams;
typedef std::map<std::string,std::string> FFSettings;
/** @class TranscodeFfmpeg /** @class TranscodeFfmpeg
* @brief wrapper around ffmpeg and ffprobe command-line utils * @brief wrapper around ffmpeg and ffprobe command-line utils
@ -46,6 +38,15 @@ class TranscodeFfmpeg : public sigc::trackable
{ {
public: public:
struct FFAudioStream {
std::string name;
std::string stream_id;
uint32_t channels;
};
typedef std::vector<FFAudioStream> FFAudioStreams;
typedef std::map<std::string,std::string> FFSettings;
/** instantiate a new transcoder. If a file-name is given, the file's /** instantiate a new transcoder. If a file-name is given, the file's
* attributes (fps, duration, geometry etc) are read. * attributes (fps, duration, geometry etc) are read.
* *
@ -110,7 +111,7 @@ class TranscodeFfmpeg : public sigc::trackable
ARDOUR::framecnt_t get_duration() { return m_duration; } ARDOUR::framecnt_t get_duration() { return m_duration; }
std::string get_codec() { return m_codec; } std::string get_codec() { return m_codec; }
AudioStreams get_audio() { return m_audio; } FFAudioStreams get_audio() { return m_audio; }
/** override file duration used with the \ref Progress signal. /** override file duration used with the \ref Progress signal.
* @param d duration in video-frames = length_in_seconds * get_fps() * @param d duration in video-frames = length_in_seconds * get_fps()
@ -145,7 +146,7 @@ class TranscodeFfmpeg : public sigc::trackable
bool ffexecok; bool ffexecok;
bool probeok; bool probeok;
AudioStreams m_audio; FFAudioStreams m_audio;
char *format_metadata (std::string, std::string); char *format_metadata (std::string, std::string);
void ffmpegparse_v (std::string d, size_t s); void ffmpegparse_v (std::string d, size_t s);

View file

@ -90,7 +90,7 @@ TranscodeVideoDialog::TranscodeVideoDialog (Session* s, std::string infile)
int w = 0, h = 0; int w = 0, h = 0;
m_aspect = 4.0/3.0; m_aspect = 4.0/3.0;
AudioStreams as; as.clear(); TranscodeFfmpeg::FFAudioStreams as; as.clear();
path_hbox->pack_start (path_label, false, false, 3); path_hbox->pack_start (path_label, false, false, 3);
path_hbox->pack_start (path_entry, true, true, 3); path_hbox->pack_start (path_entry, true, true, 3);
@ -229,7 +229,7 @@ TranscodeVideoDialog::TranscodeVideoDialog (Session* s, std::string infile)
t->attach (audio_combo, 1, 4, 2, 3); t->attach (audio_combo, 1, 4, 2, 3);
audio_combo.append_text("No audio"); audio_combo.append_text("No audio");
if (as.size() > 0) { if (as.size() > 0) {
for (AudioStreams::iterator it = as.begin(); it < as.end(); ++it) { for (TranscodeFfmpeg::FFAudioStreams::iterator it = as.begin(); it < as.end(); ++it) {
audio_combo.append_text((*it).name); audio_combo.append_text((*it).name);
} }
} }

View file

@ -151,7 +151,7 @@ class ProxyWithConstructor: public ProxyBase {
: ProxyBase (name, menu_name) , creator (c) {} : ProxyBase (name, menu_name) , creator (c) {}
ProxyWithConstructor (const std::string& name, const std::string& menu_name, const boost::function<T*()>& c, const XMLNode* node) ProxyWithConstructor (const std::string& name, const std::string& menu_name, const boost::function<T*()>& c, const XMLNode* node)
: ProxyBase (name, menu_name, node) , creator (c) {} : ProxyBase (name, menu_name, *node) , creator (c) {}
Gtk::Window* get (bool create = false) { Gtk::Window* get (bool create = false) {
if (!_window) { if (!_window) {
@ -198,7 +198,7 @@ class Proxy : public ProxyBase {
: ProxyBase (name, menu_name) {} : ProxyBase (name, menu_name) {}
Proxy (const std::string& name, const std::string& menu_name, const XMLNode* node) Proxy (const std::string& name, const std::string& menu_name, const XMLNode* node)
: ProxyBase (name, menu_name, node) {} : ProxyBase (name, menu_name, *node) {}
Gtk::Window* get (bool create = false) { Gtk::Window* get (bool create = false) {
if (!_window) { if (!_window) {

View file

@ -20,6 +20,8 @@
#ifndef __ardour_midi_track_h__ #ifndef __ardour_midi_track_h__
#define __ardour_midi_track_h__ #define __ardour_midi_track_h__
#include "pbd/ffs.h"
#include "ardour/track.h" #include "ardour/track.h"
#include "ardour/midi_ring_buffer.h" #include "ardour/midi_ring_buffer.h"
@ -183,7 +185,7 @@ private:
/* if mode is ForceChannel, force mask to the lowest set channel or 1 if no /* if mode is ForceChannel, force mask to the lowest set channel or 1 if no
* channels are set. * channels are set.
*/ */
#define force_mask(mode,mask) (((mode) == ForceChannel) ? (((mask) ? (1<<(ffs((mask))-1)) : 1)) : mask) #define force_mask(mode,mask) (((mode) == ForceChannel) ? (((mask) ? (1<<(PBD::ffs((mask))-1)) : 1)) : mask)
void _set_playback_channel_mode(ChannelMode mode, uint16_t mask) { void _set_playback_channel_mode(ChannelMode mode, uint16_t mask) {
mask = force_mask (mode, mask); mask = force_mask (mode, mask);

View file

@ -325,6 +325,9 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram
if (!_active) { if (!_active) {
silence (nframes); silence (nframes);
if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
_meter->reset();
}
return 0; return 0;
} }
@ -354,7 +357,7 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram
fill_buffers_with_input (bufs, _input, nframes); fill_buffers_with_input (bufs, _input, nframes);
if (_meter_point == MeterInput) { if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
_meter->run (bufs, start_frame, end_frame, nframes, true); _meter->run (bufs, start_frame, end_frame, nframes, true);
} }

View file

@ -1717,6 +1717,7 @@ AUPlugin::set_state(const XMLNode& node, int version)
return -1; return -1;
} }
#ifndef NO_PLUGIN_STATE
if (node.children().empty()) { if (node.children().empty()) {
return -1; return -1;
} }
@ -1752,6 +1753,7 @@ AUPlugin::set_state(const XMLNode& node, int version)
} }
CFRelease (propertyList); CFRelease (propertyList);
} }
#endif
Plugin::set_state (node, version); Plugin::set_state (node, version);
return ret; return ret;

View file

@ -1568,7 +1568,7 @@ AudioEngine::stop_process_thread (jack_native_thread_t thread)
* Jack 2 _jack arg is not used so it should be OK * Jack 2 _jack arg is not used so it should be OK
*/ */
#ifdef USING_JACK2_EXPANSION_OF_JACK_API #if defined(USING_JACK2_EXPANSION_OF_JACK_API) || defined(WIN32)
if (jack_client_stop_thread (_jack, thread) != 0) { if (jack_client_stop_thread (_jack, thread) != 0) {
error << "AudioEngine: cannot stop process thread" << endmsg; error << "AudioEngine: cannot stop process thread" << endmsg;
return false; return false;

View file

@ -1645,8 +1645,10 @@ IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, fr
} }
_buffers.get_jack_port_addresses (_ports, nframes); _buffers.get_jack_port_addresses (_ports, nframes);
if (proc) {
proc->run (_buffers, start_frame, end_frame, nframes, true); proc->run (_buffers, start_frame, end_frame, nframes, true);
} }
}
void void
IO::collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset) IO::collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset)

View file

@ -46,12 +46,6 @@ void Kmeterdsp::process (float *p, int n)
float s, t, z1, z2; float s, t, z1, z2;
if (_flag) // Display thread has read the rms value.
{
_rms = 0;
_flag = false;
}
// Get filter state. // Get filter state.
z1 = _z1; z1 = _z1;
z2 = _z2; z2 = _z2;
@ -88,10 +82,19 @@ void Kmeterdsp::process (float *p, int n)
_z1 = z1 + 1e-20f; _z1 = z1 + 1e-20f;
_z2 = z2 + 1e-20f; _z2 = z2 + 1e-20f;
// Adjust RMS value and update maximum since last read().
s = sqrtf (2 * z2); s = sqrtf (2 * z2);
if (_flag) // Display thread has read the rms value.
{
_rms = s;
_flag = false;
}
else
{
// Adjust RMS value and update maximum since last read().
if (s > _rms) _rms = s; if (s > _rms) _rms = s;
} }
}
/* Returns highest _rms value since last call */ /* Returns highest _rms value since last call */

View file

@ -40,6 +40,7 @@
#include "pbd/compose.h" #include "pbd/compose.h"
#include "pbd/error.h" #include "pbd/error.h"
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "pbd/stacktrace.h"
#include "midi++/manager.h" #include "midi++/manager.h"
@ -372,6 +373,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
return set_state_2X (node, version); return set_state_2X (node, version);
} }
#ifndef NO_PLUGIN_STATE
XMLNodeList nodes; XMLNodeList nodes;
XMLProperty *prop; XMLProperty *prop;
XMLNodeConstIterator iter; XMLNodeConstIterator iter;
@ -379,6 +381,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
const char *port; const char *port;
const char *data; const char *data;
uint32_t port_id; uint32_t port_id;
#endif
LocaleGuard lg (X_("POSIX")); LocaleGuard lg (X_("POSIX"));
if (node.name() != state_node_name()) { if (node.name() != state_node_name()) {
@ -386,6 +389,8 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
return -1; return -1;
} }
#ifndef NO_PLUGIN_STATE
nodes = node.children ("Port"); nodes = node.children ("Port");
for (iter = nodes.begin(); iter != nodes.end(); ++iter) { for (iter = nodes.begin(); iter != nodes.end(); ++iter) {
@ -408,6 +413,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
sscanf (port, "%" PRIu32, &port_id); sscanf (port, "%" PRIu32, &port_id);
set_parameter (port_id, atof(data)); set_parameter (port_id, atof(data));
} }
#endif
latency_compute_run (); latency_compute_run ();
@ -417,6 +423,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
int int
LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */) LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
{ {
#ifndef NO_PLUGIN_STATE
XMLNodeList nodes; XMLNodeList nodes;
XMLProperty *prop; XMLProperty *prop;
XMLNodeConstIterator iter; XMLNodeConstIterator iter;
@ -424,6 +431,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
const char *port; const char *port;
const char *data; const char *data;
uint32_t port_id; uint32_t port_id;
#endif
LocaleGuard lg (X_("POSIX")); LocaleGuard lg (X_("POSIX"));
if (node.name() != state_node_name()) { if (node.name() != state_node_name()) {
@ -431,6 +439,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
return -1; return -1;
} }
#ifndef NO_PLUGIN_STATE
nodes = node.children ("port"); nodes = node.children ("port");
for(iter = nodes.begin(); iter != nodes.end(); ++iter){ for(iter = nodes.begin(); iter != nodes.end(); ++iter){
@ -455,6 +464,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
} }
latency_compute_run (); latency_compute_run ();
#endif
return 0; return 0;
} }

View file

@ -113,6 +113,8 @@ public:
LV2World (); LV2World ();
~LV2World (); ~LV2World ();
void load_bundled_plugins();
LilvWorld* world; LilvWorld* world;
LilvNode* atom_AtomPort; LilvNode* atom_AtomPort;
@ -141,6 +143,9 @@ public:
LilvNode* time_Position; LilvNode* time_Position;
LilvNode* ui_GtkUI; LilvNode* ui_GtkUI;
LilvNode* ui_external; LilvNode* ui_external;
private:
bool _bundle_checked;
}; };
static LV2World _world; static LV2World _world;
@ -1229,6 +1234,8 @@ LV2Plugin::set_state(const XMLNode& node, int version)
return -1; return -1;
} }
#ifndef NO_PLUGIN_STATE
if (version < 3000) { if (version < 3000) {
nodes = node.children("port"); nodes = node.children("port");
} else { } else {
@ -1284,6 +1291,7 @@ LV2Plugin::set_state(const XMLNode& node, int version)
} }
latency_compute_run(); latency_compute_run();
#endif
return Plugin::set_state(node, version); return Plugin::set_state(node, version);
} }
@ -1904,27 +1912,10 @@ static bool lv2_filter (const string& str, void *arg)
LV2World::LV2World() LV2World::LV2World()
: world(lilv_world_new()) : world(lilv_world_new())
, _bundle_checked(false)
{ {
lilv_world_load_all(world); lilv_world_load_all(world);
cout << "Scanning folders for bundled LV2s: " << ARDOUR::lv2_bundled_search_path().to_string() << endl;
PathScanner scanner;
vector<string *> *plugin_objects = scanner (ARDOUR::lv2_bundled_search_path().to_string(), lv2_filter, 0, true, true);
if (plugin_objects) {
for ( vector<string *>::iterator x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
#ifdef WINDOWS
string uri = "file:///" + **x + "/";
#else
string uri = "file://" + **x + "/";
#endif
LilvNode *node = lilv_new_uri(world, uri.c_str());
lilv_world_load_bundle(world, node);
lilv_node_free(node);
}
}
delete (plugin_objects);
atom_AtomPort = lilv_new_uri(world, LV2_ATOM__AtomPort); atom_AtomPort = lilv_new_uri(world, LV2_ATOM__AtomPort);
atom_Chunk = lilv_new_uri(world, LV2_ATOM__Chunk); atom_Chunk = lilv_new_uri(world, LV2_ATOM__Chunk);
atom_Sequence = lilv_new_uri(world, LV2_ATOM__Sequence); atom_Sequence = lilv_new_uri(world, LV2_ATOM__Sequence);
@ -1983,6 +1974,31 @@ LV2World::~LV2World()
lilv_node_free(atom_AtomPort); lilv_node_free(atom_AtomPort);
} }
void
LV2World::load_bundled_plugins()
{
if (!_bundle_checked) {
cout << "Scanning folders for bundled LV2s: " << ARDOUR::lv2_bundled_search_path().to_string() << endl;
PathScanner scanner;
vector<string *> *plugin_objects = scanner (ARDOUR::lv2_bundled_search_path().to_string(), lv2_filter, 0, true, true);
if (plugin_objects) {
for ( vector<string *>::iterator x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
#ifdef WINDOWS
string uri = "file:///" + **x + "/";
#else
string uri = "file://" + **x + "/";
#endif
LilvNode *node = lilv_new_uri(world, uri.c_str());
lilv_world_load_bundle(world, node);
lilv_node_free(node);
}
}
delete (plugin_objects);
_bundle_checked = true;
}
}
LV2PluginInfo::LV2PluginInfo (const void* c_plugin) LV2PluginInfo::LV2PluginInfo (const void* c_plugin)
: _c_plugin(c_plugin) : _c_plugin(c_plugin)
{ {
@ -2014,6 +2030,8 @@ LV2PluginInfo::load(Session& session)
PluginInfoList* PluginInfoList*
LV2PluginInfo::discover() LV2PluginInfo::discover()
{ {
_world.load_bundled_plugins();
PluginInfoList* plugs = new PluginInfoList; PluginInfoList* plugs = new PluginInfoList;
const LilvPlugins* plugins = lilv_world_get_all_plugins(_world.world); const LilvPlugins* plugins = lilv_world_get_all_plugins(_world.world);

View file

@ -116,6 +116,10 @@ PeakMeter::reset ()
for (size_t i = 0; i < _peak_signal.size(); ++i) { for (size_t i = 0; i < _peak_signal.size(); ++i) {
_peak_signal[i] = 0.0f; _peak_signal[i] = 0.0f;
} }
for (size_t n = 0; n < _kmeter.size(); ++n) {
_kmeter[n]->reset();
}
} }
void void

View file

@ -26,10 +26,10 @@
#include <fcntl.h> #include <fcntl.h>
#include <cstdlib> #include <cstdlib>
#include <ctime> #include <ctime>
#include <strings.h> // for ffs(3)
#include <sys/stat.h> #include <sys/stat.h>
#include "pbd/error.h" #include "pbd/error.h"
#include "pbd/ffs.h"
#include "pbd/basename.h" #include "pbd/basename.h"
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include "pbd/xml++.h" #include "pbd/xml++.h"
@ -438,7 +438,7 @@ MidiDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
break; break;
case ForceChannel: case ForceChannel:
if (ev.is_channel_event()) { if (ev.is_channel_event()) {
ev.set_channel (ffs(mask) - 1); ev.set_channel (PBD::ffs(mask) - 1);
} }
_capture_buf->write(transport_frame + loop_offset + ev.time(), _capture_buf->write(transport_frame + loop_offset + ev.time(),
ev.type(), ev.size(), ev.buffer()); ev.type(), ev.size(), ev.buffer());

View file

@ -17,8 +17,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <strings.h> // for ffs(3) #include "pbd/ffs.h"
#include "pbd/enumwriter.h" #include "pbd/enumwriter.h"
#include "pbd/convert.h" #include "pbd/convert.h"
#include "evoral/midi_util.h" #include "evoral/midi_util.h"
@ -330,6 +329,9 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
if (!_active) { if (!_active) {
silence (nframes); silence (nframes);
if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
_meter->reset();
}
return 0; return 0;
} }
@ -354,7 +356,7 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
fill_buffers_with_input (bufs, _input, nframes); fill_buffers_with_input (bufs, _input, nframes);
if (_meter_point == MeterInput) { if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
_meter->run (bufs, start_frame, end_frame, nframes, true); _meter->run (bufs, start_frame, end_frame, nframes, true);
} }
@ -504,7 +506,7 @@ MidiTrack::filter_channels (BufferSet& bufs, ChannelMode mode, uint32_t mask)
} }
break; break;
case ForceChannel: case ForceChannel:
ev.set_channel (ffs (mask) - 1); ev.set_channel (PBD::ffs (mask) - 1);
++e; ++e;
break; break;
case AllChannels: case AllChannels:

View file

@ -397,7 +397,7 @@ Plugin::get_state ()
add_state (root); add_state (root);
#else #else
if (!seen_get_state_message) { if (!seen_get_state_message) {
info << string_compose (_("Saving AudioUnit settings is not supported in this build of %1. Consider paying for a newer version"), info << string_compose (_("Saving plugin settings is not supported in this build of %1. Consider paying for the full version"),
PROGRAM_NAME) PROGRAM_NAME)
<< endmsg; << endmsg;
seen_get_state_message = true; seen_get_state_message = true;

View file

@ -882,7 +882,12 @@ PluginInsert::set_control_ids (const XMLNode& node, int version)
if ((prop = (*iter)->property (X_("parameter"))) != 0) { if ((prop = (*iter)->property (X_("parameter"))) != 0) {
uint32_t p = atoi (prop->value()); uint32_t p = atoi (prop->value());
/* this may create the new controllable */
boost::shared_ptr<Evoral::Control> c = control (Evoral::Parameter (PluginAutomation, 0, p)); boost::shared_ptr<Evoral::Control> c = control (Evoral::Parameter (PluginAutomation, 0, p));
#ifndef NO_PLUGIN_STATE
if (!c) { if (!c) {
continue; continue;
} }
@ -890,6 +895,7 @@ PluginInsert::set_control_ids (const XMLNode& node, int version)
if (ac) { if (ac) {
ac->set_state (**iter, version); ac->set_state (**iter, version);
} }
#endif
} }
} }
} }

View file

@ -2562,21 +2562,10 @@ Route::set_processor_state (const XMLNode& node)
continue; continue;
} }
#ifndef NO_PLUGIN_STATE
if (processor->set_state (**niter, Stateful::current_state_version) != 0) { if (processor->set_state (**niter, Stateful::current_state_version) != 0) {
/* This processor could not be configured. Turn it into a UnknownProcessor */ /* This processor could not be configured. Turn it into a UnknownProcessor */
processor.reset (new UnknownProcessor (_session, **niter)); processor.reset (new UnknownProcessor (_session, **niter));
} }
#else
if (boost::dynamic_pointer_cast<PluginInsert>(processor)) {
if (processor->set_state (**niter, Stateful::current_state_version) != 0) {
/* This processor could not be configured. Turn it into a UnknownProcessor */
processor.reset (new UnknownProcessor (_session, **niter));
}
} else {
/* plugin, but ::set_state() not * allowed no message here - things will get too verbose */
}
#endif
/* we have to note the monitor send here, otherwise a new one will be created /* we have to note the monitor send here, otherwise a new one will be created
and the state of this one will be lost. and the state of this one will be lost.

View file

@ -347,6 +347,9 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
if (!_active) { if (!_active) {
silence (nframes); silence (nframes);
if (_meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled())) {
_meter->reset();
}
return 0; return 0;
} }
@ -405,9 +408,40 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
if (be_silent) { if (be_silent) {
if (_meter_point == MeterInput) { if (_meter_point == MeterInput) {
/* still need input monitoring */ /* still need input monitoring and metering */
bool const track_rec = _diskstream->record_enabled ();
bool const auto_input = _session.config.get_auto_input ();
bool const software_monitor = Config->get_monitoring_model() == SoftwareMonitoring;
bool const tape_machine_mode = Config->get_tape_machine_mode ();
bool no_meter = false;
/* this needs a proper K-map
* and should be separated into a function similar to monitoring_state()
* that also handles roll() states in audio_track.cc, midi_track.cc and route.cc
*
* see http://www.oofus.co.uk/ardour/Ardour3MonitorModesV3.pdf
*/
if (!auto_input && !track_rec) {
no_meter=true;
}
else if (tape_machine_mode && !track_rec && auto_input) {
no_meter=true;
}
else if (!software_monitor && tape_machine_mode && !track_rec) {
no_meter=true;
}
else if (!software_monitor && !tape_machine_mode && !track_rec && !auto_input) {
no_meter=true;
}
if (no_meter) {
_meter->reset();
_input->process_input (boost::shared_ptr<Processor>(), start_frame, end_frame, nframes);
} else {
_input->process_input (_meter, start_frame, end_frame, nframes); _input->process_input (_meter, start_frame, end_frame, nframes);
} }
}
passthru_silence (start_frame, end_frame, nframes, 0); passthru_silence (start_frame, end_frame, nframes, 0);
@ -945,6 +979,14 @@ Track::set_monitoring (MonitorChoice mc)
MeterState MeterState
Track::metering_state () const Track::metering_state () const
{ {
return (_diskstream->record_enabled() || _meter_point == MeterInput) ? MeteringInput : MeteringRoute; bool rv;
if (_session.transport_rolling ()) {
// audio_track.cc || midi_track.cc roll() runs meter IFF:
rv = _meter_point == MeterInput && (_monitoring & MonitorInput || _diskstream->record_enabled());
} else {
// track no_roll() always metering if
rv = _meter_point == MeterInput;
}
return rv ? MeteringInput : MeteringRoute;
} }

View file

@ -197,14 +197,15 @@ int
VSTPlugin::set_state (const XMLNode& node, int version) VSTPlugin::set_state (const XMLNode& node, int version)
{ {
LocaleGuard lg (X_("POSIX")); LocaleGuard lg (X_("POSIX"));
int ret = -1;
if (node.name() != state_node_name()) { if (node.name() != state_node_name()) {
error << _("Bad node sent to VSTPlugin::set_state") << endmsg; error << _("Bad node sent to VSTPlugin::set_state") << endmsg;
return 0; return 0;
} }
#ifndef NO_PLUGIN_STATE
XMLNode* child; XMLNode* child;
int ret = -1;
if ((child = find_named_node (node, X_("chunk"))) != 0) { if ((child = find_named_node (node, X_("chunk"))) != 0) {
@ -237,6 +238,7 @@ VSTPlugin::set_state (const XMLNode& node, int version)
ret = 0; ret = 0;
} }
#endif
Plugin::set_state (node, version); Plugin::set_state (node, version);
return ret; return ret;

View file

@ -3,6 +3,7 @@
#include "flag_field.h" #include "flag_field.h"
#include <cstdlib>
#include <string> #include <string>
#ifdef __GNUC__ #ifdef __GNUC__
@ -25,7 +26,7 @@ struct DebugUtils
char * res = abi::__cxa_demangle (typeid(obj).name(), 0, 0, &status); char * res = abi::__cxa_demangle (typeid(obj).name(), 0, 0, &status);
if (status == 0) { if (status == 0) {
std::string s(res); std::string s(res);
free (res); std::free (res);
return s; return s;
} }
#endif #endif

View file

@ -123,7 +123,7 @@ public:
return time() < o.time(); return time() < o.time();
} }
if (bank != o.bank()) { if (bank() != o.bank()) {
return bank() < o.bank(); return bank() < o.bank();
} }

View file

@ -24,6 +24,10 @@
#include <stdint.h> #include <stdint.h>
#include <cstdio> #include <cstdio>
#if __clang__
#include "evoral/Note.hpp"
#endif
#include "pbd/compose.h" #include "pbd/compose.h"
#include "pbd/error.h" #include "pbd/error.h"

View file

@ -23,6 +23,8 @@
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <stdlib.h>
#include <gdkmm/rectangle.h> #include <gdkmm/rectangle.h>
#include <gtkmm2ext/fastmeter.h> #include <gtkmm2ext/fastmeter.h>
#include <gtkmm2ext/utils.h> #include <gtkmm2ext/utils.h>
@ -37,6 +39,7 @@ using namespace std;
int FastMeter::min_pattern_metric_size = 16; int FastMeter::min_pattern_metric_size = 16;
int FastMeter::max_pattern_metric_size = 1024; int FastMeter::max_pattern_metric_size = 1024;
bool FastMeter::no_rgba_overlay = false;
FastMeter::Pattern10Map FastMeter::vm_pattern_cache; FastMeter::Pattern10Map FastMeter::vm_pattern_cache;
FastMeter::PatternBgMap FastMeter::vb_pattern_cache; FastMeter::PatternBgMap FastMeter::vb_pattern_cache;
@ -61,6 +64,7 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len,
last_peak_rect.height = 0; last_peak_rect.height = 0;
highlight = false; highlight = false;
no_rgba_overlay = ! Glib::getenv("NO_METER_SHADE").empty();
_clr[0] = clr0; _clr[0] = clr0;
_clr[1] = clr1; _clr[1] = clr1;
@ -173,7 +177,7 @@ FastMeter::generate_meter_pattern (
cairo_pattern_add_color_stop_rgb (pat, 1.0, cairo_pattern_add_color_stop_rgb (pat, 1.0,
r/255.0, g/255.0, b/255.0); r/255.0, g/255.0, b/255.0);
if (shade) { if (shade && !no_rgba_overlay) {
cairo_pattern_t* shade_pattern = cairo_pattern_create_linear (0.0, 0.0, width, 0.0); cairo_pattern_t* shade_pattern = cairo_pattern_create_linear (0.0, 0.0, width, 0.0);
cairo_pattern_add_color_stop_rgba (shade_pattern, 0, 1.0, 1.0, 1.0, 0.2); cairo_pattern_add_color_stop_rgba (shade_pattern, 0, 1.0, 1.0, 1.0, 0.2);
cairo_pattern_add_color_stop_rgba (shade_pattern, 1, 0.0, 0.0, 0.0, 0.3); cairo_pattern_add_color_stop_rgba (shade_pattern, 1, 0.0, 0.0, 0.0, 0.3);
@ -221,7 +225,7 @@ FastMeter::generate_meter_background (
cairo_pattern_add_color_stop_rgb (pat, 1.0, cairo_pattern_add_color_stop_rgb (pat, 1.0,
r0/255.0, g0/255.0, b0/255.0); r0/255.0, g0/255.0, b0/255.0);
if (shade) { if (shade && !no_rgba_overlay) {
cairo_pattern_t* shade_pattern = cairo_pattern_create_linear (0.0, 0.0, width, 0.0); cairo_pattern_t* shade_pattern = cairo_pattern_create_linear (0.0, 0.0, width, 0.0);
cairo_pattern_add_color_stop_rgba (shade_pattern, 0.0, 1.0, 1.0, 1.0, 0.15); cairo_pattern_add_color_stop_rgba (shade_pattern, 0.0, 1.0, 1.0, 1.0, 0.15);
cairo_pattern_add_color_stop_rgba (shade_pattern, 0.6, 0.0, 0.0, 0.0, 0.10); cairo_pattern_add_color_stop_rgba (shade_pattern, 0.6, 0.0, 0.0, 0.0, 0.10);
@ -417,7 +421,8 @@ FastMeter::vertical_expose (GdkEventExpose* ev)
cairo_set_source (cr, fgpattern->cobj()); cairo_set_source (cr, fgpattern->cobj());
cairo_rectangle (cr, 1, last_peak_rect.y, pixwidth, last_peak_rect.height); cairo_rectangle (cr, 1, last_peak_rect.y, pixwidth, last_peak_rect.height);
if (bright_hold) {
if (bright_hold && !no_rgba_overlay) {
cairo_fill_preserve (cr); cairo_fill_preserve (cr);
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.3); cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.3);
} }

View file

@ -96,6 +96,8 @@ private:
bool vertical_expose (GdkEventExpose*); bool vertical_expose (GdkEventExpose*);
void queue_vertical_redraw (const Glib::RefPtr<Gdk::Window>&, float); void queue_vertical_redraw (const Glib::RefPtr<Gdk::Window>&, float);
static bool no_rgba_overlay;
static Cairo::RefPtr<Cairo::Pattern> generate_meter_pattern ( static Cairo::RefPtr<Cairo::Pattern> generate_meter_pattern (
int w, int h, int *clr, float *stp, bool shade); int w, int h, int *clr, float *stp, bool shade);
static Cairo::RefPtr<Cairo::Pattern> request_vertical_meter ( static Cairo::RefPtr<Cairo::Pattern> request_vertical_meter (

View file

@ -48,6 +48,9 @@ PersistentTooltip::~PersistentTooltip ()
bool bool
PersistentTooltip::enter (GdkEventCrossing *) PersistentTooltip::enter (GdkEventCrossing *)
{ {
if (_timeout.connected()) {
leave(NULL);
}
_timeout = Glib::signal_timeout().connect (sigc::mem_fun (*this, &PersistentTooltip::timeout), 500); _timeout = Glib::signal_timeout().connect (sigc::mem_fun (*this, &PersistentTooltip::timeout), 500);
return false; return false;
} }

35
libs/pbd/ffs.cc Normal file
View file

@ -0,0 +1,35 @@
/*
Copyright (C) 2013 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "pbd/ffs.h"
#include <strings.h>
namespace PBD {
int
ffs (int x)
{
#if defined(WIN32) && defined(__GNUC__)
return __builtin_ffs(x);
#else
return ffs(x);
#endif
}
}

View file

@ -38,7 +38,7 @@ PBD::canonical_path (const std::string& path)
{ {
#ifdef COMPILER_MINGW #ifdef COMPILER_MINGW
return path; return path;
#endif #else
char buf[PATH_MAX+1]; char buf[PATH_MAX+1];
if (!realpath (path.c_str(), buf) && (errno != ENOENT)) { if (!realpath (path.c_str(), buf) && (errno != ENOENT)) {
@ -46,6 +46,7 @@ PBD::canonical_path (const std::string& path)
} }
return string (buf); return string (buf);
#endif
} }
string string

27
libs/pbd/pbd/ffs.h Normal file
View file

@ -0,0 +1,27 @@
/*
Copyright (C) 2013 Tim Mayberry
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __libpbd_ffs_h__
#define __libpbd_ffs_h__
namespace PBD {
int ffs(int x);
}
#endif /* __libpbd_ffs_h__ */

View file

@ -20,6 +20,14 @@
#ifndef __libmisc_stl_delete_h__ #ifndef __libmisc_stl_delete_h__
#define __libmisc_stl_delete_h__ #define __libmisc_stl_delete_h__
#if __clang__ && __APPLE__ && __cplusplus >= 201103L
#include <vector>
#ifndef _CPP_VECTOR
#define _CPP_VECTOR
#endif
#endif
/* To actually use any of these deletion functions, you need to /* To actually use any of these deletion functions, you need to
first include the revelant container type header. first include the revelant container type header.
*/ */

View file

@ -45,6 +45,7 @@ libpbd_sources = [
'enums.cc', 'enums.cc',
'epa.cc', 'epa.cc',
'error.cc', 'error.cc',
'ffs.cc',
'file_manager.cc', 'file_manager.cc',
'file_utils.cc', 'file_utils.cc',
'fpu.cc', 'fpu.cc',

View file

@ -0,0 +1,66 @@
#ifndef _TARGETSXS_H_
#define _TARGETSXS_H_
#pragma warning( disable : 4996 )
#ifndef HAVE_LV2
#define HAVE_SUIL
#define HAVE_LV2
/* Comment out the above lines to build Mixbus without LV2 support */
#endif
#ifndef VST_SUPPORT
#define VST_SUPPORT
/* Comment out the above line to build Mixbus without VST support */
#endif
#ifndef JACK_32_64
#define JACK_32_64
/* Shouldn't really be needed but make sure that any structs we
obtain from libjack will have 1-byte packing alignment where
necessary (belt & braces approach to be on the safe side) */
#endif
#ifdef _DEBUG
#define _SECURE_SCL 1
#define _HAS_ITERATOR_DEBUGGING 1
/* #define to zero for a more conventional Debug build */
#endif
#ifndef __midl
#if defined(_DEBUG) || defined (DEBUG)
/* Experimental - link to the lowest DebugCRT so we can run on another system */
#define _SXS_ASSEMBLY_VERSION "8.0.50727.42"
#else
#define _SXS_ASSEMBLY_VERSION "8.0.50727.6195"
#endif
#define _CRT_ASSEMBLY_VERSION _SXS_ASSEMBLY_VERSION
#define _MFC_ASSEMBLY_VERSION _SXS_ASSEMBLY_VERSION
#define _ATL_ASSEMBLY_VERSION _SXS_ASSEMBLY_VERSION
#ifdef __cplusplus
extern "C" {
#endif
__declspec(selectany) int _forceCRTManifest;
__declspec(selectany) int _forceMFCManifest;
__declspec(selectany) int _forceAtlDllManifest;
__declspec(selectany) int _forceCRTManifestRTM;
__declspec(selectany) int _forceMFCManifestRTM;
__declspec(selectany) int _forceAtlDllManifestRTM;
#ifdef __cplusplus
}
#endif
#endif
/* 'stdint.h' conflicts with various other libraries so
let's #include stdint.h first to ensure one consistent
implementation for commonly used integer types. */
#include <stdint.h>
#if (BUILDING_ARDOUR)
#if defined(_MSC_VER) && !defined(__MINGW__) && !defined(__MINGW32__)
#include <ardourext/misc.h>
#endif
#endif
#endif /*_TARGETSXS_H_*/

20
wscript
View file

@ -8,7 +8,7 @@ import subprocess
import sys import sys
MAJOR = '3' MAJOR = '3'
MINOR = '2' MINOR = '3'
VERSION = MAJOR + '.' + MINOR VERSION = MAJOR + '.' + MINOR
APPNAME = 'Ardour' + MAJOR APPNAME = 'Ardour' + MAJOR
@ -109,6 +109,22 @@ def set_compiler_flags (conf,opt):
# waf adds -O0 -g itself. thanks waf! # waf adds -O0 -g itself. thanks waf!
is_clang = conf.env['CXX'][0].endswith('clang++') is_clang = conf.env['CXX'][0].endswith('clang++')
if conf.options.cxx11:
conf.check_cxx(cxxflags=["-std=c++11"])
conf.env.append_unique('CXXFLAGS', ['-std=c++11'])
if platform == "darwin":
conf.env.append_unique('CXXFLAGS', ['-stdlib=libc++'])
conf.env.append_unique('LINKFLAGS', ['-lc++'])
# Prevents visibility issues in standard headers
conf.define("_DARWIN_C_SOURCE", 1)
if is_clang and platform == "darwin":
# Silence warnings about the non-existing osx clang compiler flags
# -compatibility_version and -current_version. These are Waf
# generated and not needed with clang
conf.env.append_unique ("CXXFLAGS", ["-Qunused-arguments"])
if opt.gprofile: if opt.gprofile:
debug_flags = [ '-pg' ] debug_flags = [ '-pg' ]
@ -453,6 +469,8 @@ def options(opt):
help='directory where Wine\'s Windows header files can be found') help='directory where Wine\'s Windows header files can be found')
opt.add_option('--noconfirm', action='store_true', default=False, dest='noconfirm', opt.add_option('--noconfirm', action='store_true', default=False, dest='noconfirm',
help='Do not ask questions that require confirmation during the build') help='Do not ask questions that require confirmation during the build')
opt.add_option('--cxx11', action='store_true', default=False, dest='cxx11',
help='Turn on c++11 compiler flags (-std=c++11)')
for i in children: for i in children:
opt.recurse(i) opt.recurse(i)