summaryrefslogtreecommitdiffstats
path: root/src/PatchageEvent.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-25 01:06:22 +0000
committerDavid Robillard <d@drobilla.net>2007-07-25 01:06:22 +0000
commit5837be3b45c83bd5743735de8cf451c5bdf3541d (patch)
tree3a0331f2a5391726efbb7b6362004a06050f50f1 /src/PatchageEvent.hpp
parent35b1c7c0683a72978f646c883f411e1eabd595ae (diff)
downloadpatchage-5837be3b45c83bd5743735de8cf451c5bdf3541d.tar.gz
patchage-5837be3b45c83bd5743735de8cf451c5bdf3541d.tar.bz2
patchage-5837be3b45c83bd5743735de8cf451c5bdf3541d.zip
Avoid some canvas text measuring overhead in Patchage (module resizing).
Fix duplex Alsa Sequencer ports (fix ticket 12). git-svn-id: http://svn.drobilla.net/lad/patchage@617 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageEvent.hpp')
-rw-r--r--src/PatchageEvent.hpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/PatchageEvent.hpp b/src/PatchageEvent.hpp
index ada4718..19cf16d 100644
--- a/src/PatchageEvent.hpp
+++ b/src/PatchageEvent.hpp
@@ -25,6 +25,9 @@
#endif
#include "PatchagePort.hpp"
+#include <iostream>
+using namespace std;
+
class Patchage;
@@ -58,8 +61,8 @@ public:
#ifdef HAVE_ALSA
PatchageEvent(Type type, snd_seq_addr_t port_1, snd_seq_addr_t port_2)
: _type(type)
- , _port_1(port_1)
- , _port_2(port_2)
+ , _port_1(port_1, false)
+ , _port_2(port_2, true)
{}
#endif
@@ -71,13 +74,14 @@ private:
uint8_t _type;
struct PortRef {
- PortRef() : type(NULL_PORT_REF) { id.jack_id = 0; }
+ PortRef() : type(NULL_PORT_REF) { memset(&id, 0, sizeof(id)); }
PortRef(jack_port_id_t jack_id) : type(JACK_ID) { id.jack_id = jack_id; }
PortRef(jack_port_t* jack_port) : type(JACK_PORT) { id.jack_port = jack_port; }
#ifdef HAVE_ALSA
- PortRef(snd_seq_addr_t addr) : type(ALSA_ADDR) { id.alsa_addr = addr; }
+ PortRef(snd_seq_addr_t addr, bool input) : type(ALSA_ADDR)
+ { id.alsa_addr = addr; is_input = input; }
#endif
enum { NULL_PORT_REF, JACK_ID, JACK_PORT, ALSA_ADDR } type;
@@ -89,6 +93,11 @@ private:
snd_seq_addr_t alsa_addr;
#endif
} id;
+
+#ifdef HAVE_ALSA
+ bool is_input;
+#endif
+
};
PortRef _port_1;