Commit Graph

25 Commits

Author SHA1 Message Date
4178db5f63 globally remove all trailing whitespace from .cpp and .hpp files missed by previous commit 2015-10-04 15:11:15 -04:00
8b2fb88f15 fix ever increasing MIDI event IDs
Iterating over a const Midi-Sequence calls Evoral::Sequence::set_event(),
which in turn used Evoral::Event::operator=()  which always created
a new event-ID (create copy of the event).

Issues fixed:
 - Saving *unmodified* MIDI produced new event-IDs on every save;
   files changed with every save. - greetings to Deva.
 - all [GUI] operations that use IDs to refer to notes e.g. undo.
   invalid undo-history.

Also clarify assignment operator name. Prefer explicit assign() over =.
2015-09-18 17:36:15 +02:00
nick_m
92b69a17da Make Evoral::Event ids unique always.
- probably fixes a lot of cases where note ids are assumed to be
	  unique (they weren't for copies and some others).
	- wrong branch, but it needs testing.
2015-05-24 01:53:34 +10: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
2a251b4570 MusicalTime => Beats. 2015-01-07 00:12:07 -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
3bc0d3e57b fix evoral assignment operator (copy buffer) 2014-01-22 15:11:31 +01:00
4b38ddec62 replace deprecated g_atomic_int_exchange_add()
git-svn-id: svn://localhost/ardour2/branches/3.0@13086 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-07-26 15:39:17 +00:00
eaa7cc5a73 fix up some const-ness issues starting from Evoral::Event::set(), and intersect with removing Mackie..MidiByteArray::bytes() method which made a copy of the data every time we wrote it
git-svn-id: svn://localhost/ardour2/branches/3.0@12124 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-30 15:54:13 +00:00
18c2ee4a26 Remove dubious Evoral::Event methods that exposed non-const references to members.
git-svn-id: svn://localhost/ardour2/branches/3.0@10239 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-10-19 18:11:31 +00:00
0906b39918 Fix my name :)
git-svn-id: svn://localhost/ardour2/branches/3.0@9302 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-04-06 15:00:16 +00:00
Carl Hetherington
5c23faaa0d Allow trim of midi regions to before the start of the source (better, this time). Fixes #3156.
git-svn-id: svn://localhost/ardour2/branches/3.0@8229 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-09 21:34:46 +00:00
Carl Hetherington
56554af08f Revert previous ill-thought-out patch.
git-svn-id: svn://localhost/ardour2/branches/3.0@8213 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-07 19:55:43 +00:00
Carl Hetherington
f3fc6195bc Allow trim of midi regions to before the start of the source. Fixes #3156.
git-svn-id: svn://localhost/ardour2/branches/3.0@8212 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-07 19:16:23 +00:00
Carl Hetherington
73192bc1a7 Remove all use of nframes_t.
git-svn-id: svn://localhost/ardour2/branches/3.0@8166 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-03 22:26:29 +00:00
bf91ed99ec add note IDs and use them for looking up notes during a history rebuild. NOTE: INVALIDATES OLDER HISTORY FILES
git-svn-id: svn://localhost/ardour2/branches/3.0@7449 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-20 16:27:34 +00:00
bb9cc45cd2 Strip trailing whitespace and fix other whitespace errors (e.g. space/tab 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-10-14 16:10:01 +00:00
3845af6ce9 lots of MIDI editing stuff. to be explained on the website when its done
git-svn-id: svn://localhost/ardour2/branches/3.0@5596 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-08-27 03:09:30 +00:00
5a48f99f72 Use nframes_t for timestamps of real (jack) time MIDI events (i.e. in MidiBuffer and MidiRingBuffer).
Use iterator interface of Sequence to read events in a MIDISource rather than Sequence::read, avoiding timestamp confusion.
Disable no longer useful Sequence::read.


git-svn-id: svn://localhost/ardour2/branches/3.0@4570 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15 01:24:26 +00:00
80e54c6ea0 MIDI robustness.
- Separate SMF::open and SMF::create, more powerful interface for both.
- Correctly handle note ons with velocity 0 as note offs in sequence.
- Use SMF (i.e. libsmf) for MIDI import


git-svn-id: svn://localhost/ardour2/branches/3.0@4558 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-14 20:52:15 +00:00
Hans Baier
db77cb9212 * more pleasant template parameter names in (MIDI)Event
git-svn-id: svn://localhost/ardour2/branches/3.0@4487 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-03 08:46:44 +00:00
166ef64e3d Make (MIDI) event time stamp type a template parameter.
git-svn-id: svn://localhost/ardour2/branches/3.0@4473 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-02 02:36:05 +00:00
c5aa717828 Sync with http://svn.drobilla.net/lad/trunk/evoral r1891.
(Only change: use #include "" instead of #include <> for local include paths).


git-svn-id: svn://localhost/ardour2/branches/3.0@4335 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-12-21 20:36:15 +00:00
a2d2f738cb Move event specific ringbuffer stuff to evoral.
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-22 16:28:02 +00:00
d357eca668 Factor out sequencing related things into an independant new library: "evoral".
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-09-19 00:47:49 +00:00