summaryrefslogtreecommitdiff
path: root/libs/ardour/smf_source.cc
AgeCommit message (Collapse)Author
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
2009-11-30attempt to remove confusion and errors caused by unclear semantics of ↵Paul Davis
_is_embedded for FileSources; member renamed _within_session, and is now ALWAYS determined by the _path of the FileSource, never by the creator git-svn-id: svn://localhost/ardour2/branches/3.0@6213 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-26Remove idiocy.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5930 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-25Remove Session dependency from BeatsFramesConverter.David Robillard
More constey TempoMap accessors. git-svn-id: svn://localhost/ardour2/branches/3.0@5916 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-24(FULL commit) start of a nominal debug tracing system, with 64 bits ↵Paul Davis
available for flags; track notes by region in MidiPlaylist, and resolve them if they are left hanging at region boundaries. note: MIDI playback is still not working 100% though its better now. git-svn-id: svn://localhost/ardour2/branches/3.0@5903 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-22Fix crash on save of MIDI data.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5875 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-22Actually load MIDI data from disk on session load (kludgey, forces model to ↵David Robillard
always be loaded, this needs fixing later). Fix hilariously braindead non-lock in SMFSource::load_model. git-svn-id: svn://localhost/ardour2/branches/3.0@5869 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-22Fix deadlocks on MIDI record.David Robillard
More locking than is strictly necessary, but the assertion in MidiModel::write_lock is a nice check, at least for now... git-svn-id: svn://localhost/ardour2/branches/3.0@5868 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-21Fix MIDI rec regions.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5842 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-21Disable excessive debug printing.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5834 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-19track notes at the region level in MidiPlaylist; resolve them (deliver note ↵Paul Davis
offs) if a note spans the end of the region git-svn-id: svn://localhost/ardour2/branches/3.0@5804 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-21(full commit): fix MIDI playback by not writing into the playback buffer ↵Paul Davis
from MidiDiskStream::process() unless recording. This has a negative impact on "monitoring" MIDI, but that needs a different, somewhat more expansive solution anyway git-svn-id: svn://localhost/ardour2/branches/3.0@5685 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-09-16remove existing attempts at optimizing MIDI event reading, to try to fix ↵Paul Davis
bugs that may be connected with it git-svn-id: svn://localhost/ardour2/branches/3.0@5667 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-09-16do not allow smf_source's reads to stomp on cached read_end position in ↵Paul Davis
parent class, which creates chaos by being out of sync with MidiSource::_model_iterator. this doesn't totally fix MIDI playback, but it helps git-svn-id: svn://localhost/ardour2/branches/3.0@5665 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-05-07The great audio processing overhaul.David Robillard
The vast majority of Route signal processing is now simply in the list of processors. There are definitely regressions here, but there's also a lot of things fixed. It's far too much work to let diverge anymore regardless, so here it is. The basic model is: A route has a fixed set of input channels (matching its JACK input ports and diskstream). The first processor takes this as input. The next processor is configured using the first processor's output as input, and is allowed to choose whatever output it wants given that input... and so on, and so on. Finally, the last processor's requested output is used to set up the panner and create whatever Jack ports are needed to output the data. All 'special' internal processors (meter, fader, amp, insert, send) are currently transparent: they read any input, and return the same set of channels back (unmodified, except for amp). User visible changes: * LV2 Instrument support (tracks with both MIDI and audio channels) * MIDI in/out plugin support * Generic plugin replication (for MIDI plugins, MIDI/audio plugins) * Movable meter point Known Bugs: * Things seem to get weird on loaded sessions * Output delivery is sketchy * 2.0 session loading was probably already broken... but it's definitely broken now :) Please test this and file bugs if you have any time... git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-04Shut up.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5040 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-04-30Rename 'position' parameter of MidiSource::midi_read to clearer 'source_start'.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5021 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-04-16Revert stupid r4975.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4984 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-04-14SMFSource: enhanced debugging output to reveal more of the problemHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@4976 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-04-14SMFSource: code readabilityHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@4975 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-04-14SMFSource / MIDISource: more readable variable names in ↵Hans Baier
read/write(_unlocked), added debugging output to diagnose recording bug (MIDI recording stops receiving events after a short while) git-svn-id: svn://localhost/ardour2/branches/3.0@4974 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-26Fix a bunch of warnings.David Robillard
Clean up. git-svn-id: svn://localhost/ardour2/branches/3.0@4668 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-20Make source length a dynamic thing.David Robillard
Update MIDI region length (actually and visually) when position changes. git-svn-id: svn://localhost/ardour2/branches/3.0@4644 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-19Introduce new time for session-relative frame time, and make source ↵David Robillard
interface capable of handling 64-bit long sessions. sframes_t is "session frames". The rules for time stamps are: - Anything relative to transport time, session position, etc, should be sframes_t - Anything relative to jack cycles, including the length thereof, should be nframes_t To support sessions which exceed UINT32_MAX frames, we need to replace all the uses of nframes_t for session time with sframes_t, and make sure the conversions are sound. This does not depend on jack's nframes_t; that we are using the same type at all right now was an oops. This is also be kinda nice for readability since the two different time bases have different types... git-svn-id: svn://localhost/ardour2/branches/3.0@4636 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-19Interpret tempo time based on read position (not source timeline position ↵David Robillard
which is more or less meaningless). Move time conversion into the region view rather than the source. Adapt MIDI (including controllers) regions to the destination tempo when moved (e.g. dragging a region to a location with half the tempo will make the notes twice as long). git-svn-id: svn://localhost/ardour2/branches/3.0@4635 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-17Fix the horrible mess that was anything related to sources and paths.David Robillard
Most significant changes: - Factor out FileSource from AudioFileSource, use for SMFSource too - Explicitly pass embedded rather than mysterious name mangling or whatever - Destroy a ton of duplicated or very-nearly-duplicated code - Clean up and document all that weird source stuff in session.cc git-svn-id: svn://localhost/ardour2/branches/3.0@4609 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-16Move duplicated AudioFileSource::Flags and SMFSource::Flags into Source.David Robillard
Clean up source stuff. git-svn-id: svn://localhost/ardour2/branches/3.0@4605 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-16Don't bind playlist_modified with a shared_ptr<Playlist> parameter.David Robillard
Clean up. git-svn-id: svn://localhost/ardour2/branches/3.0@4599 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-16Time unit translation for AutomationLine (correctly display MIDI controller ↵David Robillard
data). git-svn-id: svn://localhost/ardour2/branches/3.0@4597 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-16Move all beats <-> frames time conversion into a single object that can be ↵David Robillard
passed around. This has 3 main benefits: - All conversion code is in one place (less duplication, potential bugs) - The conversion method can be passed to things that are ignorant of the actual time units involved, information required, etc. (In the future it would be nice to have user selectable tempo/frame time) - It should be relatively simple now to support tempo changes part-way through a MIDI region (at least architecturally speaking) git-svn-id: svn://localhost/ardour2/branches/3.0@4594 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Clean up fugly debug printing stuff.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4588 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Fix crash on reading meta event.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4586 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Fix genererally retarded and broken note range / diskstream display / etc. ↵David Robillard
related things (correctly display region contents on initial session load). git-svn-id: svn://localhost/ardour2/branches/3.0@4583 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-15Commit of the century, right here.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4580 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Cache file position in SMFSource::read_unlocked (i.e. don't seek to start ↵David Robillard
and search every single time). git-svn-id: svn://localhost/ardour2/branches/3.0@4573 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Clean up.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4572 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15De-templatify Evoral::SMF which has no concept of time other than SMF time.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4571 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Use nframes_t for timestamps of real (jack) time MIDI events (i.e. in ↵David Robillard
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-14Tidy.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4569 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-14Make SMF::append_event_delta take a buffer and a size rather than an Event ↵David Robillard
(no point, more generic, etc.). git-svn-id: svn://localhost/ardour2/branches/3.0@4567 d708f5d6-7413-0410-9779-e7cbd77b26cf