new trim cursors from chrisg, fix up hotspots for said cursors, make Editor cursors public; note draw mode now trims existing notes (but without trim cursor :(
git-svn-id: svn://localhost/ardour2/branches/3.0@7270 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ac9589ff2c
commit
fe85a922ec
|
@ -1245,12 +1245,12 @@ Editor::build_cursors ()
|
|||
|
||||
{
|
||||
Glib::RefPtr<Gdk::Pixbuf> apixbuf (::get_icon ("trim_left_cursor"));
|
||||
left_side_trim_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 5, 17);
|
||||
left_side_trim_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 5, 11);
|
||||
}
|
||||
|
||||
{
|
||||
Glib::RefPtr<Gdk::Pixbuf> apixbuf (::get_icon ("trim_right_cursor"));
|
||||
right_side_trim_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 5, 17);
|
||||
right_side_trim_cursor = new Gdk::Cursor (Gdk::Display::get_default(), apixbuf, 23, 11);
|
||||
}
|
||||
|
||||
selector_cursor = new Gdk::Cursor (XTERM);
|
||||
|
|
|
@ -447,6 +447,27 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
void begin_reversible_command (std::string cmd_name);
|
||||
void commit_reversible_command ();
|
||||
|
||||
/* handy cursors for everyone to use */
|
||||
|
||||
static Gdk::Cursor* cross_hair_cursor;
|
||||
static Gdk::Cursor* trimmer_cursor;
|
||||
static Gdk::Cursor* right_side_trim_cursor;
|
||||
static Gdk::Cursor* left_side_trim_cursor;
|
||||
static Gdk::Cursor* selector_cursor;
|
||||
static Gdk::Cursor* grabber_cursor;
|
||||
static Gdk::Cursor* grabber_edit_point_cursor;
|
||||
static Gdk::Cursor* zoom_cursor;
|
||||
static Gdk::Cursor* time_fx_cursor;
|
||||
static Gdk::Cursor* fader_cursor;
|
||||
static Gdk::Cursor* speaker_cursor;
|
||||
static Gdk::Cursor* midi_pencil_cursor;
|
||||
static Gdk::Cursor* midi_select_cursor;
|
||||
static Gdk::Cursor* midi_resize_cursor;
|
||||
static Gdk::Cursor* midi_erase_cursor;
|
||||
static Gdk::Cursor* wait_cursor;
|
||||
static Gdk::Cursor* timebar_cursor;
|
||||
static Gdk::Cursor* transparent_cursor;
|
||||
|
||||
protected:
|
||||
void map_transport_state ();
|
||||
void map_position_change (nframes64_t);
|
||||
|
@ -986,25 +1007,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
|
||||
TrackViewList get_tracks_for_range_action () const;
|
||||
|
||||
static Gdk::Cursor* cross_hair_cursor;
|
||||
static Gdk::Cursor* trimmer_cursor;
|
||||
static Gdk::Cursor* right_side_trim_cursor;
|
||||
static Gdk::Cursor* left_side_trim_cursor;
|
||||
static Gdk::Cursor* selector_cursor;
|
||||
static Gdk::Cursor* grabber_cursor;
|
||||
static Gdk::Cursor* grabber_edit_point_cursor;
|
||||
static Gdk::Cursor* zoom_cursor;
|
||||
static Gdk::Cursor* time_fx_cursor;
|
||||
static Gdk::Cursor* fader_cursor;
|
||||
static Gdk::Cursor* speaker_cursor;
|
||||
static Gdk::Cursor* midi_pencil_cursor;
|
||||
static Gdk::Cursor* midi_select_cursor;
|
||||
static Gdk::Cursor* midi_resize_cursor;
|
||||
static Gdk::Cursor* midi_erase_cursor;
|
||||
static Gdk::Cursor* wait_cursor;
|
||||
static Gdk::Cursor* timebar_cursor;
|
||||
static Gdk::Cursor* transparent_cursor;
|
||||
|
||||
static void build_cursors ();
|
||||
|
||||
sigc::connection super_rapid_screen_update_connection;
|
||||
|
|
|
@ -1592,7 +1592,7 @@ NoteResizeDrag::NoteResizeDrag (Editor* e, ArdourCanvas::Item* i)
|
|||
void
|
||||
NoteResizeDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
|
||||
{
|
||||
Gdk::Cursor cursor;
|
||||
Gdk::Cursor* cursor;
|
||||
ArdourCanvas::CanvasNote* cnote = dynamic_cast<ArdourCanvas::CanvasNote*>(_item);
|
||||
|
||||
Drag::start_grab (event);
|
||||
|
@ -1603,14 +1603,15 @@ NoteResizeDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
|
|||
double const middle_point = region_start + cnote->x1() + (cnote->x2() - cnote->x1()) / 2.0L;
|
||||
|
||||
if (grab_x() <= middle_point) {
|
||||
cursor = Gdk::Cursor(Gdk::LEFT_SIDE);
|
||||
cursor = _editor->left_side_trim_cursor;
|
||||
at_front = true;
|
||||
} else {
|
||||
cursor = Gdk::Cursor(Gdk::RIGHT_SIDE);
|
||||
cursor = _editor->right_side_trim_cursor;
|
||||
at_front = false;
|
||||
}
|
||||
cerr << "Set cursor for note resize\n";
|
||||
|
||||
_item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, cursor, event->motion.time);
|
||||
_item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, *cursor, event->motion.time);
|
||||
|
||||
if (event->motion.state & Keyboard::PrimaryModifier) {
|
||||
relative = false;
|
||||
|
|
|
@ -663,6 +663,13 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
}
|
||||
break;
|
||||
|
||||
case NoteItem:
|
||||
if (internal_editing()) {
|
||||
/* trim notes if we're in internal edit mode and near the ends of the note */
|
||||
_drags->set (new NoteResizeDrag (this, item), event);
|
||||
}
|
||||
return true;
|
||||
|
||||
case StreamItem:
|
||||
if (internal_editing()) {
|
||||
_drags->set (new RegionCreateDrag (this, item, clicked_axisview), event);
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 467 B After Width: | Height: | Size: 631 B |
Binary file not shown.
Before Width: | Height: | Size: 450 B After Width: | Height: | Size: 625 B |
|
@ -308,6 +308,7 @@ MidiRegionView::button_press (GdkEventButton* ev)
|
|||
_mouse_state = Pressed;
|
||||
return true;
|
||||
}
|
||||
|
||||
_pressed_button = ev->button;
|
||||
|
||||
return true;
|
||||
|
@ -347,7 +348,6 @@ MidiRegionView::button_release (GdkEventButton* ev)
|
|||
if (!success) {
|
||||
beats = 1;
|
||||
}
|
||||
|
||||
create_note_at (event_x, event_y, beats);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue