Browse Source

User can temporarily disable snapping by holding down 's'.

tags/non-daw-v1.1.0
Jonathan Moore Liles 15 years ago
parent
commit
60e54068b3
2 changed files with 13 additions and 1 deletions
  1. +12
    -1
      Timeline/Timeline.C
  2. +1
    -0
      Timeline/Timeline.H

+ 12
- 1
Timeline/Timeline.C View File

@@ -67,6 +67,7 @@

bool Timeline::draw_with_measure_lines = true;
Timeline::snap_e Timeline::snap_to = Bars;
bool Timeline::snapping_on_hold = false;
bool Timeline::snap_magnetic = true;
bool Timeline::follow_playhead = true;
bool Timeline::center_playhead = true;
@@ -597,7 +598,7 @@ prev_next_line_cb ( nframes_t frame, const BBT &bbt, void *arg )
bool
Timeline::nearest_line ( nframes_t *frame, bool snap ) const
{
if ( snap && None == Timeline::snap_to )
if ( snap && ( snapping_on_hold || None == Timeline::snap_to ) )
return false;

nframes_t when = *frame;
@@ -1192,6 +1193,11 @@ Timeline::handle ( int m )
range = true;
return 1;
}
else if ( Fl::event_key() == 's' )
{
snapping_on_hold = true;
return 1;
}
return 0;
case FL_KEYUP:
if ( Fl::event_key() == 'r' )
@@ -1199,6 +1205,11 @@ Timeline::handle ( int m )
range = false;
return 1;
}
else if ( Fl::event_key() == 's' )
{
snapping_on_hold = false;
return 1;
}
return 0;
// case FL_KEYBOARD:
case FL_SHORTCUT:


+ 1
- 0
Timeline/Timeline.H View File

@@ -124,6 +124,7 @@ public:

static bool draw_with_measure_lines;
static snap_e snap_to;
static bool snapping_on_hold;
static bool snap_magnetic;
static bool follow_playhead;
static bool center_playhead;


Loading…
Cancel
Save