- // Snap length
- length = region_frames_to_region_beats(
- snap_frame_to_frame (t + region_beats_to_region_frames(length)) - t
- );
-
assert (length != 0);
if (sh) {
assert (length != 0);
if (sh) {
- length = region_frames_to_region_beats (region_beats_to_region_frames (length) - 1);
+ /* shorten the note down, but rather than using 1 frame (which
+ would be the highest resolution, use 1 tick since all
+ musical data is essentially quantized to this unit. it
+ is bigger, but not by enough to make any difference.
+
+ old single frame code:
+
+ length = region_frames_to_region_beats (region_beats_to_region_frames (length) - 1);
+ */
+ length -= 1.0/Timecode::BBT_Time::ticks_per_beat;
}
const boost::shared_ptr<NoteType> new_note (new NoteType (mtv->get_channel_for_add (),
}
const boost::shared_ptr<NoteType> new_note (new NoteType (mtv->get_channel_for_add (),
- region_frames_to_region_beats(t + _region->start()), length,
+ region_frames_to_region_beats(t + _region->start()),
+ length,
(uint8_t)note, 0x40));
if (_model->contains (new_note)) {
(uint8_t)note, 0x40));
if (_model->contains (new_note)) {
void
MidiRegionView::clear_selection_except (ArdourCanvas::CanvasNoteEvent* ev, bool signal)
{
void
MidiRegionView::clear_selection_except (ArdourCanvas::CanvasNoteEvent* ev, bool signal)
{
+ bool changed = false;
+
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ) {
if ((*i) != ev) {
Selection::iterator tmp = i;
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ) {
if ((*i) != ev) {
Selection::iterator tmp = i;
(*i)->set_selected (false);
(*i)->hide_velocity ();
_selection.erase (i);
(*i)->set_selected (false);
(*i)->hide_velocity ();
_selection.erase (i);
+ if (changed && signal) {
SelectionCleared (this); /* EMIT SIGNAL */
}
}
SelectionCleared (this); /* EMIT SIGNAL */
}
}
framepos_t const unsnapped_frame = editor.pixel_to_frame (x);
framecnt_t grid_frames;
framepos_t const f = snap_frame_to_grid_underneath (unsnapped_frame, grid_frames);
framepos_t const unsnapped_frame = editor.pixel_to_frame (x);
framecnt_t grid_frames;
framepos_t const f = snap_frame_to_grid_underneath (unsnapped_frame, grid_frames);
/* use region_frames... because we are converting a delta within the region
*/
/* use region_frames... because we are converting a delta within the region
*/
- double length = region_frames_to_region_beats (snap_frame_to_frame (f + grid_frames) - f);
+ bool success;
+ double length = editor.get_grid_type_as_beats (success, unsnapped_frame);
+
+ if (!success) {
+ length = 1;
+ }
/* note that this sets the time of the ghost note in beats relative to
the start of the source; that is how all note times are stored.
/* note that this sets the time of the ghost note in beats relative to
the start of the source; that is how all note times are stored.