diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-18 03:42:32 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-18 03:42:32 +0000 |
commit | eb4a1fdbb8fec1f8aa5dfe33f882064e85792a84 (patch) | |
tree | b97aadaf2a8593e33ceaf1e4da78ab39d2608702 /libs/midi++2/midi++/jack.h | |
parent | d69f4e9e3dde0e400c80bca37f7bfcc555fbbf1b (diff) |
refactor JACK MIDI port to allow writing from a non-process() thread, and 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
Diffstat (limited to 'libs/midi++2/midi++/jack.h')
-rw-r--r-- | libs/midi++2/midi++/jack.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/midi++2/midi++/jack.h b/libs/midi++2/midi++/jack.h index 845dd0c229..291b87f835 100644 --- a/libs/midi++2/midi++/jack.h +++ b/libs/midi++2/midi++/jack.h @@ -28,9 +28,13 @@ #include <fcntl.h> #include <unistd.h> +#include <glibmm/thread.h> + +#include <pbd/ringbuffer.h> #include <jack/jack.h> #include <jack/midiport.h> #include <midi++/port.h> +#include <midi++/event.h> namespace MIDI { @@ -52,6 +56,8 @@ public: virtual XMLNode& get_state () const; virtual void set_state (const XMLNode&); + static void set_process_thread (pthread_t); + protected: std::string get_typestring () const { return typestring; @@ -69,6 +75,14 @@ private: jack_port_t* _jack_input_port; jack_port_t* _jack_output_port; nframes_t _last_read_index; + + void flush (void* jack_port_buffer); + + static pthread_t _process_thread; + static bool is_process_thread(); + + RingBuffer<MIDI::Event> non_process_thread_fifo; + Glib::Mutex non_process_thread_fifo_lock; }; |