summaryrefslogtreecommitdiff
path: root/libs/ardour/smf_source.cc
AgeCommit message (Collapse)Author
2013-03-14match *.[mM][iI][dD][iI]$ as well as *.[mM][iI][dD] files when looking for ↵Paul Davis
MIDI files
2013-01-21Fix MIDI loop recording.David Robillard
This changes how things work a bit, but I am committing it for 3.0 since the previous revision often crashed (and never worked), this one seems to work fine, and the code is quite a bit more cogent. I have tested the following use cases with live input and audible output: * Non-loop recording, armed before roll * Non-loop recording, arm while rolling * Loop recording, armed before roll * Loop recording, arm during roll In the last case, the source/region is created starting at the loop start rather than the current transport frame as usual so time makes sense when it wraps around. See the documentation added to the code for details, but the basic idea here is to simply push MIDI events to the source with increasing monotonic time, ignoring looping altogether. Essentially we pretend the loop does not exist, but the source knows all the details so it can implement whatever behaviour is appropriate. Currently, this is simply recording a complete non-destructive copy of the input, which is a good thing. Perhaps not what the user expects of loop recording, but at least it works and is one sensible option. We will need to add more later. Display while recording is a little bit wacky, but whatever. git-svn-id: svn://localhost/ardour2/branches/3.0@13940 d708f5d6-7413-0410-9779-e7cbd77b26cf
2013-01-21More style-only changes.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@13939 d708f5d6-7413-0410-9779-e7cbd77b26cf
2013-01-16use regex to match [mM][iI][dD] file extension for MIDI files, thus making ↵Paul Davis
it case-insensitive (fixes #5231) git-svn-id: svn://localhost/ardour2/branches/3.0@13855 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-08-10add -Wpointer-arith -Wcast-qual -Wcast-align and others to compile flags, ↵Paul Davis
and fix const cast warnings generated by new flags git-svn-id: svn://localhost/ardour2/branches/3.0@13124 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-07-17lots more fidgety work on automation. sort of works now, but undo/redo needs ↵Paul Davis
attention git-svn-id: svn://localhost/ardour2/branches/3.0@13047 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-06-23Remove two unnecessary header includes of pbd/mountpoint.hTim Mayberry
git-svn-id: svn://localhost/ardour2/branches/3.0@12826 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-10Compute delta time correctly when appending events; the converter must be ↵Carl Hetherington
used to convert a source time, not a delta time, otherwise tempo / meter changes are not correctly accounted for. git-svn-id: svn://localhost/ardour2/branches/3.0@10963 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-01stop spewing debug output from SMFSourcePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@10851 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-11-15Remove debug code.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@10603 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-10-24Remove unused read/write data count code.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@10300 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-10-19Remove dubious Evoral::Event methods that exposed non-const references to ↵David Robillard
members. git-svn-id: svn://localhost/ardour2/branches/3.0@10239 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-07-20try to fix data loss at end of a capture pass for MIDI - add a new virtual ↵Paul Davis
method to MidiSource that specifies what should be done with stuck notes, remove duplicate(i hope) _last_flush_frame from SMFSource that mirrored, more or less, MidiSource::_last_write_end; use new virtual method when stopping after capture. git-svn-id: svn://localhost/ardour2/branches/3.0@9910 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-07-19more MIDI I/O debugging outputPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9901 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-07-14initial pass at session-renaming functionalityPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9876 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-07-14more midi I/O debuggingPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9873 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-07-11accept .MID as a MIDI file extension, not just .midPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9839 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-06-22second half of "bomb out if playlist construction from XML fails"Paul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@9759 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-08Ensure that empty drag-created MIDI regions get a file on disk so that there ↵Carl Hetherington
aren't missing file errors on reload (#4024). git-svn-id: svn://localhost/ardour2/branches/3.0@9486 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-04-06Fix my name :)David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@9302 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-03-26remove Evoral::RingBuffer, which was (a) duplicating PBD::RingBufferNPT and ↵Paul Davis
(b) broken; replace it with PBD::RingBufferNPT git-svn-id: svn://localhost/ardour2/branches/3.0@9212 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-03-03move open-on-write call for MIDI into mark_streaming_midi_write_started() so ↵Paul Davis
that it works for the fork operation (or any other op that writes a new file) git-svn-id: svn://localhost/ardour2/branches/3.0@9052 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
2011-03-01Make sure that the MidiSource constructor doesn't set the wrong _flags.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8996 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-20Fix more broken whitespace.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@8314 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-09Use a weak_ptr rather than a bald pointer for _midi_source in MidiModel.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8228 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-12-03Remove all use of nframes_t.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@8166 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-11-09add "origin" property to FileSource so that we can track multiple importsPaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@7986 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-10-08Update recorded MIDI regions as notes arrive. Fixes one cause of infinite ↵Carl Hetherington
note-lengths during record. Fix various problems with multiple captures of MIDI during one pass. git-svn-id: svn://localhost/ardour2/branches/3.0@7887 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-10-05Improve GUI display during MIDI record in various ways.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@7875 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-09-17megaopus patch #2 for today: remove nframes64_t and sframes_t from sourcePaul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@7792 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-09-14remove Glib::ustring from libardour; allow any characters except '/' and '\' ↵Paul Davis
in paths (may cause issues when loading creatively named 2.X sessions; fix a couple of details of name collection and usage from the startup dialog git-svn-id: svn://localhost/ardour2/branches/3.0@7772 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-09-01Clean up MidiSource::midi_read now that the signed type sframes_t is being ↵Carl Hetherington
used to pass positions around. git-svn-id: svn://localhost/ardour2/branches/3.0@7726 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-25Remove debug output from last commit.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@7486 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-25Add test for #3356.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@7485 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-20add note IDs and use them for looking up notes during a history rebuild. ↵Paul Davis
NOTE: INVALIDATES OLDER HISTORY FILES git-svn-id: svn://localhost/ardour2/branches/3.0@7449 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-16newly created files for use in recording appear in a .stubs folder, and are ↵Paul Davis
moved out of it when recording stops git-svn-id: svn://localhost/ardour2/branches/3.0@7426 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-14A few fixes to interpolation of MIDI controller data. Don't interpolateCarl Hetherington
when writing these data back to a source, otherwise surprising new interpolated points appear in MIDI automation. Similarly don't interpolate when reading the model during MIDI stretch. Fix handling of interpolation state; controllers that have been set by the user to use a different interpolation style are noted in the <Source> tag of the session file and this state is sprayed around to MidiModel and the GUI as necessary. git-svn-id: svn://localhost/ardour2/branches/3.0@7409 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-01add MidiModel::sync_to_source() to push model state into its existing ↵Paul Davis
source; mark SMFSource as non-removable after its called SMF::end_write(); some indentation fixes git-svn-id: svn://localhost/ardour2/branches/3.0@7350 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-07-01fix assumption that Session::_mmc != 0Paul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@7349 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-06-28Fix a couple of crashes on MIDI import.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@7308 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-06-26lots of details relating to MIDI file management; try to ignore ALSA ↵Paul Davis
sequencer MIDI ports named "Midi-Through" git-svn-id: svn://localhost/ardour2/branches/3.0@7305 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-06-01rationale pathways that add notes to Sequence<T> so that there is only final ↵Paul Davis
insertion step; when changing note properties that affect "indexing" within a Sequence<T> (i.e. via set<T,comparator> indexing/ordering/hashing), remove the note and add it back so that indexing stays consistent; fix marshalling of MidiModel::DiffCommand (boost::bind(&Object::method, reference_to_object) will COPY the reference, so use a pointer); fix MidiModel::find_note() to compare note properties not pointer addresses git-svn-id: svn://localhost/ardour2/branches/3.0@7203 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-05-30make trimming in region name (colored) highlight work even in internal edit ↵Paul Davis
mode; change enter/leave handler to return true by default (MIGHT HAVE UNINTENDED EFFECTS on mouse response), thus avoiding multiple stacked canvas items fighting over enter/leave git-svn-id: svn://localhost/ardour2/branches/3.0@7195 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-05-24Use debug macros for SMFSource.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@7150 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-05-24Note the time of the last event that was read by read_unlocked, so that the ↵Carl Hetherington
current time can be reset on a subsequent call. git-svn-id: svn://localhost/ardour2/branches/3.0@7148 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-05-16Move FileManager code into libpbd. Use it for SMF read/write.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@7108 d708f5d6-7413-0410-9779-e7cbd77b26cf