Commit graph

659 commits

Author SHA1 Message Date
David Robillard
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
Robin Gareus
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
David Robillard
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
David Robillard
700cb13b36 Fix note visibility (#0006168). 2015-03-13 22:30:11 -04:00
David Robillard
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
Robin Gareus
232d67bc53 midi note paste undo fix. 2015-01-25 01:56:19 +01:00
David Robillard
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
David Robillard
305af7a5ce Fix whitespace. 2015-01-12 02:06:40 -05:00
David Robillard
ba9a90b927 Merge duplicated code. 2015-01-12 02:06:40 -05:00
David Robillard
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
David Robillard
8d98102573 Fix show MIDI regions using track color. 2015-01-08 19:59:40 -05:00
David Robillard
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
David Robillard
2a251b4570 MusicalTime => Beats. 2015-01-07 00:12:07 -05:00
David Robillard
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
David Robillard
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
David Robillard
937cf046a4 Fix key bindings for note trim/extend. 2014-12-29 20:50:39 -05:00
David Robillard
3d1f955a0c Fix MIDI recording display when zoom/etc changes. 2014-12-29 18:56:39 -05:00
David Robillard
d283608fe9 Automation ghost notes for percussive hits. 2014-12-28 21:31:33 -05:00
David Robillard
606efb601c Show correct ghost hit for percussive tracks. 2014-12-28 20:23:52 -05:00
David Robillard
b54863c8c3 Set new note velocity based on surrounding notes. 2014-12-28 19:21:46 -05:00
David Robillard
4973ddc478 Fix events for short notes at region start/end. 2014-12-28 17:45:24 -05:00
David Robillard
6a73fd337c Update note colors when model changes. 2014-12-28 16:06:44 -05:00
David Robillard
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
David Robillard
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
Paul Davis
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
Paul Davis
00887f94dc more color/modifier tweaks 2014-12-19 12:06:42 -05:00
David Robillard
6031308520 Use color modifiers for dynamic region styles. 2014-12-18 20:23:34 -05:00
David Robillard
a12a065457 Fix copy paste of MIDI and track automation. 2014-12-18 20:23:34 -05:00
David Robillard
026f7bf5b7 Make MIDI regions translucent for internal tools. 2014-12-18 20:23:23 -05:00
Ben Loftis
7ab8a11fb5 Enforce internal/external selection exclusivity. 2014-12-18 20:22:48 -05:00
David Robillard
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
David Robillard
5f66300349 Support stepping bank by shift+scroll/arrow. 2014-12-17 20:18:11 -05:00
David Robillard
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
David Robillard
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
David Robillard
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
David Robillard
da2043e179 Force ghost note positive in all circumstances. 2014-12-17 03:17:07 -05:00
David Robillard
5ee4a5d56a Don't allow drawing notes in rec regions (crash). 2014-12-17 02:50:45 -05:00
David Robillard
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
Paul Davis
1ab2705b4b next modifier 2014-12-15 10:32:17 -05:00
Paul Davis
811677c543 fix incorrect item name for color 2014-12-15 09:05:01 -05:00
Paul Davis
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
Paul Davis
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
David Robillard
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
David Robillard
ec8c0e93bb Fix shift-rect-select with MIDI notes. 2014-12-07 17:30:06 -05:00