commit = set_selected_track_from_click (press, op, false);
break;
- case GainAutomationControlPointItem:
- case PanAutomationControlPointItem:
- case RedirectAutomationControlPointItem:
+ case ControlPointItem:
commit = set_selected_track_from_click (press, op, true);
if (mouse_mode != MouseRange) {
commit |= set_selected_control_point_from_click (op, false);
return true;
break;
- case GainAutomationControlPointItem:
- case PanAutomationControlPointItem:
- case RedirectAutomationControlPointItem:
+ case ControlPointItem:
start_control_point_grab (item, event);
return true;
break;
- case GainAutomationLineItem:
- case PanAutomationLineItem:
- case RedirectAutomationLineItem:
+ case AutomationLineItem:
start_line_grab_from_line (item, event);
return true;
break;
// start_line_grab_from_regionview (item, event);
break;
- case GainControlPointItem:
- start_control_point_grab (item, event);
- return true;
-
case GainLineItem:
start_line_grab_from_line (item, event);
return true;
- case GainAutomationControlPointItem:
- case PanAutomationControlPointItem:
- case RedirectAutomationControlPointItem:
+ case ControlPointItem:
start_control_point_grab (item, event);
return true;
break;
break;
switch (item_type) {
- case GainAutomationControlPointItem:
- case PanAutomationControlPointItem:
- case RedirectAutomationControlPointItem:
+ case ControlPointItem:
start_control_point_grab (item, event);
break;
- case GainAutomationLineItem:
- case PanAutomationLineItem:
- case RedirectAutomationLineItem:
+ case AutomationLineItem:
start_line_grab_from_line (item, event);
break;
}
break;
- case GainAutomationControlPointItem:
- case PanAutomationControlPointItem:
- case RedirectAutomationControlPointItem:
+ case ControlPointItem:
start_control_point_grab (item, event);
return true;
break;
}
break;
- case GainControlPointItem:
+ case ControlPointItem:
if (mouse_mode == MouseGain) {
remove_gain_control_point (item, event);
+ } else {
+ remove_control_point (item, event);
}
break;
- case GainAutomationControlPointItem:
- case PanAutomationControlPointItem:
- case RedirectAutomationControlPointItem:
- remove_control_point (item, event);
- break;
-
default:
break;
}
case PlayheadCursorItem:
case MarkerItem:
case GainLineItem:
- case GainAutomationLineItem:
- case PanAutomationLineItem:
- case RedirectAutomationLineItem:
+ case AutomationLineItem:
case StartSelectionTrimItem:
case EndSelectionTrimItem:
return true;
double fraction;
switch (item_type) {
- case GainControlPointItem:
- if (mouse_mode == MouseGain) {
- cp = static_cast<ControlPoint*>(item->get_data ("control_point"));
- cp->set_visible (true);
-
- double at_x, at_y;
- at_x = cp->get_x();
- at_y = cp->get_y ();
- cp->item->i2w (at_x, at_y);
- at_x += 20.0;
- at_y += 20.0;
-
- fraction = 1.0 - ((cp->get_y() - cp->line.y_position()) / cp->line.height());
-
- set_verbose_canvas_cursor (cp->line.get_verbose_cursor_string (fraction), at_x, at_y);
- show_verbose_canvas_cursor ();
-
- if (is_drawable()) {
- track_canvas.get_window()->set_cursor (*fader_cursor);
- }
- }
- break;
-
- case GainAutomationControlPointItem:
- case PanAutomationControlPointItem:
- case RedirectAutomationControlPointItem:
+ case ControlPointItem:
if (mouse_mode == MouseGain || mouse_mode == MouseObject) {
cp = static_cast<ControlPoint*>(item->get_data ("control_point"));
cp->set_visible (true);
if (mouse_mode == MouseGain) {
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
if (line)
- line->property_fill_color_rgba() = color_map[cEnteredGainLine];
+ line->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_EnteredGainLine.get();
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*fader_cursor);
}
}
break;
- case GainAutomationLineItem:
- case RedirectAutomationLineItem:
- case PanAutomationLineItem:
+ case AutomationLineItem:
if (mouse_mode == MouseGain || mouse_mode == MouseObject) {
{
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
if (line)
- line->property_fill_color_rgba() = color_map[cEnteredAutomationLine];
+ line->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_EnteredAutomationLine.get();
}
if (is_drawable()) {
track_canvas.get_window()->set_cursor (*fader_cursor);
if ((marker = static_cast<Marker *> (item->get_data ("marker"))) == 0) {
break;
}
- marker->set_color_rgba (color_map[cEnteredMarker]);
+ marker->set_color_rgba (ARDOUR_UI::config()->canvasvar_EnteredMarker.get());
// fall through
case MeterMarkerItem:
case TempoMarkerItem:
switch (item_type) {
case GainLineItem:
- case GainAutomationLineItem:
- case RedirectAutomationLineItem:
- case PanAutomationLineItem:
- case GainControlPointItem:
- case GainAutomationControlPointItem:
- case PanAutomationControlPointItem:
- case RedirectAutomationControlPointItem:
+ case AutomationLineItem:
+ case ControlPointItem:
/* these do not affect the current entered track state */
clear_entered_track = false;
break;
bool is_start;
switch (item_type) {
- case GainControlPointItem:
- case GainAutomationControlPointItem:
- case PanAutomationControlPointItem:
- case RedirectAutomationControlPointItem:
+ case ControlPointItem:
cp = reinterpret_cast<ControlPoint*>(item->get_data ("control_point"));
if (cp->line.npoints() > 1) {
if (!cp->selected) {
break;
case GainLineItem:
- case GainAutomationLineItem:
- case RedirectAutomationLineItem:
- case PanAutomationLineItem:
+ case AutomationLineItem:
al = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
{
ArdourCanvas::Line *line = dynamic_cast<ArdourCanvas::Line *> (item);
case PlayheadCursorItem:
case EditCursorItem:
case MarkerItem:
- case GainControlPointItem:
- case RedirectAutomationControlPointItem:
- case GainAutomationControlPointItem:
- case PanAutomationControlPointItem:
+ case ControlPointItem:
case TempoMarkerItem:
case MeterMarkerItem:
case RegionViewNameHighlight:
case EndSelectionTrimItem:
case SelectionItem:
case GainLineItem:
- case RedirectAutomationLineItem:
- case GainAutomationLineItem:
- case PanAutomationLineItem:
+ case AutomationLineItem:
case FadeInHandleItem:
case FadeOutHandleItem:
AudioRegionView* arv = static_cast<AudioRegionView*>(drag_info.data);
- drag_info.pointer_frame_offset = drag_info.grab_frame - ((nframes_t) arv->audio_region()->fade_in().back()->when + arv->region()->position());
+ drag_info.pointer_frame_offset = drag_info.grab_frame - ((nframes_t) arv->audio_region()->fade_in()->back()->when + arv->region()->position());
}
void
continue;
}
- AutomationList& alist = tmp->audio_region()->fade_in();
- XMLNode &before = alist.get_state();
+ boost::shared_ptr<AutomationList> alist = tmp->audio_region()->fade_in();
+ XMLNode &before = alist->get_state();
tmp->audio_region()->set_fade_in_length (fade_length);
- XMLNode &after = alist.get_state();
- session->add_command(new MementoCommand<AutomationList>(alist, &before, &after));
+ XMLNode &after = alist->get_state();
+ session->add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &after));
}
commit_reversible_command ();
AudioRegionView* arv = static_cast<AudioRegionView*>(drag_info.data);
- drag_info.pointer_frame_offset = drag_info.grab_frame - (arv->region()->length() - (nframes_t) arv->audio_region()->fade_out().back()->when + arv->region()->position());
+ drag_info.pointer_frame_offset = drag_info.grab_frame - (arv->region()->length() - (nframes_t) arv->audio_region()->fade_out()->back()->when + arv->region()->position());
}
void
continue;
}
- AutomationList& alist = tmp->audio_region()->fade_out();
- XMLNode &before = alist.get_state();
+ boost::shared_ptr<AutomationList> alist = tmp->audio_region()->fade_out();
+ XMLNode &before = alist->get_state();
tmp->audio_region()->set_fade_out_length (fade_length);
- XMLNode &after = alist.get_state();
- session->add_command(new MementoCommand<AutomationList>(alist, &before, &after));
+ XMLNode &after = alist->get_state();
+ session->add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &after));
}
commit_reversible_command ();
// The actual copying is not done before we reach the finish callback.
char name[64];
snprintf (name, sizeof(name), "%g/%g", meter_marker->meter().beats_per_bar(), meter_marker->meter().note_divisor ());
- MeterMarker* new_marker = new MeterMarker(*this, *meter_group, color_map[cMeterMarker], name,
+ MeterMarker* new_marker = new MeterMarker(*this, *meter_group, ARDOUR_UI::config()->canvasvar_MeterMarker.get(), name,
*new MeterSection(meter_marker->meter()));
drag_info.item = &new_marker->the_item();
// The actual copying is not done before we reach the finish callback.
char name[64];
snprintf (name, sizeof (name), "%.2f", tempo_marker->tempo().beats_per_minute());
- TempoMarker* new_marker = new TempoMarker(*this, *tempo_group, color_map[cTempoMarker], name,
+ TempoMarker* new_marker = new TempoMarker(*this, *tempo_group, ARDOUR_UI::config()->canvasvar_TempoMarker.get(), name,
*new TempoSection(tempo_marker->tempo()));
drag_info.item = &new_marker->the_item();
TimeAxisView *tracklist_timeview;
tracklist_timeview = (*i);
RouteTimeAxisView* rtv2 = dynamic_cast<RouteTimeAxisView*>(tracklist_timeview);
- list<TimeAxisView*> children_list;
+ TimeAxisView::Children children_list;
/* zeroes are audio tracks. ones are other types. */
height_list[rtv2->order] = (*i)->height;
children = 1;
if ((children_list = rtv2->get_child_list()).size() > 0) {
- for (list<TimeAxisView*>::iterator j = children_list.begin(); j != children_list.end(); ++j) {
+ for (TimeAxisView::Children::iterator j = children_list.begin(); j != children_list.end(); ++j) {
tracks = tracks |= (0x01 << (rtv2->order + children));
height_list[rtv2->order + children] = (*j)->height;
numtracks++;
motion handler.
*/
- if (drag_info.first_move && !(drag_info.copy && drag_info.x_constrained)) {
+ if (drag_info.first_move) {
/* just a click */
goto out;
}
boost::shared_ptr<Region> newregion;
boost::shared_ptr<Region> ar;
+ boost::shared_ptr<Region> mr;
if ((ar = boost::dynamic_pointer_cast<AudioRegion>(rv->region())) != 0) {
newregion = RegionFactory::create (ar);
- } else {
- /* XXX MIDI HERE drobilla */
- continue;
+ } else if ((mr = boost::dynamic_pointer_cast<MidiRegion>(rv->region())) != 0) {
+ newregion = RegionFactory::create (mr);
}
/* add it */