mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Fix some evil "tabs".
Switch canvas cursor for MIDI tools. Fix delete tool bug (touch delete always on). git-svn-id: svn://localhost/ardour2/trunk@2287 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
1ead67fbd7
commit
f32a6d0f04
5 changed files with 87 additions and 63 deletions
|
|
@ -152,7 +152,9 @@ Gdk::Cursor* Editor::zoom_cursor = 0;
|
||||||
Gdk::Cursor* Editor::time_fx_cursor = 0;
|
Gdk::Cursor* Editor::time_fx_cursor = 0;
|
||||||
Gdk::Cursor* Editor::fader_cursor = 0;
|
Gdk::Cursor* Editor::fader_cursor = 0;
|
||||||
Gdk::Cursor* Editor::speaker_cursor = 0;
|
Gdk::Cursor* Editor::speaker_cursor = 0;
|
||||||
Gdk::Cursor* Editor::note_cursor = 0;
|
Gdk::Cursor* Editor::midi_select_cursor = 0;
|
||||||
|
Gdk::Cursor* Editor::midi_pencil_cursor = 0;
|
||||||
|
Gdk::Cursor* Editor::midi_erase_cursor = 0;
|
||||||
Gdk::Cursor* Editor::wait_cursor = 0;
|
Gdk::Cursor* Editor::wait_cursor = 0;
|
||||||
Gdk::Cursor* Editor::timebar_cursor = 0;
|
Gdk::Cursor* Editor::timebar_cursor = 0;
|
||||||
|
|
||||||
|
|
@ -326,8 +328,8 @@ Editor::Editor ()
|
||||||
range_marker_drag_rect = 0;
|
range_marker_drag_rect = 0;
|
||||||
marker_drag_line = 0;
|
marker_drag_line = 0;
|
||||||
|
|
||||||
set_mouse_mode (MouseObject, true);
|
|
||||||
set_midi_edit_mode (MidiEditSelect, true);
|
set_midi_edit_mode (MidiEditSelect, true);
|
||||||
|
set_mouse_mode (MouseObject, true);
|
||||||
|
|
||||||
frames_per_unit = 2048; /* too early to use reset_zoom () */
|
frames_per_unit = 2048; /* too early to use reset_zoom () */
|
||||||
reset_hscrollbar_stepping ();
|
reset_hscrollbar_stepping ();
|
||||||
|
|
@ -1236,7 +1238,9 @@ Editor::build_cursors ()
|
||||||
time_fx_cursor = new Gdk::Cursor (SIZING);
|
time_fx_cursor = new Gdk::Cursor (SIZING);
|
||||||
wait_cursor = new Gdk::Cursor (WATCH);
|
wait_cursor = new Gdk::Cursor (WATCH);
|
||||||
timebar_cursor = new Gdk::Cursor(LEFT_PTR);
|
timebar_cursor = new Gdk::Cursor(LEFT_PTR);
|
||||||
note_cursor = new Gdk::Cursor (PENCIL);
|
midi_select_cursor = new Gdk::Cursor (CENTER_PTR);
|
||||||
|
midi_pencil_cursor = new Gdk::Cursor (PENCIL);
|
||||||
|
midi_erase_cursor = new Gdk::Cursor (DRAPED_BOX);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Pop up a context menu for when the user clicks on a fade in or fade out */
|
/** Pop up a context menu for when the user clicks on a fade in or fade out */
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,7 @@ class Editor : public PublicEditor
|
||||||
void step_mouse_mode (bool next);
|
void step_mouse_mode (bool next);
|
||||||
Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
|
Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
|
||||||
|
|
||||||
|
void set_midi_edit_cursor (Editing::MidiEditMode);
|
||||||
void set_midi_edit_mode (Editing::MidiEditMode, bool force=true);
|
void set_midi_edit_mode (Editing::MidiEditMode, bool force=true);
|
||||||
Editing::MidiEditMode current_midi_edit_mode () const { return midi_edit_mode; }
|
Editing::MidiEditMode current_midi_edit_mode () const { return midi_edit_mode; }
|
||||||
|
|
||||||
|
|
@ -813,7 +814,9 @@ class Editor : public PublicEditor
|
||||||
static Gdk::Cursor* time_fx_cursor;
|
static Gdk::Cursor* time_fx_cursor;
|
||||||
static Gdk::Cursor* fader_cursor;
|
static Gdk::Cursor* fader_cursor;
|
||||||
static Gdk::Cursor* speaker_cursor;
|
static Gdk::Cursor* speaker_cursor;
|
||||||
static Gdk::Cursor* note_cursor;
|
static Gdk::Cursor* midi_select_cursor;
|
||||||
|
static Gdk::Cursor* midi_pencil_cursor;
|
||||||
|
static Gdk::Cursor* midi_erase_cursor;
|
||||||
static Gdk::Cursor* wait_cursor;
|
static Gdk::Cursor* wait_cursor;
|
||||||
static Gdk::Cursor* timebar_cursor;
|
static Gdk::Cursor* timebar_cursor;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ Editor::set_mouse_mode (MouseMode m, bool force)
|
||||||
|
|
||||||
case MouseNote:
|
case MouseNote:
|
||||||
mouse_note_button.set_active (true);
|
mouse_note_button.set_active (true);
|
||||||
current_canvas_cursor = note_cursor;
|
set_midi_edit_cursor (current_midi_edit_mode());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -339,6 +339,8 @@ Editor::midi_edit_mode_toggled (MidiEditMode m)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_midi_edit_cursor(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -362,17 +364,14 @@ Editor::set_midi_edit_mode (MidiEditMode m, bool force)
|
||||||
switch (midi_edit_mode) {
|
switch (midi_edit_mode) {
|
||||||
case MidiEditSelect:
|
case MidiEditSelect:
|
||||||
midi_tool_select_button.set_active (true);
|
midi_tool_select_button.set_active (true);
|
||||||
//current_canvas_cursor = selector_cursor;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MidiEditPencil:
|
case MidiEditPencil:
|
||||||
midi_tool_pencil_button.set_active (true);
|
midi_tool_pencil_button.set_active (true);
|
||||||
//current_canvas_cursor = selector_cursor;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MidiEditErase:
|
case MidiEditErase:
|
||||||
midi_tool_erase_button.set_active (true);
|
midi_tool_erase_button.set_active (true);
|
||||||
//current_canvas_cursor = selector_cursor;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -383,9 +382,27 @@ Editor::set_midi_edit_mode (MidiEditMode m, bool force)
|
||||||
|
|
||||||
ignore_midi_edit_mode_toggle = false;
|
ignore_midi_edit_mode_toggle = false;
|
||||||
|
|
||||||
/*if (is_drawable()) {
|
set_midi_edit_cursor (current_midi_edit_mode());
|
||||||
|
|
||||||
|
if (is_drawable()) {
|
||||||
track_canvas.get_window()->set_cursor(*current_canvas_cursor);
|
track_canvas.get_window()->set_cursor(*current_canvas_cursor);
|
||||||
}*/
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::set_midi_edit_cursor (MidiEditMode m)
|
||||||
|
{
|
||||||
|
switch (midi_edit_mode) {
|
||||||
|
case MidiEditSelect:
|
||||||
|
current_canvas_cursor = midi_select_cursor;
|
||||||
|
break;
|
||||||
|
case MidiEditPencil:
|
||||||
|
current_canvas_cursor = midi_pencil_cursor;
|
||||||
|
break;
|
||||||
|
case MidiEditErase:
|
||||||
|
current_canvas_cursor = midi_erase_cursor;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -241,11 +241,6 @@ MidiRegionView::canvas_event(GdkEvent* ev)
|
||||||
|
|
||||||
_mouse_state = AddDragging;
|
_mouse_state = AddDragging;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Eraser drag start
|
|
||||||
} else if (trackview.editor.current_midi_edit_mode() == MidiEditErase) {
|
|
||||||
_mouse_state = EraseTouchDragging;
|
|
||||||
return false; // Don't ask me...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -729,6 +724,7 @@ MidiRegionView::move_selection(double dx, double dy)
|
||||||
(*i)->item()->move(dx, dy);
|
(*i)->item()->move(dx, dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MidiRegionView::note_dropped(CanvasMidiEvent* ev, double dt, uint8_t dnote)
|
MidiRegionView::note_dropped(CanvasMidiEvent* ev, double dt, uint8_t dnote)
|
||||||
{
|
{
|
||||||
|
|
@ -749,3 +745,17 @@ MidiRegionView::note_dropped(CanvasMidiEvent* ev, double dt, uint8_t dnote)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MidiRegionView::note_entered(ArdourCanvas::CanvasMidiEvent* ev)
|
||||||
|
{
|
||||||
|
cerr << "NOTE ENTERED: " << _mouse_state << endl;
|
||||||
|
if (ev->note() && _mouse_state == EraseTouchDragging) {
|
||||||
|
start_delta_command();
|
||||||
|
ev->selected(true);
|
||||||
|
_delta_command->remove(*ev->note());
|
||||||
|
} else if (_mouse_state == SelectTouchDragging) {
|
||||||
|
note_selected(ev, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,11 @@ class MidiRegionView : public RegionView
|
||||||
_delta_command = _model->new_delta_command();
|
_delta_command = _model->new_delta_command();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void command_add_note(ARDOUR::MidiModel::Note& note) {
|
||||||
|
if (_delta_command)
|
||||||
|
_delta_command->add(note);
|
||||||
|
}
|
||||||
|
|
||||||
void command_remove_note(ArdourCanvas::CanvasMidiEvent* ev) {
|
void command_remove_note(ArdourCanvas::CanvasMidiEvent* ev) {
|
||||||
if (_delta_command && ev->note()) {
|
if (_delta_command && ev->note()) {
|
||||||
_delta_command->remove(*ev->note());
|
_delta_command->remove(*ev->note());
|
||||||
|
|
@ -105,22 +110,6 @@ class MidiRegionView : public RegionView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void command_add_note(ARDOUR::MidiModel::Note& note) {
|
|
||||||
if (_delta_command) {
|
|
||||||
_delta_command->add(note);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void note_entered(ArdourCanvas::CanvasMidiEvent* ev) {
|
|
||||||
if (ev->note() && _mouse_state == EraseTouchDragging) {
|
|
||||||
start_delta_command();
|
|
||||||
ev->selected(true);
|
|
||||||
_delta_command->remove(*ev->note());
|
|
||||||
} else if (_mouse_state == SelectTouchDragging) {
|
|
||||||
note_selected(ev, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void abort_command() {
|
void abort_command() {
|
||||||
delete _delta_command;
|
delete _delta_command;
|
||||||
_delta_command = NULL;
|
_delta_command = NULL;
|
||||||
|
|
@ -135,6 +124,7 @@ class MidiRegionView : public RegionView
|
||||||
midi_view()->midi_track()->diskstream()->playlist_modified();
|
midi_view()->midi_track()->diskstream()->playlist_modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void note_entered(ArdourCanvas::CanvasMidiEvent* ev);
|
||||||
void unique_select(ArdourCanvas::CanvasMidiEvent* ev);
|
void unique_select(ArdourCanvas::CanvasMidiEvent* ev);
|
||||||
void note_selected(ArdourCanvas::CanvasMidiEvent* ev, bool add);
|
void note_selected(ArdourCanvas::CanvasMidiEvent* ev, bool add);
|
||||||
void note_deselected(ArdourCanvas::CanvasMidiEvent* ev, bool add);
|
void note_deselected(ArdourCanvas::CanvasMidiEvent* ev, bool add);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue