13
0
Commit Graph

667 Commits

Author SHA1 Message Date
nick_m
550f2925cc Performance - don't redisplay model immediately in MidiRegionView::enable_display ().
- allows MidiRegionView::reset_width_dependent_items () to do it
	  as intended (i think).
2016-07-10 02:18:36 +10:00
nick_m
6b0eadc62f Use mostly beat-based calculation for displayed midi note position. 2016-07-10 02:18:36 +10:00
nick_m
0e63fa65b5 Remove frame conversion for MidiRegionView::note_in_region_range(), speed up tempo dilation 2016-07-10 02:18:36 +10:00
nick_m
93c24e4433 Paste uses exact beats. rework _start_beats calculation in copy-with-offset ctor. 2016-07-10 02:18:36 +10:00
nick_m
94e0a15325 Exact beat - provide audio->music mapping for region split.
- for those not in the know, this series provides a way to
	  remove the temporal distortion introduced when using an
	  audio frame-based gui for music-locked objects.

	  In short, the gui uses an audio frame representation to move
	  objects. It displays the object using frame_at_beat(), quantizing
	  the time value to audio frames. This is fine until the user selects
	  that frame but expects it to be interpreted as a beat.
	  Thus beat_at_frame() would not produce the user-expected beat
	  (temporal quantization error of up to 0.5 audio samples).
	  This is one method of mapping audio time to music time accurately.
2016-07-10 02:18:36 +10:00
nick_m
f3b4644969 Fix many offset errors when drawing notes in midi regions that have been edited.
- hopefully this can close bugs such as 6270 & 6793
2016-06-11 05:40:50 +10:00
nick_m
03ea905b86 Step edit cursor no longer assumes constant tempo. 2016-06-08 02:45:40 +10:00
4653e301c8 slight improvement of MIDI program names in verbose cursor while scrolling 2016-05-31 15:30:44 -04:00
nick_m
5d6ad68004 Revert terrible thinko in 647c86e. (back to slow for now) 2016-05-29 05:57:19 +10:00
nick_m
647c86e0f7 Speed up redraw while tempo dragging with midi regions (and possibly other redraws) 2016-05-29 05:47:11 +10:00
nick_m
baf8f37967 Tempo ramps - rename meter_at() -> meter_at_frame() & make the ticker slightly more efficient. 2016-05-27 23:38:17 +10:00
nick_m
4f7a4cd233 Crapola - this is an experimental performance hack that must be reverted. 2016-05-27 23:38:14 +10:00
nick_m
e82c997b3d Tempo ramps - remove double calls to RegionView::set_duration() and MidiRegionView::redisplay_model()
- massively improves note redrawing performance when dragging tempos
	  and audio-locked meters,
2016-05-27 23:38:11 +10:00
nick_m
b415b59f79 Tempo ramps - respect tempo note type and meter note divisor correctly.
- tempo and meter position is now pulse-based,
	  although meter still has a beat for convenience.
2016-05-27 23:38:11 +10:00
nick_m
d3c24fe0ca Tempo ramps - midi notes resize when dragged, misc bug fixes. 2016-05-27 23:38:11 +10:00
nick_m
bdef9b2466 Tempo ramps - fix constant tempo assumption wrt midi ghost note. 2016-05-27 23:38:10 +10:00
nick_m
885f1fd684 Tempo ramps - update midi regions and locations when dragging tempo.
- also make locations and regions use a double beat rather than bbt for musical position.
2016-05-27 23:38:10 +10:00
nick_m
dbfe991cd8 Tempo ramps - fix changing from const to ramp in the gui.
- also fixes some midi mouse over problems
	- start using replacements for frames_per_bar() frames_per_beat() etc.
2016-05-27 23:38:09 +10:00
Adrian Knoth
6fa88273aa Spelling correction patch from Debian
Patch taken (and forward-ported to HEAD) from
<https://anonscm.debian.org/cgit/pkg-multimedia/ardour.git/plain/debian/patches/0100-fix-typos.patch>
2016-02-22 15:13:01 -05:00
90e35c7143 Fix bug #6762, MIDNAM note read outs don't work when dragging MIDI note
Also fixes it so the key is selected in the piano roll header
2016-02-11 08:17:18 +10:00
084af96bf4 Change handling of Midi note selection to eliminate signal emission/delays.
Each MidiRegionView(MRV) is connected to the Selection::ClearMidiNoteSelection
signal that is used to notify the all MRV instances to clear their note
selection.

The MRV class also has a private static SelectionCleared signal that is used to
signal other MRV instances when their selection has been cleared. When the
Selection::ClearMidiNoteSelection signal is emitted it causes each MRV to also
emit the SelectionCleared signal. So the emission takes quadratic time.

With 1500 MRV instances emission takes about 2.2 seconds on my machine, and
some operations like track selection cause it to be emitted 3 times(another
issue).

The Selection class in the Editor knows which MRV instances have note
selections, as it is notified by MidiRegionView whenever the selection count
becomes zero or becomes non-zero. Clearing the Note selection should then just
be O(N) and direct calls can be used rather than signals.

This change removes both the signals and uses the existing references between
Selection and MRV class to control note selection. There should be no
behavioural changes in Midi note selection with this change.
2016-01-14 20:41:44 +10:00
André Nusser
ef9713d5c6 Comment remaining unsolved bug. 2016-01-12 13:45:39 +01:00
André Nusser
f979d9c0a6 Don't show a ghost note when draw mode is entered over a note. 2016-01-12 13:45:39 +01:00
André Nusser
616c1aa0ce Clean enter_internal and leave_internal in MidiRegionView. 2016-01-12 13:45:39 +01:00
André Nusser
76237a696c Hide MIDI ghost note when over existing note. 2016-01-12 13:45:38 +01:00
André Nusser
688fe8504b Hide ghost note when switching from draw to internal edit mode.
Before it was only hidden after moving the mouse.
2016-01-12 13:45:38 +01:00
André Nusser
2d786617bb Fix appearing ghost note after drag select in internal edit mode. 2016-01-12 13:45:38 +01:00
Nil Geisweiller
93ea63f6d0 Better align note end time with grid 2015-12-22 04:52:50 +01:00
Nil Geisweiller
ef393f5a88 Remove shortening inserted notes by one tick
I don't think this is necessary, if some synth cannot deal with that,
perhaps Ardour could try to send the note off right before the next
note on, even-though they supposedly occur simultaneously.
2015-12-22 04:52:50 +01:00
André Nusser
6389c52d3c Enable horizontal scrolling in midi regions when note is selected.
The shortcut for 'change velocities together' had to be changed to
achieve that. The new shortcut is now primary+tertiary modifier +scroll,
i.e. ctrl+shift+scroll for the default keys.
2015-12-02 18:36:59 -05:00
nick_m
0e809dd1d5 Add comment to MRV snap workaround. 2015-11-01 01:43:13 +11:00
nick_m
d5c4d068b0 Fix snap modifiers not working on notes when grid is set to off. 2015-10-31 06:02:54 +11:00
nick_m
96524d863b Clear point selection when uniquely selecting a note.
- Also fix selection undo when creating notes w/control
	  in MouseContent mode.
2015-10-24 00:07:03 +11:00
b074ff0dd5 Remove GhostRegion::CatchDeletion signal to reduce session close times
Currently when a GhostRegion is deleted by its "parent" RegionView it emits the
static GhostRegion::CatchDeletion signal which is connected to the
RegionView::remove_ghost method of every RegionView instance.

With a static GhostRegion::CatchDeletion signal a particular test session
causes 31 Million calls of RegionView::remove_ghost on Session deletion and the
session takes 70 seconds to close with a debug build.

The lifetime of a ghost region is tied to both the TimeAxisView(TAV) and
RegionView(RV) in that when a RegionView is deleted all GhostRegion instances
associated with the RegionView should be deleted or when a TimeAxisView is
deleted all ghost regions that are contained in the view should be deleted.

This means that there needs to be notification between GhostRegion and both
classes. Instead of using a signal for this as we know there are only two
listeners and GhostRegion already holds a reference to the TimeAxisView, also
take a reference to the parent RegionView in the GhostRegion constructor and
use it to notify the RegionView when GhostRegion destructor is called so it can
drop any references it holds.

Using a direct function call in the GhostRegion destructor to notify the
TimeAxisView and RegionView "parents" brings the unload/close time down for the
test session from 70 seconds to 4.5 seconds.

The GhostRegion also references canvas items that are added to the TimeAxisView
canvas group or at least a canvas group that it manages. So when the
TimeAxisView is destroyed and the canvas group that is the parent of those
items is destroyed, the GhostRegion's canvas items will also be
deleted/destroyed by the parent canvas item/group. This means the GhostRegions
must be destroyed when the TimeAxisView they are contained in is destroyed or
there will be dangling references to canvas items that have already been
deleted and trying to delete them again will be bad.
2015-10-22 11:51:03 -04:00
e7b8e98db2 Replace static PBD::Signal in NoteBase with direct call to MidiRegionView
NoteBaseDeleted signal is static so each MidiRegionView(MRV) gets notified
about the deletion of each NodeBase instance even if it is contained in another
MRV

The NoteBase and MRV classes are currently coupled anyway, so this change uses
the reference to the MRV parent to directly call the parent when the NoteBase
is deleted. This is all in the GUI thread so I'm not sure why a PBD::Signal was
being used?

If the MRV class is the only reference holder to the NoteBase class
then I'm not sure if a callback is needed, perhaps the MRV should just remove
the note from the selection before deleting it but I'm not that familiar with
the code.

Signal emission/calls static NoteBaseDeleted signal vs direct with 10540
NoteBase instances.

static:

After Load Session: 6360638
After Unload Session: 12221026(5860388)

direct:

After load Session: 10540
After unload Session: 21080

Session Load/Unload time in master, debug/release with ~10000 Notes(seconds)

Load Debug: 32, 26
Unload Debug: 83
Load Release 32, 20, 42
Unload Release 26, 25

Session Load/Unload time with direct call debug/release(seconds)

Load Debug: 21.7, 18.1
Unload Debug: 69.4, 71
Load Release: 22.6, 13.4, 17.7
Unload Release: 24, 23.5

This is not a large Session, 1500 regions, 10000 notes so there is probably
some other funky stuff going on that needs fixing.
2015-10-17 22:15:07 -04:00
22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
4dc63966f0 globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
2015-10-04 14:51:05 -04:00
2ef2ea0b59 create new Event-IDs for pasted midi-notes 2015-09-18 20:37:23 +02:00
6b019a4953 Move UIConfiguration Singleton into UIConfiguration header
This removes the direct dependence on ardour_ui.h from 39 files
2015-09-16 16:55:17 -04:00
344c435dae cont'd work on piano roll highlighting. 2015-08-15 05:13:14 +02:00
f2495d9808 Highlight note in piano roll - #6510 2015-08-15 03:08:55 +02:00
da3df9c1d1 Revert "replace two more instances of !! with implicit use of operator bool()"
This reverts commit e8eff9fb9c2fa6fc518404c2f9b731f8c28d3a23.

OS X compiler gets confused by this change.
2015-06-29 14:18:15 -04:00
8ac11386a6 replace two more instances of !! with implicit use of operator bool() 2015-06-29 14:18:15 -04:00
c4c7dc0086 Revert "use newly added operator bool() for Evoral::Beats rather than double-negation as boolean"
This reverts commit a19902b52f08bf33c54e60dfb49c44a1c154f4c9.

OS X compiler gets confused by this change.
2015-06-29 14:18:14 -04:00
9c84633eb4 Revert "replace two more instances of !! with implicit use of operator bool()"
This reverts commit e8eff9fb9c2fa6fc518404c2f9b731f8c28d3a23.

OS X compiler gets confused by this change.
2015-06-29 14:18:14 -04:00
82fc73d663 replace two more instances of !! with implicit use of operator bool() 2015-06-29 14:18:14 -04:00
15b3ad956d use newly added operator bool() for Evoral::Beats rather than double-negation as boolean 2015-06-29 14:18:14 -04:00
nick_m
392f48709c Magnetic snap now works on note moves / resizes. 2015-06-11 02:20:37 +10:00
nick_m
b3a4c88e0e Make absolute snap the default snap.
- also fixes a couple of absolute snap bugs wrt midi notes.
2015-06-11 01:36:34 +10:00
nick_m
2ef94d9422 Fix uninitialised variable. 2015-05-28 23:37:46 +10:00
nick_m
ea8b5a970f Bring back contrained drag modifier with preference setting.
- this should work as before, but when applied to a button 1 drag,
	  the constraint is in the first direction travelled.
2015-05-23 05:36:03 +10:00
nick_m
3d599be991 Fix missing comment. 2015-05-23 03:44:42 +10:00
nick_m
88477ace25 Fix inverted logic of SnapOff with snap modifiers pressed.
- also clean up, rename and comment some previous hanges.
2015-05-23 03:09:48 +10:00
nick_m
784abd03e0 Make note drags and resizes obey the disable sanp modifier. 2015-05-22 06:54:16 +10:00
nick_m
65e06fa350 More cleanup
- remove "no_magnets" ugh.
2015-05-22 04:26:16 +10:00
nick_m
c359f881a1 Relative Snap -make it activated by the tertiary modifier during drag.
Disabled/enabled with the shift key. no config stuff at all now.
	Move existing (strange) trim feature to primary + tertiary modifiers.
2015-05-17 23:47:01 +10:00
nick_m
91a34c596d Relative snap - support magnetic mode (hackishly for now) 2015-05-17 04:26:05 +10:00
nick_m
68a8330afc Relative snap 2015-05-16 04:15:52 +10:00
c9023ae73d Fix mute of MIDI tracks with channel forcing.
This moves MIDI channel filtering into a reusable class and moves filtering to
the source, rather than modifying the buffer afterwards.  This is necessary so
that the playlist trackers reflect the emitted notes (and thus are able to stop
them in situations like mute).

As a perk, this is also faster because events are just dropped on read, rather
than pushed into a buffer then later removed (which is very slow).

Really hammering on mute or solo still seems to produce stuck notes
occasionally (perhaps related to multiple-on warnings).  I am not yet sure why,
but occasional beats always.
2015-03-29 00:51:56 -04:00
74b3d0b602 Drag/Drop work-around midi note bleeding
During DnD, the region uses the 'old/current'                                                                                                                                                                                                
midi_stream_view()'s range and its position/height calculation.

Ideally DnD would decouple the midi_stream_view() for the
region(s) being dragged and set it to the target's range
(or in case of the drop-zone, FullRange).
but I don't see how this can be done without major rework.

For now, just prevent visual bleeding of events in case
the target-track is smaller.
2015-03-28 18:22:37 +01:00
nick_m
1580c6d635 Fix some strings incorrectly marked for translation.
My apologies to translators.
2015-03-25 23:31:23 +11:00
b72fc759c0 Only sound selected notes momentarily (#6142).
This is debatable, the "sustained until mouse release" behaviour is handy
sometimes, but this way seems like what most people probably want.

Also, this "fire it and forget it and let it delete itself a bit later" thing
with MidiPlayer makes me nervous.  I guess it's unlikely someone manages to
select a note then delete a track within 100ms, but, well...
2015-03-14 01:12:29 -04:00
700cb13b36 Fix note visibility (#0006168). 2015-03-13 22:30:11 -04:00
a8aae56d92 Handle edits while playing precisely.
This avoids stuck notes if active notes are edited, but without stopping all
active notes in the region on any edit as before.

This implementation injects note ons in places that aren't actually note
starts.  Depending on how percussive the instrument is, this may not be
desired.  In the future, an option for this would be an improvement, but there
are other places where "start notes in the middle" is a reasonable option.  I
think that should be handled universally if we're to do it at all, so not
considering it a part of this fix for now.
2015-03-05 17:30:31 -05:00
232d67bc53 midi note paste undo fix. 2015-01-25 01:56:19 +01:00
8565470797 Fix hidden notes at trimmed region start. 2015-01-16 14:52:40 -05:00
nick_m
ade1c4923c Fix note resize double undo bug.
Newly drawn notes are selected.
Clear midi note selection on Selection::set_state().
2015-01-17 04:55:05 +11:00
nick_m
5ef868e767 Don't reuse _optimization_iterator - fixes crash on multiple note delete undo. 2015-01-13 22:52:02 +11:00
305af7a5ce Fix whitespace. 2015-01-12 02:06:40 -05:00
ba9a90b927 Merge duplicated code. 2015-01-12 02:06:40 -05:00
4438263d4d Fix crash when undoing note delete. 2015-01-12 02:03:49 -05:00
nick_m
44203ce955 Fix AutomationTrackItem rubberband click thinking it was unhandled.
Fix several other cases where a single mouse click could cause several
(not nested) selection ops.
Fix missing selection memento for midi notes and midi commands.
Rename some variables.
Fix random style issues.
2015-01-11 04:07:31 +11:00
8d98102573 Fix show MIDI regions using track color. 2015-01-08 19:59:40 -05:00
57947ff5a8 Prevent note trim to zero length (shown as stuck).
The reasonable value 1 tick doesn't seem to work here, presumably it gets lost
in rounding conversion somewhere.  Instead use a really small power of two
reciprocal.  Once we use actual beats and ticks we can fix this to be a minimum
of one tick (the actual minimum length for a note).
2015-01-08 19:13:00 -05:00
2a251b4570 MusicalTime => Beats. 2015-01-07 00:12:07 -05:00
2c8babf41e Fix stuck note display while recording.
This doesn't make sense, but I'm okay with that.
2014-12-30 20:06:37 -05:00
e82ce75cb1 Fix display of MIDI while recording.
... almost.  There are some artifacts when you zoom out while recording that I
can't figure out, but whatever.

Also fix performance issues caused by last attempt at rec display while zoom.
2014-12-30 19:16:41 -05:00
937cf046a4 Fix key bindings for note trim/extend. 2014-12-29 20:50:39 -05:00
3d1f955a0c Fix MIDI recording display when zoom/etc changes. 2014-12-29 18:56:39 -05:00
d283608fe9 Automation ghost notes for percussive hits. 2014-12-28 21:31:33 -05:00
606efb601c Show correct ghost hit for percussive tracks. 2014-12-28 20:23:52 -05:00
b54863c8c3 Set new note velocity based on surrounding notes. 2014-12-28 19:21:46 -05:00
4973ddc478 Fix events for short notes at region start/end. 2014-12-28 17:45:24 -05:00
6a73fd337c Update note colors when model changes. 2014-12-28 16:06:44 -05:00
49b7a46805 Fix potential memory errors with note player.
Seems unlikely, but if the event firing stuff is off, it could trigger the
issue (#5502) and/or a possible memory leak.
2014-12-24 16:54:38 -05:00
62355de33a Fix cursor update on nested entry.
For example, if you're in a note and something about the mode changes, it's the
underlying region context that needs to change.  So, seems we need a stack of
entry contexts to deal with this sort of thing.

Switching in/out of smart mode still doesn't update immediately because we
don't have the y-coordinate needed to update it.
2014-12-23 13:47:59 -05:00
64fa63212f move all (G)UI related configuration parameters into UIConfiguration, not RCConfiguration 2014-12-22 13:39:46 -05:00
David Robillard
670938c8c4 Fix various cursor problems.
Add a new scoped cursor system that makes it much harder to screw up and end up
with stick cursors and so on.
2014-12-20 01:13:25 -05:00
00887f94dc more color/modifier tweaks 2014-12-19 12:06:42 -05:00
6031308520 Use color modifiers for dynamic region styles. 2014-12-18 20:23:34 -05:00
a12a065457 Fix copy paste of MIDI and track automation. 2014-12-18 20:23:34 -05:00
026f7bf5b7 Make MIDI regions translucent for internal tools. 2014-12-18 20:23:23 -05:00
7ab8a11fb5 Enforce internal/external selection exclusivity. 2014-12-18 20:22:48 -05:00
5fef655380 Remove internal edit mode and add "content" tool. 2014-12-18 20:21:01 -05:00
nick_m
9af9e17adc Add editor selection state to session history via a SelectionMemento, which
combines selection related editor properties with the current editor selection.

The related editor properties are:
mouse mode,
zoom setting,
left frame of the canvas,
y origin of the canvas.

Selection state now includes region views (storing the underlying region id)
and time.

This patch also fixes a region mute undo bug.
2014-12-18 11:03:10 -05:00
5f66300349 Support stepping bank by shift+scroll/arrow. 2014-12-17 20:18:11 -05:00
d2cafbe95a Remove some aborts that don't really need to be.
Enforce PatchPrimaryKey sanity at the type level rather than attempting to
check for it everywhere.

Remove dead file.
2014-12-17 19:43:09 -05:00
6e912a0aa3 Fix display of MIDI notes/regions while recording.
Make record rect transparency configurable.

Factor out some copy-paste streamview code.
2014-12-17 18:41:23 -05:00
a706755710 Fix various MIDI locking issues.
Attempt to make mistakes much less likely in the future by statically requiring
caller to pass scoped locks where necessary.
2014-12-17 16:07:29 -05:00
da2043e179 Force ghost note positive in all circumstances. 2014-12-17 03:17:07 -05:00
5ee4a5d56a Don't allow drawing notes in rec regions (crash). 2014-12-17 02:50:45 -05:00
e0cb9efb00 Various color tweaks.
This commit changes some color names, nuke your theme.  This isn't quite ideal
yet, but takes some steps towards where I think things should go aesthetically:

Make automation tracks/regions colors correspond to their parent's type.

Make selected MIDI notes outlined in red like most everything else, and scrap
separate min/mid/max fill colors for selected MIDI notes.

Color automation ghost MIDI notes based on original note color.

Try to kill 90's looking brightish gray gradients in general.
2014-12-16 00:05:45 -05:00
1ab2705b4b next modifier 2014-12-15 10:32:17 -05:00
811677c543 fix incorrect item name for color 2014-12-15 09:05:01 -05:00
56ca52651e fix up requested color names everywhere.
Thank <deity> for emacs ... space-uncamelcase-word-at-point FTW
2014-12-14 16:15:38 -05:00
48a7a11974 initial pass to replace all UIConfiguration::get_XXXXXX() calls with UIConfiguration::color(name).
IMPORTANT: names have not been downcased and spaced yet, so many colors are not found
2014-12-14 12:27:07 -05:00
ee38c44109 Structure MIDI device selector by manufacturer.
Unfortunately we store the state of models as simply model, so if there's ever
duplicate model names, we're somewhat screwed, but this makes the (previously
unmanageably huge) menu usable, while retaining the "model name as global
identifier" state unmodified.
2014-12-13 00:37:34 -05:00
ec8c0e93bb Fix shift-rect-select with MIDI notes. 2014-12-07 17:30:06 -05:00
39da38dd6e Nudge notes by 1 bar if secondary modifier active.
Similar to how transpose moves an octave if the same modifier is active.
2014-12-06 22:43:06 -05:00
16d60ef2f7 Grab keyboard only with note selection.
When entered, the keyboard is grabbed when the selection becomes non-empty, and
ungrabbed if it becomes empty again or the region is left or the user switches
out of internal mode.

This fixes scroll in internal mode and note moving with arrow keys.  Also frees
up useful keybindings when there is no note selection, which is much nicer than
the "nothing works in edit mode at all" greedy grab approach used previously.

Attempt #874327892 of getting this damned grabbing right.
2014-12-06 22:43:06 -05:00
63082821d8 Support paste between automation lanes.
Also push the increasingly unwieldly paste parameters into a context object.

As with othe things, currently it is only possible to do "cross-type paste" by
explicitly selecting the target track.  We will need to get automation region
view selection working to do better here, but at least for now it's possible to
get the data over.
2014-12-06 12:20:52 -05:00
34fcf22476 Fix internal paste when selection has only points. 2014-12-06 10:26:25 -05:00
a65cd2a1b9 Make scroll work on MIDI regions when internal.
For some reason, grabbing the magic keyboard focus makes scroll stop working
regardless of what MRV::canvas_group_event() returns.  I can't figure out any
reason to grab the keyboard in this case anyway, so I just removed it.

Also simlify MRV event handling code in general.
2014-12-05 17:36:02 -05:00
0ffeaa6d6a Remove braindead Parameter inheritance abuse. 2014-11-30 23:56:20 -05:00
cf537b97f5 Add missing namespace qualifiers. 2014-11-30 23:56:19 -05:00
ea5876b836 Remove dead code. 2014-11-25 02:11:44 -05:00
57c1b6e261 Fix quantization and other time-related ops. 2014-11-22 21:49:42 -05:00
bed95a64a0 Fix note resizing. 2014-11-22 15:33:40 -05:00
c1cfa12d6e Wrap MusicalTime in a class.
This lets us get a more explicit handle on time conversions, and is the main
step towards using actual beat:tick time and getting away from floating point
precision problems.
2014-11-22 04:05:42 -05:00
24f7eccc86 Factor out copy-paste code to get grid type in beats defaulting to 1. 2014-11-22 00:46:15 -05:00
41a9060df9 Move time converters only to the region views that actually need them.
A step towards sorting out time issues more solidly, the time situation of MIDI
region views and automation region views is slightly different.
2014-11-22 00:46:15 -05:00
563f5c11a6 Support cut/copy/paste of MIDI notes and controllers at the same time. 2014-11-16 22:35:45 -05:00
fd9ccc7058 Use an enum for RoundMode instead of magic numbers.
No functional changes in this one (for easier auditing), but towards having
round up/down only if necessary modes, rather than kludging around that
situation with a double round as we do currently.
2014-11-16 22:35:45 -05:00
8793e60af2 Use symbol for paste operation like everywhere else. 2014-11-16 22:35:45 -05:00
3f8251962f Fix crash when splitting regions in internal edit mode. 2014-11-16 22:35:45 -05:00
31acd96384 Implement "multi-paste" for notes, regions, and automation.
The idea here is that pasting several times to the same location doesn't make
sense.  Instead, the paste is appended past the last paste, snapped to the
grid.  This make it simple to replicate a given section a number of times,
simply by copying once and pasting several times.

This behaviour only appears when successive pastes are done to the same
location (whatever the edit point is).  When the paste point changes, the
"multi-paste" state is reset.

Boots 'n cats 'n boots 'n cats.
2014-11-14 20:04:19 -05:00
31b6b05125 Fix MIDI note cut/copy/paste. 2014-11-14 20:04:19 -05:00
5d5d9cb9e2 Fix various sticky/broken cursor issues.
This still isn't quite right, but it's a lot less broken than before, at least.
2014-11-14 02:37:36 -05:00
3b23aed5e1 Fix error when create-dragging note backwards past start of region (#5934). 2014-11-14 00:31:28 -05:00
a733a2a4c5 Don't make MIDI regions in note mode completely invisible.
This makes for extremely confusing behaviour, particularly when creating new
regions.  This is still probably too transparent, IMO, but at least isn't
totally mysterious.  "visible" is a bit of a misnomer in the code, now.
2014-11-13 23:33:11 -05:00
ba4d1cd1c1 remove "canvasvar_" from all functions related to obtaining values from ARDOUR_UI::config() 2014-10-21 22:58:58 -04:00
b73f725676 remove mouse zoom mode; bind z to zoom-to-range 2014-10-21 12:47:53 -04:00
f369208334 Disallow midi-note duration changes beyond region boundaries
Fixes crash/assert with negative Beats.

TODO discuss alternative:
 automatically extend/trim region (if possible) or
 accept but hide notes that are out of bounds. That would need
 some solution for ghost notes which still can have negative Beats
 while dragging.
2014-10-21 15:48:11 +02:00
148c1f1768 fix stuck key-grab/scrolling.
Problem: mouse-scrolling over a MIDI region in internal edit mode
never released “magic widget focus” (mod keys and global scrolls after
that were ignored). -> added to leave_notify.

Also, the MouseModeChanged signal needs to be emitted when internal edit,
mode changes in order to trigger MidiRegionView::mouse_mode_changed(), 
which in turn releases the magic focus while still hovering over a MIDI
region.
2014-10-21 11:07:53 +02:00
a9532179d5 Midi Region: pass unhandled scroll events to regionview
see note in MidiRegionView:📜 “allow PrimaryModifier scroll
through so that it still works for zoom.”
2014-10-21 11:01:28 +02:00
1f313ec19c Vertically align Midi Notes, Piano Roll & Canvas Line Grid 2014-09-08 18:44:32 +02:00
4e689d9496 use new TrackingText for verbose cursor 2014-06-26 15:10:24 -04:00
a3c378cf62 move utility functions into a dedicated namespace 2014-06-25 21:47:54 +02:00
6a5d805b38 more canvas refactoring.
Remove Canvas::Layout, use Canvas::Container for the same purpose, move child-rendering into Item::render_children() so that it
could theoretically be used by any derived type.
2014-06-22 11:41:05 -04:00
0796ccfb65 use newly factored canvas in gtk2_ardour 2014-06-21 11:44:22 -04:00
ce08ec0de0 substantial changes in color management, involving a reduction in the use of Gdk::Color and more consistent logic for region coloring.
Group tabs now also get the text drawn in an appropriately contrast-y color
2014-06-09 23:29:00 -04:00
dbaf203bac fix ridiculous spelling error 2014-04-15 12:44:49 -04:00
279aefc60e fix error in height computation of MIDI region views (FUDGE!) use Rectangle::set_outline_all() and avoid the removed integer version of ::set_outline_what() 2014-03-11 07:39:25 -04:00
41c4c41eaa fix apparent logic error for MidiRegionView when redisplaying note model 2014-03-06 23:16:42 -05:00
feebabb330 trivial API change for MidiRegionView::update_hit() 2014-03-06 13:27:51 -05:00
3bbbf56718 passthrough unhandled motion events in MIDI region views because we may be dragging non-note objects like patch changes 2014-02-11 22:46:21 -05:00
7eb40ae6c8 slight code replacement 2014-01-20 10:52:27 -05:00
934e827420 fix non-editing/non-draw event handling by MIDI regions 2014-01-16 10:53:02 -05:00
3020b224fa Merge windows+cc branch into cairocanvas branch. Not finished, need to now merge windows branch to get changes from there 2014-01-10 16:07:57 -05:00
4f9e46976c make middle-click on piano roll track header more usefully select/unselect notes 2013-10-23 10:38:50 -04:00