#include <algorithm>
#include <string>
#include <vector>
-#include <map>
+#include <map>
#include <utility>
#include <sigc++/bind.h>
#include "evoral/Parameter.hpp"
#include "ardour_ui.h"
+#include "debug.h"
+#include "global_signals.h"
#include "route_time_axis.h"
#include "automation_time_axis.h"
#include "canvas_impl.h"
}
_editor.ZoomChanged.connect (sigc::mem_fun(*this, &RouteTimeAxisView::reset_samples_per_unit));
+ _editor.HorizontalPositionChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::horizontal_position_changed));
ColorsChanged.connect (sigc::mem_fun (*this, &RouteTimeAxisView::color_handler));
PropertyList* plist = new PropertyList();
name_entry.set_text (x);
}
+ if (x != name_label.get_text()) {
+ name_label.set_text (x);
+ }
+
ARDOUR_UI::instance()->set_tip (name_entry, x);
}
void
RouteTimeAxisView::take_name_changed (void *src)
-
{
if (src != this) {
label_view ();
items.push_back (MenuElem (_("Color..."), sigc::mem_fun(*this, &RouteTimeAxisView::select_track_color)));
+ build_size_menu ();
+ items.push_back (MenuElem (_("Height"), *_size_menu));
+
items.push_back (SeparatorElem());
if (!Profile->get_sae()) {
// Hook for derived classes to add type specific stuff
append_extra_display_menu_items ();
- items.push_back (SeparatorElem());
if (is_track()) {
}
void
-RouteTimeAxisView::show_timestretch (nframes_t start, nframes_t end)
+RouteTimeAxisView::show_timestretch (framepos_t start, framepos_t end)
{
double x1;
double x2;
set_samples_per_unit (_editor.get_current_zoom());
}
+void
+RouteTimeAxisView::horizontal_position_changed ()
+{
+ if (_view) {
+ _view->horizontal_position_changed ();
+ }
+}
+
void
RouteTimeAxisView::set_samples_per_unit (double spu)
{
speed = track()->speed();
}
- nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
- nframes_t end_adjusted = session_frame_to_track_frame(end, speed);
+ framepos_t const start_adjusted = session_frame_to_track_frame(start, speed);
+ framepos_t const end_adjusted = session_frame_to_track_frame(end, speed);
if ((_view && ((top < 0.0 && bot < 0.0))) || touched (top, bot)) {
_view->get_selectables (start_adjusted, end_adjusted, top, bot, results);
}
boost::shared_ptr<Region>
-RouteTimeAxisView::find_next_region (nframes_t pos, RegionPoint point, int32_t dir)
+RouteTimeAxisView::find_next_region (framepos_t pos, RegionPoint point, int32_t dir)
{
boost::shared_ptr<Playlist> pl = playlist ();
return boost::shared_ptr<Region> ();
}
-nframes64_t
-RouteTimeAxisView::find_next_region_boundary (nframes64_t pos, int32_t dir)
+framepos_t
+RouteTimeAxisView::find_next_region_boundary (framepos_t pos, int32_t dir)
{
boost::shared_ptr<Playlist> pl = playlist ();
}
}
- playlist->clear_history ();
- playlist->clear_owned_history ();
+ playlist->clear_changes ();
+ playlist->clear_owned_changes ();
switch (op) {
case Cut:
if ((what_we_got = playlist->cut (time)) != 0) {
_editor.get_cut_buffer().add (what_we_got);
- vector<StatefulDiffCommand*> cmds;
-
+ vector<Command*> cmds;
playlist->rdiff (cmds);
-
- for (vector<StatefulDiffCommand*>::iterator c = cmds.begin(); c != cmds.end(); ++c) {
- _session->add_command (*c);
- }
+ _session->add_commands (cmds);
+
_session->add_command (new StatefulDiffCommand (playlist));
}
break;
case Clear:
if ((what_we_got = playlist->cut (time)) != 0) {
- vector<StatefulDiffCommand*> cmds;
-
+
+ vector<Command*> cmds;
playlist->rdiff (cmds);
-
- for (vector<StatefulDiffCommand*>::iterator c = cmds.begin(); c != cmds.end(); ++c) {
- _session->add_command (*c);
- }
+ _session->add_commands (cmds);
_session->add_command (new StatefulDiffCommand (playlist));
what_we_got->release ();
}
return false;
}
+ DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("paste to %1\n", pos));
+
if (track()->speed() != 1.0f) {
pos = session_frame_to_track_frame (pos, track()->speed());
+ DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("modified paste to %1\n", pos));
}
- pl->clear_history ();
+ pl->clear_changes ();
pl->paste (*p, pos, times);
_session->add_command (new StatefulDiffCommand (pl));
RouteTimeAxisView::region_view_added (RegionView* rv)
{
/* XXX need to find out if automation children have automationstreamviews. If yes, no ghosts */
- if (is_audio_track()) {
- for (Children::iterator i = children.begin(); i != children.end(); ++i) {
- boost::shared_ptr<AutomationTimeAxisView> atv;
-
- if ((atv = boost::dynamic_pointer_cast<AutomationTimeAxisView> (*i)) != 0) {
- atv->add_ghost(rv);
- }
+ for (Children::iterator i = children.begin(); i != children.end(); ++i) {
+ boost::shared_ptr<AutomationTimeAxisView> atv;
+
+ if ((atv = boost::dynamic_pointer_cast<AutomationTimeAxisView> (*i)) != 0) {
+ atv->add_ghost(rv);
}
}
ProcessorAutomationNode* pan;
if ((pan = find_processor_automation_node (processor, what)) == 0) {
- error << _("programming error: ")
- << string_compose (X_("processor automation curve for %1:%2 not registered with track!"),
- processor->name(), what)
+ /* session state may never have been saved with new plugin */
+ error << _("programming error: ")
+ << string_compose (X_("processor automation curve for %1:%2/%3/%4 not registered with track!"),
+ processor->name(), what.type(), (int) what.channel(), what.id() )
<< endmsg;
/*NOTREACHED*/
return;
/* FIXME: ew */
char state_name[256];
- snprintf (state_name, sizeof (state_name), "Redirect-%s-%" PRIu32, legalize_for_xml_node (processor->name()).c_str(), what.id());
+ snprintf (state_name, sizeof (state_name), "%s-%" PRIu32, legalize_for_xml_node (processor->name()).c_str(), what.id());
boost::shared_ptr<AutomationControl> control
= boost::dynamic_pointer_cast<AutomationControl>(processor->control(what, true));
pan->view = boost::shared_ptr<AutomationTimeAxisView>(
- new AutomationTimeAxisView (_session, _route, processor, control,
- _editor, *this, false, parent_canvas, name, state_name));
+ new AutomationTimeAxisView (_session, _route, processor, control, control->parameter (),
+ _editor, *this, false, parent_canvas, name, state_name));
pan->view->Hiding.connect (sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::processor_automation_track_hidden), pan, processor));
return 0;
}
+
+void
+RouteTimeAxisView::create_gain_automation_child (const Evoral::Parameter& param, bool show)
+{
+ boost::shared_ptr<AutomationControl> c = _route->gain_control();
+ if (!c) {
+ error << "Route has no gain automation, unable to add automation track view." << endmsg;
+ return;
+ }
+
+ gain_track.reset (new AutomationTimeAxisView (_session,
+ _route, _route->amp(), c, param,
+ _editor,
+ *this,
+ false,
+ parent_canvas,
+ _route->amp()->describe_parameter(param)));
+
+ add_automation_child (Evoral::Parameter(GainAutomation), gain_track, show);
+}