summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/smf_source.h
AgeCommit message (Collapse)Author
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-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-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-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-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-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-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-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-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-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* 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-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-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
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-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-16Don't create tracks for empty MIDI channels on import (i.e. make import look ↵David Robillard
clean and sensible). Remove no longer useful debugging output. git-svn-id: svn://localhost/ardour2/branches/3.0@3365 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-06* bugfix: SMFSource: track footer overwrote the last MIDI eventHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@3319 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-03Comment out excessive terminal output.David Robillard
Write all events (not just notes) to SMF file from MidiModel (just use iterator instead of hand-hacked MidiModel::write_to). Various MIDI bug fixes. git-svn-id: svn://localhost/ardour2/branches/3.0@3312 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-04-19* first prototype for track based channel selection worksHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@3267 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-04-08* fixed bug: MIDI region did not sound if its position was less than its ↵Hans Baier
start offset git-svn-id: svn://localhost/ardour2/branches/3.0@3239 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-03-18refactor JACK MIDI port to allow writing from a non-process() thread, and ↵Paul Davis
move ARDOUR::MidiEvent into MIDI namespace along with midi_events.h header git-svn-id: svn://localhost/ardour2/branches/3.0@3155 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-02-21Fix timing on MIDI import.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3093 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-02-18Preliminary (read: kludgey) MIDI import support.David Robillard
Only really works when tracks contain only channel 1 data for now. git-svn-id: svn://localhost/ardour2/branches/3.0@3083 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-07Fix several MIDI timestamp related problems:David Robillard
Fix recording MIDI regions that start at t != 0. Fix display of MIDI events in regions that start at t != 0. Fix recording after relocating an already rec-armed MIDI track. git-svn-id: svn://localhost/ardour2/trunk@2528 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-09-06Deep "automation regions" support.David Robillard
Fix zoom/height/etc changing for automation region views. Broke smooth automation region dragging (make omelette, break eggs, etc). git-svn-id: svn://localhost/ardour2/trunk@2424 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-16Make SMFSource suck significantly less.David Robillard
Read from MidiRingbuffer directly into model, don't read MidiRingBuffer into a new midi buffer, then into the model. Pass rec data to UI via model instead of a separate buffer. Read MIDI CC data into MidiModel (though not actually used yet). Made quantization toggle edited flag so model is saved. git-svn-id: svn://localhost/ardour2/trunk@2308 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-11Saving of edited MIDI data to disk (on session save).David Robillard
Seems to be a pretty random problem with note duration restoring though... git-svn-id: svn://localhost/ardour2/trunk@2290 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-11Fix MIDI file names on recording (don't write out a ton of useless empty ↵David Robillard
.mid files). Preliminary hooks for writing model to file (still does nothing). git-svn-id: svn://localhost/ardour2/trunk@2289 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-07-15Selection of visible note range (full range vs fit contents, selectable from ↵David Robillard
midi track menu). Added note pencil tool, mock note adding (notes can be added visually but don't yet play). Reworked MidiModel to be notes w/ duration instead of realtime style MIDI events. Moved layering (stacked/overlaid) from auto time axis down to route time axis since it applies to MIDI tracks as well. git-svn-id: svn://localhost/ardour2/trunk@2128 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-06-23Insert/Redirect refactoring, towards better MIDI support in mixer strip, andDavid Robillard
http://ardour.org/node/1043 style things. git-svn-id: svn://localhost/ardour2/trunk@2027 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-06-09Use double MIDI timestamps (towards tempo based time, and ↵David Robillard
more-than-sample-accurate LV2 MIDI plugin application). Eliminate double iteration over MIDIRingBuffer read to translate timestamps. git-svn-id: svn://localhost/ardour2/trunk@1981 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-06-05Save MIDI files to interchange/sessionname/midifiles (instead of audiofiles).David Robillard
Fix some uninitialized variables in Streamview. Tempo-based SMF source (internally only). Horrible crash on MIDI record finish. git-svn-id: svn://localhost/ardour2/trunk@1955 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-06-03Fix MIDI region loading.David Robillard
Add model loading and destroying to SMFSource. Load and display MIDI region data on session load. git-svn-id: svn://localhost/ardour2/trunk@1947 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-05-31Rewrote MidiRingBuffer to more efficiently pack data (flat pack stamps, ↵David Robillard
sizes, and event data into a single buffer). Eliminate a double-copy on MIDI playback (MidiRingBuffer -> MidiBuffer). Various MIDI diskstream/source/SMF fixes (only write when appropriate, handle transport locates, etc). Fix MIDI rec region size/offset problems. Code cleanups. git-svn-id: svn://localhost/ardour2/trunk@1934 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-05-03optimize some performance bottlenecks; remove jack_nframes_t that crept back ↵Paul Davis
into the code git-svn-id: svn://localhost/ardour2/branches/midi@1779 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-09-19Merged with trunk R920.David Robillard
git-svn-id: svn://localhost/ardour2/branches/midi@921 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-23- Fixes for some recording bugsDavid Robillard
- Working MIDI playback - Various SMF fixes - Loading of MIDI containing sessions w/o clobbering .mid files - Varispeed MIDI fixes (still no reverse though) - Fix for crazy rec-region sizes - Throttled MIDI diskstream flush based on time passed (related to rec-region fix) - Fixed playback of MIDI regions not positioned at origin (time stamp translation) - Commented/removed old debug print statements (though some still remain) git-svn-id: svn://localhost/ardour2/branches/midi@844 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-21Recording to SMF. Playback not quite working yet, just some buglets left to ↵David Robillard
iron out. git-svn-id: svn://localhost/ardour2/branches/midi@841 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-14More solid "fake" recording and serializationDavid Robillard
git-svn-id: svn://localhost/ardour2/branches/midi@825 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-14- MIDI "recording" - rec region creation/drawing, actual MIDI region ↵David Robillard
creation/view/pretty pictures/etc - MIDI containing session saving and restoring (ie XML - Source, Region, Playlist; all but the actual .mid files) - Numerous little fixes for audio specific stuff to accomplish the above - Dirty hacks to accomplish the above - Profit!!! git-svn-id: svn://localhost/ardour2/branches/midi@821 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-11- Changed IO's vector<Port*>'s to PortListDavid Robillard
- Added new Port classes, code to drive them - Added PortList, which is a filthy mess ATM (nevermind that, it's the interface that's important at this stage) - Added ChanCount, though it isn't very thoroughly used yet. That's the next step.... - Fixed a few bugs relating to loading sessions saved with trunk - Fixed a few random other bugs Slowly working towards type agnosticism while keeping all the former code/logic intact is the name of the game here Warning: Removing ports is currently (intentionally) broken due solely to laziness. git-svn-id: svn://localhost/ardour2/branches/midi@786 d708f5d6-7413-0410-9779-e7cbd77b26cf