Commit graph

24 commits

Author SHA1 Message Date
Robin Gareus
57d1f68cd6 Introduce "virtual" async MIDI ports
This allows to flush an async MIDI port's ringbuffer at cycle-start,
to makes its data available as "input/source" during process(), while
collecting data in the background for the next cycle.

This facilitates virtual MIDI Ports for eg. Control Surface Pads:
output from a surface, input to Ardour channels.
2016-10-23 22:25:40 +02:00
Paul Davis
d1c024f4f9 move shadow port stuff from AsyncMIDIPort to MidiPort, where it belongs 2016-09-27 14:59:30 -05:00
Paul Davis
3669096c05 expose AsyncMIDIPort::shadow_port() 2016-09-27 14:59:30 -05:00
Paul Davis
0c1c7ec642 set latency range for shadow port.
Not tracked if parent/owner port changes latency
2016-09-27 14:59:30 -05:00
Paul Davis
7f7a5f1c51 Flush shadow port buffer (to the backend port buffer) if filtering wrote anything. 2016-09-27 14:59:30 -05:00
Paul Davis
74ae2c6ae6 Add additional flags when registering a shadow port. 2016-09-27 14:59:30 -05:00
Paul Davis
8565d61444 change API for shadow ports and filters
Filter functor needs to be set before registering port, so provide it when adding the port.
2016-09-27 14:59:30 -05:00
Paul Davis
8a06e6735d add initial implementation of a "shadow port" for AsyncMIDIPort.
The shadow port is a secondary port that can be used to allow others to get a copy of part, all or none of the MIDI
stream received by the owner (input) port.
2016-09-27 14:59:29 -05:00
Paul Davis
5153631d70 change API of MIDI::Port::drain() to include a maximum blocking time 2016-02-01 13:26:30 -05:00
Paul Davis
f74eab854a fix behaviour of AsyncMIDIPort so that large amounts of data are handled well.
Increased the size of the FIFO that acts as the intermediate between writers and the MidiBuffer. Changed
implementation of ::write() to notice if MidiBuffer::push_back() fails, and then just leave data queued
for subsequent calls to ::flush_output_fifo().

Note: the logic here will be broken by invalid events/data, which ALSO cause MidiBuffer::push_back() to
return false. That needs fixing
2015-10-09 11:08:33 -04:00
Robin Gareus
22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
Paul Davis
4dc63966f0 globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
2015-10-04 14:51:05 -04:00
Paul Davis
fb63b3ffc3 fix to follow changes to evoral/libardour split 2014-12-03 21:22:53 -05:00
Paul Davis
d762ed8c22 alter Async MIDI port implementation to use crossthreadchannel on all platforms 2014-12-03 20:53:49 -05:00
David Robillard
1693e57e0e Move EventRingBuffer to libardour.
This is not used anywhere in Evoral and is just a wrapper around the PBD
RingBuffer anyway.  Towards a (once again?) independently buildable/testable
Evoral and fewer cross-dependencies.
2014-11-30 23:56:19 -05:00
John Emmas
9cf2cf55f5 Add some casting and namespace specifiers to keep MSVC happy 2014-05-06 09:20:03 +01:00
Paul Davis
2cf411e4be merge (squash) with scenechange topic branch to provide MIDI-driven scene change markers 2014-04-28 19:58:24 -04:00
John Emmas
4f8c30de02 'libs/ardour' - Further platform specific changes 2013-09-18 12:27:39 +01:00
John Emmas
b5da5a1af0 'libs/ardour' - Use 'std::vector' to implement an array whose size is unknown (required to be buildable with MSVC) 2013-09-18 12:25:36 +01:00
John Emmas
dc3288565b 'libs/ardour' - Clarify ambiguous symbols (needs to be checked) 2013-09-18 10:11:54 +01:00
John Emmas
10047037be 'libs/ardour/async_midi_port.cc' - Add a missing header file 2013-09-18 10:03:41 +01:00
Paul Davis
bb826f4bee incomplete merge of master into windows (requires upcoming changes to master to be complete) 2013-09-12 11:28:50 -04:00
Paul Davis
018465f739 exit early from AsyncMIDIPort::drain() if it will never be used in a process callback again 2013-09-06 10:38:49 -04:00
Paul Davis
917aed0da0 add new files (code based on the old midi++ JACKMidiPort) 2013-08-08 09:10:11 -04:00