summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_model.cc
AgeCommit message (Collapse)Author
2009-10-21Fix unused parameter warnings since GCC apparently doesn't feel like ↵David Robillard
listening to -Wno-unused-parameter git-svn-id: svn://localhost/ardour2/branches/3.0@5835 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-20handle searching for a note in an empty note listPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@5822 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-19Use logarithmic search for MidiModel::find_note (used by DiffCommand).David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5800 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-15rework Stateful::set_state() patch to avoid default version argumentPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@5787 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-15Part 1 of loading 2.X sessions; some things work, some things don't, hacks ↵Carl Hetherington
a-plenty. LOADING 2.X SESSIONS WITH THIS COMMIT IN PLACE WILL (PROBABLY) CORRUPT THE .ardour FILE, MAKING THE SESSION UNLOADABLE ON 2.X AND LOSING INFORMATION. So don't do that unless you make a backup of the session file first. git-svn-id: svn://localhost/ardour2/branches/3.0@5786 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-14Strip trailing whitespace and fix other whitespace errors (e.g. space/tab ↵David Robillard
mixing). Whitespace changes only. Vimmers, try let c_space_errors = 1 in your .vimrc to highlight this kind of stuff in red. I don't know the emacs equivalent... git-svn-id: svn://localhost/ardour2/branches/3.0@5773 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-09-14fix up marshall/unmarshall of note data for MidiModel::DiffCommandPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@5662 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-09-10do not crash when loading old history files with MIDI edits; add all notes ↵Paul Davis
in region to canvas, but pay attention to visibility git-svn-id: svn://localhost/ardour2/branches/3.0@5652 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-09-10more MIDI editing cleanups, mostly fixing subtleties. Will break loading the ↵Paul Davis
history file for older sessions with MIDI editing present - we warned you :) git-svn-id: svn://localhost/ardour2/branches/3.0@5651 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-09-07add anonymous union to DiffCommand to allow uint8t_t and time-based ↵Paul Davis
arguments; use DiffCommand for note trimming git-svn-id: svn://localhost/ardour2/branches/3.0@5638 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-09-06the start (only the start) of MIDI diff commandsPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@5637 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-08-27lots of MIDI editing stuff. to be explained on the website when its donePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@5596 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-04Fix MIDI recording.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5039 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-25*** NEW CODING POLICY ***David Robillard
All #include statements that include a header that is a part of a library bundled with ardour MUST use quotes, not angle brackets. Do this: #include "ardour/types.h" NOT this: #include <ardour/types.h> Rationale: This is best practice in general, to ensure we include the local version and not the system version. That quotes mean "local" (in some sense) and angle brackets mean "system" (in some sense) is a ubiquitous convention and IIRC right in the C spec somewhere. More pragmatically, this is required by (my) waf (stuff) for dependencies to work correctly. That is: !!! FAILURE TO DO THIS CAN RESULT IN BROKEN BUILDS !!! Failure to comply is punishable by death by torture. :) P.S. It's not that dramatic in all cases, but this (in combination with some GCC flags specific to the include type) is the best way I have found to be absolutely 100% positive the local ones are being used (and we definitely want to be absolutely 100% positive on that one). git-svn-id: svn://localhost/ardour2/branches/3.0@4655 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-17Fix deadlock and potential race condition when editing MIDI.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4614 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15The Big Change: Store time in MidiModel as tempo time, not frame time.David Robillard
The time stamp of an event is now always tempo, from file to model and back again. Frame time is only relevant at playback or recording time, in the audio thread (MidiModel and MidiBuffer). I think perhaps we don't need to change the actual time from double (which is convenient for math), it is the time base conversion that caused problems. Using a correct equality comparison (i.e. not == which is not correct for floating point) should probably make the undo issues go away, in 99.99% of cases anyway. There's almost certainly some regressions in here somewhere, but they do not seem to be time related. The bugs I'm hitting in testing are old ones that seem unrelated now, so it's checkpoint time. This sets us up for fancy things like tempo map import and tempo/meter changes halfway through MIDI regions, but for now it's still assumed that the tempo at the start of the region is valid for the duration of the entire region. git-svn-id: svn://localhost/ardour2/branches/3.0@4582 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Session XML style consistency (tag names are capitalized).David Robillard
One thing left, this weird "end-marker-is-free" in <Config>. Is this really a config option? Anyone? git-svn-id: svn://localhost/ardour2/branches/3.0@4577 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Tidy, remove dead code.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4576 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-11verbosity--David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4536 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-02Make (MIDI) event time stamp type a template parameter.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4473 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-01Style.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4470 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-12-11* added myself to about.ccHans Baier
* created ArdourCanvas::CanvasFlag as a base class for flags * removed obsolete cruft from midi_model * made MidiTimeAxisView and MidiRegionView work together to display program changes as names by means of MidiPatchManager git-svn-id: svn://localhost/ardour2/branches/3.0@4307 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-10-05Normalize XML property name style, preserving old session loading (on load _ ↵David Robillard
will be converted to -). Still to go: Non-consistent PBD tag names, colours. git-svn-id: svn://localhost/ardour2/branches/3.0@3872 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-27robustify MidiModel::unmarshal_note()Paul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@3813 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-22Move event specific ringbuffer stuff to evoral.David Robillard
Sane event type interface between evoral and libardour (no more shared magic numbers). Cleanup Evoral::Sequence iterator, fix bugs, probably introduce new ones. Move MIDI specific event functions to Evoral::MIDIEvent (is-a Evoral::Event). git-svn-id: svn://localhost/ardour2/branches/3.0@3785 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-21Display recorded controller data (fix show all/existing automation).David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3779 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-19Factor out sequencing related things into an independant new library: "evoral".David Robillard
Anything related to the storage of events/values over a range of time lives in evoral. This includes MidiModel (Evoral::Sequence) and automation data (AutomationList (Evoral::ControlList), Automatable (Evoral::ControlSet), etc). libs/evoral synced with http://svn.drobilla.net/lad/trunk/evoral r1511. git-svn-id: svn://localhost/ardour2/branches/3.0@3754 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-06-02rollback to 3428, before the mysterious removal of libs/* at 3431/3432Paul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@3435 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-06-02remove empty sigc++2 directoryDoug McLain
git-svn-id: svn://localhost/ardour2/branches/3.0@3432 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-24Changed Byte to uint8_t in some files (left out from drobilla's previous commit)Sakari Bergen
git-svn-id: svn://localhost/ardour2/branches/3.0@3411 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-23* added midnam test file for xpathHans Baier
* added to_string() to MIDI::Event * added XMLNode::attribute_value for attribute nodes * debugging output in MidiModel (incorrect rendering of Pitchbender events: Notes lost * added xpath tests for midnam files git-svn-id: svn://localhost/ardour2/branches/3.0@3406 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-23* fixed: wrong conversion from double for pitch bender in ↵Hans Baier
MidiModel::control_to_midi_event git-svn-id: svn://localhost/ardour2/branches/3.0@3404 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-23*fix the bugfix: Input and Output Ports exchanged in Track/Bus inspectorHans Baier
*increased buffer sizes to get rid of overruns (PitchBender still doesnt work though....) git-svn-id: svn://localhost/ardour2/branches/3.0@3403 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-22Fix corrupt MIDI file writing when meta events are present (fixes missing ↵David Robillard
first note issue on some imported files). Reduce number of buffer allocations on MIDI read/write. git-svn-id: svn://localhost/ardour2/branches/3.0@3395 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-22Fix MIDI selection/tool issues (issue #0002415 and other bugs).David Robillard
Fix selection preservation across MIDI model editing commands (for both note moving and resizing). Fix selection breakage introduced by old selection preservation stuff (fix zombie selection). git-svn-id: svn://localhost/ardour2/branches/3.0@3381 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-21* bugfix: Inputs and Outputs swapped in the Track/Bus InspectorHans Baier
* bugfix: control_to_midi_event has no effect * typo (track/bus inspector) git-svn-id: svn://localhost/ardour2/branches/3.0@3379 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-21Separate audio and MIDI disk buffer size (and track read ahead) parameters.David Robillard
Clean up and remove more unused stuff from MidiDiskstream. Remove false assumptions that MIDI ring buffer space (bytes) corresponds to disk I/O chunk length (frames). git-svn-id: svn://localhost/ardour2/branches/3.0@3375 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-16* fix out of range MIDI event detectionHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@3366 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-16Fix out of range MIDI event error detection (duuuhhhhh).David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3364 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-16Fix invalid error message during MIDI recording (or files with stuck notes).David Robillard
Handle stuck notes more gracefully in the view (probably should show up as a diamond though?). git-svn-id: svn://localhost/ardour2/branches/3.0@3359 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-16Tidy up MIDI debugging output.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3358 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-16Fix crash on out of range MIDI events (though this shouldn't be possible at ↵David Robillard
all....). git-svn-id: svn://localhost/ardour2/branches/3.0@3357 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-15Re-comment-out MIDI iteration debug prints (oops).David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3353 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-15Fix silly bugs introduced in previous commit.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3352 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-15Eliminate excessive allocation (for every event) during MidiModel iteration.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3351 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-13* formattingHans Baier
* fixed corruption bugs due to allocation hell of MidiModel::const_iterator::_event: Changed it into boost::shared_ptr * fixed MidiModel::const_iterator bugs: -First note on lost, if an automation event comes first -corrupt MidiEvent compared to automation event if there are no notes in the region * (hopefully) fixed possible race condition * fixed range check in MidiDiskstream::set_state for channel mask * treating notes with duration 0 more gently in MidiRegionView (warning instead of assertion) git-svn-id: svn://localhost/ardour2/branches/3.0@3345 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-13Fix event allocation issues with MidiModel iteration.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3342 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-12Remove junk from MidiModel::write_toDavid Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3341 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-12* Quick Fix: assertion converted into warning in MidiModel::write_toHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@3337 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-12* fixed various event size bugsHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@3336 d708f5d6-7413-0410-9779-e7cbd77b26cf