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

@ -389,8 +389,8 @@ gnome_canvas_simpleline_render (GnomeCanvasItem *item,
}
static void
gnome_canvas_simpleline_draw (GnomeCanvasItem *canvas,
GdkDrawable *drawable,
gnome_canvas_simpleline_draw (GnomeCanvasItem* canvas,
GdkDrawable* drawable,
int x, int y,
int width, int height)
{

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.
@ -698,15 +698,15 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
if (tv->view()->layer_display() == Stacked) {
tv->view()->set_layer_display (Expanded);
}
/* We're only allowed to go -ve in layer on Expanded views */
if (tv->view()->layer_display() != Expanded && (i->layer + this_delta_layer) < 0) {
this_delta_layer = - i->layer;
}
/* Set height */
rv->set_height (tv->view()->child_height ());
/* Update show/hidden status as the region view may have come from a hidden track,
or have moved to one.
*/
@ -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;
@ -1486,7 +1503,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
case SelectionItem:
popup_track_context_menu (1, event->button.time, item_type, true);
break;
case AutomationTrackItem:
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,8 +687,9 @@ LocationEditRow::position_lock_style_changed (ARDOUR::Location*)
}
void
LocationEditRow::focus_name() {
name_entry.grab_focus();
LocationEditRow::focus_name()
{
name_entry.grab_focus ();
}
void
@ -862,9 +863,9 @@ LocationUI::location_redraw_ranges ()
}
struct LocationSortByStart {
bool operator() (Location *a, Location *b) {
return a->start() < b->start();
}
bool operator() (Location *a, Location *b) {
return a->start() < b->start();
}
};
void
@ -879,7 +880,7 @@ LocationUI::location_added (Location* location)
loc.sort (LocationSortByStart ());
LocationEditRow* erow = manage (new LocationEditRow (_session, location));
erow->set_clock_group (*_clock_group);
erow->remove_requested.connect (sigc::mem_fun (*this, &LocationUI::location_remove_requested));
@ -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,32 +393,32 @@ 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;
return;
}
Glib::ustring mpath;
path = Glib::build_filename (userconfigdir, "pango.rc");
std::ofstream pangorc (path.c_str());
if (!pangorc) {
error << string_compose (_("cannot open pango.rc file %1") , path) << endmsg;
} else {
Glib::ustring mpath;
path = Glib::build_filename (userconfigdir, "pango.rc");
std::ofstream pangorc (path.c_str());
if (!pangorc) {
error << string_compose (_("cannot open pango.rc file %1") , path) << endmsg;
} else {
mpath = Glib::build_filename (userconfigdir, "pango.modules");
pangorc << "[Pango]\nModuleFiles=";
pangorc << mpath << endl;
pangorc.close ();
}
setenv ("PANGO_RC_FILE", path.c_str(), 1);
/* similar for GDK pixbuf loaders, but there's no RC file required
to specify where it lives.
*/
mpath = Glib::build_filename (userconfigdir, "gdk-pixbuf.loaders");
setenv ("GDK_PIXBUF_MODULE_FILE", mpath.c_str(), 1);
mpath = Glib::build_filename (userconfigdir, "pango.modules");
pangorc << "[Pango]\nModuleFiles=";
pangorc << mpath << endl;
pangorc.close ();
}
setenv ("PANGO_RC_FILE", path.c_str(), 1);
/* similar for GDK pixbuf loaders, but there's no RC file required
to specify where it lives.
*/
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,15 +319,22 @@ PluginSelector::refiller (const PluginInfoList& plugs, const::std::string& filte
newrow[plugin_columns.creator] = creator;
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());
newrow[plugin_columns.midi_ins] = buf;
snprintf (buf, sizeof(buf), "%d", (*i)->n_outputs.n_audio());
newrow[plugin_columns.audio_outs] = buf;
snprintf (buf, sizeof(buf), "%d", (*i)->n_outputs.n_midi());
newrow[plugin_columns.midi_outs] = buf;
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());
newrow[plugin_columns.midi_ins] = buf;
snprintf (buf, sizeof(buf), "%d", (*i)->n_outputs.n_audio());
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_WIDTH);
frame_handle_end->property_x2() = pixel_width;
frame_handle_end->show();
}
frame_handle_start->show();
frame_handle_end->property_x1() = pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
frame_handle_end->show();
frame_handle_end->property_x2() = pixel_width;
}
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(); }
@ -142,6 +142,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 ();
@ -373,9 +372,12 @@ public:
*/
virtual void pre_uncombine (std::vector<boost::shared_ptr<Region> >&, boost::shared_ptr<Region>) {}
private:
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;
@ -118,8 +130,8 @@ class Plugin : public PBD::StatefulDestructible, public Latent
virtual uint32_t parameter_count () const = 0;
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_docs () 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,8 +312,9 @@ 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 */
/* Top's fade-in will cause an implicit fade-out of bottom */
framecnt_t len = 0;
switch (_session.config.get_xfade_model()) {
case FullCrossfade:
@ -328,11 +324,27 @@ AudioPlaylist::check_crossfades (Evoral::Range<framepos_t> range)
len = _session.config.get_short_xfade_seconds() * _session.frame_rate();
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);
}
}
}

File diff suppressed because it is too large Load diff

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;
}
@ -200,10 +204,10 @@ ControlProtocolManager::discover_control_protocols ()
Glib::PatternSpec dylib_extension_pattern("*.dylib");
find_matching_files_in_search_path (control_protocol_search_path (),
so_extension_pattern, cp_modules);
so_extension_pattern, cp_modules);
find_matching_files_in_search_path (control_protocol_search_path (),
dylib_extension_pattern, cp_modules);
dylib_extension_pattern, cp_modules);
DEBUG_TRACE (DEBUG::ControlProtocols,
string_compose (_("looking for control protocols in %1"), control_protocol_search_path().to_string()));
@ -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 ();
}
_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) {
_thread_list.push_back (a_thread);
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

@ -175,7 +175,8 @@ LV2Plugin::LV2Plugin (AudioEngine& engine,
Session& session,
void* c_plugin,
framecnt_t rate)
: Plugin(engine, session)
: Plugin (engine, session)
, Workee ()
, _impl(new Impl())
, _features(NULL)
, _worker(NULL)
@ -185,7 +186,8 @@ LV2Plugin::LV2Plugin (AudioEngine& engine,
}
LV2Plugin::LV2Plugin (const LV2Plugin& other)
: Plugin(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) {
@ -1772,126 +1775,125 @@ Playlist::regions_touched (framepos_t start, framepos_t end)
return rlist;
}
framepos_t
Playlist::find_next_transient (framepos_t from, int dir)
{
RegionLock rlock (this);
AnalysisFeatureList points;
AnalysisFeatureList these_points;
framepos_t
Playlist::find_next_transient (framepos_t from, int dir)
{
RegionLock rlock (this);
AnalysisFeatureList points;
AnalysisFeatureList these_points;
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
if (dir > 0) {
if ((*i)->last_frame() < from) {
continue;
}
} else {
if ((*i)->first_frame() > from) {
continue;
}
}
(*i)->get_transients (these_points);
/* add first frame, just, err, because */
these_points.push_back ((*i)->first_frame());
points.insert (points.end(), these_points.begin(), these_points.end());
these_points.clear ();
}
if (points.empty()) {
return -1;
}
TransientDetector::cleanup_transients (points, _session.frame_rate(), 3.0);
bool reached = false;
if (dir > 0) {
for (AnalysisFeatureList::iterator x = points.begin(); x != points.end(); ++x) {
if ((*x) >= from) {
reached = true;
}
if (reached && (*x) > from) {
return *x;
}
}
} else {
for (AnalysisFeatureList::reverse_iterator x = points.rbegin(); x != points.rend(); ++x) {
if ((*x) <= from) {
reached = true;
}
if (reached && (*x) < from) {
return *x;
}
}
}
return -1;
}
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
if (dir > 0) {
if ((*i)->last_frame() < from) {
continue;
}
} else {
if ((*i)->first_frame() > from) {
continue;
}
}
(*i)->get_transients (these_points);
/* add first frame, just, err, because */
these_points.push_back ((*i)->first_frame());
points.insert (points.end(), these_points.begin(), these_points.end());
these_points.clear ();
}
if (points.empty()) {
return -1;
}
TransientDetector::cleanup_transients (points, _session.frame_rate(), 3.0);
bool reached = false;
if (dir > 0) {
for (AnalysisFeatureList::iterator x = points.begin(); x != points.end(); ++x) {
if ((*x) >= from) {
reached = true;
}
if (reached && (*x) > from) {
return *x;
}
}
} else {
for (AnalysisFeatureList::reverse_iterator x = points.rbegin(); x != points.rend(); ++x) {
if ((*x) <= from) {
reached = true;
}
if (reached && (*x) < from) {
return *x;
}
}
}
return -1;
}
boost::shared_ptr<Region>
Playlist::find_next_region (framepos_t frame, RegionPoint point, int dir)
{
RegionLock rlock (this);
boost::shared_ptr<Region> ret;
framepos_t closest = max_framepos;
bool end_iter = false;
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
if(end_iter) break;
frameoffset_t distance;
boost::shared_ptr<Region> r = (*i);
framepos_t pos = 0;
switch (point) {
case Start:
pos = r->first_frame ();
break;
case End:
pos = r->last_frame ();
break;
case SyncPoint:
pos = r->sync_position ();
break;
}
switch (dir) {
case 1: /* forwards */
if (pos > frame) {
if ((distance = pos - frame) < closest) {
closest = distance;
ret = r;
end_iter = true;
}
}
break;
default: /* backwards */
if (pos < frame) {
if ((distance = frame - pos) < closest) {
closest = distance;
ret = r;
}
}
else {
end_iter = true;
}
break;
}
}
return ret;
}
boost::shared_ptr<Region>
Playlist::find_next_region (framepos_t frame, RegionPoint point, int dir)
{
RegionLock rlock (this);
boost::shared_ptr<Region> ret;
framepos_t closest = max_framepos;
bool end_iter = false;
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
if(end_iter) break;
frameoffset_t distance;
boost::shared_ptr<Region> r = (*i);
framepos_t pos = 0;
switch (point) {
case Start:
pos = r->first_frame ();
break;
case End:
pos = r->last_frame ();
break;
case SyncPoint:
pos = r->sync_position ();
break;
}
switch (dir) {
case 1: /* forwards */
if (pos > frame) {
if ((distance = pos - frame) < closest) {
closest = distance;
ret = r;
end_iter = true;
}
}
break;
default: /* backwards */
if (pos < frame) {
if ((distance = frame - pos) < closest) {
closest = distance;
ret = r;
}
} else {
end_iter = true;
}
break;
}
}
return ret;
}
framepos_t
Playlist::find_next_region_boundary (framepos_t frame, int dir)
@ -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;

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