+ XMLNode& get_state () const;
+ void set_state (const XMLNode&);
+
+ // FIXME: make Manager a friend of port so these can be hidden?
+
+ /* Only for use by MidiManager. Don't ever call this. */
+ virtual void cycle_start (pframes_t) {}
+ /* Only for use by MidiManager. Don't ever call this. */
+ virtual void cycle_end () {}
+
+ /** Write a message to port.
+ * @param msg Raw MIDI message to send
+ * @param msglen Size of @a msg
+ * @param timestamp Time stamp in frames of this message (relative to cycle start)
+ * @return number of bytes successfully written
+ */
+ virtual int write (const byte *msg, size_t msglen, timestamp_t timestamp) = 0;
+
+ /** Read raw bytes from a port.
+ * @param buf memory to store read data in
+ * @param bufsize size of @a buf
+ * @return number of bytes successfully read, negative if error
+ */
+ virtual int read (byte *buf, size_t bufsize) = 0;
+
+ /** block until the output FIFO used by non-process threads
+ * is empty, checking every @a check_interval_usecs usecs
+ * for current status. Not to be called by a thread that
+ * executes any part of a JACK process callback (will
+ * simply return immediately in that situation).
+ */
+ virtual void drain (int /* check_interval_usecs */) {}
+
+ /** Write a message to port.
+ * @return true on success.
+ * FIXME: describe semantics here
+ */
+ int midimsg (byte *msg, size_t len, timestamp_t timestamp) {
+ return !(write (msg, len, timestamp) == (int) len);
+ }