diff options
author | David Robillard <d@drobilla.net> | 2007-01-14 04:22:16 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-01-14 04:22:16 +0000 |
commit | f9a66347152ad4459a564d5f92fdeabb6d8b4019 (patch) | |
tree | 8ab4ed5436a83bbad634773d5b3b96428f77d85e /src/PatchageEvent.h | |
parent | 8e946da143030272b1bb325aba1ea52e67792254 (diff) | |
download | patchage-f9a66347152ad4459a564d5f92fdeabb6d8b4019.tar.gz patchage-f9a66347152ad4459a564d5f92fdeabb6d8b4019.tar.bz2 patchage-f9a66347152ad4459a564d5f92fdeabb6d8b4019.zip |
Follow Jack port creation/destruction.
git-svn-id: http://svn.drobilla.net/lad/patchage@257 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageEvent.h')
-rw-r--r-- | src/PatchageEvent.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/PatchageEvent.h b/src/PatchageEvent.h new file mode 100644 index 0000000..8dec31d --- /dev/null +++ b/src/PatchageEvent.h @@ -0,0 +1,60 @@ +/* This file is part of Patchage. Copyright (C) 2005 Dave Robillard. + * + * Patchage is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PATCHAGEEVENT_H +#define PATCHAGEEVENT_H + +#include <string> +#include <jack/jack.h> + +class Patchage; + + +/** A Driver event to be processed by the GUI thread. + */ +class PatchageEvent { +public: + enum Type { + NULL_EVENT, + PORT_CREATION, + PORT_DESTRUCTION + }; + + PatchageEvent(Patchage* patchage) + : _patchage(patchage) + , _type(NULL_EVENT) + {} + + PatchageEvent(Patchage* patchage, Type type, jack_port_id_t port_id) + : _patchage(patchage) + , _type(type) + , _port_id(port_id) + {} + + void execute(); + + Type type() { return _type; } + jack_port_id_t port_id() { return _port_id; } + +private: + Patchage* _patchage; + Type _type; + jack_port_id_t _port_id; +}; + + +#endif // PATCHAGEEVENT_H + |