merge 12096:12268 from svn+ssh://ardoursvn@subversion.ardour.org/ardour2/branches/3.0

git-svn-id: svn://localhost/ardour2/branches/3.0-SG@12269 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-05-14 18:35:19 +00:00
parent 9c8b57aab0
commit d6edbf5ca2
162 changed files with 2931 additions and 1064 deletions

View file

@ -334,6 +334,7 @@ AnalysisWindow::analyze_data (Gtk::Button */*button*/)
n = length - x;
}
memset (buf, 0, n * sizeof (Sample));
n = arv->audio_region()->read_at(buf, mixbuf, gain, arv->region()->position() + x, n, channel);
if (n == 0)

View file

@ -8,6 +8,7 @@ export ARDOUR_PATH=$TOP/gtk2_ardour/icons:$TOP/gtk2_ardour/pixmaps:$TOP/build/gt
export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs/surfaces/tranzport:$libs/surfaces/powermate:$libs/surfaces/mackie
export ARDOUR_PANNER_PATH=$libs/panners/2in2out:$libs/panners/1in2out:$libs/panners/vbap
export ARDOUR_DATA_PATH=$TOP/gtk2_ardour:build/gtk2_ardour:.
export ARDOUR_MIDIMAPS_PATH=$TOP/midi_maps:.
export ARDOUR_MCP_PATH=$TOP/mcp:.
if test -d $HOME/gtk/inst ; then

View file

@ -925,7 +925,7 @@ ARDOUR_UI::update_sample_rate (framecnt_t)
if (!engine->connected()) {
snprintf (buf, sizeof (buf), _("disconnected"));
snprintf (buf, sizeof (buf), "%s", _("disconnected"));
} else {
@ -1063,7 +1063,7 @@ ARDOUR_UI::update_disk_space()
framecnt_t fr = _session->frame_rate();
if (frames == max_framecnt) {
snprintf (buf, sizeof (buf), _("Disk: <span foreground=\"green\">24hrs+</span>"));
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">24hrs+</span>"));
} else {
rec_enabled_streams = 0;
_session->foreach_route (this, &ARDOUR_UI::count_recenabled_streams);
@ -1079,7 +1079,7 @@ ARDOUR_UI::update_disk_space()
hrs = frames / (fr * 3600);
if (hrs > 24) {
snprintf (buf, sizeof (buf), _("Disk: <span foreground=\"green\">&gt;24 hrs</span>"));
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">&gt;24 hrs</span>"));
} else {
frames -= hrs * fr * 3600;
mins = frames / (fr * 60);

View file

@ -706,7 +706,7 @@ ARDOUR_UI::float_big_clock (Gtk::Window* parent)
}
void
ARDOUR_UI::big_clock_size_allocate (Gtk::Allocation& alloc)
ARDOUR_UI::big_clock_size_allocate (Gtk::Allocation&)
{
if (!big_clock_resize_in_progress) {
Glib::signal_idle().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::idle_big_clock_text_resizer), 0, 0));

View file

@ -36,7 +36,7 @@ ArdourWindow::ArdourWindow (string title)
init ();
}
ArdourWindow::ArdourWindow (Gtk::Window& parent, string title)
ArdourWindow::ArdourWindow (Gtk::Window& parent, string /*title*/)
: Window ()
{
init ();

View file

@ -796,7 +796,7 @@ AudioClock::parse_as_timecode_distance (const std::string& str)
}
framecnt_t
AudioClock::parse_as_bbt_distance (const std::string& str)
AudioClock::parse_as_bbt_distance (const std::string&)
{
return 0;
}
@ -1001,7 +1001,7 @@ AudioClock::set_frames (framepos_t when, bool /*force*/)
}
void
AudioClock::set_minsec (framepos_t when, bool force)
AudioClock::set_minsec (framepos_t when, bool /*force*/)
{
char buf[32];
framecnt_t left;
@ -1046,7 +1046,7 @@ AudioClock::set_minsec (framepos_t when, bool force)
}
void
AudioClock::set_timecode (framepos_t when, bool force)
AudioClock::set_timecode (framepos_t when, bool /*force*/)
{
char buf[32];
Timecode::Time TC;
@ -1112,7 +1112,7 @@ AudioClock::set_timecode (framepos_t when, bool force)
}
void
AudioClock::set_bbt (framepos_t when, bool force)
AudioClock::set_bbt (framepos_t when, bool /*force*/)
{
char buf[16];
Timecode::BBT_Time BBT;
@ -1740,7 +1740,7 @@ AudioClock::get_frame_step (Field field, framepos_t pos, int dir)
}
framepos_t
AudioClock::current_time (framepos_t pos) const
AudioClock::current_time (framepos_t) const
{
return last_when;
}
@ -1795,7 +1795,7 @@ AudioClock::bbt_validate_edit (const string& str)
}
bool
AudioClock::timecode_validate_edit (const string& str)
AudioClock::timecode_validate_edit (const string&)
{
Timecode::Time TC;

View file

@ -20,6 +20,8 @@
#include <cassert>
#include <algorithm>
#include <boost/scoped_ptr.hpp>
#include <gtkmm.h>
#include <gtkmm2ext/gtk_ui.h>
@ -43,6 +45,7 @@
#include "waveview.h"
#include "public_editor.h"
#include "audio_region_editor.h"
#include "audio_streamview.h"
#include "region_gain_line.h"
#include "control_point.h"
#include "ghostregion.h"
@ -73,13 +76,18 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView
, fade_in_handle(0)
, fade_out_handle(0)
, fade_position_line(0)
, start_xfade_in (0)
, start_xfade_out (0)
, start_xfade_rect (0)
, end_xfade_in (0)
, end_xfade_out (0)
, end_xfade_rect (0)
, _amplitude_above_axis(1.0)
, _flags(0)
, fade_color(0)
{
}
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
Gdk::Color const & basic_color, bool recording, TimeAxisViewItem::Visibility visibility)
: RegionView (parent, tv, r, spu, basic_color, recording, visibility)
@ -89,6 +97,12 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView
, fade_in_handle(0)
, fade_out_handle(0)
, fade_position_line(0)
, start_xfade_in (0)
, start_xfade_out (0)
, start_xfade_rect (0)
, end_xfade_in (0)
, end_xfade_out (0)
, end_xfade_rect (0)
, _amplitude_above_axis(1.0)
, _flags(0)
, fade_color(0)
@ -102,6 +116,12 @@ AudioRegionView::AudioRegionView (const AudioRegionView& other, boost::shared_pt
, fade_in_handle(0)
, fade_out_handle(0)
, fade_position_line(0)
, start_xfade_in (0)
, start_xfade_out (0)
, start_xfade_rect (0)
, end_xfade_in (0)
, end_xfade_out (0)
, end_xfade_rect (0)
, _amplitude_above_axis (other._amplitude_above_axis)
, _flags (other._flags)
, fade_color(0)
@ -288,6 +308,7 @@ AudioRegionView::fade_out_changed ()
{
reset_fade_out_shape ();
}
void
AudioRegionView::fade_in_active_changed ()
{
@ -534,10 +555,31 @@ AudioRegionView::reset_fade_in_shape ()
void
AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
{
if (dragging()) {
return;
}
if (audio_region()->fade_in_is_xfade()) {
if (fade_in_handle) {
fade_in_handle->hide ();
fade_in_shape->hide ();
}
redraw_start_xfade ();
return;
} else {
if (start_xfade_in) {
start_xfade_in->hide ();
start_xfade_out->hide ();
start_xfade_rect->hide ();
}
}
if (fade_in_handle == 0) {
return;
}
fade_in_handle->show ();
/* smallest size for a fade is 64 frames */
width = std::max ((framecnt_t) 64, width);
@ -621,10 +663,31 @@ AudioRegionView::reset_fade_out_shape ()
void
AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
{
if (dragging()) {
return;
}
if (audio_region()->fade_out_is_xfade()) {
if (fade_out_handle) {
fade_out_handle->hide ();
fade_out_shape->hide ();
}
redraw_end_xfade ();
return;
} else {
if (end_xfade_in) {
end_xfade_in->hide ();
end_xfade_out->hide ();
end_xfade_rect->hide ();
}
}
if (fade_out_handle == 0) {
return;
}
fade_out_handle->show ();
/* smallest size for a fade is 64 frames */
width = std::max ((framecnt_t) 64, width);
@ -1462,6 +1525,287 @@ void
AudioRegionView::thaw_after_trim ()
{
RegionView::thaw_after_trim ();
unhide_envelope ();
drag_end ();
}
void
AudioRegionView::redraw_start_xfade ()
{
boost::shared_ptr<AudioRegion> ar (audio_region());
if (!ar->fade_in() || ar->fade_in()->empty()) {
return;
}
if (!ar->fade_in_is_xfade()) {
if (start_xfade_in) {
start_xfade_in->hide ();
start_xfade_out->hide ();
start_xfade_rect->hide ();
}
return;
}
redraw_start_xfade_to (ar, ar->fade_in()->back()->when);
}
void
AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, framecnt_t len)
{
int32_t const npoints = trackview.editor().frame_to_pixel (len);
if (npoints < 3) {
return;
}
if (!start_xfade_in) {
start_xfade_in = new ArdourCanvas::Line (*group);
start_xfade_in->property_width_pixels() = 1;
start_xfade_in->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_GainLine.get();
}
if (!start_xfade_out) {
start_xfade_out = new ArdourCanvas::Line (*group);
start_xfade_out->property_width_pixels() = 1;
start_xfade_out->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_GainLine.get();
}
if (!start_xfade_rect) {
start_xfade_rect = new ArdourCanvas::SimpleRect (*group);
start_xfade_rect->property_draw() = true;
start_xfade_rect->property_fill() = true;;
start_xfade_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ActiveCrossfade.get();
start_xfade_rect->property_outline_pixels() = 0;
start_xfade_rect->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_start_xfade_event), start_xfade_rect, this));
start_xfade_rect->set_data ("regionview", this);
}
Points* points = get_canvas_points ("xfade edit redraw", npoints);
boost::scoped_ptr<float> vec (new float[npoints]);
double effective_height = _height - NAME_HIGHLIGHT_SIZE - 1.0;
ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);
for (int i = 0, pci = 0; i < npoints; ++i) {
Gnome::Art::Point &p ((*points)[pci++]);
p.set_x (i);
p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
}
start_xfade_rect->property_x1() = ((*points)[0]).get_x();
start_xfade_rect->property_y1() = 1.0;
start_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
start_xfade_rect->property_y2() = effective_height;
start_xfade_rect->show ();
start_xfade_rect->raise_to_top ();
start_xfade_in->property_points() = *points;
start_xfade_in->show ();
start_xfade_in->raise_to_top ();
/* fade out line */
boost::shared_ptr<AutomationList> inverse = ar->inverse_fade_in();
if (!inverse) {
for (int i = 0, pci = 0; i < npoints; ++i) {
Gnome::Art::Point &p ((*points)[pci++]);
p.set_x (i);
p.set_y (1.0 + effective_height - (effective_height * (1.0 - vec.get()[i])));
}
} else {
inverse->curve().get_vector (0, inverse->back()->when, vec.get(), npoints);
for (int i = 0, pci = 0; i < npoints; ++i) {
Gnome::Art::Point &p ((*points)[pci++]);
p.set_x (i);
p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
}
}
start_xfade_out->property_points() = *points;
start_xfade_out->show ();
start_xfade_out->raise_to_top ();
delete points;
}
void
AudioRegionView::redraw_end_xfade ()
{
boost::shared_ptr<AudioRegion> ar (audio_region());
if (!ar->fade_out() || ar->fade_out()->empty()) {
return;
}
if (!ar->fade_out_is_xfade()) {
if (end_xfade_in) {
end_xfade_in->hide ();
end_xfade_out->hide ();
end_xfade_rect->hide ();
}
return;
}
redraw_end_xfade_to (ar, ar->fade_out()->back()->when);
}
void
AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecnt_t len)
{
int32_t const npoints = trackview.editor().frame_to_pixel (len);
if (npoints < 3) {
return;
}
if (!end_xfade_in) {
end_xfade_in = new ArdourCanvas::Line (*group);
end_xfade_in->property_width_pixels() = 1;
end_xfade_in->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_GainLine.get();
}
if (!end_xfade_out) {
end_xfade_out = new ArdourCanvas::Line (*group);
end_xfade_out->property_width_pixels() = 1;
end_xfade_out->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_GainLine.get();
}
if (!end_xfade_rect) {
end_xfade_rect = new ArdourCanvas::SimpleRect (*group);
end_xfade_rect->property_draw() = true;
end_xfade_rect->property_fill() = true;;
end_xfade_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ActiveCrossfade.get();
end_xfade_rect->property_outline_pixels() = 0;
end_xfade_rect->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_end_xfade_event), end_xfade_rect, this));
end_xfade_rect->set_data ("regionview", this);
}
Points* points = get_canvas_points ("xfade edit redraw", npoints);
boost::scoped_ptr<float> vec (new float[npoints]);
ar->fade_out()->curve().get_vector (0, ar->fade_out()->back()->when, vec.get(), npoints);
double rend = trackview.editor().frame_to_pixel (_region->length() - len);
double effective_height = _height - NAME_HIGHLIGHT_SIZE - 1;
for (int i = 0, pci = 0; i < npoints; ++i) {
Gnome::Art::Point &p ((*points)[pci++]);
p.set_x (rend + i);
p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
}
end_xfade_rect->property_x1() = ((*points)[0]).get_x();
end_xfade_rect->property_y1() = 1;
end_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
end_xfade_rect->property_y2() = effective_height;
end_xfade_rect->show ();
end_xfade_rect->raise_to_top ();
end_xfade_in->property_points() = *points;
end_xfade_in->show ();
end_xfade_in->raise_to_top ();
/* fade in line */
boost::shared_ptr<AutomationList> inverse = ar->inverse_fade_out ();
if (!inverse) {
for (int i = 0, pci = 0; i < npoints; ++i) {
Gnome::Art::Point &p ((*points)[pci++]);
p.set_x (rend + i);
p.set_y (1.0 + effective_height - (effective_height * (1.0 - vec.get()[i])));
}
} else {
inverse->curve().get_vector (inverse->front()->when, inverse->back()->when, vec.get(), npoints);
for (int i = 0, pci = 0; i < npoints; ++i) {
Gnome::Art::Point &p ((*points)[pci++]);
p.set_x (rend + i);
p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
}
}
end_xfade_out->property_points() = *points;
end_xfade_out->show ();
end_xfade_out->raise_to_top ();
delete points;
}
void
AudioRegionView::hide_xfades ()
{
if (start_xfade_in) {
start_xfade_in->hide();
}
if (start_xfade_out) {
start_xfade_out->hide();
}
if (start_xfade_rect) {
start_xfade_rect->hide ();
}
if (end_xfade_in) {
end_xfade_in->hide();
}
if (end_xfade_out) {
end_xfade_out->hide();
}
if (end_xfade_rect) {
end_xfade_rect->hide ();
}
}
void
AudioRegionView::show_xfades ()
{
if (start_xfade_in) {
start_xfade_in->show();
}
if (start_xfade_out) {
start_xfade_out->show();
}
if (start_xfade_rect) {
start_xfade_rect->show ();
}
if (end_xfade_in) {
end_xfade_in->show();
}
if (end_xfade_out) {
end_xfade_out->show();
}
if (end_xfade_rect) {
end_xfade_rect->show ();
}
}
void
AudioRegionView::drag_start ()
{
TimeAxisViewItem::drag_start ();
AudioTimeAxisView* atav = dynamic_cast<AudioTimeAxisView*> (&trackview);
if (atav) {
AudioStreamView* av = atav->audio_view();
if (av) {
/* this will hide our xfades too */
av->hide_xfades_with (audio_region());
}
}
}
void
AudioRegionView::drag_end ()
{
TimeAxisViewItem::drag_end ();
/* fades will be redrawn if they changed */
}

View file

@ -117,6 +117,17 @@ class AudioRegionView : public RegionView
void thaw_after_trim ();
void drag_start ();
void drag_end ();
void redraw_start_xfade_to (boost::shared_ptr<ARDOUR::AudioRegion>, framecnt_t);
void redraw_end_xfade_to (boost::shared_ptr<ARDOUR::AudioRegion>, framecnt_t);
void redraw_start_xfade ();
void redraw_end_xfade ();
void hide_xfades ();
void show_xfades ();
protected:
/* this constructor allows derived types
@ -142,6 +153,14 @@ class AudioRegionView : public RegionView
ArdourCanvas::SimpleRect* fade_out_handle; ///< fade out handle, or 0
ArdourCanvas::SimpleLine* fade_position_line;
ArdourCanvas::Line *start_xfade_in;
ArdourCanvas::Line *start_xfade_out;
ArdourCanvas::SimpleRect* start_xfade_rect;
ArdourCanvas::Line *end_xfade_in;
ArdourCanvas::Line *end_xfade_out;
ArdourCanvas::SimpleRect* end_xfade_rect;
boost::shared_ptr<AudioRegionGainLine> gain_line;
double _amplitude_above_axis;
@ -180,7 +199,6 @@ class AudioRegionView : public RegionView
void transients_changed();
private:
void setup_fade_handle_positions ();
/** A ScopedConnection for each PeaksReady callback (one per channel). Each member

View file

@ -532,6 +532,23 @@ AudioStreamView::hide_all_fades ()
}
}
void
AudioStreamView::hide_xfades_with (boost::shared_ptr<AudioRegion> ar)
{
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
if (arv) {
switch (arv->region()->coverage (ar->position(), ar->last_frame())) {
case Evoral::OverlapNone:
break;
default:
arv->hide_xfades ();
break;
}
}
}
}
void
AudioStreamView::color_handler ()
{

View file

@ -61,6 +61,8 @@ class AudioStreamView : public StreamView
void show_all_fades ();
void hide_all_fades ();
void hide_xfades_with (boost::shared_ptr<ARDOUR::AudioRegion> ar);
RegionView* create_region_view (boost::shared_ptr<ARDOUR::Region>, bool, bool);
private:

View file

@ -900,3 +900,69 @@ AutomationTimeAxisView::parse_state_id (
return true;
}
void
AutomationTimeAxisView::cut_copy_clear (Selection& selection, CutCopyOp op)
{
list<boost::shared_ptr<AutomationLine> > lines;
if (_line) {
lines.push_back (_line);
} else if (_view) {
lines = _view->get_lines ();
}
for (list<boost::shared_ptr<AutomationLine> >::iterator i = lines.begin(); i != lines.end(); ++i) {
cut_copy_clear_one (**i, selection, op);
}
}
void
AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& selection, CutCopyOp op)
{
boost::shared_ptr<Evoral::ControlList> what_we_got;
boost::shared_ptr<AutomationList> alist (line.the_list());
XMLNode &before = alist->get_state();
/* convert time selection to automation list model coordinates */
const Evoral::TimeConverter<double, ARDOUR::framepos_t>& tc = line.time_converter ();
double const start = tc.from (selection.time.front().start - tc.origin_b ());
double const end = tc.from (selection.time.front().end - tc.origin_b ());
switch (op) {
case Delete:
if (alist->cut (start, end) != 0) {
_session->add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
}
break;
case Cut:
if ((what_we_got = alist->cut (start, end)) != 0) {
_editor.get_cut_buffer().add (what_we_got);
_session->add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
}
break;
case Copy:
if ((what_we_got = alist->copy (start, end)) != 0) {
_editor.get_cut_buffer().add (what_we_got);
}
break;
case Clear:
if ((what_we_got = alist->cut (start, end)) != 0) {
_session->add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &alist->get_state()));
}
break;
}
if (what_we_got) {
for (AutomationList::iterator x = what_we_got->begin(); x != what_we_got->end(); ++x) {
double when = (*x)->when;
double val = (*x)->value;
line.model_to_view_coord (when, val);
(*x)->when = when;
(*x)->value = val;
}
}
}

View file

@ -91,6 +91,7 @@ class AutomationTimeAxisView : public TimeAxisView {
/* editing operations */
void cut_copy_clear (Selection&, Editing::CutCopyOp);
bool paste (ARDOUR::framepos_t, float times, Selection&, size_t nth);
int set_state (const XMLNode&, int version);
@ -166,6 +167,7 @@ class AutomationTimeAxisView : public TimeAxisView {
void build_display_menu ();
void cut_copy_clear_one (AutomationLine&, Selection&, Editing::CutCopyOp);
bool paste_one (AutomationLine&, ARDOUR::framepos_t, float times, Selection&, size_t nth);
void route_going_away ();

View file

@ -138,7 +138,7 @@ ButtonJoiner::on_size_allocate (Allocation& alloc)
}
bool
ButtonJoiner::on_button_release_event (GdkEventButton* ev)
ButtonJoiner::on_button_release_event (GdkEventButton*)
{
if (_action) {
_action->activate ();

View file

@ -889,7 +889,7 @@ CrossfadeEditor::build_presets ()
/* FADE IN */
p = new Preset ("Linear (-6dB)", "crossfade-in-linear");
p = new Preset ("Linear (-6dB)", "fadein-linear");
p->push_back (PresetPoint (0, 0));
p->push_back (PresetPoint (0.000000, 0.000000));
p->push_back (PresetPoint (0.166667, 0.166366));
@ -900,7 +900,7 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1.000000, 1.000000));
fade_in_presets->push_back (p);
p = new Preset ("S(1)-curve", "crossfade-in-S1");
p = new Preset ("S(1)-curve", "fadein-S1");
p->push_back (PresetPoint (0, 0));
p->push_back (PresetPoint (0.1, 0.01));
p->push_back (PresetPoint (0.2, 0.03));
@ -909,7 +909,7 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1, 1));
fade_in_presets->push_back (p);
p = new Preset ("S(2)-curve", "crossfade-in-S2");
p = new Preset ("S(2)-curve", "fadein-S2");
p->push_back (PresetPoint (0.0, 0.0));
p->push_back (PresetPoint (0.055, 0.222));
p->push_back (PresetPoint (0.163, 0.35));
@ -918,7 +918,7 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1.0, 1.0));
fade_in_presets->push_back (p);
p = new Preset ("Constant Power (-3dB)", "crossfade-in-constant-power");
p = new Preset ("Constant Power (-3dB)", "fadein-constant-power");
p->push_back (PresetPoint (0.000000, 0.000000));
p->push_back (PresetPoint (0.166667, 0.282192));
@ -932,7 +932,7 @@ CrossfadeEditor::build_presets ()
if (!Profile->get_sae()) {
p = new Preset ("Short cut", "crossfade-in-short-cut");
p = new Preset ("Short cut", "fadein-short-cut");
p->push_back (PresetPoint (0, 0));
p->push_back (PresetPoint (0.389401, 0.0333333));
p->push_back (PresetPoint (0.629032, 0.0861111));
@ -942,7 +942,7 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1, 1));
fade_in_presets->push_back (p);
p = new Preset ("Slow cut", "crossfade-in-slow-cut");
p = new Preset ("Slow cut", "fadein-slow-cut");
p->push_back (PresetPoint (0, 0));
p->push_back (PresetPoint (0.304147, 0.0694444));
p->push_back (PresetPoint (0.529954, 0.152778));
@ -952,7 +952,7 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1, 1));
fade_in_presets->push_back (p);
p = new Preset ("Fast cut", "crossfade-in-fast-cut");
p = new Preset ("Fast cut", "fadein-fast-cut");
p->push_back (PresetPoint (0, 0));
p->push_back (PresetPoint (0.0737327, 0.308333));
p->push_back (PresetPoint (0.246544, 0.658333));
@ -962,7 +962,7 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1, 1));
fade_in_presets->push_back (p);
p = new Preset ("Long cut", "crossfade-in-long-cut");
p = new Preset ("Long cut", "fadein-long-cut");
p->push_back (PresetPoint (0, 0));
p->push_back (PresetPoint (0.0207373, 0.197222));
p->push_back (PresetPoint (0.0645161, 0.525));
@ -977,7 +977,7 @@ CrossfadeEditor::build_presets ()
/* FADE OUT */
// p = new Preset ("regout.xpm");
p = new Preset ("Linear (-6dB cut)", "crossfade-out-linear");
p = new Preset ("Linear (-6dB cut)", "fadeout-linear");
p->push_back (PresetPoint (0, 1));
p->push_back (PresetPoint (0.000000, 1.000000));
p->push_back (PresetPoint (0.166667, 0.833033));
@ -988,7 +988,7 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1.000000, 0.000000));
fade_out_presets->push_back (p);
p = new Preset ("S(1)-Curve", "crossfade-out-S1");
p = new Preset ("S(1)-Curve", "fadeout-S1");
p->push_back (PresetPoint (0, 1));
p->push_back (PresetPoint (0.1, 0.99));
p->push_back (PresetPoint (0.2, 0.97));
@ -997,7 +997,7 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1, 0));
fade_out_presets->push_back (p);
p = new Preset ("S(2)-Curve", "crossfade-out-S2");
p = new Preset ("S(2)-Curve", "fadeout-S2");
p->push_back (PresetPoint (0.0, 1.0));
p->push_back (PresetPoint (0.163, 0.678));
p->push_back (PresetPoint (0.055, 0.783));
@ -1007,7 +1007,7 @@ CrossfadeEditor::build_presets ()
fade_out_presets->push_back (p);
// p = new Preset ("linout.xpm");
p = new Preset ("Constant Power (-3dB cut)", "crossfade-out-constant-power");
p = new Preset ("Constant Power (-3dB cut)", "fadeout-constant-power");
p->push_back (PresetPoint (0.000000, 1.000000));
p->push_back (PresetPoint (0.166667, 0.948859));
p->push_back (PresetPoint (0.333333, 0.851507));
@ -1019,7 +1019,7 @@ CrossfadeEditor::build_presets ()
if (!Profile->get_sae()) {
// p = new Preset ("hiout.xpm");
p = new Preset ("Short cut", "crossfade-out-short-cut");
p = new Preset ("Short cut", "fadeout-short-cut");
p->push_back (PresetPoint (0, 1));
p->push_back (PresetPoint (0.305556, 1));
p->push_back (PresetPoint (0.548611, 0.991736));
@ -1029,7 +1029,7 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1, 0));
fade_out_presets->push_back (p);
p = new Preset ("Slow cut", "crossfade-out-slow-cut");
p = new Preset ("Slow cut", "fadeout-slow-cut");
p->push_back (PresetPoint (0, 1));
p->push_back (PresetPoint (0.228111, 0.988889));
p->push_back (PresetPoint (0.347926, 0.972222));
@ -1039,7 +1039,7 @@ CrossfadeEditor::build_presets ()
p->push_back (PresetPoint (1, 0));
fade_out_presets->push_back (p);
p = new Preset ("Fast cut", "crossfade-out-fast-cut");
p = new Preset ("Fast cut", "fadeout-fast-cut");
p->push_back (PresetPoint (0, 1));
p->push_back (PresetPoint (0.080645, 0.730556));
p->push_back (PresetPoint (0.277778, 0.289256));
@ -1049,7 +1049,7 @@ CrossfadeEditor::build_presets ()
fade_out_presets->push_back (p);
// p = new Preset ("loout.xpm");
p = new Preset ("Long cut", "crossfade-out-long-cut");
p = new Preset ("Long cut", "fadeout-long-cut");
p->push_back (PresetPoint (0, 1));
p->push_back (PresetPoint (0.023041, 0.697222));
p->push_back (PresetPoint (0.0553, 0.483333));

View file

@ -32,6 +32,11 @@ using namespace PBD;
int
curvetest (string filename)
{
// needed to initialize ID objects/counter used
// by Curve et al.
PBD::ID::init ();
ifstream in (filename.c_str());
stringstream line;
//Evoral::Parameter param(GainAutomation, -1.0, +1.0, 0.0);
@ -40,11 +45,6 @@ curvetest (string filename)
double minx = DBL_MAX;
double maxx = DBL_MIN;
// needed to initialize ID objects/counter used
// by Curve et al.
PBD::ID::init ();
while (in) {
double x, y;

View file

@ -548,7 +548,7 @@ Editor::Editor ()
add_notebook_page (_("Regions"), _regions->widget ());
add_notebook_page (_("Tracks & Busses"), _routes->widget ());
add_notebook_page (_("Snapshots"), _snapshots->widget ());
add_notebook_page (_("Route Groups"), _route_groups->widget ());
add_notebook_page (_("Track & Bus Groups"), _route_groups->widget ());
add_notebook_page (_("Ranges & Marks"), _locations->widget ());
_the_notebook.set_show_tabs (true);
@ -721,6 +721,7 @@ Editor::Editor ()
ControlProtocol::AddRouteToSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Add), gui_context());
ControlProtocol::RemoveRouteFromSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Toggle), gui_context());
ControlProtocol::SetRouteSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Set), gui_context());
ControlProtocol::ToggleRouteSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_select, this, _1, Selection::Toggle), gui_context());
ControlProtocol::ClearRouteSelection.connect (*this, invalidator (*this), boost::bind (&Editor::control_unselect, this), gui_context());
BasicUI::AccessAction.connect (*this, invalidator (*this), boost::bind (&Editor::access_action, this, _1, _2), gui_context());
@ -1340,6 +1341,101 @@ Editor::action_pre_activated (Glib::RefPtr<Action> const & a)
}
}
void
Editor::fill_xfade_menu (Menu_Helpers::MenuList& items, bool start)
{
using namespace Menu_Helpers;
void (Editor::*emf)(FadeShape);
std::map<ARDOUR::FadeShape,Gtk::Image*>* images;
if (start) {
images = &_xfade_in_images;
emf = &Editor::set_fade_in_shape;
} else {
images = &_xfade_out_images;
emf = &Editor::set_fade_out_shape;
}
items.push_back (
ImageMenuElem (
_("Linear (for highly correlated material)"),
*(*images)[FadeLinear],
sigc::bind (sigc::mem_fun (*this, emf), FadeLinear)
)
);
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
_("ConstantPower"),
*(*images)[FadeConstantPower],
sigc::bind (sigc::mem_fun (*this, emf), FadeConstantPower)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
_("Symmetric"),
*(*images)[FadeSymmetric],
sigc::bind (sigc::mem_fun (*this, emf), FadeSymmetric)
)
);
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
_("Slow"),
*(*images)[FadeSlow],
sigc::bind (sigc::mem_fun (*this, emf), FadeSlow)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
_("Fast"),
*(*images)[FadeFast],
sigc::bind (sigc::mem_fun (*this, emf), FadeFast)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
}
/** Pop up a context menu for when the user clicks on a start crossfade */
void
Editor::popup_xfade_in_context_menu (int button, int32_t time, ArdourCanvas::Item* item, ItemType item_type)
{
using namespace Menu_Helpers;
MenuList& items (xfade_in_context_menu.items());
if (items.empty()) {
fill_xfade_menu (items, true);
}
xfade_in_context_menu.popup (button, time);
}
/** Pop up a context menu for when the user clicks on an end crossfade */
void
Editor::popup_xfade_out_context_menu (int button, int32_t time, ArdourCanvas::Item* item, ItemType item_type)
{
using namespace Menu_Helpers;
MenuList& items (xfade_out_context_menu.items());
if (items.empty()) {
fill_xfade_menu (items, false);
}
xfade_out_context_menu.popup (button, time);
}
/** Pop up a context menu for when the user clicks on a fade in or fade out */
void
Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* item, ItemType item_type)
@ -1386,7 +1482,16 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i
items.push_back (
ImageMenuElem (
_("Slowest"),
_("Slow"),
*_fade_in_images[FadeSlow],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeSlow)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
_("Fast"),
*_fade_in_images[FadeFast],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeFast)
));
@ -1395,27 +1500,16 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i
items.push_back (
ImageMenuElem (
_("Slow"),
*_fade_in_images[FadeLogB],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeLogB)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
_("Fast"),
*_fade_in_images[FadeLogA],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeLogA)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
_("Fastest"),
_("Symmetric"),
*_fade_in_images[FadeSlow],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeSlow)
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeSymmetric)
));
items.push_back (
ImageMenuElem (
_("Constant Power"),
*_fade_in_images[FadeConstantPower],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeConstantPower)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
@ -1450,36 +1544,34 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i
items.push_back (
ImageMenuElem (
_("Slowest"),
*_fade_out_images[FadeFast],
_("Slow"),
*_fade_out_images[FadeSlow],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeSlow)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
_("Slow"),
*_fade_out_images[FadeLogB],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeLogA)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
_("Fast"),
*_fade_out_images[FadeLogA],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeLogB)
*_fade_out_images[FadeFast],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeFast)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
_("Fastest"),
_("Symmetric"),
*_fade_out_images[FadeSlow],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeFast)
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeSymmetric)
));
items.push_back (
ImageMenuElem (
_("Constant Power"),
*_fade_out_images[FadeConstantPower],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeConstantPower)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
@ -5282,17 +5374,30 @@ Editor::update_region_layering_order_editor ()
void
Editor::setup_fade_images ()
{
_fade_in_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("crossfade-in-linear")));
_fade_in_images[FadeFast] = new Gtk::Image (get_icon_path (X_("crossfade-in-short-cut")));
_fade_in_images[FadeLogB] = new Gtk::Image (get_icon_path (X_("crossfade-in-slow-cut")));
_fade_in_images[FadeLogA] = new Gtk::Image (get_icon_path (X_("crossfade-in-fast-cut")));
_fade_in_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("crossfade-in-long-cut")));
_fade_in_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("fadein-linear")));
_fade_in_images[FadeSymmetric] = new Gtk::Image (get_icon_path (X_("fadein-short-cut")));
_fade_in_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadein-slow-cut")));
_fade_in_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadein-fast-cut")));
_fade_in_images[FadeConstantPower] = new Gtk::Image (get_icon_path (X_("fadein-long-cut")));
_fade_out_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("fadeout-linear")));
_fade_out_images[FadeSymmetric] = new Gtk::Image (get_icon_path (X_("fadeout-short-cut")));
_fade_out_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadeout-slow-cut")));
_fade_out_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadeout-fast-cut")));
_fade_out_images[FadeConstantPower] = new Gtk::Image (get_icon_path (X_("fadeout-long-cut")));
_xfade_in_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("fadeout-linear")));
_xfade_in_images[FadeSymmetric] = new Gtk::Image (get_icon_path (X_("fadeout-short-cut")));
_xfade_in_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadeout-slow-cut")));
_xfade_in_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadeout-fast-cut")));
_xfade_in_images[FadeConstantPower] = new Gtk::Image (get_icon_path (X_("fadeout-long-cut")));
_xfade_out_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("fadeout-linear")));
_xfade_out_images[FadeSymmetric] = new Gtk::Image (get_icon_path (X_("fadeout-short-cut")));
_xfade_out_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadeout-slow-cut")));
_xfade_out_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadeout-fast-cut")));
_xfade_out_images[FadeConstantPower] = new Gtk::Image (get_icon_path (X_("fadeout-long-cut")));
_fade_out_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("crossfade-out-linear")));
_fade_out_images[FadeFast] = new Gtk::Image (get_icon_path (X_("crossfade-out-short-cut")));
_fade_out_images[FadeLogB] = new Gtk::Image (get_icon_path (X_("crossfade-out-slow-cut")));
_fade_out_images[FadeLogA] = new Gtk::Image (get_icon_path (X_("crossfade-out-fast-cut")));
_fade_out_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("crossfade-out-long-cut")));
}
/** @return Gtk::manage()d menu item for a given action from `editor_actions' */

View file

@ -1337,6 +1337,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
Gtk::Menu fade_context_menu;
void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
Gtk::Menu xfade_in_context_menu;
Gtk::Menu xfade_out_context_menu;
void popup_xfade_in_context_menu (int, int, ArdourCanvas::Item*, ItemType);
void popup_xfade_out_context_menu (int, int, ArdourCanvas::Item*, ItemType);
void fill_xfade_menu (Gtk::Menu_Helpers::MenuList& items, bool start);
void set_fade_in_shape (ARDOUR::FadeShape);
void set_fade_out_shape (ARDOUR::FadeShape);
@ -1374,6 +1380,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
bool canvas_start_xfade_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
bool canvas_end_xfade_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
@ -2057,6 +2065,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void setup_fade_images ();
std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_in_images;
std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_out_images;
std::map<ARDOUR::FadeShape, Gtk::Image*> _xfade_in_images;
std::map<ARDOUR::FadeShape, Gtk::Image*> _xfade_out_images;
Gtk::MenuItem& action_menu_item (std::string const &);
void action_pre_activated (Glib::RefPtr<Gtk::Action> const &);

View file

@ -348,6 +348,70 @@ Editor::canvas_automation_track_event (GdkEvent *event, ArdourCanvas::Item* item
return ret;
}
bool
Editor::canvas_start_xfade_event (GdkEvent *event, ArdourCanvas::Item* item, AudioRegionView *rv)
{
if (!rv->sensitive()) {
return false;
}
switch (event->type) {
case GDK_BUTTON_PRESS:
clicked_regionview = rv;
clicked_control_point = 0;
clicked_axisview = &rv->get_time_axis_view();
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
if (event->button.button == 3) {
return button_press_handler (item, event, StartCrossFadeItem);
}
break;
case GDK_BUTTON_RELEASE:
if (event->button.button == 3) {
return button_release_handler (item, event, StartCrossFadeItem);
}
break;
default:
break;
}
return typed_event (item, event, StartCrossFadeItem);
}
bool
Editor::canvas_end_xfade_event (GdkEvent *event, ArdourCanvas::Item* item, AudioRegionView *rv)
{
if (!rv->sensitive()) {
return false;
}
switch (event->type) {
case GDK_BUTTON_PRESS:
clicked_regionview = rv;
clicked_control_point = 0;
clicked_axisview = &rv->get_time_axis_view();
clicked_routeview = dynamic_cast<RouteTimeAxisView*>(clicked_axisview);
if (event->button.button == 3) {
return button_press_handler (item, event, EndCrossFadeItem);
}
break;
case GDK_BUTTON_RELEASE:
if (event->button.button == 3) {
return button_release_handler (item, event, EndCrossFadeItem);
}
break;
default:
break;
}
return typed_event (item, event, EndCrossFadeItem);
}
bool
Editor::canvas_fade_in_event (GdkEvent *event, ArdourCanvas::Item* item, AudioRegionView *rv)
{

View file

@ -663,7 +663,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
if (first_move) {
rv->get_time_axis_view().hide_dependent_views (*rv);
rv->drag_start ();
/* Absolutely no idea why this is necessary, but it is; without
it, the region view disappears after the reparent.
@ -1063,7 +1063,7 @@ RegionMoveDrag::finished_no_copy (
rv->get_canvas_group()->reparent (*dest_rtv->view()->canvas_item());
rv->get_canvas_group()->property_y() = i->initial_y;
rv->get_time_axis_view().reveal_dependent_views (*rv);
rv->drag_end ();
/* just change the model */
@ -1277,7 +1277,7 @@ RegionMotionDrag::aborted (bool)
assert (rtv);
rv->get_canvas_group()->reparent (*rtv->view()->canvas_item());
rv->get_canvas_group()->property_y() = 0;
rv->get_time_axis_view().reveal_dependent_views (*rv);
rv->drag_end ();
rv->fake_set_opaque (false);
rv->move (-_total_x_delta, 0);
rv->set_height (rtv->view()->child_height ());
@ -1706,6 +1706,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
if (arv) {
arv->temporarily_hide_envelope ();
arv->drag_start ();
}
boost::shared_ptr<Playlist> pl = rv->region()->playlist();
@ -4360,7 +4361,7 @@ MidiRubberbandSelectDrag::MidiRubberbandSelectDrag (Editor* e, MidiRegionView* r
}
void
MidiRubberbandSelectDrag::select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress)
MidiRubberbandSelectDrag::select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool /*drag_in_progress*/)
{
framepos_t const p = _region_view->region()->position ();
double const y = _region_view->midi_view()->y_position ();
@ -4393,7 +4394,7 @@ MidiVerticalSelectDrag::MidiVerticalSelectDrag (Editor* e, MidiRegionView* rv)
}
void
MidiVerticalSelectDrag::select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress)
MidiVerticalSelectDrag::select_things (int button_state, framepos_t /*x1*/, framepos_t /*x2*/, double y1, double y2, bool /*drag_in_progress*/)
{
double const y = _region_view->midi_view()->y_position ();
@ -4516,7 +4517,7 @@ NoteCreateDrag::motion (GdkEvent* event, bool)
}
void
NoteCreateDrag::finished (GdkEvent* event, bool had_movement)
NoteCreateDrag::finished (GdkEvent*, bool had_movement)
{
if (!had_movement) {
return;
@ -4550,3 +4551,100 @@ NoteCreateDrag::aborted (bool)
{
}
/*------------*/
CrossfadeEdgeDrag::CrossfadeEdgeDrag (Editor* e, AudioRegionView* rv, ArdourCanvas::Item* i, bool start_yn)
: Drag (e, i)
, arv (rv)
, start (start_yn)
{
}
void
CrossfadeEdgeDrag::start_grab (GdkEvent* event, Gdk::Cursor *cursor)
{
Drag::start_grab (event, cursor);
}
void
CrossfadeEdgeDrag::motion (GdkEvent*, bool)
{
double distance;
double new_length;
framecnt_t len;
boost::shared_ptr<AudioRegion> ar (arv->audio_region());
if (start) {
distance = _drags->current_pointer_x() - grab_x();
len = ar->fade_in()->back()->when;
} else {
distance = grab_x() - _drags->current_pointer_x();
len = ar->fade_out()->back()->when;
}
/* how long should it be ? */
new_length = len + _editor->unit_to_frame (distance);
/* now check with the region that this is legal */
new_length = ar->verify_xfade_bounds (new_length, start);
if (start) {
arv->redraw_start_xfade_to (ar, new_length);
} else {
arv->redraw_end_xfade_to (ar, new_length);
}
}
void
CrossfadeEdgeDrag::finished (GdkEvent*, bool)
{
double distance;
double new_length;
framecnt_t len;
boost::shared_ptr<AudioRegion> ar (arv->audio_region());
if (start) {
distance = _drags->current_pointer_x() - grab_x();
len = ar->fade_in()->back()->when;
} else {
distance = grab_x() - _drags->current_pointer_x();
len = ar->fade_out()->back()->when;
}
new_length = ar->verify_xfade_bounds (len + _editor->unit_to_frame (distance), start);
_editor->begin_reversible_command ("xfade trim");
ar->playlist()->clear_owned_changes ();
if (start) {
ar->set_fade_in_length (new_length);
} else {
ar->set_fade_out_length (new_length);
}
/* Adjusting the xfade may affect other regions in the playlist, so we need
to get undo Commands from the whole playlist rather than just the
region.
*/
vector<Command*> cmds;
ar->playlist()->rdiff (cmds);
_editor->session()->add_commands (cmds);
}
void
CrossfadeEdgeDrag::aborted (bool)
{
if (start) {
arv->redraw_start_xfade ();
} else {
arv->redraw_end_xfade ();
}
}

View file

@ -972,5 +972,30 @@ private:
bool _nothing_to_drag;
};
/** Drag of one edge of an xfade
*/
class CrossfadeEdgeDrag : public Drag
{
public:
CrossfadeEdgeDrag (Editor*, AudioRegionView*, ArdourCanvas::Item*, bool start);
void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
void motion (GdkEvent*, bool);
void finished (GdkEvent*, bool);
void aborted (bool);
bool y_movement_matters () const {
return false;
}
virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
return std::make_pair (4, 4);
}
private:
AudioRegionView* arv;
bool start;
};
#endif /* __gtk2_ardour_editor_drag_h_ */

View file

@ -50,6 +50,8 @@ enum ItemType {
FeatureLineItem,
LeftFrameHandle,
RightFrameHandle,
StartCrossFadeItem,
EndCrossFadeItem,
#ifdef WITH_CMT
MarkerViewItem,

View file

@ -640,11 +640,12 @@ Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemTyp
}
break;
case FadeInHandleItem:
case FadeInItem:
case FadeOutHandleItem:
case FadeOutItem:
case StartCrossFadeItem:
case EndCrossFadeItem:
if (doing_object_stuff() || (mouse_mode != MouseRange && mouse_mode != MouseObject)) {
set_selected_regionview_from_click (press, op);
} else if (event->type == GDK_BUTTON_PRESS) {
@ -931,6 +932,14 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
return true;
}
case StartCrossFadeItem:
_drags->set (new CrossfadeEdgeDrag (this, reinterpret_cast<AudioRegionView*>(item->get_data("regionview")), item, true), event, 0);
break;
case EndCrossFadeItem:
_drags->set (new CrossfadeEdgeDrag (this, reinterpret_cast<AudioRegionView*>(item->get_data("regionview")), item, false), event, 0);
break;
case FeatureLineItem:
{
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::TertiaryModifier)) {
@ -1471,6 +1480,14 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
popup_fade_context_menu (1, event->button.time, item, item_type);
break;
case StartCrossFadeItem:
popup_xfade_in_context_menu (1, event->button.time, item, item_type);
break;
case EndCrossFadeItem:
popup_xfade_out_context_menu (1, event->button.time, item, item_type);
break;
case StreamItem:
popup_track_context_menu (1, event->button.time, item_type, false);
break;

View file

@ -4708,8 +4708,7 @@ Editor::quantize_region ()
qd->hide ();
if (r == Gtk::RESPONSE_OK) {
Quantize quant (*_session, Plain,
qd->snap_start(), qd->snap_end(),
Quantize quant (*_session, qd->snap_start(), qd->snap_end(),
qd->start_grid_size(), qd->end_grid_size(),
qd->strength(), qd->swing(), qd->threshold());
@ -5250,6 +5249,10 @@ Editor::set_fade_out_active (bool yn)
void
Editor::toggle_region_fades (int dir)
{
if (_ignore_region_action) {
return;
}
boost::shared_ptr<AudioRegion> ar;
bool yn = false;

View file

@ -380,7 +380,7 @@ EditorRouteGroups::button_press_event (GdkEventButton* ev)
}
void
EditorRouteGroups::row_change (const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter)
EditorRouteGroups::row_change (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter)
{
RouteGroup* group;
@ -487,7 +487,7 @@ EditorRouteGroups::groups_changed ()
}
void
EditorRouteGroups::property_changed (RouteGroup* group, const PropertyChange& change)
EditorRouteGroups::property_changed (RouteGroup* group, const PropertyChange&)
{
_in_row_change = true;

View file

@ -1055,6 +1055,10 @@ Editor::sensitize_the_right_region_actions ()
bool have_envelope_inactive = false;
bool have_non_unity_scale_amplitude = false;
bool have_compound_regions = false;
bool have_inactive_fade_in = false;
bool have_inactive_fade_out = false;
bool have_active_fade_in = false;
bool have_active_fade_out = false;
for (list<RegionView*>::const_iterator i = rs.begin(); i != rs.end(); ++i) {
@ -1114,6 +1118,18 @@ Editor::sensitize_the_right_region_actions ()
if (ar->scale_amplitude() != 1) {
have_non_unity_scale_amplitude = true;
}
if (ar->fade_in_active ()) {
have_active_fade_in = true;
} else {
have_inactive_fade_in = true;
}
if (ar->fade_out_active ()) {
have_active_fade_out = true;
} else {
have_inactive_fade_out = true;
}
}
}
@ -1168,7 +1184,7 @@ Editor::sensitize_the_right_region_actions ()
if (have_envelope_active && !have_envelope_inactive) {
Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-gain-envelope-active"))->set_active ();
} else if (have_envelope_active && have_envelope_inactive) {
// _region_actions->get_action("toggle-region-gain-envelope-active")->set_inconsistent ();
// Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-gain-envelope-active"))->set_inconsistent ();
}
} else {
@ -1184,25 +1200,29 @@ Editor::sensitize_the_right_region_actions ()
_region_actions->get_action("reset-region-scale-amplitude")->set_sensitive (false);
}
Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-lock"))->set_active (have_locked && !have_unlocked);
Glib::RefPtr<ToggleAction> a = Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-lock"));
a->set_active (have_locked && !have_unlocked);
if (have_locked && have_unlocked) {
// _region_actions->get_action("toggle-region-lock")->set_inconsistent ();
// a->set_inconsistent ();
}
Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-lock-style"))->set_active (have_position_lock_style_music && !have_position_lock_style_audio);
a = Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-lock-style"));
a->set_active (have_position_lock_style_music && !have_position_lock_style_audio);
if (have_position_lock_style_music && have_position_lock_style_audio) {
// _region_actions->get_action("toggle-region-lock-style")->set_inconsistent ();
// a->set_inconsistent ();
}
Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-mute"))->set_active (have_muted && !have_unmuted);
a = Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-mute"));
a->set_active (have_muted && !have_unmuted);
if (have_muted && have_unmuted) {
// _region_actions->get_action("toggle-region-mute")->set_inconsistent ();
// a->set_inconsistent ();
}
Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-opaque-region"))->set_active (have_opaque && !have_non_opaque);
a = Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-opaque-region"));
a->set_active (have_opaque && !have_non_opaque);
if (have_opaque && have_non_opaque) {
// _region_actions->get_action("toggle-opaque-region")->set_inconsistent ();
// a->set_inconsistent ();
}
if (!have_not_at_natural_position) {
@ -1216,6 +1236,29 @@ Editor::sensitize_the_right_region_actions ()
_region_actions->get_action("insert-region-from-region-list")->set_sensitive (true);
}
a = Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-fade-in"));
a->set_active (have_active_fade_in && !have_inactive_fade_in);
if (have_active_fade_in && have_inactive_fade_in) {
// a->set_inconsistent ();
}
a = Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-fade-out"));
a->set_active (have_active_fade_out && !have_inactive_fade_out);
if (have_active_fade_out && have_inactive_fade_out) {
// a->set_inconsistent ();
}
bool const have_active_fade = have_active_fade_in || have_active_fade_out;
bool const have_inactive_fade = have_inactive_fade_in || have_inactive_fade_out;
a = Glib::RefPtr<ToggleAction>::cast_dynamic (_region_actions->get_action("toggle-region-fades"));
a->set_active (have_active_fade && !have_inactive_fade);
if (have_active_fade && have_inactive_fade) {
// a->set_inconsistent ();
}
_ignore_region_action = false;
_all_region_actions_sensitized = false;

View file

@ -121,7 +121,7 @@ EditorSnapshots::popup_context_menu (int button, int32_t time, std::string snaps
add_item_with_sensitivity (items, MenuElem (_("Remove"), sigc::bind (sigc::mem_fun (*this, &EditorSnapshots::remove), snapshot_name)), modification_allowed);
add_item_with_sensitivity (items, MenuElem (_("Rename"), sigc::bind (sigc::mem_fun (*this, &EditorSnapshots::rename), snapshot_name)), modification_allowed);
add_item_with_sensitivity (items, MenuElem (_("Rename..."), sigc::bind (sigc::mem_fun (*this, &EditorSnapshots::rename), snapshot_name)), modification_allowed);
_menu.popup (button, time);
}
@ -134,6 +134,7 @@ EditorSnapshots::rename (std::string old_name)
string new_name;
prompter.set_name ("Prompter");
prompter.set_title (_("Rename Snapshot"));
prompter.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
prompter.set_prompt (_("New name of snapshot"));
prompter.set_initial_text (old_name);

View file

@ -96,7 +96,7 @@ ExportFormatSelector::update_format_list ()
tree_it->set_value (format_cols.label, (*it)->description());
}
if (format_combo.get_active_row_number() == -1) {
if (format_combo.get_active_row_number() == -1 && format_combo.get_model()->children().size() > 0) {
format_combo.set_active (0);
}

View file

@ -180,7 +180,7 @@ GroupTabs::on_motion_notify_event (GdkEventMotion* ev)
bool
GroupTabs::on_button_release_event (GdkEventButton* ev)
GroupTabs::on_button_release_event (GdkEventButton*)
{
if (_dragging == 0) {
return false;

View file

@ -527,7 +527,7 @@ piano_keyboard_expose(GtkWidget *widget, GdkEventExpose *event)
}
static void
piano_keyboard_size_request(GtkWidget* widget, GtkRequisition *requisition)
piano_keyboard_size_request(GtkWidget* w, GtkRequisition *requisition)
{
requisition->width = PIANO_KEYBOARD_DEFAULT_WIDTH;
requisition->height = PIANO_KEYBOARD_DEFAULT_HEIGHT;

View file

Before

Width:  |  Height:  |  Size: 922 B

After

Width:  |  Height:  |  Size: 922 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 913 B

After

Width:  |  Height:  |  Size: 913 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 962 B

After

Width:  |  Height:  |  Size: 962 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 893 B

After

Width:  |  Height:  |  Size: 893 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 959 B

After

Width:  |  Height:  |  Size: 959 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 735 B

After

Width:  |  Height:  |  Size: 735 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 904 B

After

Width:  |  Height:  |  Size: 904 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 988 B

After

Width:  |  Height:  |  Size: 988 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1,012 B

After

Width:  |  Height:  |  Size: 1,012 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

View file

@ -687,7 +687,8 @@ LocationEditRow::position_lock_style_changed (ARDOUR::Location*)
}
void
LocationEditRow::focus_name() {
LocationEditRow::focus_name()
{
name_entry.grab_focus ();
}
@ -910,6 +911,11 @@ LocationUI::location_added (Location* location)
range_rows.show_all ();
location_rows.show_all ();
if (location == newest_location) {
newest_location = 0;
erow->focus_name();
}
}
}
@ -959,10 +965,6 @@ LocationUI::map_locations (Locations::LocationList& locations)
Box_Helpers::BoxList & loc_children = location_rows.children();
loc_children.push_back(Box_Helpers::Element(*erow, PACK_SHRINK, 1, PACK_START));
if (location == newest_location) {
newest_location = 0;
erow->focus_name();
}
} else if (location->is_auto_punch()) {
punch_edit_row.set_session (_session);
punch_edit_row.set_location (location);

View file

@ -162,6 +162,10 @@ class LocationUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
private:
ARDOUR::LocationStack* locations;
/** set to the location that has just been created with the LocationUI `add' button
(if Config->get_name_new_markers() is true); if it is non-0, the name entry of
the location is given the focus by location_added().
*/
ARDOUR::Location *newest_location;
void session_going_away ();

View file

@ -21,6 +21,7 @@
#include <signal.h>
#include <cerrno>
#include <fstream>
#include <vector>
#include <sigc++/bind.h>
#include <gtkmm/settings.h>
@ -197,6 +198,7 @@ fixup_bundle_environment (int, char* [])
export_search_path (dir_path, "ARDOUR_PANNER_PATH", "/../Panners");
export_search_path (dir_path, "ARDOUR_SURFACES_PATH", "/../Surfaces");
export_search_path (dir_path, "ARDOUR_MIDIMAPS_PATH", "/../MidiMaps");
export_search_path (dir_path, "ARDOUR_MCP_PATH", "../MCP");
export_search_path (dir_path, "ARDOUR_EXPORT_FORMATS_PATH", "/../ExportFormats");
path = dir_path;
@ -289,6 +291,10 @@ fixup_bundle_environment (int, char* [])
void
fixup_bundle_environment (int /*argc*/, char* argv[])
{
/* THIS IS FOR LINUX - its just about the only place where its
* acceptable to build paths directly using '/'.
*/
if (!getenv ("ARDOUR_BUNDLED")) {
return;
}
@ -340,6 +346,7 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
export_search_path (dir_path, "ARDOUR_PANNER_PATH", "/lib/panners");
export_search_path (dir_path, "ARDOUR_SURFACES_PATH", "/lib/surfaces");
export_search_path (dir_path, "ARDOUR_MIDIMAPS_PATH", "/share/midi_maps");
export_search_path (dir_path, "ARDOUR_MCP_PATH", "/share/mcp");
export_search_path (dir_path, "ARDOUR_EXPORT_FORMATS_PATH", "/share/export");
path = dir_path;
@ -359,6 +366,22 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
setenv ("GTK_LOCALEDIR", localedir, 1);
}
/* Tell fontconfig where to find fonts.conf. Use the system version
if it exists, otherwise use the stuff we included in t
*/
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);
} else {
/* use the one included in the bundle */
path = Glib::build_filename (dir_path, "etc/fonts/fonts.conf");
setenv ("FONTCONFIG_FILE", path.c_str(), 1);
path = Glib::build_filename (dir_path, "etc/fonts");
setenv ("FONTCONFIG_PATH", "/etc/fonts", 1);
}
/* write a pango.rc file and tell pango to use it. we'd love
to put this into the Ardour.app bundle and leave it there,
but the user may not have write permission. so ...
@ -370,7 +393,8 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
if (g_mkdir_with_parents (userconfigdir.c_str(), 0755) < 0) {
error << string_compose (_("cannot create user ardour folder %1 (%2)"), userconfigdir, strerror (errno))
<< endmsg;
} else {
return;
}
Glib::ustring mpath;
@ -396,7 +420,6 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
mpath = Glib::build_filename (userconfigdir, "gdk-pixbuf.loaders");
setenv ("GDK_PIXBUF_MODULE_FILE", mpath.c_str(), 1);
}
}
#endif

View file

@ -89,7 +89,6 @@ PBD::Signal1<void, MidiRegionView *> MidiRegionView::SelectionCleared;
MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv,
boost::shared_ptr<MidiRegion> r, double spu, Gdk::Color const & basic_color)
: RegionView (parent, tv, r, spu, basic_color)
, _force_channel(-1)
, _last_channel_selection(0xFFFF)
, _current_range_min(0)
, _current_range_max(0)
@ -126,7 +125,6 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &
boost::shared_ptr<MidiRegion> r, double spu, Gdk::Color& basic_color,
TimeAxisViewItem::Visibility visibility)
: RegionView (parent, tv, r, spu, basic_color, false, visibility)
, _force_channel(-1)
, _last_channel_selection(0xFFFF)
, _current_range_min(0)
, _current_range_max(0)
@ -171,7 +169,6 @@ MidiRegionView::parameter_changed (std::string const & p)
MidiRegionView::MidiRegionView (const MidiRegionView& other)
: sigc::trackable(other)
, RegionView (other)
, _force_channel(-1)
, _last_channel_selection(0xFFFF)
, _current_range_min(0)
, _current_range_max(0)
@ -206,7 +203,6 @@ MidiRegionView::MidiRegionView (const MidiRegionView& other)
MidiRegionView::MidiRegionView (const MidiRegionView& other, boost::shared_ptr<MidiRegion> region)
: RegionView (other, boost::shared_ptr<Region> (region))
, _force_channel(-1)
, _last_channel_selection(0xFFFF)
, _current_range_min(0)
, _current_range_max(0)
@ -853,7 +849,7 @@ MidiRegionView::create_note_at (framepos_t t, double y, double length, bool snap
view->update_note_range(new_note->note());
MidiModel::NoteDiffCommand* cmd = _model->new_note_diff_command("add note");
MidiModel::NoteDiffCommand* cmd = _model->new_note_diff_command(_("add note"));
cmd->add (new_note);
_model->apply_command(*trackview.session(), cmd);
@ -3109,15 +3105,9 @@ MidiRegionView::set_frame_color()
void
MidiRegionView::midi_channel_mode_changed(ChannelMode mode, uint16_t mask)
{
switch (mode) {
case AllChannels:
case FilterChannels:
_force_channel = -1;
break;
case ForceChannel:
_force_channel = mask;
if (mode == ForceChannel) {
mask = 0xFFFF; // Show all notes as active (below)
};
}
// Update notes for selection
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {

View file

@ -363,7 +363,6 @@ private:
void show_verbose_cursor (std::string const &, double, double) const;
void show_verbose_cursor (boost::shared_ptr<NoteType>) const;
int8_t _force_channel;
uint16_t _last_channel_selection;
uint8_t _current_range_min;
uint8_t _current_range_max;

View file

@ -199,7 +199,7 @@ PluginSelector::~PluginSelector ()
}
void
PluginSelector::row_activated(Gtk::TreeModel::Path path, Gtk::TreeViewColumn* col)
PluginSelector::row_activated(Gtk::TreeModel::Path, Gtk::TreeViewColumn*)
{
btn_add_clicked();
}
@ -319,6 +319,12 @@ PluginSelector::refiller (const PluginInfoList& plugs, const::std::string& filte
newrow[plugin_columns.creator] = creator;
if ((*i)->reconfigurable_io ()) {
newrow[plugin_columns.audio_ins] = _("variable");
newrow[plugin_columns.midi_ins] = _("variable");
newrow[plugin_columns.audio_outs] = _("variable");
newrow[plugin_columns.midi_outs] = _("variable");
} else {
snprintf (buf, sizeof(buf), "%d", (*i)->n_inputs.n_audio());
newrow[plugin_columns.audio_ins] = buf;
snprintf (buf, sizeof(buf), "%d", (*i)->n_inputs.n_midi());
@ -328,6 +334,7 @@ PluginSelector::refiller (const PluginInfoList& plugs, const::std::string& filte
newrow[plugin_columns.audio_outs] = buf;
snprintf (buf, sizeof(buf), "%d", (*i)->n_outputs.n_midi());
newrow[plugin_columns.midi_outs] = buf;
}
newrow[plugin_columns.plugin] = *i;
}

View file

@ -444,10 +444,8 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t)
if (bc[dim].channel != -1) {
add_remove_option (sub, w, bc[dim].channel);
} else {
snprintf (buf, sizeof (buf), _("Remove all"));
sub.push_back (
MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::remove_all_channels), w))
MenuElem (_("Remove all"), sigc::bind (sigc::mem_fun (*this, &PortMatrix::remove_all_channels), w))
);
if (bc[dim].bundle->nchannels().n_total() > 1) {

View file

@ -965,7 +965,7 @@ ProcessorBox::enter_notify (GdkEventCrossing*)
}
bool
ProcessorBox::leave_notify (GdkEventCrossing* ev)
ProcessorBox::leave_notify (GdkEventCrossing*)
{
return false;
}

View file

@ -314,6 +314,8 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
virtual bool canvas_selection_rect_event (GdkEvent* event, ArdourCanvas::Item*, SelectionRect*) = 0;
virtual bool canvas_selection_start_trim_event (GdkEvent* event, ArdourCanvas::Item*, SelectionRect*) = 0;
virtual bool canvas_selection_end_trim_event (GdkEvent* event, ArdourCanvas::Item*, SelectionRect*) = 0;
virtual bool canvas_start_xfade_event (GdkEvent* event, ArdourCanvas::Item*, AudioRegionView*) = 0;
virtual bool canvas_end_xfade_event (GdkEvent* event, ArdourCanvas::Item*, AudioRegionView*) = 0;
virtual bool canvas_fade_in_event (GdkEvent* event, ArdourCanvas::Item*, AudioRegionView*) = 0;
virtual bool canvas_fade_in_handle_event (GdkEvent* event, ArdourCanvas::Item*, AudioRegionView*) = 0;
virtual bool canvas_fade_out_event (GdkEvent* event, ArdourCanvas::Item*, AudioRegionView*) = 0;

View file

@ -46,20 +46,11 @@ static const gchar *_grid_strings[] = {
0
};
static const gchar *_type_strings[] = {
N_("Grid"),
N_("Legato"),
N_("Groove"),
0
};
std::vector<std::string> QuantizeDialog::grid_strings;
std::vector<std::string> QuantizeDialog::type_strings;
QuantizeDialog::QuantizeDialog (PublicEditor& e)
: ArdourDialog (_("Quantize"), false, false)
, editor (e)
, type_label (_("Quantize Type"))
, strength_adjustment (100.0, 0.0, 100.0, 1.0, 10.0)
, strength_spinner (strength_adjustment)
, strength_label (_("Strength"))
@ -74,7 +65,6 @@ QuantizeDialog::QuantizeDialog (PublicEditor& e)
{
if (grid_strings.empty()) {
grid_strings = I18N (_grid_strings);
type_strings = I18N (_type_strings);
}
set_popdown_strings (start_grid_combo, grid_strings);
@ -82,20 +72,12 @@ QuantizeDialog::QuantizeDialog (PublicEditor& e)
set_popdown_strings (end_grid_combo, grid_strings);
end_grid_combo.set_active_text (grid_strings.front());
set_popdown_strings (type_combo, type_strings);
type_combo.set_active_text (type_strings.front());
Table* table = manage (new Table (6, 2));
table->set_spacings (12);
table->set_border_width (12);
int r = 0;
type_label.set_alignment (0, 0.5);
table->attach (type_label, 0, 1, r, r + 1);
table->attach (type_combo, 1, 2, r, r + 1);
++r;
table->attach (snap_start_button, 0, 1, r, r + 1);
table->attach (start_grid_combo, 1, 2, r, r + 1);
++r;

View file

@ -45,7 +45,6 @@ class QuantizeDialog : public ArdourDialog
QuantizeDialog (PublicEditor&);
~QuantizeDialog ();
ARDOUR::QuantizeType type() const;
double start_grid_size() const;
double end_grid_size() const;
bool snap_start() const { return snap_start_button.get_active(); }
@ -57,10 +56,8 @@ class QuantizeDialog : public ArdourDialog
private:
PublicEditor& editor;
Gtk::ComboBoxText type_combo;
Gtk::ComboBoxText start_grid_combo;
Gtk::ComboBoxText end_grid_combo;
Gtk::Label type_label;
Gtk::Adjustment strength_adjustment;
Gtk::SpinButton strength_spinner;
Gtk::Label strength_label;

View file

@ -722,7 +722,18 @@ private:
if (!was_enabled) {
ControlProtocolManager::instance().instantiate (*cpi);
} else {
Gtk::Window* win = r[_model.editor];
if (win) {
win->hide ();
}
ControlProtocolManager::instance().teardown (*cpi);
if (win) {
delete win;
}
r[_model.editor] = 0;
cpi->requested = false;
}
}
@ -1573,7 +1584,7 @@ RCOptionEditor::RCOptionEditor ()
add_option (S_("Visual|Interface"),
new BoolOption (
"use-own-plugin-gui",
_("Use plugins' own interface instead of a builtin one"),
_("Use plugins' own interfaces instead of Ardour's"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_plugin_own_gui),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_plugin_own_gui)
));

View file

@ -33,7 +33,7 @@ using namespace std;
using namespace PBD;
RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new)
: ArdourDialog (_("Route Group"))
: ArdourDialog (_("Track/bus Group"))
, _group (g)
, _initial_name (g->name ())
, _active (_("Active"))
@ -44,7 +44,7 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new)
, _rec_enable (_("Record enable"))
, _select (_("Selection"))
, _edit (_("Editing"))
, _route_active (_("Route active state"))
, _route_active (_("Active state"))
, _share_color (_("Color"))
, _share_monitoring (_("Monitoring"))
{

View file

@ -2362,13 +2362,16 @@ RouteTimeAxisView::set_button_names ()
switch (Config->get_listen_position()) {
case AfterFaderListen:
solo_button->set_text (_("A"));
ARDOUR_UI::instance()->set_tip (*solo_button, _("After-fade listen (AFL)"));
break;
case PreFaderListen:
solo_button->set_text (_("P"));
ARDOUR_UI::instance()->set_tip (*solo_button, _("Pre-fade listen (PFL)"));
break;
}
} else {
solo_button->set_text (_("s"));
ARDOUR_UI::instance()->set_tip (*solo_button, _("Solo"));
}
}
mute_button->set_text (_("m"));

View file

@ -629,7 +629,7 @@ RouteUI::update_monitoring_display ()
}
bool
RouteUI::monitor_input_press(GdkEventButton* ev)
RouteUI::monitor_input_press(GdkEventButton*)
{
return true;
}
@ -641,7 +641,7 @@ RouteUI::monitor_input_release(GdkEventButton* ev)
}
bool
RouteUI::monitor_disk_press (GdkEventButton* ev)
RouteUI::monitor_disk_press (GdkEventButton*)
{
return true;
}

View file

@ -115,7 +115,7 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
ClockOption* co = new ClockOption (
"timecode-offset",
_("Timecode Offset"),
_("Timecode offset"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_timecode_offset),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_timecode_offset)
);
@ -154,6 +154,19 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
add_option (_("Fades"), cfm);
ComboOption<CrossfadeChoice>* cfc = new ComboOption<CrossfadeChoice> (
"xfade-choice",
_("Crossfade type"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfade_choice),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfade_choice)
);
cfc->add (ConstantPowerMinus3dB, _("constant power (-3dB)"));
cfc->add (ConstantPowerMinus6dB, _("constant power (-6dB)"));
cfc->add (RegionFades, _("use existing region fade shape"));
add_option (_("Fades"), cfc);
add_option (_("Fades"), new SpinOption<float> (
_("short-xfade-seconds"),
_("Short crossfade length"),
@ -179,20 +192,6 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
sigc::mem_fun (*_session_config, &SessionConfiguration::set_auto_xfade)
));
add_option (_("Fades"), new BoolOption (
"xfades-active",
_("Crossfades active"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfades_active),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfades_active)
));
add_option (_("Fades"), new BoolOption (
"xfades-visible",
_("Crossfades visible"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfades_visible),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfades_visible)
));
add_option (_("Fades"), new BoolOption (
"use-region-fades",
_("Region fades active"),

View file

@ -369,7 +369,7 @@ std::string Mootcher::getAudioFile(std::string originalFileName, std::string ID,
}
//---------
int Mootcher::progress_callback(void *caller, double dltotal, double dlnow, double ultotal, double ulnow)
int Mootcher::progress_callback(void *caller, double dltotal, double dlnow, double /*ultotal*/, double /*ulnow*/)
{
SoundFileBrowser *sfb = (SoundFileBrowser *) caller;

View file

@ -522,7 +522,7 @@ ShuttleControl::on_expose_event (GdkEventExpose*)
if (Config->get_shuttle_units() == Percentage) {
if (speed == 1.0) {
snprintf (buf, sizeof (buf), _("Playing"));
snprintf (buf, sizeof (buf), "%s", _("Playing"));
} else {
if (speed < 0.0) {
snprintf (buf, sizeof (buf), "<<< %d%%", (int) round (-speed * 100));
@ -544,7 +544,7 @@ ShuttleControl::on_expose_event (GdkEventExpose*)
}
} else {
snprintf (buf, sizeof (buf), _("Stopped"));
snprintf (buf, sizeof (buf), "%s", _("Stopped"));
}
last_speed_displayed = speed;
@ -559,10 +559,10 @@ ShuttleControl::on_expose_event (GdkEventExpose*)
switch (Config->get_shuttle_behaviour()) {
case Sprung:
snprintf (buf, sizeof (buf), _("Sprung"));
snprintf (buf, sizeof (buf), "%s", _("Sprung"));
break;
case Wheel:
snprintf (buf, sizeof (buf), _("Wheel"));
snprintf (buf, sizeof (buf), "%s", _("Wheel"));
break;
}

View file

@ -511,7 +511,7 @@ greater control in monitoring without affecting the mix."));
use_monitor_section_button.signal_toggled().connect (sigc::mem_fun (*this, &ArdourStartup::config_changed));
no_monitor_section_button.signal_toggled().connect (sigc::mem_fun (*this, &ArdourStartup::config_changed));
monitor_section_label.set_markup(_("<i>You can change this preference at any time, via the Preferences dialog). You can also add or remove the monitor section to/from any session.</i>\n\n\
monitor_section_label.set_markup(_("<i>You can change this preference at any time via the Preferences dialog.\nYou can also add or remove the monitor section to/from any session.</i>\n\n\
<i>If you do not understand what this is about, just accept the default.</i>"));
monitor_section_label.set_alignment (0.0, 0.0);

View file

@ -111,7 +111,7 @@ StereoPanner::set_drag_data ()
}
bool
StereoPanner::on_expose_event (GdkEventExpose* ev)
StereoPanner::on_expose_event (GdkEventExpose*)
{
Glib::RefPtr<Gdk::Window> win (get_window());
Glib::RefPtr<Gdk::GC> gc (get_style()->get_base_gc (get_state()));

View file

@ -36,7 +36,7 @@ using namespace Gtkmm2ext;
using namespace ARDOUR;
using namespace PBD;
TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string & action)
TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string&)
: ArdourDialog (_("New Tempo"))
, bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0)
, bpm_spinner (bpm_adjustment)
@ -51,7 +51,7 @@ TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string & action
init (when, tempo.beats_per_minute(), tempo.note_type(), true);
}
TempoDialog::TempoDialog (TempoSection& section, const string & action)
TempoDialog::TempoDialog (TempoSection& section, const string&)
: ArdourDialog ("Edit Tempo")
, bpm_adjustment (60.0, 1.0, 999.9, 0.1, 1.0)
, bpm_spinner (bpm_adjustment)
@ -251,7 +251,7 @@ TempoDialog::pulse_change ()
}
MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string & action)
MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string&)
: ArdourDialog ("New Meter")
{
Timecode::BBT_Time when;
@ -262,7 +262,7 @@ MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string & action
init (when, meter.divisions_per_bar(), meter.note_divisor(), true);
}
MeterDialog::MeterDialog (MeterSection& section, const string & action)
MeterDialog::MeterDialog (MeterSection& section, const string&)
: ArdourDialog ("Edit Meter")
{
init (section.start(), section.divisions_per_bar(), section.note_divisor(), section.movable());

View file

@ -160,9 +160,6 @@ class TimeAxisView : public virtual AxisView
virtual void show_timestretch (framepos_t start, framepos_t end);
virtual void hide_timestretch ();
virtual void hide_dependent_views (TimeAxisViewItem&) {}
virtual void reveal_dependent_views (TimeAxisViewItem&) {}
/* editing operations */
virtual void cut_copy_clear (Selection&, Editing::CutCopyOp) {}

View file

@ -52,7 +52,8 @@ using namespace Gtkmm2ext;
Pango::FontDescription TimeAxisViewItem::NAME_FONT;
const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6;
const double TimeAxisViewItem::GRAB_HANDLE_TOP = 6;
const double TimeAxisViewItem::GRAB_HANDLE_WIDTH = 5;
int TimeAxisViewItem::NAME_HEIGHT;
double TimeAxisViewItem::NAME_Y_OFFSET;
@ -102,6 +103,7 @@ TimeAxisViewItem::TimeAxisViewItem(
, _height (1.0)
, _recregion (recording)
, _automation (automation)
, _dragging (false)
{
group = new ArdourCanvas::Group (parent);
@ -115,6 +117,7 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
, trackview (other.trackview)
, _recregion (other._recregion)
, _automation (other._automation)
, _dragging (other._dragging)
{
Gdk::Color c;
@ -131,10 +134,8 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
_selected = other._selected;
init (
other.item_name, other.samples_per_unit, c, other.frame_position,
other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name
);
init (other.item_name, other.samples_per_unit, c, other.frame_position,
other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name);
}
void
@ -215,9 +216,12 @@ TimeAxisViewItem::init (
/* create our grab handles used for trimming/duration etc */
if (!_recregion && !_automation) {
frame_handle_start = new ArdourCanvas::SimpleRect (*group, 0.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH, 5.0, trackview.current_height());
double top = TimeAxisViewItem::GRAB_HANDLE_TOP;
double width = TimeAxisViewItem::GRAB_HANDLE_WIDTH;
frame_handle_start = new ArdourCanvas::SimpleRect (*group, 0.0, top, width, trackview.current_height());
frame_handle_start->property_outline_what() = 0x0;
frame_handle_end = new ArdourCanvas::SimpleRect (*group, 0.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH, 5.0, trackview.current_height());
frame_handle_end = new ArdourCanvas::SimpleRect (*group, 0.0, top, width, trackview.current_height());
frame_handle_end->property_outline_what() = 0x0;
} else {
frame_handle_start = frame_handle_end = 0;
@ -807,14 +811,6 @@ TimeAxisViewItem::set_samples_per_unit (double spu)
void
TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
{
if (pixel_width < GRAB_HANDLE_LENGTH * 2) {
if (frame_handle_start) {
frame_handle_start->hide();
frame_handle_end->hide();
}
}
if (pixel_width < 2.0) {
@ -862,14 +858,20 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
}
if (frame_handle_start) {
if (pixel_width < (2*TimeAxisViewItem::GRAB_HANDLE_LENGTH)) {
if (pixel_width < (3 * TimeAxisViewItem::GRAB_HANDLE_WIDTH)) {
/*
* there's less than GRAB_HANDLE_WIDTH of the region between
* the right-hand end of frame_handle_start and the left-hand
* end of frame_handle_end, so disable the handles
*/
frame_handle_start->hide();
frame_handle_end->hide();
}
} else {
frame_handle_start->show();
frame_handle_end->property_x1() = pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
frame_handle_end->show();
frame_handle_end->property_x1() = pixel_width - (TimeAxisViewItem::GRAB_HANDLE_WIDTH);
frame_handle_end->property_x2() = pixel_width;
frame_handle_end->show();
}
}
wide_enough_for_name = true;

View file

@ -78,6 +78,10 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
double get_samples_per_unit();
virtual void drag_start() { _dragging = true; }
virtual void drag_end() { _dragging = false; }
bool dragging() const { return _dragging; }
virtual void raise () { return; }
virtual void raise_to_top () { return; }
virtual void lower () { return; }
@ -93,7 +97,8 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
static Pango::FontDescription NAME_FONT;
static void set_constant_heights ();
static const double NAME_X_OFFSET;
static const double GRAB_HANDLE_LENGTH;
static const double GRAB_HANDLE_TOP;
static const double GRAB_HANDLE_WIDTH;
/* these are not constant, but vary with the pixel size
of the font used to display the item name.
@ -239,6 +244,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
Visibility visibility;
bool _recregion;
bool _automation; ///< true if this is an automation region view
bool _dragging;
private:

View file

@ -104,7 +104,6 @@ class AUPlugin : public ARDOUR::Plugin
bool has_editor () const;
bool reconfigurable_io() const { return true; }
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
ChanCount output_streams() const;
ChanCount input_streams() const;
@ -241,6 +240,8 @@ class AUPluginInfo : public PluginInfo {
AUPluginCachedInfo cache;
bool reconfigurable_io() const { return true; }
static PluginInfoList* discover ();
static void get_names (CAComponentDescription&, std::string& name, std::string& maker);
static std::string stringify_descriptor (const CAComponentDescription&);

View file

@ -89,8 +89,15 @@ class AudioRegion : public Region
bool fade_in_active () const { return _fade_in_active; }
bool fade_out_active () const { return _fade_out_active; }
bool fade_in_is_xfade() const { return _fade_in_is_xfade; }
void set_fade_in_is_xfade (bool yn);
bool fade_out_is_xfade() const { return _fade_out_is_xfade; }
void set_fade_out_is_xfade (bool yn);
boost::shared_ptr<AutomationList> fade_in() { return _fade_in; }
boost::shared_ptr<AutomationList> inverse_fade_in() { return _inverse_fade_in; }
boost::shared_ptr<AutomationList> fade_out() { return _fade_out; }
boost::shared_ptr<AutomationList> inverse_fade_out() { return _inverse_fade_out; }
boost::shared_ptr<AutomationList> envelope() { return _envelope; }
Evoral::Range<framepos_t> body_range () const;
@ -101,13 +108,6 @@ class AudioRegion : public Region
/* Readable interface */
enum ReadOps {
ReadOpsNone = 0x0,
ReadOpsOwnAutomation = 0x1,
ReadOpsOwnScaling = 0x2,
ReadOpsFades = 0x4
};
virtual framecnt_t read (Sample*, framepos_t pos, framecnt_t cnt, int channel) const;
virtual framecnt_t readable_length() const { return length(); }
@ -143,6 +143,8 @@ class AudioRegion : public Region
void set_default_fade_in ();
void set_default_fade_out ();
framecnt_t verify_xfade_bounds (framecnt_t, bool start);
void set_envelope_active (bool yn);
void set_default_envelope ();
@ -178,7 +180,6 @@ class AudioRegion : public Region
private:
friend class RegionFactory;
friend class Crossfade;
AudioRegion (boost::shared_ptr<AudioSource>);
AudioRegion (const SourceList &);
@ -208,11 +209,7 @@ class AudioRegion : public Region
void recompute_gain_at_end ();
void recompute_gain_at_start ();
framecnt_t _read_at (const SourceList&, framecnt_t limit,
Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
framepos_t position, framecnt_t cnt,
uint32_t chan_n = 0,
ReadOps readops = ReadOps (~0)) const;
framecnt_t read_from_sources (SourceList const &, framecnt_t, Sample *, framepos_t, framecnt_t, uint32_t) const;
void recompute_at_start ();
void recompute_at_end ();
@ -228,10 +225,19 @@ class AudioRegion : public Region
Automatable _automatable;
boost::shared_ptr<AutomationList> _fade_in;
boost::shared_ptr<AutomationList> _inverse_fade_in;
boost::shared_ptr<AutomationList> _fade_out;
boost::shared_ptr<AutomationList> _inverse_fade_out;
boost::shared_ptr<AutomationList> _envelope;
uint32_t _fade_in_suspended;
uint32_t _fade_out_suspended;
/* This is not a Property because its not subject to user control,
or undo/redo. XXX this may prove to be a mistake.
*/
bool _fade_in_is_xfade;
bool _fade_out_is_xfade;
boost::shared_ptr<ARDOUR::Region> get_single_other_xfade_region (bool start) const;
protected:
/* default constructor for derived (compound) types */

View file

@ -89,7 +89,7 @@ public:
/* Panning */
static int disable_panners (void);
static int reset_panners (void);
static void reset_panners ();
boost::shared_ptr<PannerShell> panner_shell() const { return _panshell; }
boost::shared_ptr<Panner> panner() const;
@ -115,9 +115,9 @@ public:
boost::shared_ptr<MuteMaster> _mute_master;
static bool panners_legal;
static PBD::Signal0<int> PannersLegal;
static PBD::Signal0<void> PannersLegal;
int panners_became_legal ();
void panners_became_legal ();
PBD::ScopedConnection panner_legal_c;
void output_changed (IOChange, void*);

View file

@ -152,7 +152,7 @@ class IO : public SessionObject, public Latent
typedef bool result_type;
template <typename Iter>
bool operator() (Iter first, Iter last) const {
result_type operator() (Iter first, Iter last) const {
bool r = false;
while (first != last) {
if (*first) {

View file

@ -39,6 +39,7 @@
#include "pbd/stateful.h"
#include "pbd/statefuldestructible.h"
#include "pbd/sequence_property.h"
#include "pbd/stacktrace.h"
#include "evoral/types.hpp"
@ -234,7 +235,10 @@ public:
protected:
struct RegionLock {
RegionLock (Playlist *pl, bool do_block_notify = true) : playlist (pl), block_notify (do_block_notify) {
playlist->region_lock.lock();
if (!playlist->region_lock.trylock()) {
std::cerr << "Lock for playlist " << pl->name() << " already held\n";
PBD::stacktrace (std::cerr, 10);
}
if (block_notify) {
playlist->delay_notifications();
}
@ -249,8 +253,6 @@ public:
bool block_notify;
};
friend class RegionLock;
RegionListProperty regions; /* the current list of regions in the playlist */
std::set<boost::shared_ptr<Region> > all_regions; /* all regions ever added to this playlist */
PBD::ScopedConnectionList region_state_changed_connections;
@ -258,11 +260,6 @@ public:
int _sort_id;
mutable gint block_notifications;
mutable gint ignore_state_changes;
#ifdef HAVE_GLIB_THREADS_RECMUTEX
mutable Glib::Threads::RecMutex region_lock;
#else
mutable Glib::RecMutex region_lock;
#endif
std::set<boost::shared_ptr<Region> > pending_adds;
std::set<boost::shared_ptr<Region> > pending_removes;
RegionList pending_bounds;
@ -309,6 +306,8 @@ public:
void _set_sort_id ();
boost::shared_ptr<RegionList> regions_touched_locked (framepos_t start, framepos_t end);
void notify_region_removed (boost::shared_ptr<Region>);
void notify_region_added (boost::shared_ptr<Region>);
void notify_layering_changed ();
@ -374,8 +373,11 @@ public:
virtual void pre_uncombine (std::vector<boost::shared_ptr<Region> >&, boost::shared_ptr<Region>) {}
private:
friend class RegionLock;
mutable Glib::Mutex region_lock;
void setup_layering_indices (RegionList const &) const;
private:
void setup_layering_indices (RegionList const &);
void coalesce_and_check_crossfades (std::list<Evoral::Range<framepos_t> >);
boost::shared_ptr<RegionList> find_regions_at (framepos_t);
};

View file

@ -67,6 +67,18 @@ class PluginInfo {
virtual PluginPtr load (Session& session) = 0;
virtual bool is_instrument() const;
/* NOTE: this block of virtual methods looks like the interface
to a Processor, but Plugin does not inherit from Processor.
It is therefore not required that these precisely match
the interface, but it is likely that they will evolve together.
*/
/* this returns true if the plugin can change its inputs or outputs on demand.
LADSPA, LV2 and VST plugins cannot do this. AudioUnits can.
*/
virtual bool reconfigurable_io() const { return false; }
protected:
friend class PluginManager;
uint32_t index;
@ -119,7 +131,7 @@ class Plugin : public PBD::StatefulDestructible, public Latent
virtual float default_value (uint32_t port) = 0;
virtual float get_parameter(uint32_t which) const = 0;
virtual std::string get_docs () const { return ""; }
virtual std::string get_parameter_docs(uint32_t which) const { return ""; }
virtual std::string get_parameter_docs (uint32_t /*which*/) const { return ""; }
virtual int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const = 0;
virtual uint32_t nth_parameter (uint32_t which, bool& ok) const = 0;
@ -203,19 +215,6 @@ class Plugin : public PBD::StatefulDestructible, public Latent
/** Emitted when any parameter changes */
PBD::Signal2<void, uint32_t, float> ParameterChanged;
/* NOTE: this block of virtual methods looks like the interface
to a Processor, but Plugin does not inherit from Processor.
It is therefore not required that these precisely match
the interface, but it is likely that they will evolve together.
*/
/* this returns true if the plugin can change its inputs or outputs on demand.
LADSPA, LV2 and VST plugins cannot do this. AudioUnits can.
*/
virtual bool reconfigurable_io() const { return false; }
/* this is only called if reconfigurable_io() returns true */
virtual bool configure_io (ChanCount /*in*/, ChanCount /*out*/) { return true; }
/* specific types of plugins can overload this. As of September 2008, only

View file

@ -30,8 +30,7 @@ class Session;
class Quantize : public MidiOperator {
public:
Quantize (ARDOUR::Session&, QuantizeType type,
bool snap_start, bool snap_end,
Quantize (ARDOUR::Session&, bool snap_start, bool snap_end,
double start_grid, double end_grid,
float strength, float swing, float threshold);
~Quantize ();

View file

@ -141,6 +141,15 @@ class Region
framepos_t first_frame () const { return _position; }
framepos_t last_frame () const { return _position + _length - 1; }
/** Return the earliest possible value of _position given the
* value of _start within the region's sources
*/
framepos_t earliest_possible_position () const;
/** Return the last possible value of _last_frame given the
* value of _startin the regions's sources
*/
framepos_t latest_possible_frame () const;
Evoral::Range<framepos_t> last_range () const {
return Evoral::Range<framepos_t> (_last_position, _last_position + _last_length - 1);
}

View file

@ -26,10 +26,9 @@
*****************************************************/
CONFIG_VARIABLE (CrossfadeModel, xfade_model, "xfade-model", FullCrossfade)
CONFIG_VARIABLE (CrossfadeChoice, xfade_choice, "xfade-choice", ConstantPowerMinus3dB)
CONFIG_VARIABLE (bool, auto_xfade, "auto-xfade", true)
CONFIG_VARIABLE (float, short_xfade_seconds, "short-xfade-seconds", 0.015)
CONFIG_VARIABLE (bool, xfades_active, "xfades-active", true)
CONFIG_VARIABLE (bool, xfades_visible, "xfades-visible", true)
CONFIG_VARIABLE (uint32_t, destructive_xfade_msecs, "destructive-xfade-msecs", 2)
CONFIG_VARIABLE (bool, use_region_fades, "use-region-fades", true)
CONFIG_VARIABLE (bool, show_region_fades, "show-region-fades", true)

View file

@ -406,6 +406,12 @@ namespace ARDOUR {
ShortCrossfade
};
enum CrossfadeChoice {
RegionFades,
ConstantPowerMinus3dB,
ConstantPowerMinus6dB,
};
enum ListenPosition {
AfterFaderListen,
PreFaderListen
@ -504,12 +510,6 @@ namespace ARDOUR {
Rectified
};
enum QuantizeType {
Plain,
Legato,
Groove
};
struct CleanupReport {
std::vector<std::string> paths;
size_t space;
@ -557,8 +557,8 @@ namespace ARDOUR {
FadeLinear,
FadeFast,
FadeSlow,
FadeLogA,
FadeLogB
FadeConstantPower,
FadeSymmetric,
};
} // namespace ARDOUR
@ -579,6 +579,7 @@ std::istream& operator>>(std::istream& o, ARDOUR::RemoteModel& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ListenPosition& sf);
std::istream& operator>>(std::istream& o, ARDOUR::InsertMergePolicy& sf);
std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeModel& sf);
std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeChoice& sf);
std::istream& operator>>(std::istream& o, ARDOUR::SyncSource& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ShuttleBehaviour& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ShuttleUnits& sf);
@ -599,6 +600,7 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::RemoteModel& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::ListenPosition& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::InsertMergePolicy& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::CrossfadeModel& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::CrossfadeChoice& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::SyncSource& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::ShuttleBehaviour& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::ShuttleUnits& sf);

View file

@ -186,16 +186,12 @@ AudioPlaylist::read (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, fr
its OK to block (for short intervals).
*/
#ifdef HAVE_GLIB_THREADS_RECMUTEX
Glib::Threads::RecMutex::Lock lm (region_lock);
#else
Glib::RecMutex::Lock rm (region_lock);
#endif
Playlist::RegionLock rl (this, false);
/* Find all the regions that are involved in the bit we are reading,
and sort them by descending layer and ascending position.
*/
boost::shared_ptr<RegionList> all = regions_touched (start, start + cnt - 1);
boost::shared_ptr<RegionList> all = regions_touched_locked (start, start + cnt - 1);
all->sort (ReadSorter ());
/* This will be a list of the bits of our read range that we have
@ -290,7 +286,6 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range)
continue;
}
boost::shared_ptr<AudioRegion> top;
boost::shared_ptr<AudioRegion> bottom;
@ -317,6 +312,7 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range)
*/
if (done_start.find (top) == done_start.end() && done_end.find (bottom) == done_end.end ()) {
/* Top's fade-in will cause an implicit fade-out of bottom */
framecnt_t len = 0;
@ -329,10 +325,26 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range)
break;
}
top->set_fade_in_length (len);
top->set_fade_in_active (true);
top->set_fade_in_is_xfade (true);
/* XXX may 2012: -3dB and -6dB curves
* are the same right now
*/
switch (_session.config.get_xfade_choice ()) {
case ConstantPowerMinus3dB:
top->set_fade_in (FadeConstantPower, len);
break;
case ConstantPowerMinus6dB:
top->set_fade_in (FadeConstantPower, len);
break;
case RegionFades:
top->set_fade_in_length (len);
break;
}
done_start.insert (top);
done_end.insert (bottom);
}
} else if (c == Evoral::OverlapEnd) {
@ -349,17 +361,29 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range)
framecnt_t len = 0;
switch (_session.config.get_xfade_model()) {
case FullCrossfade:
len = bottom->last_frame () - top->first_frame ();
len = top->last_frame () - bottom->first_frame ();
break;
case ShortCrossfade:
len = _session.config.get_short_xfade_seconds() * _session.frame_rate();
break;
}
top->set_fade_out_length (len);
top->set_fade_out_active (true);
top->set_fade_out_is_xfade (true);
switch (_session.config.get_xfade_choice ()) {
case ConstantPowerMinus3dB:
top->set_fade_out (FadeConstantPower, len);
break;
case ConstantPowerMinus6dB:
top->set_fade_out (FadeConstantPower, len);
break;
case RegionFades:
top->set_fade_out_length (len);
break;
}
done_end.insert (top);
done_start.insert (bottom);
}
}
}

View file

@ -65,6 +65,90 @@ namespace ARDOUR {
}
}
static const double VERY_SMALL_SIGNAL = 0.0000001; //-140dB
/* Curve manipulations */
static void
reverse_curve (boost::shared_ptr<Evoral::ControlList> dst, boost::shared_ptr<const Evoral::ControlList> src)
{
size_t len = src->back()->when;
for (Evoral::ControlList::const_iterator it = src->begin(); it!=src->end(); it++) {
dst->add ( len - (*it)->when, (*it)->value );
}
}
static void
generate_inverse_power_curve (boost::shared_ptr<Evoral::ControlList> dst, boost::shared_ptr<const Evoral::ControlList> src)
{
//calc inverse curve using sum of squares
for (Evoral::ControlList::const_iterator it = src->begin(); it!=src->end(); ++it ) {
float value = (*it)->value;
value = 1 - powf(value,2);
value = sqrtf(value);
dst->fast_simple_add ( (*it)->when, value );
}
}
/*
static void
generate_inverse_coefficient_curve (boost::shared_ptr<Evoral::ControlList> dst, boost::shared_ptr<const Evoral::ControlList> src)
{
//calc inverse gain coefficient curve
for (Evoral::ControlList::const_iterator it = src->begin(); it!=src->end(); ++it ) {
float value = 1.0 - (*it)->value;
dst->fast_simple_add ( (*it)->when, value );
}
}
*/
static void
generate_db_fade (boost::shared_ptr<Evoral::ControlList> dst, double len, int num_steps, float dB_drop)
{
dst->fast_simple_add (0, 1);
//generate a fade-out curve by successively applying a gain drop
float fade_speed = dB_to_coefficient(dB_drop / (float) num_steps);
for (int i = 1; i < (num_steps-1); i++) {
float coeff = 1.0;
for (int j = 0; j < i; j++) {
coeff *= fade_speed;
}
dst->fast_simple_add (len*(double)i/(double)num_steps, coeff);
}
dst->fast_simple_add (len, VERY_SMALL_SIGNAL);
}
static void
merge_curves (boost::shared_ptr<Evoral::ControlList> dst,
boost::shared_ptr<const Evoral::ControlList> curve1,
boost::shared_ptr<const Evoral::ControlList> curve2)
{
Evoral::ControlList::EventList::size_type size = curve1->size();
//curve lengths must match for now
if (size != curve2->size()) {
return;
}
Evoral::ControlList::const_iterator c1 = curve1->begin();
int count = 0;
for (Evoral::ControlList::const_iterator c2 = curve2->begin(); c2!=curve2->end(); c2++ ) {
float v1 = accurate_coefficient_to_dB((*c1)->value);
float v2 = accurate_coefficient_to_dB((*c2)->value);
double interp = v1 * ( 1.0-( (double)count / (double)size) );
interp += v2 * ( (double)count / (double)size );
interp = dB_to_coefficient(interp);
dst->add ( (*c1)->when, interp );
c1++;
count++;
}
}
void
AudioRegion::make_property_quarks ()
{
@ -133,10 +217,14 @@ AudioRegion::AudioRegion (Session& s, framepos_t start, framecnt_t len, std::str
, AUDIOREGION_STATE_DEFAULT
, _automatable (s)
, _fade_in (new AutomationList(Evoral::Parameter(FadeInAutomation)))
, _inverse_fade_in (new AutomationList(Evoral::Parameter(FadeInAutomation)))
, _fade_out (new AutomationList(Evoral::Parameter(FadeOutAutomation)))
, _inverse_fade_out (new AutomationList(Evoral::Parameter(FadeOutAutomation)))
, _envelope (new AutomationList(Evoral::Parameter(EnvelopeAutomation)))
, _fade_in_suspended (0)
, _fade_out_suspended (0)
, _fade_in_is_xfade (false)
, _fade_out_is_xfade (false)
{
init ();
assert (_sources.size() == _master_sources.size());
@ -148,10 +236,14 @@ AudioRegion::AudioRegion (const SourceList& srcs)
, AUDIOREGION_STATE_DEFAULT
, _automatable(srcs[0]->session())
, _fade_in (new AutomationList(Evoral::Parameter(FadeInAutomation)))
, _inverse_fade_in (new AutomationList(Evoral::Parameter(FadeInAutomation)))
, _fade_out (new AutomationList(Evoral::Parameter(FadeOutAutomation)))
, _inverse_fade_out (new AutomationList(Evoral::Parameter(FadeOutAutomation)))
, _envelope (new AutomationList(Evoral::Parameter(EnvelopeAutomation)))
, _fade_in_suspended (0)
, _fade_out_suspended (0)
, _fade_in_is_xfade (false)
, _fade_out_is_xfade (false)
{
init ();
assert (_sources.size() == _master_sources.size());
@ -162,13 +254,17 @@ AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other)
, AUDIOREGION_COPY_STATE (other)
, _automatable (other->session())
, _fade_in (new AutomationList (*other->_fade_in))
, _inverse_fade_in (new AutomationList(*other->_inverse_fade_in))
, _fade_out (new AutomationList (*other->_fade_out))
, _inverse_fade_out (new AutomationList (*other->_inverse_fade_out))
/* As far as I can see, the _envelope's times are relative to region position, and have nothing
to do with sources (and hence _start). So when we copy the envelope, we just use the supplied offset.
*/
, _envelope (new AutomationList (*other->_envelope, 0, other->_length))
, _fade_in_suspended (0)
, _fade_out_suspended (0)
, _fade_in_is_xfade (false)
, _fade_out_is_xfade (false)
{
/* don't use init here, because we got fade in/out from the other region
*/
@ -186,13 +282,17 @@ AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, framecnt_t
, AUDIOREGION_COPY_STATE (other)
, _automatable (other->session())
, _fade_in (new AutomationList (*other->_fade_in))
, _inverse_fade_in (new AutomationList(*other->_inverse_fade_in))
, _fade_out (new AutomationList (*other->_fade_out))
, _inverse_fade_out (new AutomationList (*other->_inverse_fade_out))
/* As far as I can see, the _envelope's times are relative to region position, and have nothing
to do with sources (and hence _start). So when we copy the envelope, we just use the supplied offset.
*/
, _envelope (new AutomationList (*other->_envelope, offset, other->_length))
, _fade_in_suspended (0)
, _fade_out_suspended (0)
, _fade_in_is_xfade (false)
, _fade_out_is_xfade (false)
{
/* don't use init here, because we got fade in/out from the other region
*/
@ -210,10 +310,14 @@ AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, const Sour
, AUDIOREGION_COPY_STATE (other)
, _automatable (other->session())
, _fade_in (new AutomationList (*other->_fade_in))
, _inverse_fade_in (new AutomationList(*other->_inverse_fade_in))
, _fade_out (new AutomationList (*other->_fade_out))
, _inverse_fade_out (new AutomationList (*other->_inverse_fade_out))
, _envelope (new AutomationList (*other->_envelope))
, _fade_in_suspended (0)
, _fade_out_suspended (0)
, _fade_in_is_xfade (false)
, _fade_out_is_xfade (false)
{
/* make-a-sort-of-copy-with-different-sources constructor (used by audio filter) */
@ -231,10 +335,14 @@ AudioRegion::AudioRegion (SourceList& srcs)
, AUDIOREGION_STATE_DEFAULT
, _automatable(srcs[0]->session())
, _fade_in (new AutomationList(Evoral::Parameter(FadeInAutomation)))
, _inverse_fade_in (new AutomationList(Evoral::Parameter(FadeInAutomation)))
, _fade_out (new AutomationList(Evoral::Parameter(FadeOutAutomation)))
, _inverse_fade_out (new AutomationList(Evoral::Parameter(FadeOutAutomation)))
, _envelope (new AutomationList(Evoral::Parameter(EnvelopeAutomation)))
, _fade_in_suspended (0)
, _fade_out_suspended (0)
, _fade_in_is_xfade (false)
, _fade_out_is_xfade (false)
{
init ();
@ -341,45 +449,43 @@ AudioRegion::read_peaks (PeakData *buf, framecnt_t npeaks, framecnt_t offset, fr
}
}
/** @param buf Buffer to write data to (existing data will be overwritten).
* @param pos Position to read from as an offset from the region position.
* @param cnt Number of frames to read.
* @param channel Channel to read from.
*/
framecnt_t
AudioRegion::read (Sample* buf, framepos_t timeline_position, framecnt_t cnt, int channel) const
AudioRegion::read (Sample* buf, framepos_t pos, framecnt_t cnt, int channel) const
{
/* raw read, no fades, no gain, nada */
/* XXX: xfade: passes no mixbuf... */
return _read_at (_sources, _length, buf, 0, 0, _position + timeline_position, cnt, channel, ReadOps (0));
return read_from_sources (_sources, _length, buf, _position + pos, cnt, channel);
}
framecnt_t
AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
framepos_t position, framecnt_t cnt, uint32_t chan_n) const
{
/* regular diskstream/butler read complete with fades etc */
return _read_at (_sources, _length, buf, mixdown_buffer, gain_buffer,
position, cnt, chan_n, ReadOps (~0));
}
framecnt_t
AudioRegion::master_read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
AudioRegion::master_read_at (Sample *buf, Sample* /*mixdown_buffer*/, float* /*gain_buffer*/,
framepos_t position, framecnt_t cnt, uint32_t chan_n) const
{
/* do not read gain/scaling/fades and do not count this disk i/o in statistics */
assert (cnt >= 0);
return _read_at (_master_sources, _master_sources.front()->length(_master_sources.front()->timeline_position()),
buf, mixdown_buffer, gain_buffer, position, cnt, chan_n, ReadOps (0));
return read_from_sources (
_master_sources, _master_sources.front()->length (_master_sources.front()->timeline_position()),
buf, position, cnt, chan_n
);
}
/** @param position Position within the session to read from.
/** @param buf Buffer to mix data into.
* @param mixdown_buffer Scratch buffer for audio data.
* @param gain_buffer Scratch buffer for gain data.
* @param position Position within the session to read from.
* @param cnt Number of frames to read.
* @param chan_n Channel number to read.
*/
framecnt_t
AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit,
Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
AudioRegion::read_at (Sample *buf, Sample *mixdown_buffer, float *gain_buffer,
framepos_t position,
framecnt_t cnt,
uint32_t chan_n,
ReadOps rops) const
uint32_t chan_n) const
{
/* We are reading data from this region into buf (possibly via mixdown_buffer).
The caller has verified that we cover the desired section.
@ -395,7 +501,7 @@ AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit,
return 0;
}
if (muted() && rops != ReadOpsNone) {
if (muted()) {
return 0; /* read nothing */
}
@ -407,11 +513,11 @@ AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit,
assert (position >= _position);
frameoffset_t const internal_offset = position - _position;
if (internal_offset >= limit) {
if (internal_offset >= _length) {
return 0; /* read nothing */
}
if ((to_read = min (cnt, limit - internal_offset)) == 0) {
if ((to_read = min (cnt, _length - internal_offset)) == 0) {
return 0; /* read nothing */
}
@ -431,8 +537,6 @@ AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit,
framecnt_t fade_interval_start = 0;
if (rops & ReadOpsFades) {
/* Fade in */
if (_fade_in_active && _session.config.get_use_region_fades()) {
@ -453,24 +557,24 @@ AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit,
/* see if some part of this read is within the fade out */
/* ................. >| REGION
limit
_length
{ } FADE
fade_out_length
^
limit - fade_out_length
_length - fade_out_length
|--------------|
^internal_offset
^internal_offset + to_read
we need the intersection of [internal_offset,internal_offset+to_read] with
[limit - fade_out_length, limit]
[_length - fade_out_length, _length]
*/
fade_interval_start = max (internal_offset, limit - framecnt_t (_fade_out->back()->when));
framecnt_t fade_interval_end = min(internal_offset + to_read, limit);
fade_interval_start = max (internal_offset, _length - framecnt_t (_fade_out->back()->when));
framecnt_t fade_interval_end = min(internal_offset + to_read, _length.val());
if (fade_interval_end > fade_interval_start) {
/* (part of the) the fade out is in this buffer */
@ -478,7 +582,6 @@ AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit,
fade_out_offset = fade_interval_start - internal_offset;
}
}
}
/* READ DATA FROM THE SOURCE INTO mixdown_buffer.
We can never read directly into buf, since it may contain data
@ -486,10 +589,146 @@ AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit,
must always mix.
*/
if (read_from_sources (_sources, _length, mixdown_buffer, position, to_read, chan_n) != to_read) {
return 0;
}
/* APPLY REGULAR GAIN CURVES AND SCALING TO mixdown_buffer */
if (envelope_active()) {
_envelope->curve().get_vector (internal_offset, internal_offset + to_read, gain_buffer, to_read);
if (_scale_amplitude != 1.0f) {
for (framecnt_t n = 0; n < to_read; ++n) {
mixdown_buffer[n] *= gain_buffer[n] * _scale_amplitude;
}
} else {
for (framecnt_t n = 0; n < to_read; ++n) {
mixdown_buffer[n] *= gain_buffer[n];
}
}
} else if (_scale_amplitude != 1.0f) {
apply_gain_to_buffer (mixdown_buffer, to_read, _scale_amplitude);
}
/* APPLY FADES TO THE DATA IN mixdown_buffer AND MIX THE RESULTS INTO
* buf. The key things to realize here: (1) the fade being applied is
* (as of April 26th 2012) just the inverse of the fade in curve (2)
* "buf" contains data from lower regions already. So this operation
* fades out the existing material.
*/
if (fade_in_limit != 0) {
if (_inverse_fade_in) {
/* explicit inverse fade in curve (e.g. for constant
* power), so we have to fetch it.
*/
_inverse_fade_in->curve().get_vector (internal_offset, internal_offset + fade_in_limit, gain_buffer, fade_in_limit);
/* Fade the data from lower layers out */
for (framecnt_t n = 0; n < fade_in_limit; ++n) {
buf[n] *= gain_buffer[n];
}
/* refill gain buffer with the fade in */
_fade_in->curve().get_vector (internal_offset, internal_offset + fade_in_limit, gain_buffer, fade_in_limit);
} else {
/* no explicit inverse fade in, so just use (1 - fade
* in) for the fade out of lower layers
*/
_fade_in->curve().get_vector (internal_offset, internal_offset + fade_in_limit, gain_buffer, fade_in_limit);
for (framecnt_t n = 0; n < fade_in_limit; ++n) {
buf[n] *= 1 - gain_buffer[n];
}
}
/* Mix our newly-read data in, with the fade */
for (framecnt_t n = 0; n < fade_in_limit; ++n) {
buf[n] += mixdown_buffer[n] * gain_buffer[n];
}
}
if (fade_out_limit != 0) {
framecnt_t const curve_offset = fade_interval_start - (_length - _fade_out->back()->when);
if (_inverse_fade_out) {
_inverse_fade_out->curve().get_vector (curve_offset, curve_offset + fade_out_limit, gain_buffer, fade_out_limit);
/* Fade the data from lower levels out */
for (framecnt_t n = 0, m = fade_out_offset; n < fade_out_limit; ++n, ++m) {
buf[m] *= gain_buffer[n];
}
/* fetch the actual fade out */
_fade_out->curve().get_vector (curve_offset, curve_offset + fade_out_limit, gain_buffer, fade_out_limit);
} else {
/* no explicit inverse fade out, so just use (1 - fade
* out) for the fade in of lower layers
*/
_fade_out->curve().get_vector (curve_offset, curve_offset + fade_out_limit, gain_buffer, fade_out_limit);
for (framecnt_t n = 0, m = fade_out_offset; n < fade_out_limit; ++n, ++m) {
buf[m] *= 1 - gain_buffer[n];
}
}
/* Mix our newly-read data out, with the fade */
for (framecnt_t n = 0, m = fade_out_offset; n < fade_out_limit; ++n, ++m) {
buf[m] += mixdown_buffer[m] * gain_buffer[n];
}
}
/* MIX THE REGION BODY FROM mixdown_buffer INTO buf */
mix_buffers_no_gain (buf + fade_in_limit, mixdown_buffer + fade_in_limit, to_read - fade_in_limit - fade_out_limit);
return to_read;
}
/** Read data directly from one of our sources, accounting for the situation when the track has a different channel
* count to the region.
*
* @param srcs Source list to get our source from.
* @param limit Furthest that we should read, as an offset from the region position.
* @param buf Buffer to write data into (existing contents of the buffer will be overwritten)
* @param position Position to read from, in session frames.
* @param cnt Number of frames to read.
* @param chan_n Channel to read from.
* @return Number of frames read.
*/
framecnt_t
AudioRegion::read_from_sources (SourceList const & srcs, framecnt_t limit, Sample* buf, framepos_t position, framecnt_t cnt, uint32_t chan_n) const
{
frameoffset_t const internal_offset = position - _position;
if (internal_offset >= limit) {
return 0;
}
framecnt_t const to_read = min (cnt, limit - internal_offset);
if (to_read == 0) {
return 0;
}
if (chan_n < n_channels()) {
boost::shared_ptr<AudioSource> src = boost::dynamic_pointer_cast<AudioSource> (srcs[chan_n]);
if (src->read (mixdown_buffer, _start + internal_offset, to_read) != to_read) {
if (src->read (buf, _start + internal_offset, to_read) != to_read) {
return 0; /* "read nothing" */
}
@ -506,67 +745,12 @@ AudioRegion::_read_at (const SourceList& srcs, framecnt_t limit,
uint32_t channel = n_channels() % chan_n;
boost::shared_ptr<AudioSource> src = boost::dynamic_pointer_cast<AudioSource> (srcs[channel]);
if (src->read (mixdown_buffer, _start + internal_offset, to_read) != to_read) {
if (src->read (buf, _start + internal_offset, to_read) != to_read) {
return 0; /* "read nothing" */
}
}
}
/* APPLY REGULAR GAIN CURVES AND SCALING TO mixdown_buffer */
if ((rops & ReadOpsOwnAutomation) && envelope_active()) {
_envelope->curve().get_vector (internal_offset, internal_offset + to_read, gain_buffer, to_read);
if ((rops & ReadOpsOwnScaling) && _scale_amplitude != 1.0f) {
for (framecnt_t n = 0; n < to_read; ++n) {
mixdown_buffer[n] *= gain_buffer[n] * _scale_amplitude;
}
} else {
for (framecnt_t n = 0; n < to_read; ++n) {
mixdown_buffer[n] *= gain_buffer[n];
}
}
} else if ((rops & ReadOpsOwnScaling) && _scale_amplitude != 1.0f) {
apply_gain_to_buffer (mixdown_buffer, to_read, _scale_amplitude);
}
/* APPLY FADES TO THE DATA IN mixdown_buffer AND MIX THE RESULTS INTO buf */
if (fade_in_limit != 0) {
_fade_in->curve().get_vector (internal_offset, internal_offset + fade_in_limit, gain_buffer, fade_in_limit);
/* Fade the current data out */
for (framecnt_t n = 0; n < fade_in_limit; ++n) {
buf[n] *= 1 - gain_buffer[n];
}
/* Mix our newly-read data in, with the fade */
for (framecnt_t n = 0; n < fade_in_limit; ++n) {
buf[n] += mixdown_buffer[n] * gain_buffer[n];
}
}
if (fade_out_limit != 0) {
framecnt_t const curve_offset = fade_interval_start - (limit - _fade_out->back()->when);
_fade_out->curve().get_vector (curve_offset, curve_offset + fade_out_limit, gain_buffer, fade_out_limit);
/* Fade the current data in */
for (framecnt_t n = 0, m = fade_out_offset; n < fade_out_limit; ++n, ++m) {
buf[m] *= 1 - gain_buffer[n];
}
/* Mix our newly-read data in, with the fade */
for (framecnt_t n = 0, m = fade_out_offset; n < fade_out_limit; ++n, ++m) {
buf[m] += mixdown_buffer[m] * gain_buffer[n];
}
}
/* MIX THE REGION BODY FROM mixdown_buffer INTO buf */
mix_buffers_no_gain (buf + fade_in_limit, mixdown_buffer + fade_in_limit, to_read - fade_in_limit - fade_out_limit);
return to_read;
}
@ -605,6 +789,7 @@ AudioRegion::state ()
}
child = node.add_child (X_("FadeIn"));
child->add_property ("is-xfade", (_fade_in_is_xfade ? "yes" : "no"));
if (_default_fade_in) {
child->add_property ("default", "yes");
@ -612,7 +797,13 @@ AudioRegion::state ()
child->add_child_nocopy (_fade_in->get_state ());
}
if (_inverse_fade_in) {
child = node.add_child (X_("InvFadeIn"));
child->add_child_nocopy (_inverse_fade_in->get_state ());
}
child = node.add_child (X_("FadeOut"));
child->add_property ("is-xfade", (_fade_out_is_xfade ? "yes" : "no"));
if (_default_fade_out) {
child->add_property ("default", "yes");
@ -620,6 +811,11 @@ AudioRegion::state ()
child->add_child_nocopy (_fade_out->get_state ());
}
if (_inverse_fade_out) {
child = node.add_child (X_("InvFadeOut"));
child->add_child_nocopy (_inverse_fade_out->get_state ());
}
return node;
}
@ -677,7 +873,7 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_
_fade_in->clear ();
if ((prop = child->property ("default")) != 0 || (prop = child->property ("steepness")) != 0) {
if (((prop = child->property ("default")) != 0 && string_is_affirmative (prop->value())) || (prop = child->property ("steepness")) != 0) {
set_default_fade_in ();
} else {
XMLNode* grandchild = child->child ("AutomationList");
@ -686,6 +882,12 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_
}
}
if ((prop = child->property ("is-xfade")) != 0) {
_fade_in_is_xfade = string_is_affirmative (prop->value());
} else {
_fade_in_is_xfade = false;
}
if ((prop = child->property ("active")) != 0) {
if (string_is_affirmative (prop->value())) {
set_fade_in_active (true);
@ -698,7 +900,7 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_
_fade_out->clear ();
if ((prop = child->property ("default")) != 0 || (prop = child->property ("steepness")) != 0) {
if (((prop = child->property ("default")) != 0 && (string_is_affirmative (prop->value()))) || (prop = child->property ("steepness")) != 0) {
set_default_fade_out ();
} else {
XMLNode* grandchild = child->child ("AutomationList");
@ -707,6 +909,12 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_
}
}
if ((prop = child->property ("is-xfade")) != 0) {
_fade_out_is_xfade = string_is_affirmative (prop->value());
} else {
_fade_out_is_xfade = false;
}
if ((prop = child->property ("active")) != 0) {
if (string_is_affirmative (prop->value())) {
set_fade_out_active (true);
@ -715,6 +923,16 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_
}
}
} else if (child->name() == "InvFadeIn") {
XMLNode* grandchild = child->child ("AutomationList");
if (grandchild) {
_inverse_fade_in->set_state (*grandchild, version);
}
} else if (child->name() == "InvFadeOut") {
XMLNode* grandchild = child->child ("AutomationList");
if (grandchild) {
_inverse_fade_out->set_state (*grandchild, version);
}
}
}
@ -757,6 +975,7 @@ AudioRegion::set_fade_in (boost::shared_ptr<AutomationList> f)
_fade_in->freeze ();
*_fade_in = *f;
_fade_in->thaw ();
_default_fade_in = false;
send_change (PropertyChange (Properties::fade_in));
}
@ -764,57 +983,64 @@ AudioRegion::set_fade_in (boost::shared_ptr<AutomationList> f)
void
AudioRegion::set_fade_in (FadeShape shape, framecnt_t len)
{
boost::shared_ptr<Evoral::ControlList> c1 (new Evoral::ControlList (FadeInAutomation));
boost::shared_ptr<Evoral::ControlList> c2 (new Evoral::ControlList (FadeInAutomation));
boost::shared_ptr<Evoral::ControlList> c3 (new Evoral::ControlList (FadeInAutomation));
_fade_in->freeze ();
_fade_in->clear ();
_inverse_fade_in->clear ();
switch (shape) {
case FadeLinear:
_fade_in->fast_simple_add (0.0, 0.0);
_fade_in->fast_simple_add (len, 1.0);
reverse_curve (_inverse_fade_in, _fade_in);
break;
case FadeFast:
_fade_in->fast_simple_add (0, 0);
_fade_in->fast_simple_add (len * 0.389401, 0.0333333);
_fade_in->fast_simple_add (len * 0.629032, 0.0861111);
_fade_in->fast_simple_add (len * 0.829493, 0.233333);
_fade_in->fast_simple_add (len * 0.9447, 0.483333);
_fade_in->fast_simple_add (len * 0.976959, 0.697222);
_fade_in->fast_simple_add (len, 1);
generate_db_fade (_fade_in, len, 10, -60);
reverse_curve (c1, _fade_in);
_fade_in->copy_events (*c1);
generate_inverse_power_curve (_inverse_fade_in, _fade_in);
break;
case FadeSlow:
_fade_in->fast_simple_add (0, 0);
_fade_in->fast_simple_add (len * 0.0207373, 0.197222);
_fade_in->fast_simple_add (len * 0.0645161, 0.525);
_fade_in->fast_simple_add (len * 0.152074, 0.802778);
_fade_in->fast_simple_add (len * 0.276498, 0.919444);
_fade_in->fast_simple_add (len * 0.481567, 0.980556);
_fade_in->fast_simple_add (len * 0.767281, 1);
_fade_in->fast_simple_add (len, 1);
generate_db_fade (c1, len, 10, -1); // start off with a slow fade
generate_db_fade (c2, len, 10, -80); // end with a fast fade
merge_curves (_fade_in, c1, c2);
generate_inverse_power_curve (_inverse_fade_in, _fade_in);
break;
case FadeLogA:
_fade_in->fast_simple_add (0, 0);
_fade_in->fast_simple_add (len * 0.0737327, 0.308333);
_fade_in->fast_simple_add (len * 0.246544, 0.658333);
_fade_in->fast_simple_add (len * 0.470046, 0.886111);
_fade_in->fast_simple_add (len * 0.652074, 0.972222);
_fade_in->fast_simple_add (len * 0.771889, 0.988889);
_fade_in->fast_simple_add (len, 1);
case FadeConstantPower:
for (int i = 0; i < 9; ++i) {
float dist = (float) i / 10.0f;
_fade_in->fast_simple_add (len*dist, sin (dist*M_PI/2));
}
_fade_in->fast_simple_add (len, 1.0);
reverse_curve (_inverse_fade_in, _fade_in);
break;
case FadeLogB:
_fade_in->fast_simple_add (0, 0);
_fade_in->fast_simple_add (len * 0.304147, 0.0694444);
_fade_in->fast_simple_add (len * 0.529954, 0.152778);
_fade_in->fast_simple_add (len * 0.725806, 0.333333);
_fade_in->fast_simple_add (len * 0.847926, 0.558333);
_fade_in->fast_simple_add (len * 0.919355, 0.730556);
_fade_in->fast_simple_add (len, 1);
case FadeSymmetric:
// starts kind of like a constant power but has a slower fadeout
// however it is NOT constant power and there will be a level drop in the middle of the crossfade
c1->fast_simple_add (0.0, 1.0);
for ( int i = 1; i < 9; i++ ) {
float dist = (float)i/10.0;
c1->fast_simple_add ((len * dist), cos(dist*M_PI/10.0));
}
c1->fast_simple_add (len, VERY_SMALL_SIGNAL);
//curve 2 is a slow fade at end
generate_db_fade (c2, len, 10, -30 );
merge_curves (c3, c1, c2);
reverse_curve (_fade_in, c3);
reverse_curve (_inverse_fade_in, _fade_in );
break;
}
_default_fade_in = false;
_fade_in->thaw ();
send_change (PropertyChange (Properties::fade_in));
}
@ -825,6 +1051,7 @@ AudioRegion::set_fade_out (boost::shared_ptr<AutomationList> f)
_fade_out->freeze ();
*_fade_out = *f;
_fade_out->thaw ();
_default_fade_out = false;
send_change (PropertyChange (Properties::fade_in));
}
@ -832,57 +1059,65 @@ AudioRegion::set_fade_out (boost::shared_ptr<AutomationList> f)
void
AudioRegion::set_fade_out (FadeShape shape, framecnt_t len)
{
boost::shared_ptr<Evoral::ControlList> c1 (new Evoral::ControlList (FadeOutAutomation));
boost::shared_ptr<Evoral::ControlList> c2 (new Evoral::ControlList (FadeOutAutomation));
_fade_out->freeze ();
_fade_out->clear ();
_inverse_fade_out->clear ();
switch (shape) {
case FadeFast:
_fade_out->fast_simple_add (len * 0, 1);
_fade_out->fast_simple_add (len * 0.023041, 0.697222);
_fade_out->fast_simple_add (len * 0.0553, 0.483333);
_fade_out->fast_simple_add (len * 0.170507, 0.233333);
_fade_out->fast_simple_add (len * 0.370968, 0.0861111);
_fade_out->fast_simple_add (len * 0.610599, 0.0333333);
_fade_out->fast_simple_add (len * 1, 0);
case FadeLinear:
_fade_out->fast_simple_add (0.0, 1.0);
_fade_out->fast_simple_add (len, VERY_SMALL_SIGNAL);
reverse_curve (_inverse_fade_out, _fade_out);
break;
case FadeLogA:
_fade_out->fast_simple_add (len * 0, 1);
_fade_out->fast_simple_add (len * 0.228111, 0.988889);
_fade_out->fast_simple_add (len * 0.347926, 0.972222);
_fade_out->fast_simple_add (len * 0.529954, 0.886111);
_fade_out->fast_simple_add (len * 0.753456, 0.658333);
_fade_out->fast_simple_add (len * 0.9262673, 0.308333);
_fade_out->fast_simple_add (len * 1, 0);
case FadeFast:
generate_db_fade (_fade_out, len, 10, -60 );
generate_inverse_power_curve (_inverse_fade_out, _fade_out);
break;
case FadeSlow:
_fade_out->fast_simple_add (len * 0, 1);
_fade_out->fast_simple_add (len * 0.305556, 1);
_fade_out->fast_simple_add (len * 0.548611, 0.991736);
_fade_out->fast_simple_add (len * 0.759259, 0.931129);
_fade_out->fast_simple_add (len * 0.918981, 0.68595);
_fade_out->fast_simple_add (len * 0.976852, 0.22865);
_fade_out->fast_simple_add (len * 1, 0);
generate_db_fade (c1, len, 10, -1 ); //start off with a slow fade
generate_db_fade (c2, len, 10, -80 ); //end with a fast fade
merge_curves (_fade_out, c1, c2);
generate_inverse_power_curve (_inverse_fade_out, _fade_out);
break;
case FadeLogB:
_fade_out->fast_simple_add (len * 0, 1);
_fade_out->fast_simple_add (len * 0.080645, 0.730556);
_fade_out->fast_simple_add (len * 0.277778, 0.289256);
_fade_out->fast_simple_add (len * 0.470046, 0.152778);
_fade_out->fast_simple_add (len * 0.695853, 0.0694444);
_fade_out->fast_simple_add (len * 1, 0);
case FadeConstantPower:
//constant-power fades use a sin/cos relationship
//the cutoff is abrupt but it has the benefit of being symmetrical
_fade_out->fast_simple_add (0.0, 1.0);
for (int i = 1; i < 9; i++ ) {
float dist = (float)i/10.0;
_fade_out->fast_simple_add ((len * dist), cos(dist*M_PI/2));
}
_fade_out->fast_simple_add (len, VERY_SMALL_SIGNAL);
reverse_curve (_inverse_fade_out, _fade_out);
break;
case FadeLinear:
_fade_out->fast_simple_add (len * 0, 1);
_fade_out->fast_simple_add (len * 1, 0);
case FadeSymmetric:
//starts kind of like a constant power but has a slower fadeout
//however it is NOT constant power and there will be a level drop in the middle of the crossfade
c1->fast_simple_add (0.0, 1.0);
for ( int i = 1; i < 9; i++ ) {
float dist = (float)i/10.0;
c1->fast_simple_add ((len * dist), cos(dist*M_PI/10.0)); //cheesy way of making a flat line
}
c1->fast_simple_add (len, VERY_SMALL_SIGNAL);
//curve 2 is a slow fade at end
generate_db_fade (c2, len, 10, -30);
merge_curves (_fade_out, c1, c2);
reverse_curve (_inverse_fade_out, _fade_out);
break;
}
_default_fade_out = false;
_fade_out->thaw ();
send_change (PropertyChange (Properties::fade_in));
send_change (PropertyChange (Properties::fade_out));
}
void
@ -892,9 +1127,31 @@ AudioRegion::set_fade_in_length (framecnt_t len)
len = _length - 1;
}
if (len < 64) {
len = 64;
}
bool changed = _fade_in->extend_to (len);
if (changed) {
if (_inverse_fade_in) {
_inverse_fade_in->extend_to (len);
}
if (_session.config.get_xfade_model() == FullCrossfade &&
_session.config.get_auto_xfade() &&
_fade_in_is_xfade) {
/* trim a single other region below us to the new start
of the fade.
*/
boost::shared_ptr<Region> other = get_single_other_xfade_region (true);
if (other) {
other->trim_end (position() + len);
}
}
_default_fade_in = false;
send_change (PropertyChange (Properties::fade_in));
}
@ -907,10 +1164,33 @@ AudioRegion::set_fade_out_length (framecnt_t len)
len = _length - 1;
}
if (len < 64) {
len = 64;
}
bool changed = _fade_out->extend_to (len);
if (changed) {
if (_inverse_fade_out) {
_inverse_fade_out->extend_to (len);
}
_default_fade_out = false;
if (_session.config.get_xfade_model() == FullCrossfade &&
_session.config.get_auto_xfade() &&
_fade_out_is_xfade) {
/* trim a single other region below us to the new start
of the fade.
*/
boost::shared_ptr<Region> other = get_single_other_xfade_region (false);
if (other) {
other->trim_front (last_frame() - len);
}
}
send_change (PropertyChange (Properties::fade_out));
}
}
@ -952,6 +1232,7 @@ void
AudioRegion::set_default_fade_in ()
{
_fade_in_suspended = 0;
_fade_in_is_xfade = false;
set_fade_in (FadeLinear, 64);
}
@ -959,6 +1240,7 @@ void
AudioRegion::set_default_fade_out ()
{
_fade_out_suspended = 0;
_fade_out_is_xfade = false;
set_fade_out (FadeLinear, 64);
}
@ -1527,6 +1809,85 @@ AudioRegion::body_range () const
return Evoral::Range<framepos_t> (first_frame() + _fade_in->back()->when, last_frame() - _fade_out->back()->when);
}
void
AudioRegion::set_fade_in_is_xfade (bool yn)
{
_fade_in_is_xfade = yn;
}
void
AudioRegion::set_fade_out_is_xfade (bool yn)
{
_fade_out_is_xfade = yn;
}
boost::shared_ptr<Region>
AudioRegion::get_single_other_xfade_region (bool start) const
{
boost::shared_ptr<Playlist> pl (playlist());
if (!pl) {
/* not currently in a playlist - xfade length is unbounded
(and irrelevant)
*/
return boost::shared_ptr<AudioRegion> ();
}
boost::shared_ptr<RegionList> rl;
if (start) {
rl = pl->regions_at (position());
} else {
rl = pl->regions_at (last_frame());
}
RegionList::iterator i;
boost::shared_ptr<Region> other;
uint32_t n = 0;
/* count and find the other region in a single pass through the list */
for (i = rl->begin(); i != rl->end(); ++i) {
if ((*i).get() != this) {
other = *i;
}
++n;
}
if (n != 2) {
/* zero or multiple regions stacked here - don't care about xfades */
return boost::shared_ptr<AudioRegion> ();
}
return other;
}
framecnt_t
AudioRegion::verify_xfade_bounds (framecnt_t len, bool start)
{
boost::shared_ptr<Region> other = get_single_other_xfade_region (start);
framecnt_t maxlen;
if (!other) {
/* zero or > 2 regions here, don't care about len */
return len;
}
/* we overlap a single region. clamp the length of an xfade to
the maximum possible duration of the overlap (if the other
region were trimmed appropriately).
*/
if (start) {
maxlen = other->latest_possible_frame() - position();
} else {
maxlen = last_frame() - other->earliest_possible_position();
}
return min (maxlen, len);
}
extern "C" {
int region_read_peaks_from_c (void *arg, uint32_t npeaks, uint32_t start, uint32_t cnt, intptr_t data, uint32_t n_chan, double samples_per_unit)

View file

@ -81,7 +81,7 @@ BroadcastInfo::set_originator (std::string const & str)
}
void
BroadcastInfo::set_originator_ref_from_session (Session const & session)
BroadcastInfo::set_originator_ref_from_session (Session const & /*session*/)
{
_has_info = true;

View file

@ -19,6 +19,8 @@
#include <dlfcn.h>
#include <glibmm/fileutils.h>
#include "pbd/compose.h"
#include "pbd/file_utils.h"
#include "pbd/error.h"
@ -169,6 +171,8 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi)
}
cpi.protocol = 0;
delete cpi.state;
cpi.state = 0;
dlclose (cpi.descriptor->module);
return 0;
}
@ -218,6 +222,13 @@ ControlProtocolManager::control_protocol_discover (string path)
{
ControlProtocolDescriptor* descriptor;
/* don't load shared objects that are just symlinks to the real thing.
*/
if (Glib::file_test (path, Glib::FILE_TEST_IS_SYMLINK)) {
return 0;
}
if ((descriptor = get_descriptor (path)) != 0) {
if (!descriptor->probe (descriptor)) {

View file

@ -47,7 +47,7 @@ using namespace std;
using namespace PBD;
using namespace ARDOUR;
PBD::Signal0<int> Delivery::PannersLegal;
PBD::Signal0<void> Delivery::PannersLegal;
bool Delivery::panners_legal = false;
/* deliver to an existing IO object */
@ -402,7 +402,7 @@ Delivery::reset_panner ()
}
}
int
void
Delivery::panners_became_legal ()
{
if (_panshell) {
@ -414,7 +414,6 @@ Delivery::panners_became_legal ()
}
panner_legal_c.disconnect ();
return 0;
}
void
@ -438,11 +437,11 @@ Delivery::disable_panners ()
return 0;
}
int
void
Delivery::reset_panners ()
{
panners_legal = true;
return *PannersLegal ();
PannersLegal ();
}
void

View file

@ -73,6 +73,7 @@ setup_enum_writer ()
RemoteModel _RemoteModel;
DenormalModel _DenormalModel;
CrossfadeModel _CrossfadeModel;
CrossfadeChoice _CrossfadeChoice;
InsertMergePolicy _InsertMergePolicy;
ListenPosition _ListenPosition;
SampleFormat _SampleFormat;
@ -121,7 +122,6 @@ setup_enum_writer ()
MidiModel::PatchChangeDiffCommand::Property _MidiModel_PatchChangeDiffCommand_Property;
WaveformScale _WaveformScale;
WaveformShape _WaveformShape;
QuantizeType _QuantizeType;
Session::PostTransportWork _Session_PostTransportWork;
Session::SlaveState _Session_SlaveState;
MTC_Status _MIDI_MTC_Status;
@ -257,6 +257,11 @@ setup_enum_writer ()
REGISTER_ENUM (ShortCrossfade);
REGISTER (_CrossfadeModel);
REGISTER_ENUM (RegionFades);
REGISTER_ENUM (ConstantPowerMinus3dB);
REGISTER_ENUM (ConstantPowerMinus6dB);
REGISTER (_CrossfadeChoice);
REGISTER_ENUM (InsertMergeReject);
REGISTER_ENUM (InsertMergeRelax);
REGISTER_ENUM (InsertMergeReplace);
@ -409,8 +414,8 @@ setup_enum_writer ()
REGISTER_ENUM (FadeLinear);
REGISTER_ENUM (FadeFast);
REGISTER_ENUM (FadeSlow);
REGISTER_ENUM (FadeLogA);
REGISTER_ENUM (FadeLogB);
REGISTER_ENUM (FadeConstantPower);
REGISTER_ENUM (FadeSymmetric);
REGISTER (_FadeShape);
REGISTER_CLASS_ENUM (Diskstream, Recordable);
@ -569,11 +574,6 @@ setup_enum_writer ()
REGISTER_ENUM(Rectified);
REGISTER(_WaveformShape);
REGISTER_ENUM(Plain);
REGISTER_ENUM(Legato);
REGISTER_ENUM(Groove);
REGISTER(_QuantizeType);
REGISTER_ENUM(AudioTime);
REGISTER_ENUM(MusicTime);
REGISTER(_PositionLockStyle);
@ -732,6 +732,21 @@ std::ostream& operator<<(std::ostream& o, const CrossfadeModel& var)
std::string s = enum_2_string (var);
return o << s;
}
std::istream& operator>>(std::istream& o, CrossfadeChoice& var)
{
std::string s;
o >> s;
var = (CrossfadeChoice) string_2_enum (s, var);
return o;
}
std::ostream& operator<<(std::ostream& o, const CrossfadeChoice& var)
{
std::string s = enum_2_string (var);
return o << s;
}
std::istream& operator>>(std::istream& o, SyncSource& var)
{
std::string s;

View file

@ -30,8 +30,6 @@
#include "i18n.h"
#define WITH_STATIC_PATHS 1
using namespace PBD;
namespace ARDOUR {
@ -109,11 +107,7 @@ ardour_search_path ()
SearchPath
system_config_search_path ()
{
#ifdef WITH_STATIC_PATHS
SearchPath config_path(string(CONFIG_DIR));
#else
SearchPath config_path(system_config_directories());
#endif
config_path.add_subdirectory_to_paths("ardour3");
@ -123,11 +117,7 @@ system_config_search_path ()
SearchPath
system_data_search_path ()
{
#ifdef WITH_STATIC_PATHS
SearchPath data_path(string(DATA_DIR));
#else
SearchPath data_path(system_data_directories());
#endif
data_path.add_subdirectory_to_paths("ardour3");

View file

@ -108,14 +108,18 @@ Graph::reset_thread_list ()
drop_threads ();
}
if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::main_thread, this), &a_thread, 100000) == 0) {
_thread_list.push_back (a_thread);
if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::main_thread, this), &a_thread, 100000) != 0) {
throw failed_constructor ();
}
for (uint32_t i = 1; i < num_threads; ++i) {
if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::helper_thread, this), &a_thread, 100000) == 0) {
_thread_list.push_back (a_thread);
for (uint32_t i = 1; i < num_threads; ++i) {
if (AudioEngine::instance()->create_process_thread (boost::bind (&Graph::helper_thread, this), &a_thread, 100000) != 0) {
throw failed_constructor ();
}
_thread_list.push_back (a_thread);
}
}

View file

@ -359,7 +359,7 @@ InternalSend::set_can_pan (bool yn)
}
void
InternalSend::cycle_start (pframes_t nframes)
InternalSend::cycle_start (pframes_t /*nframes*/)
{
for (BufferSet::audio_iterator b = mixbufs.audio_begin(); b != mixbufs.audio_end(); ++b) {
b->prepare ();

View file

@ -256,8 +256,8 @@ IO::remove_port (boost::shared_ptr<Port> port, void* src)
ChanCount after = before;
after.set (port->type(), after.get (port->type()) - 1);
bool const r = PortCountChanging (after); /* EMIT SIGNAL */
if (r) {
boost::optional<bool> const r = PortCountChanging (after); /* EMIT SIGNAL */
if (r.get_value_or (false)) {
return -1;
}

View file

@ -176,6 +176,7 @@ LV2Plugin::LV2Plugin (AudioEngine& engine,
void* c_plugin,
framecnt_t rate)
: Plugin (engine, session)
, Workee ()
, _impl(new Impl())
, _features(NULL)
, _worker(NULL)
@ -186,6 +187,7 @@ LV2Plugin::LV2Plugin (AudioEngine& engine,
LV2Plugin::LV2Plugin (const LV2Plugin& other)
: Plugin (other)
, Workee ()
, _impl(new Impl())
, _features(NULL)
, _worker(NULL)

View file

@ -107,11 +107,8 @@ MidiPlaylist::read (Evoral::EventSink<framepos_t>& dst, framepos_t start, framec
its OK to block (for short intervals).
*/
#ifdef HAVE_GLIB_THREADS_RECMUTEX
Glib::Threads::RecMutex::Lock rm (region_lock);
#else
Glib::RecMutex::Lock rm (region_lock);
#endif
Playlist::RegionLock rl (this, false);
DEBUG_TRACE (DEBUG::MidiPlaylistIO, string_compose ("++++++ %1 .. %2 +++++++ %3 trackers +++++++++++++++++\n",
start, start + dur, _note_trackers.size()));
@ -298,11 +295,8 @@ MidiPlaylist::read (Evoral::EventSink<framepos_t>& dst, framepos_t start, framec
void
MidiPlaylist::clear_note_trackers ()
{
#ifdef HAVE_GLIB_THREADS_RECMUTEX
Glib::Threads::RecMutex::Lock rm (region_lock);
#else
Glib::RecMutex::Lock rm (region_lock);
#endif
Playlist::RegionLock rl (this, false);
for (NoteTrackers::iterator n = _note_trackers.begin(); n != _note_trackers.end(); ++n) {
delete n->second;
}
@ -407,12 +401,7 @@ MidiPlaylist::contained_automation()
its OK to block (for short intervals).
*/
#ifdef HAVE_GLIB_THREADS_RECMUTEX
Glib::Threads::RecMutex::Lock rm (region_lock);
#else
Glib::RecMutex::Lock rm (region_lock);
#endif
Playlist::RegionLock rl (this, false);
set<Evoral::Parameter> ret;
for (RegionList::const_iterator r = regions.begin(); r != regions.end(); ++r) {

View file

@ -142,7 +142,7 @@ MidiPlaylistSource::read_unlocked (Evoral::EventSink<framepos_t>& dst,
}
framecnt_t
MidiPlaylistSource::write_unlocked (MidiRingBuffer<framepos_t>& dst,
MidiPlaylistSource::write_unlocked (MidiRingBuffer<framepos_t>&,
framepos_t,
framecnt_t)
{

View file

@ -45,7 +45,7 @@ MidiControlUI* MidiControlUI::_instance = 0;
#include "pbd/abstract_ui.cc" /* instantiate the template */
MidiControlUI::MidiControlUI (Session& s)
: AbstractUI<MidiUIRequest> (_("midiui"))
: AbstractUI<MidiUIRequest> (X_("midiui"))
, _session (s)
{
MIDI::Manager::instance()->PortsChanged.connect_same_thread (rebind_connection, boost::bind (&MidiControlUI::change_midi_ports, this));

View file

@ -32,6 +32,7 @@
#include "pbd/failed_constructor.h"
#include "pbd/stateful_diff_command.h"
#include "pbd/xml++.h"
#include "pbd/stacktrace.h"
#include "ardour/debug.h"
#include "ardour/playlist.h"
@ -608,11 +609,7 @@ Playlist::flush_notifications (bool from_undo)
*/
}
if (
((regions_changed || pending_contents_change) && !in_set_state) ||
pending_layering
) {
if (((regions_changed || pending_contents_change) && !in_set_state) || pending_layering) {
relayer ();
}
@ -1761,6 +1758,12 @@ boost::shared_ptr<RegionList>
Playlist::regions_touched (framepos_t start, framepos_t end)
{
RegionLock rlock (this);
return regions_touched_locked (start, end);
}
boost::shared_ptr<RegionList>
Playlist::regions_touched_locked (framepos_t start, framepos_t end)
{
boost::shared_ptr<RegionList> rlist (new RegionList);
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
@ -1881,8 +1884,7 @@ Playlist::regions_touched (framepos_t start, framepos_t end)
closest = distance;
ret = r;
}
}
else {
} else {
end_iter = true;
}
@ -2276,15 +2278,16 @@ Playlist::set_layer (boost::shared_ptr<Region> region, double new_layer)
}
void
Playlist::setup_layering_indices (RegionList const & regions) const
Playlist::setup_layering_indices (RegionList const & regions)
{
uint64_t j = 0;
list<Evoral::Range<framepos_t> > xf;
for (RegionList::const_iterator k = regions.begin(); k != regions.end(); ++k) {
(*k)->set_layering_index (j++);
}
}
/** Take the layering indices of each of our regions, compute the layers
* that they should be on, and write the layers back to the regions.
*/
@ -2400,7 +2403,7 @@ Playlist::relayer ()
notify_layering_changed ();
/* This relayer() may have been called as a result of a region removal, in which
case we need to setup layering indices so account for the one that has just
case we need to setup layering indices to account for the one that has just
gone away.
*/
setup_layering_indices (copy);
@ -2411,6 +2414,7 @@ Playlist::raise_region (boost::shared_ptr<Region> region)
{
set_layer (region, region->layer() + 1.5);
relayer ();
check_crossfades (region->range ());
}
void
@ -2418,6 +2422,7 @@ Playlist::lower_region (boost::shared_ptr<Region> region)
{
set_layer (region, region->layer() - 1.5);
relayer ();
check_crossfades (region->range ());
}
void
@ -2425,6 +2430,7 @@ Playlist::raise_region_to_top (boost::shared_ptr<Region> region)
{
set_layer (region, DBL_MAX);
relayer ();
check_crossfades (region->range ());
}
void
@ -2432,6 +2438,7 @@ Playlist::lower_region_to_bottom (boost::shared_ptr<Region> region)
{
set_layer (region, -0.5);
relayer ();
check_crossfades (region->range ());
}
void
@ -2577,8 +2584,6 @@ Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
_shuffling = true;
Evoral::Range<framepos_t> old_range = region->range ();
{
RegionLock rlock (const_cast<Playlist*> (this));
@ -2677,12 +2682,6 @@ Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
if (moved) {
relayer ();
list<Evoral::Range<framepos_t> > xf;
xf.push_back (old_range);
xf.push_back (region->range ());
coalesce_and_check_crossfades (xf);
notify_contents_changed();
}
@ -3096,6 +3095,9 @@ Playlist::set_orig_track_id (const PBD::ID& id)
_orig_track_id = id;
}
/** Take a list of ranges, coalesce any that can be coalesced, then call
* check_crossfades for each one.
*/
void
Playlist::coalesce_and_check_crossfades (list<Evoral::Range<framepos_t> > ranges)
{

View file

@ -138,12 +138,14 @@ PluginInsert::output_streams() const
{
assert (!_plugins.empty());
if (_plugins.front()->reconfigurable_io()) {
PluginInfoPtr info = _plugins.front()->get_info();
if (info->reconfigurable_io()) {
ChanCount out = _plugins.front()->output_streams ();
// DEBUG_TRACE (DEBUG::Processors, string_compose ("Plugin insert, reconfigur(able) output streams = %1\n", out));
return out;
} else {
ChanCount out = _plugins.front()->get_info()->n_outputs;
ChanCount out = info->n_outputs;
// DEBUG_TRACE (DEBUG::Processors, string_compose ("Plugin insert, static output streams = %1 for %2 plugins\n", out, _plugins.size()));
out.set_audio (out.n_audio() * _plugins.size());
out.set_midi (out.n_midi() * _plugins.size());
@ -158,11 +160,13 @@ PluginInsert::input_streams() const
ChanCount in;
if (_plugins.front()->reconfigurable_io()) {
PluginInfoPtr info = _plugins.front()->get_info();
if (info->reconfigurable_io()) {
assert (_plugins.size() == 1);
in = _plugins.front()->input_streams();
} else {
in = _plugins[0]->get_info()->n_inputs;
in = info->n_inputs;
}
DEBUG_TRACE (DEBUG::Processors, string_compose ("Plugin insert, input streams = %1, match using %2\n", in, _match.method));
@ -712,7 +716,9 @@ PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out)
PluginInsert::Match
PluginInsert::private_can_support_io_configuration (ChanCount const & in, ChanCount& out) const
{
if (_plugins.front()->reconfigurable_io()) {
PluginInfoPtr info = _plugins.front()->get_info();
if (info->reconfigurable_io()) {
/* Plugin has flexible I/O, so delegate to it */
bool const r = _plugins.front()->can_support_io_configuration (in, out);
if (!r) {
@ -722,8 +728,8 @@ PluginInsert::private_can_support_io_configuration (ChanCount const & in, ChanCo
return Match (Delegate, 1);
}
ChanCount inputs = _plugins[0]->get_info()->n_inputs;
ChanCount outputs = _plugins[0]->get_info()->n_outputs;
ChanCount inputs = info->n_inputs;
ChanCount outputs = info->n_outputs;
bool no_inputs = true;
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {

View file

@ -40,8 +40,7 @@ using namespace ARDOUR;
* 0.25 = quantize to beats/4, etc.
*/
Quantize::Quantize (Session& s, QuantizeType /* type */,
bool snap_start, bool snap_end,
Quantize::Quantize (Session& s, bool snap_start, bool snap_end,
double start_grid, double end_grid,
float strength, float swing, float threshold)
: session (s)

View file

@ -1654,3 +1654,33 @@ Region::set_start_internal (framecnt_t s)
{
_start = s;
}
framepos_t
Region::earliest_possible_position () const
{
if (_start > _position) {
return 0;
} else {
return _position - _start;
}
}
framecnt_t
Region::latest_possible_frame () const
{
framecnt_t minlen = max_framecnt;
for (SourceList::const_iterator i = _sources.begin(); i != _sources.end(); ++i) {
/* non-audio regions have a length that may vary based on their
* position, so we have to pass it in the call.
*/
minlen = min (minlen, (*i)->length (_position));
}
/* the latest possible last frame is determined by the current
* position, plus the shortest source extent past _start.
*/
return _position + (minlen - _start) - 1;
}

View file

@ -16,6 +16,7 @@ libs='libs'
export LD_LIBRARY_PATH=$libs/audiographer:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/timecode:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
export ARDOUR_PANNER_PATH=$libs/panners/2in2out:$libs/panners/1in2out:$libs/panners/vbap
export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs/surfaces/tranzport:$libs/surfaces/powermate:$libs/surfaces/mackie
if [ "$1" == "--debug" ]; then
gdb ./libs/ardour/run-tests

View file

@ -182,7 +182,7 @@ SessionMetadata::get_state ()
}
int
SessionMetadata::set_state (const XMLNode & state, int version_num)
SessionMetadata::set_state (const XMLNode & state, int /*version_num*/)
{
const XMLNodeList & children = state.children();
string name;

View file

@ -926,8 +926,12 @@ Session::load_state (string snapshot_name)
Stateful::loading_state_version = 1000;
} else {
if (prop->value().find ('.')) {
/* old school version format - lock at 3000 */
/* old school version format */
if (prop->value()[0] == '2') {
Stateful::loading_state_version = 2000;
} else {
Stateful::loading_state_version = 3000;
}
} else {
Stateful::loading_state_version = atoi (prop->value());
}

Some files were not shown because too many files have changed in this diff Show more