summaryrefslogtreecommitdiff
path: root/libs/ardour/smf_source.cc
AgeCommit message (Collapse)Author
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
2009-02-14Remove unused (and timestamp type nasty) last_event_time() from SMF.David Robillard
I swear I already did this. git-svn-id: svn://localhost/ardour2/branches/3.0@4564 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-14MIDI robustness.David Robillard
- 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-14Fix most absurd function name I've seen in a while.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4555 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-14More powerful SMF::open interface.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4554 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-12* disabled debugging outputHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@4541 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-12* Swapped MidiSource to LibSMFHans Baier
* integrated libsmf into scons git-svn-id: svn://localhost/ardour2/branches/3.0@4539 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-11Remove unused (and weirdly typed) time parameter from begin_write.David Robillard
Fix append_event_unlocked shadowing. git-svn-id: svn://localhost/ardour2/branches/3.0@4535 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-01Removed fixed/maximum event size assumption/limitation from MIDI buffer.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4471 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-01-30Trim include dependency graph, especially for io.h and session.h.David Robillard
Clean up some stuff and other such gruntwork in the process. git-svn-id: svn://localhost/ardour2/branches/3.0@4468 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-01-29* set right interpolation on MidiModel controls after recording tooHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@4459 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-01-28* Set Discrete mode as default until Linear mode works properlyHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@4455 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-01-28* MIDI control lanes: Set Interpolationtype according to ParameterHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@4452 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-10-13Fix pollution of global namespace by Evoral.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3947 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-30Move midi_util.h.David Robillard
Fix building without aubio. git-svn-id: svn://localhost/ardour2/branches/3.0@3842 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-30Separate low level details of SMF reading/writing from concept of 'midi ↵David Robillard
source in ardour'. git-svn-id: svn://localhost/ardour2/branches/3.0@3839 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-23Fix merge regression: use TempoLines class instead of same built in to editor.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3795 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-22Fix loading midi controller data.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3788 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-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-23Remove pointless Byte typedef that didn't really match any other typedef in ↵David Robillard
ardour anyway. git-svn-id: svn://localhost/ardour2/branches/3.0@3409 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 source/region length on MIDI import.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3391 d708f5d6-7413-0410-9779-e7cbd77b26cf