summaryrefslogtreecommitdiffstats
path: root/src/PatchageEvent.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-05 03:06:59 +0000
committerDavid Robillard <d@drobilla.net>2007-07-05 03:06:59 +0000
commit6067f8f8572bd7b318d3d17f16dc192079c7e046 (patch)
tree8f1b6a37ea61b72f918c672b282056c48098e5d9 /src/PatchageEvent.h
parent8006c612d557bd071f9ab033c82d27a499bdc0e6 (diff)
downloadpatchage-6067f8f8572bd7b318d3d17f16dc192079c7e046.tar.gz
patchage-6067f8f8572bd7b318d3d17f16dc192079c7e046.tar.bz2
patchage-6067f8f8572bd7b318d3d17f16dc192079c7e046.zip
More memory consumption reduction.
git-svn-id: http://svn.drobilla.net/lad/patchage@579 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageEvent.h')
-rw-r--r--src/PatchageEvent.h33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/PatchageEvent.h b/src/PatchageEvent.h
index c249613..79fb711 100644
--- a/src/PatchageEvent.h
+++ b/src/PatchageEvent.h
@@ -34,49 +34,42 @@ class Patchage;
class PatchageEvent {
public:
enum Type {
- NULL_EVENT,
+ NULL_EVENT = 0,
PORT_CREATION,
PORT_DESTRUCTION,
CONNECTION,
DISCONNECTION
};
- PatchageEvent(Patchage* patchage)
- : _patchage(patchage)
- , _type(NULL_EVENT)
+ PatchageEvent()
+ : _type(NULL_EVENT)
{}
- PatchageEvent(Patchage* patchage, Type type, jack_port_id_t port)
- : _patchage(patchage)
- , _type(type)
+ PatchageEvent(Type type, jack_port_id_t port)
+ : _type(type)
, _port_1(port)
{}
- PatchageEvent(Patchage* patchage, Type type,
- jack_port_id_t port_1, jack_port_id_t port_2)
- : _patchage(patchage)
- , _type(type)
+ PatchageEvent(Type type, jack_port_id_t port_1, jack_port_id_t port_2)
+ : _type(type)
, _port_1(port_1)
, _port_2(port_2)
{}
#ifdef HAVE_ALSA
- PatchageEvent(Patchage* patchage, Type type,
- snd_seq_addr_t port_1, snd_seq_addr_t port_2)
- : _patchage(patchage)
- , _type(type)
+ 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)
{}
#endif
- void execute();
+ void execute(Patchage* patchage);
- Type type() { return _type; }
+ inline Type type() const { return (Type)_type; }
private:
- Patchage* _patchage;
- Type _type;
+ uint8_t _type;
struct PortRef {
PortRef() : type(NULL_PORT_REF) { id.jack_id = 0; }
@@ -102,7 +95,7 @@ private:
PortRef _port_1;
PortRef _port_2;
- boost::shared_ptr<PatchagePort> find_port(const PortRef& ref);
+ boost::shared_ptr<PatchagePort> find_port(const Patchage* patchage, const PortRef& ref);
};