summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_model.cc
AgeCommit message (Collapse)Author
2017-09-24convert codebase to use Temporal for various time typesPaul Davis
2017-04-19Use XMLNode::get/set_property API in ARDOUR::MidiModel classTim Mayberry
2017-03-04offset linked regions to compensate for negative start after trim drag.nick_m
- should fix 7105
2017-01-23NO-OP: add a few spaces before function argsPaul Davis
2016-12-03Remove Evoral::MIDIEventDavid Robillard
It is slightly questionable whether type specific methods like velocity() belong on Event at all, these may be better off as free functions. However the code currently uses them as methods in many places, and it seems like a step in the right direction, since, for example, we might some day have events that have a velocity but aren't stored as MIDI messages (e.g. if Ardour uses an internal musical model that is more expressive). In any case, the former inheritance and plethora of sloppy casts is definitely not the right thing.
2016-11-08Support multiple readers for MIDI source/modelDavid Robillard
Fixes the multiple reader issue #6541 properly without resorting to a linear search kludge. All the read state has been pulled out into a MidiCursor which the caller is required to pass. The playlist keeps cursors for all the regions it is reading, any number of cursors are allowed at a time. MidiCursor should probably be made a smarter and more fool-proof object (and/or possibly merged with some of the other tracker/fixer stuff) but for now I wanted to keep it simple.
2016-10-07proper C++ const API (possible fix for MSVC builds)Robin Gareus
2016-07-20Make MidiModel::write_section_to able to offset event timesJulien "_FrnchFrgg_" RIVAUD
MidiModel::write_section_to() only wrote events to the given source if those events had a time in the given range. Make it able to optionally offset event times so that the start of the written range corresponds to time 0 in the source.
2016-07-20Make MidiModel::write_section_to() more type-independantJulien "_FrnchFrgg_" RIVAUD
Replace hard-coded Evoral::Beats by TimeType which is currently the same thing but might change in the future.
2016-07-14enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.hPaul Davis
2016-05-04OMNIBUS COMMIT: prefer const XMLNode::property method (and provide a real one)Paul Davis
2015-12-22Fix overlapping resolution (see issue #177)Nil Geisweiller
It assumes that a note ending at the same time of another one starting is not considered overlapping.
2015-10-17Remove all the now unused functions in the MidiModel class.André Nusser
2015-10-17Split transpose in MidiModel into two functions.André Nusser
2015-10-05NOOP, remove trailing tabs/whitespace.Robin Gareus
2015-10-04globally remove all trailing whitespace from ardour code base.Paul Davis
Paul Davis was responsible for introducing almost all of this.
2015-05-12Fix stuck notes on save during MIDI playback.David Robillard
2015-03-05Handle edits while playing precisely.David Robillard
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-02-06Rework previous commit to avoid extra property lookup (fwiw).nick_m
2015-02-06Make sure we have the property rather than the value of patch change id.nick_m
(don't crash whenever someone adds a patch change and reloads the session).
2015-01-07MusicalTime => Beats.David Robillard
2014-12-30Fix some mangled whitespace (noop).David Robillard
2014-12-29Fix occasional crash when saving MIDI.David Robillard
I can't figure out why a change has a NULL note; that shouldn't happen, but it does. Worse case scenario is some undo loss, so better to print something informative and soldier on than crash. Hopefully this will help track down the real cause with more testing.
2014-12-29fix a few compiler warningsPaul Davis
2014-12-28MIDI transform dialog.David Robillard
2014-12-28Clean up note delta command code.David Robillard
Use Variant to store the value and the same code path for all properties. Factor out getting the value of whatever property instead of special casing the handling. Towards using this stuff for some fancy things...
2014-12-17Fix various MIDI locking issues.David Robillard
Attempt to make mistakes much less likely in the future by statically requiring caller to pass scoped locks where necessary.
2014-11-22Wrap MusicalTime in a class.David Robillard
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-20Fix lost MIDI note offs and controllers.David Robillard
Fix initial read of discrete MIDI controllers. Fix spurious note offs when starting to play in the middle of a note. Faster search for initial event when cached iterator is invalid. So much for dropping the cached iterator. The iterator is responsible for handling note offs, so that doesn't work. This design means we have some stuck note issues at the source read level, but they should be taken care of by the state tracker anyway.
2014-11-19Fix dropped MIDI events, especially with record enabled.David Robillard
I am not precisely sure why the cached iterator was causing this problem, it shouldn't be invalidated, and the times make sense. It may be some lock related issue since the iterator holds a lock on the source. In any case, this cached iterator was just to avoid repeated linear search of the model, but since the model has a logarithmic search, instead just scrap all this problematic persistent state and search for the appropriate start time every read. No need to be careful about invalidating when anything changes.
2014-11-14add abort() to non-reached codeRobin Gareus
This cleans up a lot of false-positives in static analysis and also helps compilers to optimize code paths in general. (tagging the fatal stingstream operator as ‘noreturn’ is far less trivial)
2014-03-23assure midi patch ID is set before assigning itRobin Gareus
2013-11-04initialize MidiModel::Change::patch_id (correctlty?)Paul Davis
2013-03-29major fixes for MIDI patch change and note undo/redo. Patch change handling ↵Paul Davis
was completely broken because of the use of absolute floating point comparisons for time comparison, and serialization/deserialization of patch change property changes was borked because of int/char conversions by stringstream. Note undo/redo would fail for note removal if a note had been moved and/or had its note number changed as the next operation after it was added, because time-based lookup would fail. Similar small changes made for sysex messages, which just needed the musical_time comparisons and nothing else
2012-10-11implement deleting of sysex eventsHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@13238 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-07-25convert from Glib:: to Glib::Threads for all thread-related APIPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@13084 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-05-24Remove over 500 unnecessary includes (including 54 of session.h).David Robillard
It's slightly possible that this causes trivial build failures on different configurations, but otherwise shouldn't cause any problems (i.e. no actual changes other than include/naming/namespace stuff). I deliberately avoided removing libardour-config.h since this can mysteriously break things, though a few of those do seem to be unnecessary. This commit only targets includes of ardour/*.h. There is also a very large number of unnecessary includes of stuff in gtk2_ardour; tackling that should also give a big improvement in build time when things are modified. git-svn-id: svn://localhost/ardour2/branches/3.0@12420 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-27Move patch changes when inserting silence at the start of a model.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@11084 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-10-23Fix read of MIDI undo information to use the correct time type. Fixes #4387.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@10292 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-10-19Trim the include tree.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@10227 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-09-27Add missed parent class call to Sequence::control_list_marked_dirty. Fixes ↵Carl Hetherington
#4335. git-svn-id: svn://localhost/ardour2/branches/3.0@10140 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-09-19Emit ContentsChanged on the model when one of its control lists changes. ↵Carl Hetherington
Should fix #3880. git-svn-id: svn://localhost/ardour2/branches/3.0@10095 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-06-22ignore unpaired noteoff's when writing part of a MidiModel to a new source. ↵Paul Davis
in reality, there should be no unpaired noteoffs, but this is still an important fix git-svn-id: svn://localhost/ardour2/branches/3.0@9757 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-06-01Fix broken whitespace. I'd apologize for the compile times if it was my ↵David Robillard
fault :D git-svn-id: svn://localhost/ardour2/branches/3.0@9654 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-05-16Fix undo when notes are changed and then removed by the overlap checker (#3995).Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@9531 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-04-23Re-fix compile failure with --no-nls (#3111).Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@9415 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-04-06Differentiate between pitch-shift (for audio) and transpose (for MIDI). ↵Carl Hetherington
Fixes #3940. git-svn-id: svn://localhost/ardour2/branches/3.0@9299 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-03-15Fix more broken whitespace.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@9152 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-03-02remove entire "stub" file concept; open new audio and MIDI files on demand ↵Paul Davis
(at first write); could be a few gotchas with some corner case scenarios, but apparently works OK git-svn-id: svn://localhost/ardour2/branches/3.0@9038 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-28Unify program change and bank handling so that they are manipulated together.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8346 d708f5d6-7413-0410-9779-e7cbd77b26cf