예제 #1
0
bool
Seq24SeqEventInput::on_motion_notify_event
(
   GdkEventMotion * ev,
   seqevent & seqev
)
{
    bool result = false;
    midipulse tick = 0;
    if (seqev.m_moving_init)
    {
        seqev.m_moving_init = false;
        seqev.m_moving = true;
    }
    if (seqev.m_selecting || seqev.m_moving || seqev.m_paste)
    {
        seqev.m_current_x = int(ev->x) + seqev.m_scroll_offset_x;
        if (seqev.m_moving || seqev.m_paste)
            seqev.snap_x(seqev.m_current_x);

        seqev.draw_selection_on_window();
    }
    if (seqev.m_painting)
    {
        seqev.m_current_x = int(ev->x) + seqev.m_scroll_offset_x;
        seqev.snap_x(seqev.m_current_x);
        seqev.convert_x(seqev.m_current_x, tick);
        seqev.drop_event(tick);
        result = true;
    }
    return result;
}
예제 #2
0
bool
FruitySeqEventInput::on_motion_notify_event
(
    GdkEventMotion * ev,
    seqevent & seqev
)
{
    bool result = false;
    midipulse tick = 0;
    seqev.m_current_x = (int) ev->x  + seqev.m_scroll_offset_x;
    if (seqev.m_moving_init)
    {
        seqev.m_moving_init = false;
        seqev.m_moving = true;
    }
    update_mouse_pointer(seqev);      /* context sensitive mouse pointer... */

    /*
     * Ctrl-left click drag on selected note(s) starts a copy/unselect/paste.
     */

    if (m_is_drag_pasting_start)
    {
        seqev.m_seq.copy_selected();
        seqev.m_seq.unselect();
        seqev.start_paste();
        m_is_drag_pasting_start = false;
        m_is_drag_pasting = true;
    }
    if (seqev.m_selecting || seqev.m_moving || seqev.m_paste)
    {
        if (seqev.m_moving || seqev.m_paste)
            seqev.snap_x(seqev.m_current_x);

        seqev.draw_selection_on_window();
    }
    if (seqev.m_painting)
    {
        seqev.m_current_x = int(ev->x)  + seqev.m_scroll_offset_x;
        seqev.snap_x(seqev.m_current_x);
        seqev.convert_x(seqev.m_current_x, tick);
        seqev.drop_event(tick);             // Why no push_undo()?
        result = true;
    }
    return result;
}