diff options
author | David Robillard <d@drobilla.net> | 2010-12-15 20:10:41 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-15 20:10:41 +0000 |
commit | f4f74f3316b474096f164aa33c9d2e8965a545c3 (patch) | |
tree | 49ed4402f138d17592d7a33a35fde7232f799bff /src/PatchagePort.hpp | |
parent | aea13cac2a4106bbca28fc062d60e18ca4990c6c (diff) | |
download | patchage-f4f74f3316b474096f164aa33c9d2e8965a545c3.tar.gz patchage-f4f74f3316b474096f164aa33c9d2e8965a545c3.tar.bz2 patchage-f4f74f3316b474096f164aa33c9d2e8965a545c3.zip |
Improve performance for setups with many apps or ports.
(Eliminate all linear searches for items, except one case for Jack
ports which is unavoidable due to the Jack API, but is memoized,
so each port will only be searched for once between refreshes).
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@2712 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchagePort.hpp')
-rw-r--r-- | src/PatchagePort.hpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/PatchagePort.hpp b/src/PatchagePort.hpp index 80e70e4..6783434 100644 --- a/src/PatchagePort.hpp +++ b/src/PatchagePort.hpp @@ -26,6 +26,9 @@ #include "flowcanvas/Module.hpp" #include "patchage-config.h" +#include "PatchageCanvas.hpp" +#include "PortID.hpp" +#include "StateManager.hpp" #ifdef HAVE_ALSA #include <alsa/asoundlib.h> @@ -33,21 +36,23 @@ using namespace FlowCanvas; -enum PortType { JACK_AUDIO, JACK_MIDI, ALSA_MIDI }; - /** A Port on a PatchageModule */ class PatchagePort : public FlowCanvas::Port { public: - PatchagePort(boost::shared_ptr<Module> module, PortType type, const std::string& name, bool is_input, int color) + PatchagePort(boost::shared_ptr<Module> module, + PortType type, + const std::string& name, + bool is_input, + uint32_t color) : Port(module, name, is_input, color) , _type(type) { #ifdef HAVE_ALSA _alsa_addr.client = '\0'; - _alsa_addr.port = '\0'; + _alsa_addr.port = '\0'; #endif } |