Compare commits
14 Commits
Author | SHA1 | Date |
---|---|---|
David Robillard | 11773e29da | |
David Robillard | 9cf18bd5f0 | |
David Robillard | f1ddb525d5 | |
David Robillard | 72e6d3d062 | |
David Robillard | a0d364791a | |
David Robillard | bc037558ba | |
David Robillard | 08d17742b5 | |
David Robillard | 9240f0db94 | |
Ben Loftis | 3c3835e870 | |
Ben Loftis | ac82aae597 | |
David Robillard | 112df5c7da | |
David Robillard | 70caaea7ef | |
David Robillard | 631373cca5 | |
David Robillard | a7c5200b23 |
|
@ -317,6 +317,7 @@
|
|||
<menuitem action='set-mouse-mode-object'/>
|
||||
<menuitem action='set-mouse-mode-zoom'/>
|
||||
<menuitem action='set-mouse-mode-timefx'/>
|
||||
<menuitem action='set-mouse-mode-content'/>
|
||||
<separator/>
|
||||
<menuitem action='cycle-edit-point'/>
|
||||
<menuitem action='cycle-edit-point-with-marker'/>
|
||||
|
|
|
@ -568,7 +568,7 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
|
|||
|
||||
if (fade_in_handle->visible()) {
|
||||
//see comment for drag_start
|
||||
entered(false);
|
||||
entered();
|
||||
}
|
||||
|
||||
if (pwidth < 5) {
|
||||
|
@ -653,7 +653,7 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
|
|||
|
||||
if (fade_out_handle->visible()) {
|
||||
//see comment for drag_start
|
||||
entered(false);
|
||||
entered();
|
||||
}
|
||||
/* don't show shape if its too small */
|
||||
|
||||
|
@ -1051,9 +1051,9 @@ AudioRegionView::update_envelope_visibility ()
|
|||
}
|
||||
|
||||
if (Config->get_show_region_gain() || trackview.editor().current_mouse_mode() == Editing::MouseDraw || trackview.editor().current_mouse_mode() == Editing::MouseRange ) {
|
||||
gain_line->add_visibility (AutomationLine::Line);
|
||||
gain_line->set_visibility (AutomationLine::VisibleAspects(AutomationLine::ControlPoints|AutomationLine::Line));
|
||||
} else {
|
||||
gain_line->hide ();
|
||||
gain_line->set_visibility (AutomationLine::VisibleAspects(0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1298,17 +1298,14 @@ AudioRegionView::add_ghost (TimeAxisView& tv)
|
|||
}
|
||||
|
||||
void
|
||||
AudioRegionView::entered (bool internal_editing)
|
||||
AudioRegionView::entered ()
|
||||
{
|
||||
trackview.editor().set_current_trimmable (_region);
|
||||
trackview.editor().set_current_movable (_region);
|
||||
|
||||
if (gain_line) {
|
||||
/* these may or may not be visible depending on mouse mode */
|
||||
gain_line->add_visibility (AutomationLine::ControlPoints);
|
||||
}
|
||||
|
||||
if (!internal_editing && ( trackview.editor().current_mouse_mode() == Editing::MouseObject ) ) {
|
||||
update_envelope_visibility();
|
||||
|
||||
if ((trackview.editor().current_mouse_mode() == Editing::MouseObject)) {
|
||||
if (start_xfade_rect) {
|
||||
start_xfade_rect->set_outline (true);
|
||||
}
|
||||
|
@ -1614,7 +1611,7 @@ AudioRegionView::drag_end ()
|
|||
// if fade_in_trim_handle or fade_out_trim_handle should
|
||||
// be visible. -- If the fade_in_handle is visible
|
||||
// we have focus and are not in internal edit mode.
|
||||
entered(false);
|
||||
entered();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ class AudioRegionView : public RegionView
|
|||
|
||||
void show_region_editor ();
|
||||
|
||||
virtual void entered (bool);
|
||||
virtual void entered ();
|
||||
virtual void exited ();
|
||||
|
||||
void thaw_after_trim ();
|
||||
|
|
|
@ -143,12 +143,6 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
|
|||
|
||||
region_views.push_front (region_view);
|
||||
|
||||
if (_trackview.editor().internal_editing()) {
|
||||
region_view->hide_rect ();
|
||||
} else {
|
||||
region_view->show_rect ();
|
||||
}
|
||||
|
||||
/* catch region going away */
|
||||
|
||||
r->DropReferences.connect (*this, invalidator (*this), boost::bind (&AudioStreamView::remove_region_view, this, boost::weak_ptr<Region> (r)), gui_context());
|
||||
|
|
|
@ -314,19 +314,3 @@ AudioTimeAxisView::build_automation_action_menu (bool for_selection)
|
|||
{
|
||||
RouteTimeAxisView::build_automation_action_menu (for_selection);
|
||||
}
|
||||
|
||||
void
|
||||
AudioTimeAxisView::enter_internal_edit_mode ()
|
||||
{
|
||||
if (audio_view()) {
|
||||
audio_view()->enter_internal_edit_mode ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioTimeAxisView::leave_internal_edit_mode ()
|
||||
{
|
||||
if (audio_view()) {
|
||||
audio_view()->leave_internal_edit_mode ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,9 +76,6 @@ class AudioTimeAxisView : public RouteTimeAxisView
|
|||
/* Overridden from parent to store display state */
|
||||
guint32 show_at (double y, int& nth, Gtk::VBox *parent);
|
||||
|
||||
void enter_internal_edit_mode ();
|
||||
void leave_internal_edit_mode ();
|
||||
|
||||
void create_automation_child (const Evoral::Parameter& param, bool show);
|
||||
|
||||
void first_idle ();
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "gtkmm2ext/keyboard.h"
|
||||
|
||||
#include "ardour_ui.h"
|
||||
#include "automation_region_view.h"
|
||||
#include "editing.h"
|
||||
#include "editor.h"
|
||||
|
@ -57,6 +58,10 @@ AutomationRegionView::AutomationRegionView (ArdourCanvas::Container*
|
|||
}
|
||||
|
||||
group->raise_to_top();
|
||||
|
||||
trackview.editor().MouseModeChanged.connect(_mouse_mode_connection, invalidator (*this),
|
||||
boost::bind (&AutomationRegionView::mouse_mode_changed, this),
|
||||
gui_context ());
|
||||
}
|
||||
|
||||
AutomationRegionView::~AutomationRegionView ()
|
||||
|
@ -97,6 +102,27 @@ AutomationRegionView::create_line (boost::shared_ptr<ARDOUR::AutomationList> lis
|
|||
_line->set_offset (_region->start ());
|
||||
}
|
||||
|
||||
uint32_t
|
||||
AutomationRegionView::get_fill_color() const
|
||||
{
|
||||
const std::string mod_name = (_dragging ? "dragging region" :
|
||||
trackview.editor().internal_editing() ? "editable region" :
|
||||
"midi frame base");
|
||||
if (_selected) {
|
||||
return ARDOUR_UI::config()->color_mod ("selected region base", mod_name);
|
||||
} else if (high_enough_for_name || !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
|
||||
return ARDOUR_UI::config()->color_mod ("midi frame base", mod_name);
|
||||
}
|
||||
return ARDOUR_UI::config()->color_mod (fill_color, mod_name);
|
||||
}
|
||||
|
||||
void
|
||||
AutomationRegionView::mouse_mode_changed ()
|
||||
{
|
||||
// Adjust frame colour (become more transparent for internal tools)
|
||||
set_frame_color();
|
||||
}
|
||||
|
||||
bool
|
||||
AutomationRegionView::canvas_group_event (GdkEvent* ev)
|
||||
{
|
||||
|
@ -106,13 +132,12 @@ AutomationRegionView::canvas_group_event (GdkEvent* ev)
|
|||
|
||||
PublicEditor& e = trackview.editor ();
|
||||
|
||||
if (!trackview.editor().internal_editing() &&
|
||||
e.current_mouse_mode() != Editing::MouseDraw) {
|
||||
if (!trackview.editor().internal_editing()) {
|
||||
// not in internal edit mode, so just act like a normal region
|
||||
return RegionView::canvas_group_event (ev);
|
||||
}
|
||||
|
||||
if (ev->type == GDK_BUTTON_PRESS && e.current_mouse_mode() == Editing::MouseObject) {
|
||||
if (ev->type == GDK_BUTTON_PRESS && e.current_mouse_mode() == Editing::MouseContent) {
|
||||
|
||||
/* XXX: icky dcast to Editor */
|
||||
e.drags()->set (new EditorRubberbandSelectDrag (dynamic_cast<Editor*> (&e), group), ev);
|
||||
|
@ -128,7 +153,7 @@ AutomationRegionView::canvas_group_event (GdkEvent* ev)
|
|||
if (e.drags()->end_grab (ev)) {
|
||||
return true;
|
||||
} else if (e.current_mouse_mode() != Editing::MouseDraw &&
|
||||
e.current_mouse_mode() != Editing::MouseObject) {
|
||||
e.current_mouse_mode() != Editing::MouseContent) {
|
||||
return RegionView::canvas_group_event (ev);
|
||||
}
|
||||
|
||||
|
@ -285,7 +310,7 @@ AutomationRegionView::region_resized (const PBD::PropertyChange& what_changed)
|
|||
|
||||
|
||||
void
|
||||
AutomationRegionView::entered (bool)
|
||||
AutomationRegionView::entered ()
|
||||
{
|
||||
if (_line) {
|
||||
_line->track_entered();
|
||||
|
|
|
@ -70,6 +70,8 @@ public:
|
|||
// We are a ghost. Meta ghosts? Crazy talk.
|
||||
virtual GhostRegion* add_ghost(TimeAxisView&) { return 0; }
|
||||
|
||||
uint32_t get_fill_color() const;
|
||||
|
||||
void set_height (double);
|
||||
void reset_width_dependent_items(double pixel_width);
|
||||
|
||||
|
@ -79,7 +81,8 @@ protected:
|
|||
void region_resized (const PBD::PropertyChange&);
|
||||
bool canvas_group_event(GdkEvent* ev);
|
||||
void add_automation_event (GdkEvent* event, framepos_t when, double y, bool with_guard_points);
|
||||
void entered (bool);
|
||||
void mouse_mode_changed ();
|
||||
void entered();
|
||||
void exited();
|
||||
|
||||
private:
|
||||
|
@ -87,6 +90,7 @@ private:
|
|||
ARDOUR::DoubleBeatsFramesConverter _source_relative_time_converter;
|
||||
Evoral::Parameter _parameter;
|
||||
boost::shared_ptr<AutomationLine> _line;
|
||||
PBD::ScopedConnection _mouse_mode_connection;
|
||||
};
|
||||
|
||||
#endif /* __gtk_ardour_automation_region_view_h__ */
|
||||
|
|
|
@ -279,9 +279,6 @@ AutomationStreamView::clear ()
|
|||
void
|
||||
AutomationStreamView::get_selectables (framepos_t start, framepos_t end, double botfrac, double topfrac, list<Selectable*>& results)
|
||||
{
|
||||
if (!_trackview.editor().internal_editing()) {
|
||||
return; // TODO: selection of automation regions
|
||||
}
|
||||
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
AutomationRegionView* arv = dynamic_cast<AutomationRegionView*> (*i);
|
||||
assert (arv);
|
||||
|
@ -313,13 +310,6 @@ AutomationStreamView::get_lines () const
|
|||
return lines;
|
||||
}
|
||||
|
||||
struct RegionPositionSorter {
|
||||
bool operator() (RegionView* a, RegionView* b) {
|
||||
return a->region()->position() < b->region()->position();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
bool
|
||||
AutomationStreamView::paste (framepos_t pos,
|
||||
unsigned paste_count,
|
||||
|
@ -332,7 +322,7 @@ AutomationStreamView::paste (framepos_t pos,
|
|||
return false;
|
||||
}
|
||||
|
||||
region_views.sort (RegionPositionSorter ());
|
||||
region_views.sort (RegionView::PositionOrder());
|
||||
|
||||
list<RegionView*>::const_iterator prev = region_views.begin ();
|
||||
|
||||
|
|
|
@ -143,21 +143,13 @@ CanvasPatchChange::on_patch_menu_selected(const PatchPrimaryKey& key)
|
|||
_region.change_patch_change (*this, key);
|
||||
}
|
||||
|
||||
static bool
|
||||
in_edit_mode(Editor* editor)
|
||||
{
|
||||
return (editor->internal_editing() &&
|
||||
(editor->current_mouse_mode() == Editing::MouseObject ||
|
||||
editor->current_mouse_mode() == Editing::MouseDraw));
|
||||
}
|
||||
|
||||
bool
|
||||
CanvasPatchChange::on_event (GdkEvent* ev)
|
||||
{
|
||||
/* XXX: icky dcast */
|
||||
Editor* e = dynamic_cast<Editor*> (&_region.get_time_axis_view().editor());
|
||||
|
||||
if (!in_edit_mode(e)) {
|
||||
if (!e.internal_editing()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- The Dark Theme for Ardour -->
|
||||
|
||||
<Ardour>
|
||||
<Colors>
|
||||
<Color name="meter color0" value="0x008800FF"/>
|
||||
<Color name="meter color1" value="0x00AA00FF"/>
|
||||
<Color name="meter color2" value="0x00FF00FF"/>
|
||||
<Color name="meter color3" value="0x00FF00FF"/>
|
||||
<Color name="meter color4" value="0xFFF000ff"/>
|
||||
<Color name="meter color5" value="0xFFF000ff"/>
|
||||
<Color name="meter color6" value="0xFF8800ff"/>
|
||||
<Color name="meter color7" value="0xFF8800ff"/>
|
||||
<Color name="meter color8" value="0xFF0000ff"/>
|
||||
<Color name="meter color9" value="0xFF0000ff"/>
|
||||
<Color name="color 1" value="0x20b2b2ff"/>
|
||||
<Color name="color 10" value="0xf0f0f0ff"/>
|
||||
<Color name="color 100" value="0xe49c9cff"/>
|
||||
|
@ -116,6 +104,16 @@
|
|||
<Color name="color 97" value="0xccccccff"/>
|
||||
<Color name="color 98" value="0x9effffff"/>
|
||||
<Color name="color 99" value="0x5da3c1ff"/>
|
||||
<Color name="meter color0" value="0x008800ff"/>
|
||||
<Color name="meter color1" value="0x00aa00ff"/>
|
||||
<Color name="meter color2" value="0x00ff00ff"/>
|
||||
<Color name="meter color3" value="0x00ff00ff"/>
|
||||
<Color name="meter color4" value="0xfff000ff"/>
|
||||
<Color name="meter color5" value="0xfff000ff"/>
|
||||
<Color name="meter color6" value="0xff8800ff"/>
|
||||
<Color name="meter color7" value="0xff8800ff"/>
|
||||
<Color name="meter color8" value="0xff0000ff"/>
|
||||
<Color name="meter color9" value="0xff0000ff"/>
|
||||
</Colors>
|
||||
<ColorAliases>
|
||||
<ColorAlias name="active crossfade" alias="color 1"/>
|
||||
|
@ -481,6 +479,8 @@
|
|||
<Modifier name="audio track base" modifier="= alpha:0.4078"/>
|
||||
<Modifier name="automation track fill" modifier="= alpha:0.326156"/>
|
||||
<Modifier name="crossfade alpha" modifier="= alpha:0.1803"/>
|
||||
<Modifier name="dragging region" modifier="= alpha:0.9"/>
|
||||
<Modifier name="editable region" modifier="= alpha:0.1"/>
|
||||
<Modifier name="gain line inactive" modifier="= alpha:0.7725"/>
|
||||
<Modifier name="ghost track base" modifier="= alpha:0.640782"/>
|
||||
<Modifier name="ghost track midi fill" modifier="= alpha:0.228968"/>
|
||||
|
@ -497,7 +497,7 @@
|
|||
<Modifier name="panner fill" modifier="= alpha:0.7882"/>
|
||||
<Modifier name="piano roll black" modifier="= alpha:0.331098"/>
|
||||
<Modifier name="piano roll white" modifier="= alpha:0.4627"/>
|
||||
<Modifier name="region base" modifier="= alpha:0.99"/>
|
||||
<Modifier name="region base" modifier="= alpha:0.75"/>
|
||||
<Modifier name="selected midi note" modifier="= alpha:0.7529"/>
|
||||
<Modifier name="selection rect" modifier="= alpha:0.4666"/>
|
||||
<Modifier name="silence" modifier="= alpha:0.4784"/>
|
||||
|
|
|
@ -72,6 +72,7 @@ MOUSEMODE(MouseCut)
|
|||
MOUSEMODE(MouseTimeFX)
|
||||
MOUSEMODE(MouseAudition)
|
||||
MOUSEMODE(MouseDraw)
|
||||
MOUSEMODE(MouseContent)
|
||||
|
||||
/* Changing this order will break the menu */
|
||||
ZOOMFOCUS(ZoomFocusLeft)
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<Binding action="Region/quantize-region" key="q"/>
|
||||
<Binding action="Region/legatize-region" key="Primary-apostrophe"/>
|
||||
<Binding action="Region/remove-overlap" key="Secondary-apostrophe"/>
|
||||
<Binding action="MouseMode/toggle-internal-edit" key="e"/>
|
||||
<Binding action="MouseMode/set-mouse-mode-content" key="e"/>
|
||||
<Binding action="Editor/select-all-before-edit-cursor" key="Primary-e"/>
|
||||
<Binding action="Region/export-region" key="Primary-Level4-e"/>
|
||||
<Binding action="Main/ExportSession" key="Level4-e"/>
|
||||
|
|
|
@ -398,7 +398,6 @@ Editor::Editor ()
|
|||
|
||||
zoom_focus = ZoomFocusLeft;
|
||||
_edit_point = EditAtMouse;
|
||||
_internal_editing = false;
|
||||
current_canvas_cursor = 0;
|
||||
_visible_track_count = -1;
|
||||
|
||||
|
@ -667,6 +666,7 @@ Editor::Editor ()
|
|||
set_snap_to (_snap_type);
|
||||
_snap_mode = SnapOff;
|
||||
set_snap_mode (_snap_mode);
|
||||
previous_mouse_mode = MouseObject;
|
||||
set_mouse_mode (MouseObject, true);
|
||||
pre_internal_mouse_mode = MouseObject;
|
||||
pre_internal_snap_type = _snap_type;
|
||||
|
@ -875,7 +875,7 @@ Editor::set_entered_regionview (RegionView* rv)
|
|||
entered_regionview = rv;
|
||||
|
||||
if (entered_regionview != 0) {
|
||||
entered_regionview->entered (internal_editing ());
|
||||
entered_regionview->entered ();
|
||||
}
|
||||
|
||||
if (!_all_region_actions_sensitized && _last_region_menu_was_main) {
|
||||
|
@ -2085,7 +2085,7 @@ Editor::set_snap_mode (SnapMode mode)
|
|||
{
|
||||
string str = snap_mode_strings[(int)mode];
|
||||
|
||||
if (_internal_editing) {
|
||||
if (internal_editing()) {
|
||||
internal_snap_mode = mode;
|
||||
} else {
|
||||
pre_internal_snap_mode = mode;
|
||||
|
@ -2254,7 +2254,6 @@ Editor::set_state (const XMLNode& node, int /*version*/)
|
|||
pre_internal_snap_type = (SnapType) string_2_enum (prop->value(), pre_internal_snap_type);
|
||||
}
|
||||
|
||||
|
||||
if ((prop = node.property ("pre-internal-snap-mode"))) {
|
||||
pre_internal_snap_mode = (SnapMode) string_2_enum (prop->value(), pre_internal_snap_mode);
|
||||
}
|
||||
|
@ -2280,16 +2279,6 @@ Editor::set_state (const XMLNode& node, int /*version*/)
|
|||
reset_y_origin (atof (prop->value ()));
|
||||
}
|
||||
|
||||
if ((prop = node.property ("internal-edit"))) {
|
||||
bool yn = string_is_affirmative (prop->value());
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("MouseMode"), X_("toggle-internal-edit"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
tact->set_active (!yn);
|
||||
tact->set_active (yn);
|
||||
}
|
||||
}
|
||||
|
||||
if ((prop = node.property ("join-object-range"))) {
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-object-range"));
|
||||
bool yn = string_is_affirmative (prop->value());
|
||||
|
@ -2481,7 +2470,6 @@ Editor::get_state ()
|
|||
node->add_property ("stationary-playhead", _stationary_playhead ? "yes" : "no");
|
||||
node->add_property ("region-list-sort-type", enum_2_string (_regions->sort_type ()));
|
||||
node->add_property ("mouse-mode", enum2str(mouse_mode));
|
||||
node->add_property ("internal-edit", _internal_editing ? "yes" : "no");
|
||||
node->add_property ("join-object-range", smart_mode_action->get_active () ? "yes" : "no");
|
||||
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("show-editor-mixer"));
|
||||
|
@ -2856,7 +2844,7 @@ Editor::setup_toolbar ()
|
|||
mouse_mode_size_group->add_widget (mouse_timefx_button);
|
||||
mouse_mode_size_group->add_widget (mouse_audition_button);
|
||||
mouse_mode_size_group->add_widget (mouse_draw_button);
|
||||
mouse_mode_size_group->add_widget (internal_edit_button);
|
||||
mouse_mode_size_group->add_widget (mouse_content_button);
|
||||
|
||||
mouse_mode_size_group->add_widget (zoom_in_button);
|
||||
mouse_mode_size_group->add_widget (zoom_out_button);
|
||||
|
@ -2895,7 +2883,7 @@ Editor::setup_toolbar ()
|
|||
mouse_mode_hbox->pack_start (mouse_timefx_button, false, false);
|
||||
mouse_mode_hbox->pack_start (mouse_audition_button, false, false);
|
||||
mouse_mode_hbox->pack_start (mouse_draw_button, false, false);
|
||||
mouse_mode_hbox->pack_start (internal_edit_button, false, false, 0);
|
||||
mouse_mode_hbox->pack_start (mouse_content_button, false, false);
|
||||
}
|
||||
|
||||
mouse_mode_vbox->pack_start (*mouse_mode_hbox);
|
||||
|
@ -3186,7 +3174,7 @@ Editor::setup_tooltips ()
|
|||
ARDOUR_UI::instance()->set_tip (mouse_draw_button, _("Draw/Edit Gain/Notes/Automation"));
|
||||
ARDOUR_UI::instance()->set_tip (mouse_timefx_button, _("Stretch/Shrink Regions and MIDI Notes"));
|
||||
ARDOUR_UI::instance()->set_tip (mouse_audition_button, _("Listen to Specific Regions"));
|
||||
ARDOUR_UI::instance()->set_tip (internal_edit_button, _("Note Level Editing"));
|
||||
ARDOUR_UI::instance()->set_tip (mouse_content_button, _("Select/move contents (notes and automation)"));
|
||||
ARDOUR_UI::instance()->set_tip (*_group_tabs, _("Groups: click to (de)activate\nContext-click for other operations"));
|
||||
ARDOUR_UI::instance()->set_tip (nudge_forward_button, _("Nudge Region/Selection Later"));
|
||||
ARDOUR_UI::instance()->set_tip (nudge_backward_button, _("Nudge Region/Selection Earlier"));
|
||||
|
@ -5052,12 +5040,6 @@ Editor::add_routes (RouteList& routes)
|
|||
|
||||
rtv->effective_gain_display ();
|
||||
|
||||
if (internal_editing()) {
|
||||
rtv->enter_internal_edit_mode ();
|
||||
} else {
|
||||
rtv->leave_internal_edit_mode ();
|
||||
}
|
||||
|
||||
rtv->view()->RegionViewAdded.connect (sigc::mem_fun (*this, &Editor::region_view_added));
|
||||
rtv->view()->RegionViewRemoved.connect (sigc::mem_fun (*this, &Editor::region_view_removed));
|
||||
}
|
||||
|
|
|
@ -177,9 +177,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
Editing::MidiEditMode current_midi_edit_mode () const;
|
||||
void remove_midi_note (ArdourCanvas::Item *, GdkEvent *);
|
||||
|
||||
bool internal_editing() const { return _internal_editing ; }
|
||||
void set_internal_edit (bool yn);
|
||||
bool toggle_internal_editing_from_double_click (GdkEvent*);
|
||||
bool internal_editing() const;
|
||||
|
||||
void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
|
||||
void add_to_idle_resize (TimeAxisView*, int32_t);
|
||||
|
@ -542,12 +540,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
void set_samples_per_pixel (framecnt_t);
|
||||
|
||||
Editing::MouseMode mouse_mode;
|
||||
Editing::MouseMode previous_mouse_mode;
|
||||
Editing::MouseMode pre_internal_mouse_mode;
|
||||
Editing::SnapType pre_internal_snap_type;
|
||||
Editing::SnapMode pre_internal_snap_mode;
|
||||
Editing::SnapType internal_snap_type;
|
||||
Editing::SnapMode internal_snap_mode;
|
||||
bool _internal_editing;
|
||||
Editing::MouseMode effective_mouse_mode () const;
|
||||
|
||||
enum JoinObjectRangeState {
|
||||
|
@ -1637,6 +1635,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
ArdourButton mouse_draw_button;
|
||||
ArdourButton mouse_move_button;
|
||||
ArdourButton mouse_timefx_button;
|
||||
ArdourButton mouse_content_button;
|
||||
ArdourButton mouse_audition_button;
|
||||
ArdourButton mouse_cut_button;
|
||||
|
||||
|
@ -1647,9 +1646,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
void mouse_mode_object_range_toggled ();
|
||||
bool ignore_mouse_mode_toggle;
|
||||
|
||||
ArdourButton internal_edit_button;
|
||||
void toggle_internal_editing ();
|
||||
|
||||
bool mouse_select_button_release (GdkEventButton*);
|
||||
|
||||
Gtk::VBox automation_box;
|
||||
|
|
|
@ -476,6 +476,11 @@ Editor::register_actions ()
|
|||
mouse_timefx_button.set_image (::get_icon("tool_stretch"));
|
||||
mouse_timefx_button.set_name ("mouse mode button");
|
||||
|
||||
act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-content", _("Content Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseContent));
|
||||
mouse_content_button.set_related_action (act);
|
||||
mouse_content_button.set_image (::get_icon("tool_content"));
|
||||
mouse_content_button.set_name ("mouse mode button");
|
||||
|
||||
if(!Profile->get_mixbus()) {
|
||||
act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-cut", _("Cut Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseCut));
|
||||
mouse_cut_button.set_related_action (act);
|
||||
|
@ -485,11 +490,6 @@ Editor::register_actions ()
|
|||
|
||||
ActionManager::register_action (editor_actions, "step-mouse-mode", _("Step Mouse Mode"), sigc::bind (sigc::mem_fun(*this, &Editor::step_mouse_mode), true));
|
||||
|
||||
act = ActionManager::register_toggle_action (mouse_mode_actions, "toggle-internal-edit", _("Edit MIDI"), sigc::mem_fun(*this, &Editor::toggle_internal_editing));
|
||||
internal_edit_button.set_related_action (act);
|
||||
internal_edit_button.set_image (::get_icon("tool_note"));
|
||||
internal_edit_button.set_name ("mouse mode button");
|
||||
|
||||
RadioAction::Group edit_point_group;
|
||||
ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-playhead"), _("Playhead"), (sigc::bind (sigc::mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtPlayhead)));
|
||||
ActionManager::register_radio_action (editor_actions, edit_point_group, X_("edit-at-mouse"), _("Mouse"), (sigc::bind (sigc::mem_fun(*this, &Editor::edit_point_chosen), Editing::EditAtMouse)));
|
||||
|
@ -1758,16 +1758,6 @@ Editor::reset_canvas_action_sensitivity (bool onoff)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_internal_editing ()
|
||||
{
|
||||
Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (X_("MouseMode"), X_("toggle-internal-edit"));
|
||||
if (act) {
|
||||
Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(act);
|
||||
set_internal_edit (tact->get_active());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::register_region_actions ()
|
||||
{
|
||||
|
|
|
@ -1023,41 +1023,16 @@ Editor::which_grabber_cursor () const
|
|||
{
|
||||
Gdk::Cursor* c = _cursors->grabber;
|
||||
|
||||
if (_internal_editing) {
|
||||
switch (mouse_mode) {
|
||||
case MouseDraw:
|
||||
c = _cursors->midi_pencil;
|
||||
break;
|
||||
|
||||
case MouseObject:
|
||||
c = _cursors->grabber_note;
|
||||
break;
|
||||
|
||||
case MouseTimeFX:
|
||||
c = _cursors->midi_resize;
|
||||
break;
|
||||
|
||||
case MouseRange:
|
||||
c = _cursors->grabber_note;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
switch (_edit_point) {
|
||||
case EditAtMouse:
|
||||
c = _cursors->grabber_edit_point;
|
||||
break;
|
||||
default:
|
||||
boost::shared_ptr<Movable> m = _movable.lock();
|
||||
if (m && m->locked()) {
|
||||
c = _cursors->speaker;
|
||||
}
|
||||
break;
|
||||
switch (_edit_point) {
|
||||
case EditAtMouse:
|
||||
c = _cursors->grabber_edit_point;
|
||||
break;
|
||||
default:
|
||||
boost::shared_ptr<Movable> m = _movable.lock();
|
||||
if (m && m->locked()) {
|
||||
c = _cursors->speaker;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return c;
|
||||
|
@ -1096,9 +1071,6 @@ Editor::which_mode_cursor () const
|
|||
switch (mouse_mode) {
|
||||
case MouseRange:
|
||||
mode_cursor = _cursors->selector;
|
||||
if (_internal_editing) {
|
||||
mode_cursor = which_grabber_cursor();
|
||||
}
|
||||
break;
|
||||
|
||||
case MouseCut:
|
||||
|
@ -1106,6 +1078,7 @@ Editor::which_mode_cursor () const
|
|||
break;
|
||||
|
||||
case MouseObject:
|
||||
case MouseContent:
|
||||
/* don't use mode cursor, pick a grabber cursor based on the item */
|
||||
break;
|
||||
|
||||
|
@ -1123,7 +1096,7 @@ Editor::which_mode_cursor () const
|
|||
}
|
||||
|
||||
/* up-down cursor as a cue that automation can be dragged up and down when in join object/range mode */
|
||||
if (!_internal_editing && get_smart_mode() ) {
|
||||
if (get_smart_mode()) {
|
||||
|
||||
double x, y;
|
||||
get_pointer_position (x, y);
|
||||
|
@ -1161,18 +1134,14 @@ Editor::which_track_cursor () const
|
|||
{
|
||||
Gdk::Cursor* cursor = 0;
|
||||
|
||||
assert (mouse_mode == MouseObject || get_smart_mode());
|
||||
|
||||
if (!_internal_editing) {
|
||||
switch (_join_object_range_state) {
|
||||
case JOIN_OBJECT_RANGE_NONE:
|
||||
case JOIN_OBJECT_RANGE_OBJECT:
|
||||
cursor = which_grabber_cursor ();
|
||||
break;
|
||||
case JOIN_OBJECT_RANGE_RANGE:
|
||||
cursor = _cursors->selector;
|
||||
break;
|
||||
}
|
||||
switch (_join_object_range_state) {
|
||||
case JOIN_OBJECT_RANGE_NONE:
|
||||
case JOIN_OBJECT_RANGE_OBJECT:
|
||||
cursor = which_grabber_cursor ();
|
||||
break;
|
||||
case JOIN_OBJECT_RANGE_RANGE:
|
||||
cursor = _cursors->selector;
|
||||
break;
|
||||
}
|
||||
|
||||
return cursor;
|
||||
|
|
|
@ -221,6 +221,28 @@ Editor::mouse_mode_object_range_toggled()
|
|||
set_mouse_mode(m, true); //call this so the button styles can get updated
|
||||
}
|
||||
|
||||
static Glib::RefPtr<Action>
|
||||
get_mouse_mode_action(MouseMode m)
|
||||
{
|
||||
switch (m) {
|
||||
case MouseRange:
|
||||
return ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-range"));
|
||||
case MouseObject:
|
||||
return ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-object"));
|
||||
case MouseCut:
|
||||
return ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-cut"));
|
||||
case MouseDraw:
|
||||
return ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-draw"));
|
||||
case MouseTimeFX:
|
||||
return ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-timefx"));
|
||||
case MouseContent:
|
||||
return ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-content"));
|
||||
case MouseAudition:
|
||||
return ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-audition"));
|
||||
}
|
||||
return Glib::RefPtr<Action>();
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_mouse_mode (MouseMode m, bool force)
|
||||
{
|
||||
|
@ -236,38 +258,8 @@ Editor::set_mouse_mode (MouseMode m, bool force)
|
|||
if ( m == MouseCut) m = MouseObject;
|
||||
}
|
||||
|
||||
Glib::RefPtr<Action> act;
|
||||
|
||||
switch (m) {
|
||||
case MouseRange:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-range"));
|
||||
break;
|
||||
|
||||
case MouseCut:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-cut"));
|
||||
break;
|
||||
|
||||
case MouseObject:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-object"));
|
||||
break;
|
||||
|
||||
case MouseDraw:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-draw"));
|
||||
break;
|
||||
|
||||
case MouseTimeFX:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-timefx"));
|
||||
break;
|
||||
|
||||
case MouseAudition:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-audition"));
|
||||
break;
|
||||
}
|
||||
|
||||
assert (act);
|
||||
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
assert (tact);
|
||||
Glib::RefPtr<Action> act = get_mouse_mode_action(m);
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
/* go there and back to ensure that the toggled handler is called to set up mouse_mode */
|
||||
tact->set_active (false);
|
||||
|
@ -279,43 +271,12 @@ Editor::set_mouse_mode (MouseMode m, bool force)
|
|||
void
|
||||
Editor::mouse_mode_toggled (MouseMode m)
|
||||
{
|
||||
Glib::RefPtr<Action> act;
|
||||
Glib::RefPtr<ToggleAction> tact;
|
||||
|
||||
if (ARDOUR::Profile->get_mixbus()) {
|
||||
if ( m == MouseCut) m = MouseObject;
|
||||
}
|
||||
|
||||
switch (m) {
|
||||
case MouseRange:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-range"));
|
||||
break;
|
||||
|
||||
case MouseObject:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-object"));
|
||||
break;
|
||||
|
||||
case MouseCut:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-cut"));
|
||||
break;
|
||||
|
||||
case MouseDraw:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-draw"));
|
||||
break;
|
||||
|
||||
case MouseTimeFX:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-timefx"));
|
||||
break;
|
||||
|
||||
case MouseAudition:
|
||||
act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-audition"));
|
||||
break;
|
||||
}
|
||||
|
||||
assert (act);
|
||||
|
||||
tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
assert (tact);
|
||||
Glib::RefPtr<Action> act = get_mouse_mode_action(m);
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
|
||||
if (!tact->get_active()) {
|
||||
/* this was just the notification that the old mode has been
|
||||
|
@ -331,8 +292,29 @@ Editor::mouse_mode_toggled (MouseMode m)
|
|||
_session->request_transport_speed (0.0, true);
|
||||
}
|
||||
|
||||
if (mouse_mode == m) {
|
||||
/* switch to the same mode, act like a toggle and switch back to previous mode */
|
||||
Glib::RefPtr<Action> pact = get_mouse_mode_action(previous_mouse_mode);
|
||||
Glib::RefPtr<ToggleAction> ptact = Glib::RefPtr<ToggleAction>::cast_dynamic(pact);
|
||||
ptact->set_active(true);
|
||||
return;
|
||||
}
|
||||
|
||||
const bool was_internal = internal_editing();
|
||||
|
||||
previous_mouse_mode = mouse_mode;
|
||||
mouse_mode = m;
|
||||
|
||||
if (!was_internal && internal_editing()) {
|
||||
/* switched to internal, switch to internal snap settings */
|
||||
set_snap_to(internal_snap_type);
|
||||
set_snap_mode(internal_snap_mode);
|
||||
} else if (was_internal && !internal_editing()) {
|
||||
/* switched out of internal, switch to non-internal snap settings */
|
||||
set_snap_to(pre_internal_snap_type);
|
||||
set_snap_mode(pre_internal_snap_mode);
|
||||
}
|
||||
|
||||
instant_save ();
|
||||
|
||||
/* this should generate a new enter event which will
|
||||
|
@ -350,23 +332,53 @@ Editor::mouse_mode_toggled (MouseMode m)
|
|||
MouseModeChanged (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
bool
|
||||
Editor::internal_editing() const
|
||||
{
|
||||
return mouse_mode == Editing::MouseContent || mouse_mode == Editing::MouseDraw;
|
||||
}
|
||||
|
||||
void
|
||||
Editor::update_time_selection_display ()
|
||||
{
|
||||
switch (mouse_mode) {
|
||||
case MouseRange:
|
||||
selection->clear_objects ();
|
||||
break;
|
||||
default:
|
||||
selection->clear_time ();
|
||||
break;
|
||||
if (smart_mode_action->get_active()) {
|
||||
/* not sure what to do here */
|
||||
if (mouse_mode == MouseObject) {
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
switch (mouse_mode) {
|
||||
case MouseRange:
|
||||
selection->clear_objects ();
|
||||
selection->ClearMidiNoteSelection(); //signal
|
||||
break;
|
||||
case MouseObject:
|
||||
selection->clear_objects ();
|
||||
selection->clear_time ();
|
||||
selection->clear_tracks ();
|
||||
selection->ClearMidiNoteSelection(); //signal
|
||||
break;
|
||||
case MouseContent:
|
||||
case MouseDraw:
|
||||
//if we go into internal editing, clear everything in the outside world
|
||||
selection->clear_objects ();
|
||||
selection->clear_time ();
|
||||
selection->clear_tracks ();
|
||||
break;
|
||||
default:
|
||||
//clear everything
|
||||
selection->clear_objects ();
|
||||
selection->clear_time ();
|
||||
selection->clear_tracks ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::step_mouse_mode (bool next)
|
||||
{
|
||||
const int n_mouse_modes = (int)MouseDraw + 1;
|
||||
const int n_mouse_modes = (int)MouseContent + 1;
|
||||
int current = (int)current_mouse_mode();
|
||||
if (next) {
|
||||
set_mouse_mode((MouseMode)((current + 1) % n_mouse_modes));
|
||||
|
@ -375,22 +387,6 @@ Editor::step_mouse_mode (bool next)
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Editor::toggle_internal_editing_from_double_click (GdkEvent* event)
|
||||
{
|
||||
if (_drags->active()) {
|
||||
_drags->end_grab (event);
|
||||
}
|
||||
|
||||
ActionManager::do_action ("MouseMode", "toggle-internal-edit");
|
||||
|
||||
/* prevent reversion of edit cursor on button release */
|
||||
|
||||
pre_press_cursor = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemType item_type)
|
||||
{
|
||||
|
@ -439,9 +435,7 @@ Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemTyp
|
|||
(mouse_mode != MouseAudition || item_type != RegionItem) &&
|
||||
(mouse_mode != MouseTimeFX || item_type != RegionItem) &&
|
||||
(mouse_mode != MouseDraw)) ||
|
||||
((event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) || event->button.button > 3) ||
|
||||
(internal_editing() && mouse_mode != MouseTimeFX)) {
|
||||
|
||||
((event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) || event->button.button > 3)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -534,6 +528,8 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
them to be modeless.
|
||||
*/
|
||||
|
||||
NoteBase* note = NULL;
|
||||
|
||||
switch (item_type) {
|
||||
case PlayheadCursorItem:
|
||||
_drags->set (new CursorDrag (this, *playhead_cursor, true), event);
|
||||
|
@ -659,11 +655,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
}
|
||||
}
|
||||
|
||||
/* there is no Range mode when in internal edit mode */
|
||||
if (eff == MouseRange && internal_editing()) {
|
||||
eff = MouseObject;
|
||||
}
|
||||
|
||||
switch (eff) {
|
||||
case MouseRange:
|
||||
switch (item_type) {
|
||||
|
@ -690,19 +681,12 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
break;
|
||||
|
||||
case StreamItem:
|
||||
if (internal_editing()) {
|
||||
if (dynamic_cast<MidiTimeAxisView*> (clicked_axisview)) {
|
||||
_drags->set (new RegionCreateDrag (this, item, clicked_axisview), event);
|
||||
return true;
|
||||
}
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier)) {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionExtend), event);
|
||||
} else {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier)) {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionExtend), event);
|
||||
} else {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
|
||||
}
|
||||
return true;
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
|
||||
case RegionViewNameHighlight:
|
||||
|
@ -713,12 +697,10 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
break;
|
||||
|
||||
default:
|
||||
if (!internal_editing()) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier)) {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionExtend), event);
|
||||
} else {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
|
||||
}
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier)) {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionExtend), event);
|
||||
} else {
|
||||
_drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -744,26 +726,42 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
}
|
||||
break;
|
||||
|
||||
case MouseObject:
|
||||
case MouseContent:
|
||||
switch (item_type) {
|
||||
case NoteItem:
|
||||
/* Existing note: allow trimming/motion */
|
||||
if (internal_editing()) {
|
||||
NoteBase* cn = reinterpret_cast<NoteBase*> (item->get_data ("notebase"));
|
||||
assert (cn);
|
||||
if (cn->big_enough_to_trim() && cn->mouse_near_ends()) {
|
||||
if ((note = reinterpret_cast<NoteBase*> (item->get_data ("notebase")))) {
|
||||
if (note->big_enough_to_trim() && note->mouse_near_ends()) {
|
||||
_drags->set (new NoteResizeDrag (this, item), event, current_canvas_cursor);
|
||||
} else {
|
||||
_drags->set (new NoteDrag (this, item), event);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
case ControlPointItem:
|
||||
_drags->set (new ControlPointDrag (this, item), event);
|
||||
return true;
|
||||
break;
|
||||
|
||||
case StreamItem:
|
||||
if (dynamic_cast<MidiTimeAxisView*> (clicked_axisview)) {
|
||||
_drags->set (new RegionCreateDrag (this, item, clicked_axisview), event);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case AutomationTrackItem:
|
||||
/* rubberband drag to select automation points */
|
||||
_drags->set (new EditorRubberbandSelectDrag (this, item), event);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case MouseObject:
|
||||
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::ModifierMask(Keyboard::PrimaryModifier|Keyboard::SecondaryModifier)) &&
|
||||
event->type == GDK_BUTTON_PRESS) {
|
||||
|
||||
|
@ -813,10 +811,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
break;
|
||||
}
|
||||
|
||||
if (internal_editing ()) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* click on a normal region view */
|
||||
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::CopyModifier)) {
|
||||
add_region_copy_drag (item, event, clicked_regionview);
|
||||
|
@ -827,10 +821,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
}
|
||||
|
||||
|
||||
// if (!internal_editing() && (_join_object_range_state == JOIN_OBJECT_RANGE_RANGE && !selection->regions.empty())) {
|
||||
// _drags->add (new SelectionDrag (this, clicked_axisview->get_selection_rect (clicked_selection)->rect, SelectionDrag::SelectionMove));
|
||||
// }
|
||||
|
||||
_drags->start_grab (event);
|
||||
return true;
|
||||
break;
|
||||
|
@ -873,15 +863,8 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
break;
|
||||
|
||||
case StreamItem:
|
||||
if (internal_editing()) {
|
||||
if (dynamic_cast<MidiTimeAxisView*> (clicked_axisview)) {
|
||||
_drags->set (new RegionCreateDrag (this, item, clicked_axisview), event);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
_drags->set (new EditorRubberbandSelectDrag (this, item), event);
|
||||
}
|
||||
break;
|
||||
_drags->set (new EditorRubberbandSelectDrag (this, item), event);
|
||||
return true;
|
||||
|
||||
case AutomationTrackItem:
|
||||
{
|
||||
|
@ -965,28 +948,23 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
break;
|
||||
|
||||
case NoteItem:
|
||||
/* Existing note: allow trimming/motion */
|
||||
if (internal_editing()) {
|
||||
/* trim notes if we're in internal edit mode and near the ends of the note */
|
||||
NoteBase* cn = reinterpret_cast<NoteBase*>(item->get_data ("notebase"));
|
||||
assert (cn);
|
||||
if (cn->big_enough_to_trim() && cn->mouse_near_ends()) {
|
||||
if ((note = reinterpret_cast<NoteBase*>(item->get_data ("notebase")))) {
|
||||
if (note->big_enough_to_trim() && note->mouse_near_ends()) {
|
||||
/* Note is big and pointer is near the end, trim */
|
||||
_drags->set (new NoteResizeDrag (this, item), event, current_canvas_cursor);
|
||||
} else {
|
||||
/* Drag note */
|
||||
_drags->set (new NoteDrag (this, item), event);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
|
||||
case StreamItem:
|
||||
if (internal_editing()) {
|
||||
if (dynamic_cast<MidiTimeAxisView*> (clicked_axisview)) {
|
||||
_drags->set (new RegionCreateDrag (this, item, clicked_axisview), event);
|
||||
}
|
||||
return true;
|
||||
if (dynamic_cast<MidiTimeAxisView*> (clicked_axisview)) {
|
||||
_drags->set (new RegionCreateDrag (this, item, clicked_axisview), event);
|
||||
}
|
||||
break;
|
||||
return true;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -995,12 +973,12 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
break;
|
||||
|
||||
case MouseTimeFX:
|
||||
if (internal_editing() && item_type == NoteItem ) {
|
||||
/* drag notes if we're in internal edit mode */
|
||||
NoteBase* cn = reinterpret_cast<NoteBase*>(item->get_data ("notebase"));
|
||||
assert (cn);
|
||||
if (cn->big_enough_to_trim()) {
|
||||
_drags->set (new NoteResizeDrag (this, item), event, current_canvas_cursor);
|
||||
if (item_type == NoteItem) {
|
||||
/* resize-drag notes */
|
||||
if ((note = reinterpret_cast<NoteBase*>(item->get_data ("notebase")))) {
|
||||
if (note->big_enough_to_trim()) {
|
||||
_drags->set (new NoteResizeDrag (this, item), event, current_canvas_cursor);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (clicked_regionview) {
|
||||
|
@ -1035,11 +1013,6 @@ Editor::button_press_handler_2 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
case MouseObject:
|
||||
switch (item_type) {
|
||||
case RegionItem:
|
||||
if (internal_editing ()) {
|
||||
/* no region drags in internal edit mode */
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Keyboard::modifier_state_contains (event->button.state, Keyboard::CopyModifier)) {
|
||||
add_region_copy_drag (item, event, clicked_regionview);
|
||||
} else {
|
||||
|
@ -1065,9 +1038,7 @@ Editor::button_press_handler_2 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
|
||||
case LeftFrameHandle:
|
||||
case RightFrameHandle:
|
||||
if (!internal_editing ()) {
|
||||
_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer()), event);
|
||||
}
|
||||
_drags->set (new TrimDrag (this, item, clicked_regionview, selection->regions.by_layer()), event);
|
||||
return true;
|
||||
break;
|
||||
|
||||
|
@ -1118,48 +1089,6 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
|
|||
return true;
|
||||
}
|
||||
|
||||
if (internal_editing()) {
|
||||
bool leave_internal_edit_mode = false;
|
||||
|
||||
switch (item_type) {
|
||||
case NoteItem:
|
||||
break;
|
||||
|
||||
case RegionItem:
|
||||
if (!dynamic_cast<MidiRegionView*> (clicked_regionview) && !dynamic_cast<AutomationRegionView*> (clicked_regionview)) {
|
||||
leave_internal_edit_mode = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case PlayheadCursorItem:
|
||||
case MarkerItem:
|
||||
case TempoMarkerItem:
|
||||
case MeterMarkerItem:
|
||||
case MarkerBarItem:
|
||||
case TempoBarItem:
|
||||
case MeterBarItem:
|
||||
case RangeMarkerBarItem:
|
||||
case CdMarkerBarItem:
|
||||
case TransportMarkerBarItem:
|
||||
case StreamItem:
|
||||
case TimecodeRulerItem:
|
||||
case SamplesRulerItem:
|
||||
case MinsecRulerItem:
|
||||
case BBTRulerItem:
|
||||
/* button press on these items never does anything to
|
||||
change the editing mode.
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (leave_internal_edit_mode) {
|
||||
ActionManager::do_action ("MouseMode", "toggle-internal-edit");
|
||||
}
|
||||
}
|
||||
|
||||
button_selection (item, event, item_type);
|
||||
|
||||
if (!_drags->active () &&
|
||||
|
@ -1667,7 +1596,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
|
|||
|
||||
case FadeInHandleItem:
|
||||
case FadeInTrimHandleItem:
|
||||
if (mouse_mode == MouseObject && !internal_editing()) {
|
||||
if (mouse_mode == MouseObject) {
|
||||
ArdourCanvas::Rectangle *rect = dynamic_cast<ArdourCanvas::Rectangle *> (item);
|
||||
if (rect) {
|
||||
RegionView* rv = static_cast<RegionView*>(item->get_data ("regionview"));
|
||||
|
@ -1678,7 +1607,7 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
|
|||
|
||||
case FadeOutHandleItem:
|
||||
case FadeOutTrimHandleItem:
|
||||
if (mouse_mode == MouseObject && !internal_editing()) {
|
||||
if (mouse_mode == MouseObject) {
|
||||
ArdourCanvas::Rectangle *rect = dynamic_cast<ArdourCanvas::Rectangle *> (item);
|
||||
if (rect) {
|
||||
RegionView* rv = static_cast<RegionView*>(item->get_data ("regionview"));
|
||||
|
@ -2377,44 +2306,6 @@ Editor::escape ()
|
|||
reset_focus ();
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_internal_edit (bool yn)
|
||||
{
|
||||
if (_internal_editing == yn) {
|
||||
return;
|
||||
}
|
||||
|
||||
_internal_editing = yn;
|
||||
|
||||
if (yn) {
|
||||
pre_internal_mouse_mode = mouse_mode;
|
||||
pre_internal_snap_type = _snap_type;
|
||||
pre_internal_snap_mode = _snap_mode;
|
||||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
(*i)->enter_internal_edit_mode ();
|
||||
}
|
||||
|
||||
set_snap_to (internal_snap_type);
|
||||
set_snap_mode (internal_snap_mode);
|
||||
|
||||
} else {
|
||||
|
||||
internal_snap_mode = _snap_mode;
|
||||
internal_snap_type = _snap_type;
|
||||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
(*i)->leave_internal_edit_mode ();
|
||||
}
|
||||
|
||||
set_snap_to (pre_internal_snap_type);
|
||||
set_snap_mode (pre_internal_snap_mode);
|
||||
}
|
||||
|
||||
reset_canvas_cursor ();
|
||||
MouseModeChanged ();
|
||||
}
|
||||
|
||||
/** Update _join_object_range_state which indicate whether we are over the top
|
||||
* or bottom half of a route view, used by the `join object/range' tool
|
||||
* mode. Coordinates in canvas space.
|
||||
|
@ -2422,7 +2313,7 @@ Editor::set_internal_edit (bool yn)
|
|||
void
|
||||
Editor::update_join_object_range_location (double y)
|
||||
{
|
||||
if (_internal_editing || !get_smart_mode()) {
|
||||
if (!get_smart_mode()) {
|
||||
_join_object_range_state = JOIN_OBJECT_RANGE_NONE;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -3832,20 +3832,15 @@ Editor::cut_copy (CutCopyOp op)
|
|||
return;
|
||||
}
|
||||
|
||||
if (internal_editing()) {
|
||||
|
||||
switch (effective_mouse_mode()) {
|
||||
case MouseObject:
|
||||
case MouseRange:
|
||||
begin_reversible_command (opname + ' ' + X_("MIDI"));
|
||||
cut_copy_midi (op);
|
||||
commit_reversible_command ();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (mouse_mode) {
|
||||
case MouseDraw:
|
||||
case MouseContent:
|
||||
begin_reversible_command (opname + ' ' + X_("MIDI"));
|
||||
cut_copy_midi (op);
|
||||
commit_reversible_command ();
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
bool did_edit = false;
|
||||
|
@ -4462,46 +4457,27 @@ Editor::paste_internal (framepos_t position, float times)
|
|||
R1.A1, R1.A2, R2, R2.A1, ... */
|
||||
}
|
||||
|
||||
begin_reversible_command (Operations::paste);
|
||||
|
||||
if (ts.size() == 1 && cut_buffer->lines.size() == 1 &&
|
||||
dynamic_cast<AutomationTimeAxisView*>(ts.front())) {
|
||||
/* Only one line copied, and one automation track selected. Do a
|
||||
"greedy" paste from one automation type to another. */
|
||||
|
||||
begin_reversible_command (Operations::paste);
|
||||
|
||||
PasteContext ctx(paste_count, times, ItemCounts(), true);
|
||||
ts.front()->paste (position, *cut_buffer, ctx);
|
||||
|
||||
commit_reversible_command ();
|
||||
|
||||
} else if (internal_editing ()) {
|
||||
|
||||
/* undo/redo is handled by individual tracks/regions */
|
||||
|
||||
RegionSelection rs;
|
||||
get_regions_at (rs, position, ts);
|
||||
|
||||
PasteContext ctx(paste_count, times, ItemCounts(), false);
|
||||
for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) {
|
||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (*r);
|
||||
if (mrv) {
|
||||
mrv->paste (position, *cut_buffer, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/* we do redo (do you do voodoo?) */
|
||||
|
||||
begin_reversible_command (Operations::paste);
|
||||
/* Paste into tracks */
|
||||
|
||||
PasteContext ctx(paste_count, times, ItemCounts(), false);
|
||||
for (TrackViewList::iterator i = ts.begin(); i != ts.end(); ++i) {
|
||||
(*i)->paste (position, *cut_buffer, ctx);
|
||||
}
|
||||
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1384,7 +1384,7 @@ Editor::select_all_objects (Selection::Operation op)
|
|||
|
||||
TrackViewList ts = track_views;
|
||||
|
||||
if (_internal_editing) {
|
||||
if (internal_editing()) {
|
||||
|
||||
bool midi_selected = false;
|
||||
|
||||
|
@ -1452,7 +1452,7 @@ Editor::invert_selection ()
|
|||
{
|
||||
list<Selectable *> touched;
|
||||
|
||||
if (_internal_editing) {
|
||||
if (internal_editing()) {
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*i);
|
||||
if (mrv) {
|
||||
|
@ -1695,7 +1695,7 @@ Editor::select_all_selectables_using_cursor (EditorCursor *cursor, bool after)
|
|||
}
|
||||
}
|
||||
|
||||
if (_internal_editing) {
|
||||
if (internal_editing()) {
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*i);
|
||||
if (mrv) {
|
||||
|
@ -1748,7 +1748,7 @@ Editor::select_all_selectables_using_edit (bool after)
|
|||
}
|
||||
}
|
||||
|
||||
if (_internal_editing) {
|
||||
if (internal_editing()) {
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*i);
|
||||
mrv->select_range (start, end);
|
||||
|
@ -1791,7 +1791,7 @@ Editor::select_all_selectables_between (bool /*within*/)
|
|||
return;
|
||||
}
|
||||
|
||||
if (_internal_editing) {
|
||||
if (internal_editing()) {
|
||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*>(*i);
|
||||
mrv->select_range (start, end);
|
||||
|
|
|
@ -181,6 +181,7 @@ setup_gtk_ardour_enums ()
|
|||
REGISTER_ENUM(MouseTimeFX);
|
||||
REGISTER_ENUM(MouseAudition);
|
||||
REGISTER_ENUM(MouseCut);
|
||||
REGISTER_ENUM(MouseContent);
|
||||
REGISTER (mouse_mode);
|
||||
|
||||
}
|
||||
|
|
|
@ -216,9 +216,9 @@
|
|||
; (gtk_accel_path "<Actions>/Main/AudioFileFormat" "")
|
||||
; (gtk_accel_path "<Actions>/Transport/Transport" "")
|
||||
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-timefx" "t")
|
||||
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-content" "e")
|
||||
; (gtk_accel_path "<Actions>/RegionList/SortByRegionName" "")
|
||||
; (gtk_accel_path "<Actions>/Main/KeyMouse Actions" "")
|
||||
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-gain" "g")
|
||||
; (gtk_accel_path "<Actions>/Snap/snap-to-frame" "")
|
||||
; (gtk_accel_path "<Actions>/Editor/SnapTo" "")
|
||||
(gtk_accel_path "<Actions>/Transport/TransitionToReverse" "<@PRIMARY@>downarrow")
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 377 B |
|
@ -135,6 +135,9 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
|||
connect_to_diskstream ();
|
||||
|
||||
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
||||
|
||||
PublicEditor& editor (trackview.editor());
|
||||
editor.get_selection().ClearMidiNoteSelection.connect (_clear_midi_selection_connection, invalidator (*this), boost::bind (&MidiRegionView::clear_midi_selection, this), gui_context ());
|
||||
}
|
||||
|
||||
MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
||||
|
@ -180,6 +183,9 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Container* parent,
|
|||
connect_to_diskstream ();
|
||||
|
||||
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
||||
|
||||
PublicEditor& editor (trackview.editor());
|
||||
editor.get_selection().ClearMidiNoteSelection.connect (_clear_midi_selection_connection, invalidator (*this), boost::bind (&MidiRegionView::clear_midi_selection, this), gui_context ());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -309,10 +315,17 @@ MidiRegionView::init (bool wfd)
|
|||
boost::bind (&MidiRegionView::snap_changed, this),
|
||||
gui_context());
|
||||
|
||||
trackview.editor().MouseModeChanged.connect(_mouse_mode_connection, invalidator (*this),
|
||||
boost::bind (&MidiRegionView::mouse_mode_changed, this),
|
||||
gui_context ());
|
||||
|
||||
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&MidiRegionView::parameter_changed, this, _1), gui_context());
|
||||
connect_to_diskstream ();
|
||||
|
||||
SelectionCleared.connect (_selection_cleared_connection, invalidator (*this), boost::bind (&MidiRegionView::selection_cleared, this, _1), gui_context ());
|
||||
|
||||
PublicEditor& editor (trackview.editor());
|
||||
editor.get_selection().ClearMidiNoteSelection.connect (_clear_midi_selection_connection, invalidator (*this), boost::bind (&MidiRegionView::clear_midi_selection, this), gui_context ());
|
||||
}
|
||||
|
||||
InstrumentInfo&
|
||||
|
@ -349,7 +362,6 @@ MidiRegionView::canvas_group_event(GdkEvent* ev)
|
|||
return RegionView::canvas_group_event (ev);
|
||||
}
|
||||
|
||||
const MouseMode m = trackview.editor().current_mouse_mode();
|
||||
bool r;
|
||||
|
||||
switch (ev->type) {
|
||||
|
@ -367,15 +379,6 @@ MidiRegionView::canvas_group_event(GdkEvent* ev)
|
|||
// reset entered_regionview (among other things)
|
||||
return RegionView::canvas_group_event (ev);
|
||||
|
||||
case GDK_2BUTTON_PRESS:
|
||||
// cannot use double-click to exit internal mode if single-click is being used
|
||||
if ((m != MouseDraw) &&
|
||||
(m != MouseObject ||
|
||||
!Keyboard::modifier_state_contains (ev->button.state, Keyboard::insert_note_modifier()))) {
|
||||
return trackview.editor().toggle_internal_editing_from_double_click (ev);
|
||||
}
|
||||
break;
|
||||
|
||||
case GDK_SCROLL:
|
||||
if (scroll (&ev->scroll)) {
|
||||
return true;
|
||||
|
@ -412,10 +415,6 @@ MidiRegionView::canvas_group_event(GdkEvent* ev)
|
|||
bool
|
||||
MidiRegionView::enter_notify (GdkEventCrossing* ev)
|
||||
{
|
||||
trackview.editor().MouseModeChanged.connect (
|
||||
_mouse_mode_connection, invalidator (*this), boost::bind (&MidiRegionView::mouse_mode_changed, this), gui_context ()
|
||||
);
|
||||
|
||||
enter_internal();
|
||||
|
||||
_entered = true;
|
||||
|
@ -425,8 +424,6 @@ MidiRegionView::enter_notify (GdkEventCrossing* ev)
|
|||
bool
|
||||
MidiRegionView::leave_notify (GdkEventCrossing*)
|
||||
{
|
||||
_mouse_mode_connection.disconnect ();
|
||||
|
||||
leave_internal();
|
||||
|
||||
_entered = false;
|
||||
|
@ -436,12 +433,17 @@ MidiRegionView::leave_notify (GdkEventCrossing*)
|
|||
void
|
||||
MidiRegionView::mouse_mode_changed ()
|
||||
{
|
||||
if (trackview.editor().internal_editing()) {
|
||||
// Switched in to internal editing mode while entered
|
||||
enter_internal();
|
||||
} else {
|
||||
// Switched out of internal editing mode while entered
|
||||
leave_internal();
|
||||
// Adjust frame colour (become more transparent for internal tools)
|
||||
set_frame_color();
|
||||
|
||||
if (_entered) {
|
||||
if (trackview.editor().internal_editing()) {
|
||||
// Switched in to internal editing mode while entered
|
||||
enter_internal();
|
||||
} else {
|
||||
// Switched out of internal editing mode while entered
|
||||
leave_internal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -482,7 +484,7 @@ MidiRegionView::button_press (GdkEventButton* ev)
|
|||
Editor* editor = dynamic_cast<Editor *> (&trackview.editor());
|
||||
MouseMode m = editor->current_mouse_mode();
|
||||
|
||||
if (m == MouseObject && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier())) {
|
||||
if (m == MouseContent && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier())) {
|
||||
pre_press_cursor = editor->get_canvas_cursor ();
|
||||
editor->set_canvas_cursor (editor->cursors()->midi_pencil);
|
||||
}
|
||||
|
@ -531,7 +533,7 @@ MidiRegionView::button_release (GdkEventButton* ev)
|
|||
clear_selection ();
|
||||
break;
|
||||
|
||||
case MouseObject:
|
||||
case MouseContent:
|
||||
case MouseTimeFX:
|
||||
{
|
||||
clear_selection();
|
||||
|
@ -596,18 +598,18 @@ MidiRegionView::motion (GdkEventMotion* ev)
|
|||
{
|
||||
PublicEditor& editor = trackview.editor ();
|
||||
|
||||
if (!_ghost_note && editor.current_mouse_mode() == MouseObject &&
|
||||
if (!_ghost_note && editor.current_mouse_mode() == MouseContent &&
|
||||
Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()) &&
|
||||
_mouse_state != AddDragging) {
|
||||
|
||||
create_ghost_note (ev->x, ev->y);
|
||||
|
||||
} else if (_ghost_note && editor.current_mouse_mode() == MouseObject &&
|
||||
} else if (_ghost_note && editor.current_mouse_mode() == MouseContent &&
|
||||
Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier())) {
|
||||
|
||||
update_ghost_note (ev->x, ev->y);
|
||||
|
||||
} else if (_ghost_note && editor.current_mouse_mode() == MouseObject) {
|
||||
} else if (_ghost_note && editor.current_mouse_mode() == MouseContent) {
|
||||
|
||||
remove_ghost_note ();
|
||||
editor.verbose_cursor()->hide ();
|
||||
|
@ -630,13 +632,13 @@ MidiRegionView::motion (GdkEventMotion* ev)
|
|||
|
||||
MouseMode m = editor.current_mouse_mode();
|
||||
|
||||
if (m == MouseDraw || (m == MouseObject && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()))) {
|
||||
if (m == MouseDraw || (m == MouseContent && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()))) {
|
||||
editor.drags()->set (new NoteCreateDrag (dynamic_cast<Editor *> (&editor), group, this), (GdkEvent *) ev);
|
||||
_mouse_state = AddDragging;
|
||||
remove_ghost_note ();
|
||||
editor.verbose_cursor()->hide ();
|
||||
return true;
|
||||
} else if (m == MouseObject) {
|
||||
} else if (m == MouseContent) {
|
||||
editor.drags()->set (new MidiRubberbandSelectDrag (dynamic_cast<Editor *> (&editor), this), (GdkEvent *) ev);
|
||||
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
|
||||
clear_selection ();
|
||||
|
@ -3257,7 +3259,7 @@ MidiRegionView::note_mouse_position (float x_fraction, float /*y_fraction*/, boo
|
|||
{
|
||||
Editor* editor = dynamic_cast<Editor*>(&trackview.editor());
|
||||
Editing::MouseMode mm = editor->current_mouse_mode();
|
||||
bool trimmable = (mm == MouseObject || mm == MouseTimeFX || mm == MouseDraw);
|
||||
bool trimmable = (mm == MouseContent || mm == MouseTimeFX || mm == MouseDraw);
|
||||
|
||||
if (can_set_cursor) {
|
||||
if (trimmable && x_fraction > 0.0 && x_fraction < 0.2) {
|
||||
|
@ -3270,30 +3272,18 @@ MidiRegionView::note_mouse_position (float x_fraction, float /*y_fraction*/, boo
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
MidiRegionView::set_frame_color()
|
||||
uint32_t
|
||||
MidiRegionView::get_fill_color() const
|
||||
{
|
||||
uint32_t f;
|
||||
|
||||
TimeAxisViewItem::set_frame_color ();
|
||||
|
||||
if (!frame) {
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string mod_name = (_dragging ? "dragging region" :
|
||||
trackview.editor().internal_editing() ? "editable region" :
|
||||
"midi frame base");
|
||||
if (_selected) {
|
||||
f = ARDOUR_UI::config()->color ("selected region base");
|
||||
return ARDOUR_UI::config()->color_mod ("selected region base", mod_name);
|
||||
} else if (high_enough_for_name || !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
|
||||
f = ARDOUR_UI::config()->color_mod ("midi frame base", "midi frame base");
|
||||
} else {
|
||||
f = fill_color;
|
||||
return ARDOUR_UI::config()->color_mod ("midi frame base", mod_name);
|
||||
}
|
||||
|
||||
if (!rect_visible) {
|
||||
f = UINT_RGBA_CHANGE_A (f, 80);
|
||||
}
|
||||
|
||||
frame->set_fill_color (f);
|
||||
return ARDOUR_UI::config()->color_mod (fill_color, mod_name);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3383,8 +3373,6 @@ MidiRegionView::selection_as_cut_buffer () const
|
|||
bool
|
||||
MidiRegionView::paste (framepos_t pos, const ::Selection& selection, PasteContext& ctx)
|
||||
{
|
||||
trackview.session()->begin_reversible_command (Operations::paste);
|
||||
|
||||
// Paste notes, if available
|
||||
MidiNoteSelection::const_iterator m = selection.midi_notes.get_nth(ctx.counts.n_notes());
|
||||
if (m != selection.midi_notes.end()) {
|
||||
|
@ -3399,8 +3387,6 @@ MidiRegionView::paste (framepos_t pos, const ::Selection& selection, PasteContex
|
|||
a->second->paste(pos, selection, ctx);
|
||||
}
|
||||
|
||||
trackview.session()->commit_reversible_command ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public:
|
|||
|
||||
inline ARDOUR::ColorMode color_mode() const { return midi_view()->color_mode(); }
|
||||
|
||||
void set_frame_color();
|
||||
uint32_t get_fill_color() const;
|
||||
void color_handler ();
|
||||
|
||||
void show_step_edit_cursor (Evoral::MusicalTime pos);
|
||||
|
@ -354,6 +354,11 @@ private:
|
|||
PBD::ScopedConnection _selection_cleared_connection;
|
||||
void selection_cleared (MidiRegionView *);
|
||||
|
||||
/** this handles the case when the "external" world wants us to clear our internal selections
|
||||
*/
|
||||
PBD::ScopedConnection _clear_midi_selection_connection;
|
||||
void clear_midi_selection () { clear_selection(); }
|
||||
|
||||
friend class EditNoteDialog;
|
||||
|
||||
/** Play the NoteOn event of the given note immediately
|
||||
|
|
|
@ -145,12 +145,6 @@ MidiStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wait
|
|||
|
||||
region_views.push_front (region_view);
|
||||
|
||||
if (_trackview.editor().internal_editing()) {
|
||||
region_view->hide_rect ();
|
||||
} else {
|
||||
region_view->show_rect ();
|
||||
}
|
||||
|
||||
/* display events and find note range */
|
||||
display_region (region_view, wait_for_data);
|
||||
|
||||
|
@ -677,14 +671,40 @@ MidiStreamView::resume_updates ()
|
|||
_canvas_group->redraw ();
|
||||
}
|
||||
|
||||
void
|
||||
MidiStreamView::leave_internal_edit_mode ()
|
||||
{
|
||||
StreamView::leave_internal_edit_mode ();
|
||||
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (*i);
|
||||
if (mrv) {
|
||||
mrv->clear_selection ();
|
||||
}
|
||||
struct RegionPositionSorter {
|
||||
bool operator() (RegionView* a, RegionView* b) {
|
||||
return a->region()->position() < b->region()->position();
|
||||
}
|
||||
};
|
||||
|
||||
bool
|
||||
MidiStreamView::paste (ARDOUR::framepos_t pos, const Selection& selection, PasteContext& ctx)
|
||||
{
|
||||
/* Paste into the first region which starts on or before pos. Only called when
|
||||
using an internal editing tool. */
|
||||
|
||||
if (region_views.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
region_views.sort (RegionView::PositionOrder());
|
||||
|
||||
list<RegionView*>::const_iterator prev = region_views.begin ();
|
||||
|
||||
for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
if ((*i)->region()->position() > pos) {
|
||||
break;
|
||||
}
|
||||
prev = i;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Region> r = (*prev)->region ();
|
||||
|
||||
/* If *prev doesn't cover pos, it's no good */
|
||||
if (r->position() > pos || ((r->position() + r->length()) < pos)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (*prev);
|
||||
return mrv ? mrv->paste(pos, selection, ctx) : false;
|
||||
}
|
||||
|
|
|
@ -79,8 +79,6 @@ class MidiStreamView : public StreamView
|
|||
|
||||
void redisplay_track ();
|
||||
|
||||
void leave_internal_edit_mode ();
|
||||
|
||||
inline double contents_height() const
|
||||
{ return (child_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2); }
|
||||
|
||||
|
@ -100,6 +98,8 @@ class MidiStreamView : public StreamView
|
|||
|
||||
RegionView* create_region_view (boost::shared_ptr<ARDOUR::Region>, bool, bool);
|
||||
|
||||
bool paste (ARDOUR::framepos_t pos, const Selection& selection, PasteContext& ctx);
|
||||
|
||||
void apply_note_range(uint8_t lowest, uint8_t highest, bool to_region_views);
|
||||
|
||||
void suspend_updates ();
|
||||
|
|
|
@ -404,22 +404,6 @@ MidiTimeAxisView::~MidiTimeAxisView ()
|
|||
delete _step_editor;
|
||||
}
|
||||
|
||||
void
|
||||
MidiTimeAxisView::enter_internal_edit_mode ()
|
||||
{
|
||||
if (midi_view()) {
|
||||
midi_view()->enter_internal_edit_mode ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MidiTimeAxisView::leave_internal_edit_mode ()
|
||||
{
|
||||
if (midi_view()) {
|
||||
midi_view()->leave_internal_edit_mode ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MidiTimeAxisView::check_step_edit ()
|
||||
{
|
||||
|
@ -1322,10 +1306,6 @@ MidiTimeAxisView::route_active_changed ()
|
|||
void
|
||||
MidiTimeAxisView::set_note_selection (uint8_t note)
|
||||
{
|
||||
if (!_editor.internal_editing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint16_t chn_mask = midi_track()->get_playback_channel_mask();
|
||||
|
||||
if (_view->num_selected_regionviews() == 0) {
|
||||
|
@ -1342,10 +1322,6 @@ MidiTimeAxisView::set_note_selection (uint8_t note)
|
|||
void
|
||||
MidiTimeAxisView::add_note_selection (uint8_t note)
|
||||
{
|
||||
if (!_editor.internal_editing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const uint16_t chn_mask = midi_track()->get_playback_channel_mask();
|
||||
|
||||
if (_view->num_selected_regionviews() == 0) {
|
||||
|
@ -1362,10 +1338,6 @@ MidiTimeAxisView::add_note_selection (uint8_t note)
|
|||
void
|
||||
MidiTimeAxisView::extend_note_selection (uint8_t note)
|
||||
{
|
||||
if (!_editor.internal_editing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const uint16_t chn_mask = midi_track()->get_playback_channel_mask();
|
||||
|
||||
if (_view->num_selected_regionviews() == 0) {
|
||||
|
@ -1382,10 +1354,6 @@ MidiTimeAxisView::extend_note_selection (uint8_t note)
|
|||
void
|
||||
MidiTimeAxisView::toggle_note_selection (uint8_t note)
|
||||
{
|
||||
if (!_editor.internal_editing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const uint16_t chn_mask = midi_track()->get_playback_channel_mask();
|
||||
|
||||
if (_view->num_selected_regionviews() == 0) {
|
||||
|
@ -1615,3 +1583,14 @@ MidiTimeAxisView::capture_channel_mode_changed ()
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
MidiTimeAxisView::paste (framepos_t pos, const Selection& selection, PasteContext& ctx)
|
||||
{
|
||||
if (!_editor.internal_editing()) {
|
||||
// Non-internal paste, paste regions like any other route
|
||||
return RouteTimeAxisView::paste(pos, selection, ctx);
|
||||
}
|
||||
|
||||
return midi_view()->paste(pos, selection, ctx);
|
||||
}
|
||||
|
|
|
@ -75,15 +75,14 @@ class MidiTimeAxisView : public RouteTimeAxisView
|
|||
|
||||
void set_height (uint32_t);
|
||||
|
||||
void enter_internal_edit_mode ();
|
||||
void leave_internal_edit_mode ();
|
||||
|
||||
boost::shared_ptr<ARDOUR::MidiRegion> add_region (ARDOUR::framepos_t, ARDOUR::framecnt_t, bool);
|
||||
|
||||
void show_all_automation (bool apply_to_selection = false);
|
||||
void show_existing_automation (bool apply_to_selection = false);
|
||||
void create_automation_child (const Evoral::Parameter& param, bool show);
|
||||
|
||||
bool paste (ARDOUR::framepos_t, const Selection&, PasteContext& ctx);
|
||||
|
||||
ARDOUR::NoteMode note_mode() const { return _note_mode; }
|
||||
ARDOUR::ColorMode color_mode() const { return _color_mode; }
|
||||
|
||||
|
|
|
@ -137,7 +137,6 @@ This mode provides many different operations on both regions and control points,
|
|||
|
||||
;; note that ctrl-w is special and consumed by the keyboard snooper
|
||||
|
||||
@mmode|MouseMode/toggle-internal-edit|e|toggle MIDI note editing
|
||||
@select|Editor/select-all-before-edit-cursor|<@PRIMARY@>e|select all before EP
|
||||
@rop|Region/export-region|<@PRIMARY@><@LEVEL4@>e|export selected region(s)
|
||||
@sess|Main/ExportSession|<@LEVEL4@>e|export session
|
||||
|
@ -160,6 +159,7 @@ This mode provides many different operations on both regions and control points,
|
|||
@sess|Editor/addExistingAudioFiles|<@PRIMARY@>i|import audio files
|
||||
@sess|Editor/toggle-midi-input-active|<@SECONDARY@>i|toggle sel. track MIDI input
|
||||
@mmode|MouseMode/set-mouse-mode-object|o|object mode
|
||||
@mmode|MouseMode/set-mouse-mode-content|e|content mode
|
||||
@sess|Main/Open|<@PRIMARY@>o|open an existing session
|
||||
@sess|Main/Recent|<@PRIMARY@><@TERTIARY@>o|open a recent session
|
||||
@wvis|Window/toggle-session-options-editor|<@WINDOW@>o|toggle preferences dialog
|
||||
|
|
|
@ -254,7 +254,8 @@ NoteBase::set_mouse_fractions (GdkEvent* ev)
|
|||
bool
|
||||
NoteBase::event_handler (GdkEvent* ev)
|
||||
{
|
||||
if (!_region.get_time_axis_view().editor().internal_editing()) {
|
||||
PublicEditor& editor = _region.get_time_axis_view().editor();
|
||||
if (!editor.internal_editing()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -276,7 +277,7 @@ NoteBase::event_handler (GdkEvent* ev)
|
|||
case GDK_BUTTON_PRESS:
|
||||
set_mouse_fractions (ev);
|
||||
if (ev->button.button == 3 && Keyboard::no_modifiers_active (ev->button.state) && _selected) {
|
||||
_region.get_time_axis_view().editor().edit_notes (_region);
|
||||
editor.edit_notes (_region);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
@ -292,7 +293,7 @@ NoteBase::event_handler (GdkEvent* ev)
|
|||
break;
|
||||
}
|
||||
|
||||
return _region.get_time_axis_view().editor().canvas_note_event (ev, _item);
|
||||
return editor.canvas_note_event (ev, _item);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -173,25 +173,8 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
|
|||
*/
|
||||
virtual Editing::MouseMode current_mouse_mode () const = 0;
|
||||
|
||||
/** Switch into a mode in which editing is primarily focused on "within" regions,
|
||||
rather than regions as black-box objects. For Ardour3, this is aimed at
|
||||
editing MIDI regions but may expand in the future to other types of regions.
|
||||
*/
|
||||
|
||||
virtual void set_internal_edit (bool yn) = 0;
|
||||
|
||||
/** Driven by a double-click, switch in or out of a mode in which
|
||||
editing is primarily focused on "within" regions, rather than
|
||||
regions as black-box objects. For Ardour3, this is aimed at editing
|
||||
MIDI regions but may expand in the future to other types of
|
||||
regions.
|
||||
*/
|
||||
|
||||
virtual bool toggle_internal_editing_from_double_click (GdkEvent*) = 0;
|
||||
|
||||
/** @return Whether editing is currently in "internal" mode or not
|
||||
/** @return Whether the current mouse mode is an "internal" editing mode.
|
||||
*/
|
||||
|
||||
virtual bool internal_editing() const = 0;
|
||||
|
||||
/** Possibly start the audition of a region. If @param r is 0, or not an AudioRegion
|
||||
|
@ -251,6 +234,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
|
|||
virtual void copy_playlists (TimeAxisView*) = 0;
|
||||
virtual void clear_playlists (TimeAxisView*) = 0;
|
||||
virtual void select_all_tracks () = 0;
|
||||
virtual void deselect_all () = 0;
|
||||
virtual void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
|
||||
virtual void set_selected_mixer_strip (TimeAxisView&) = 0;
|
||||
virtual void hide_track_in_display (TimeAxisView* tv, bool apply_to_selection = false) = 0;
|
||||
|
|
|
@ -511,18 +511,6 @@ RegionView::set_duration (framecnt_t frames, void *src)
|
|||
return true;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
RegionView::fill_opacity () const
|
||||
{
|
||||
if (!_region->opaque()) {
|
||||
return 60;
|
||||
}
|
||||
|
||||
uint32_t normal_tavi_opacity = TimeAxisViewItem::fill_opacity ();
|
||||
|
||||
return normal_tavi_opacity;
|
||||
}
|
||||
|
||||
void
|
||||
RegionView::set_colors ()
|
||||
{
|
||||
|
@ -535,10 +523,14 @@ RegionView::set_colors ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
RegionView::set_frame_color ()
|
||||
uint32_t
|
||||
RegionView::get_fill_color () const
|
||||
{
|
||||
TimeAxisViewItem::set_frame_color ();
|
||||
uint32_t f = TimeAxisViewItem::get_fill_color();
|
||||
if (_region->opaque()) {
|
||||
f = UINT_RGBA_CHANGE_A (f, 255);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -85,11 +85,13 @@ class RegionView : public TimeAxisViewItem
|
|||
|
||||
virtual void region_changed (const PBD::PropertyChange&);
|
||||
|
||||
uint32_t get_fill_color () const;
|
||||
|
||||
virtual GhostRegion* add_ghost (TimeAxisView&) = 0;
|
||||
void remove_ghost_in (TimeAxisView&);
|
||||
void remove_ghost (GhostRegion*);
|
||||
|
||||
virtual void entered (bool) {}
|
||||
virtual void entered () {}
|
||||
virtual void exited () {}
|
||||
|
||||
virtual void enable_display(bool yn) { _enable_display = yn; }
|
||||
|
@ -113,6 +115,12 @@ class RegionView : public TimeAxisViewItem
|
|||
void drop_silent_frames ();
|
||||
void hide_silent_frames ();
|
||||
|
||||
struct PositionOrder {
|
||||
bool operator()(const RegionView* a, const RegionView* b) {
|
||||
return a->region()->position() < b->region()->position();
|
||||
}
|
||||
};
|
||||
|
||||
ARDOUR::frameoffset_t snap_frame_to_frame (ARDOUR::frameoffset_t) const;
|
||||
|
||||
protected:
|
||||
|
@ -143,11 +151,8 @@ class RegionView : public TimeAxisViewItem
|
|||
void lock_toggle ();
|
||||
|
||||
virtual void set_colors ();
|
||||
virtual void set_frame_color ();
|
||||
virtual void reset_width_dependent_items (double pixel_width);
|
||||
|
||||
uint32_t fill_opacity () const;
|
||||
|
||||
virtual void color_handler () {}
|
||||
|
||||
boost::shared_ptr<ARDOUR::Region> _region;
|
||||
|
|
|
@ -173,6 +173,9 @@ Selection::clear_midi_notes ()
|
|||
midi_notes.clear ();
|
||||
MidiNotesChanged ();
|
||||
}
|
||||
|
||||
//the MIDI note selections are actually stored in a per-MRV selection object. so this tells them to clear their selections:
|
||||
ClearMidiNoteSelection(); //signal
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -198,6 +198,8 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
|
|||
* The Track selection isn't affected when ranges or objects are added.
|
||||
*/
|
||||
|
||||
void clear_all() { clear_time(); clear_tracks(); clear_objects(); }
|
||||
|
||||
void clear_time(); //clears any time selection ( i.e. Range )
|
||||
void clear_tracks (); //clears the track header selections
|
||||
void clear_objects(); //clears the items listed below
|
||||
|
@ -219,6 +221,8 @@ class Selection : public sigc::trackable, public PBD::ScopedConnectionList
|
|||
XMLNode& get_state () const;
|
||||
int set_state (XMLNode const &, int);
|
||||
|
||||
PBD::Signal0<void> ClearMidiNoteSelection;
|
||||
|
||||
private:
|
||||
PublicEditor const * editor;
|
||||
uint32_t next_time_id;
|
||||
|
|
|
@ -675,19 +675,3 @@ StreamView::setup_new_rec_layer_time (boost::shared_ptr<Region> region)
|
|||
_new_rec_layer_time = max_framepos;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
StreamView::enter_internal_edit_mode ()
|
||||
{
|
||||
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
(*i)->hide_rect ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
StreamView::leave_internal_edit_mode ()
|
||||
{
|
||||
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
(*i)->show_rect ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,9 +76,6 @@ public:
|
|||
virtual int set_samples_per_pixel (double);
|
||||
gdouble get_samples_per_pixel () const { return _samples_per_pixel; }
|
||||
|
||||
virtual void enter_internal_edit_mode ();
|
||||
virtual void leave_internal_edit_mode ();
|
||||
|
||||
void set_layer_display (LayerDisplay);
|
||||
LayerDisplay layer_display () const { return _layer_display; }
|
||||
|
||||
|
|
|
@ -106,9 +106,6 @@ class TimeAxisView : public virtual AxisView
|
|||
/** @return maximum allowable value of order */
|
||||
static int max_order () { return _max_order; }
|
||||
|
||||
virtual void enter_internal_edit_mode () {}
|
||||
virtual void leave_internal_edit_mode () {}
|
||||
|
||||
ArdourCanvas::Container* canvas_display () { return _canvas_display; }
|
||||
ArdourCanvas::Container* ghost_group () { return _ghost_group; }
|
||||
|
||||
|
|
|
@ -184,7 +184,6 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
|
|||
last_item_width = 0;
|
||||
wide_enough_for_name = wide;
|
||||
high_enough_for_name = high;
|
||||
rect_visible = true;
|
||||
vestigial_frame = 0;
|
||||
|
||||
if (duration == 0) {
|
||||
|
@ -287,30 +286,6 @@ TimeAxisViewItem::canvas_group_event (GdkEvent* /*ev*/)
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
TimeAxisViewItem::hide_rect ()
|
||||
{
|
||||
rect_visible = false;
|
||||
set_frame_color ();
|
||||
|
||||
if (name_highlight) {
|
||||
name_highlight->set_outline_what (ArdourCanvas::Rectangle::What (0));
|
||||
name_highlight->set_fill_color (UINT_RGBA_CHANGE_A (fill_color, 64));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TimeAxisViewItem::show_rect ()
|
||||
{
|
||||
rect_visible = true;
|
||||
set_frame_color ();
|
||||
|
||||
if (name_highlight) {
|
||||
name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
|
||||
name_highlight->set_fill_color (fill_color);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the position of this item on the timeline.
|
||||
*
|
||||
|
@ -716,56 +691,30 @@ TimeAxisViewItem::set_name_text_color ()
|
|||
name_text->set_color (ArdourCanvas::contrasting_text_color (f));
|
||||
}
|
||||
|
||||
uint32_t
|
||||
TimeAxisViewItem::fill_opacity () const
|
||||
{
|
||||
if (!rect_visible) {
|
||||
/* if the frame/rect is marked as "invisible", then the
|
||||
fill should be translucent.parent.
|
||||
*/
|
||||
return 64;
|
||||
}
|
||||
|
||||
if (_dragging) {
|
||||
return 130;
|
||||
}
|
||||
|
||||
uint32_t col = ARDOUR_UI::config()->color_mod (_fill_color_name, _fill_color_name);
|
||||
return UINT_RGBA_A (col);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
TimeAxisViewItem::get_fill_color () const
|
||||
{
|
||||
uint32_t f;
|
||||
uint32_t o = fill_opacity ();
|
||||
|
||||
const std::string mod_name = (_dragging ? "dragging region" : _fill_color_name);
|
||||
if (_selected) {
|
||||
|
||||
f = ARDOUR_UI::config()->color ("selected region base");
|
||||
f = ARDOUR_UI::config()->color_mod ("selected region base", mod_name);
|
||||
|
||||
if (o == 0) {
|
||||
/* some condition of this item has set fill opacity to
|
||||
* zero, but it has been selected, so use a mid-way
|
||||
* alpha value to make it reasonably visible.
|
||||
*/
|
||||
o = 130;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (_recregion) {
|
||||
f = ARDOUR_UI::config()->color ("recording rect");
|
||||
} else {
|
||||
if ((!Config->get_show_name_highlight() || high_enough_for_name) && !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
|
||||
f = ARDOUR_UI::config()->color_mod (_fill_color_name, _fill_color_name);
|
||||
f = ARDOUR_UI::config()->color_mod (_fill_color_name, mod_name);
|
||||
} else {
|
||||
f = fill_color;
|
||||
f = ARDOUR_UI::config()->color_mod (fill_color, mod_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return UINT_RGBA_CHANGE_A (f, o);
|
||||
return f;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -782,14 +731,7 @@ TimeAxisViewItem::set_frame_color()
|
|||
set_frame_gradient ();
|
||||
|
||||
if (!_recregion) {
|
||||
uint32_t f = ARDOUR_UI::config()->color ("time axis frame");
|
||||
|
||||
if (!rect_visible) {
|
||||
/* make the frame outline be visible but rather transparent */
|
||||
f = UINT_RGBA_CHANGE_A (f, 64);
|
||||
}
|
||||
|
||||
frame->set_outline_color (f);
|
||||
frame->set_outline_color (ARDOUR_UI::config()->color ("time axis frame"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -857,13 +799,10 @@ TimeAxisViewItem::frame_handle_crossing (GdkEvent* ev, ArdourCanvas::Rectangle*
|
|||
item->set_fill (false);
|
||||
break;
|
||||
case GDK_ENTER_NOTIFY:
|
||||
if (trackview.editor().effective_mouse_mode() == Editing::MouseObject &&
|
||||
!trackview.editor().internal_editing()) {
|
||||
/* never set this to be visible in internal
|
||||
edit mode. Note, however, that we do need to
|
||||
undo visibility (LEAVE_NOTIFY case above) no
|
||||
matter what the mode is.
|
||||
*/
|
||||
if (trackview.editor().effective_mouse_mode() == Editing::MouseObject) {
|
||||
/* Never set this to be visible in other modes. Note, however,
|
||||
that we do need to undo visibility (LEAVE_NOTIFY case above) no
|
||||
matter what the mode is. */
|
||||
item->set_fill (true);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -76,7 +76,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
|
|||
void set_color (uint32_t);
|
||||
void set_name_text_color ();
|
||||
|
||||
uint32_t get_fill_color () const;
|
||||
virtual uint32_t get_fill_color () const;
|
||||
|
||||
ArdourCanvas::Item* get_canvas_frame();
|
||||
ArdourCanvas::Item* get_canvas_group();
|
||||
|
@ -95,9 +95,6 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
|
|||
virtual void lower () { return; }
|
||||
virtual void lower_to_bottom () { return; }
|
||||
|
||||
virtual void hide_rect ();
|
||||
virtual void show_rect ();
|
||||
|
||||
/** @return true if the name area should respond to events */
|
||||
bool name_active() const { return name_connected; }
|
||||
|
||||
|
@ -218,13 +215,10 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
|
|||
|
||||
uint32_t fill_color;
|
||||
|
||||
virtual uint32_t fill_opacity() const;
|
||||
|
||||
uint32_t last_item_width;
|
||||
int name_text_width;
|
||||
bool wide_enough_for_name;
|
||||
bool high_enough_for_name;
|
||||
bool rect_visible;
|
||||
|
||||
ArdourCanvas::Container* group;
|
||||
ArdourCanvas::Rectangle* vestigial_frame;
|
||||
|
|
|
@ -243,51 +243,40 @@ TimeInfoBox::selection_changed ()
|
|||
|
||||
switch (Editor::instance().current_mouse_mode()) {
|
||||
|
||||
case Editing::MouseContent:
|
||||
/* displaying MIDI note selection is tricky */
|
||||
selection_start->set_off (true);
|
||||
selection_end->set_off (true);
|
||||
selection_length->set_off (true);
|
||||
break;
|
||||
|
||||
case Editing::MouseObject:
|
||||
if (Editor::instance().internal_editing()) {
|
||||
/* displaying MIDI note selection is tricky */
|
||||
|
||||
selection_start->set_off (true);
|
||||
selection_end->set_off (true);
|
||||
selection_length->set_off (true);
|
||||
if (selection.regions.empty()) {
|
||||
if (selection.points.empty()) {
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("MouseMode", "set-mouse-mode-object-range");
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
|
||||
} else {
|
||||
if (selection.regions.empty()) {
|
||||
if (selection.points.empty()) {
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action ("MouseMode", "set-mouse-mode-object-range");
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
||||
|
||||
if (tact && tact->get_active() && !selection.time.empty()) {
|
||||
/* show selected range */
|
||||
selection_start->set_off (false);
|
||||
selection_end->set_off (false);
|
||||
selection_length->set_off (false);
|
||||
selection_start->set (selection.time.start());
|
||||
selection_end->set (selection.time.end_frame());
|
||||
selection_length->set (selection.time.length());
|
||||
} else {
|
||||
selection_start->set_off (true);
|
||||
selection_end->set_off (true);
|
||||
selection_length->set_off (true);
|
||||
}
|
||||
} else {
|
||||
s = max_framepos;
|
||||
e = 0;
|
||||
for (PointSelection::iterator i = selection.points.begin(); i != selection.points.end(); ++i) {
|
||||
framepos_t const p = (*i)->line().session_position ((*i)->model ());
|
||||
s = min (s, p);
|
||||
e = max (e, p);
|
||||
}
|
||||
if (tact && tact->get_active() && !selection.time.empty()) {
|
||||
/* show selected range */
|
||||
selection_start->set_off (false);
|
||||
selection_end->set_off (false);
|
||||
selection_length->set_off (false);
|
||||
selection_start->set (s);
|
||||
selection_end->set (e);
|
||||
selection_length->set (e - s + 1);
|
||||
selection_start->set (selection.time.start());
|
||||
selection_end->set (selection.time.end_frame());
|
||||
selection_length->set (selection.time.length());
|
||||
} else {
|
||||
selection_start->set_off (true);
|
||||
selection_end->set_off (true);
|
||||
selection_length->set_off (true);
|
||||
}
|
||||
} else {
|
||||
s = selection.regions.start();
|
||||
e = selection.regions.end_frame();
|
||||
s = max_framepos;
|
||||
e = 0;
|
||||
for (PointSelection::iterator i = selection.points.begin(); i != selection.points.end(); ++i) {
|
||||
framepos_t const p = (*i)->line().session_position ((*i)->model ());
|
||||
s = min (s, p);
|
||||
e = max (e, p);
|
||||
}
|
||||
selection_start->set_off (false);
|
||||
selection_end->set_off (false);
|
||||
selection_length->set_off (false);
|
||||
|
@ -295,6 +284,15 @@ TimeInfoBox::selection_changed ()
|
|||
selection_end->set (e);
|
||||
selection_length->set (e - s + 1);
|
||||
}
|
||||
} else {
|
||||
s = selection.regions.start();
|
||||
e = selection.regions.end_frame();
|
||||
selection_start->set_off (false);
|
||||
selection_end->set_off (false);
|
||||
selection_length->set_off (false);
|
||||
selection_start->set (s);
|
||||
selection_end->set (e);
|
||||
selection_length->set (e - s + 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<accelerator action='set-mouse-mode-draw'/>
|
||||
<accelerator action='set-mouse-mode-zoom'/>
|
||||
<accelerator action='set-mouse-mode-timefx'/>
|
||||
<accelerator action='set-mouse-mode-content'/>
|
||||
<accelerator action='set-mouse-mode-object-range'/>
|
||||
<accelerator action='toggle-internal-edit'/>
|
||||
<accelerator action='focus-on-clock'/>
|
||||
<accelerator action='track-solo-toggle'/>
|
||||
<accelerator action='track-mute-toggle'/>
|
||||
|
|
Loading…
Reference in New Issue