diff options
author | David Robillard <d@drobilla.net> | 2007-10-01 05:27:41 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-01 05:27:41 +0000 |
commit | a47220df59c076eaa717710dc2ffc6614bee268c (patch) | |
tree | bea9dd981dd6a8ca90bb27c77bb976997be31f2d /src/libs/gui/App.cpp | |
parent | 344cdcbd4f2bc7a9203b4e98da2ac349581e521a (diff) | |
download | ingen-a47220df59c076eaa717710dc2ffc6614bee268c.tar.gz ingen-a47220df59c076eaa717710dc2ffc6614bee268c.tar.bz2 ingen-a47220df59c076eaa717710dc2ffc6614bee268c.zip |
Blink MIDI ports on message transmission.
git-svn-id: http://svn.drobilla.net/lad/ingen@794 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/App.cpp')
-rw-r--r-- | src/libs/gui/App.cpp | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp index feeae181..dc3db30d 100644 --- a/src/libs/gui/App.cpp +++ b/src/libs/gui/App.cpp @@ -47,11 +47,12 @@ #ifdef HAVE_SLV2 #include <slv2/slv2.h> #endif -using std::cerr; using std::cout; using std::endl; -using std::string; -namespace Ingen { namespace Client { class PluginModel; } } + +using namespace std; using namespace Ingen::Client; +namespace Ingen { namespace Client { class PluginModel; } } + namespace Ingen { namespace GUI { @@ -145,6 +146,9 @@ App::attach(SharedPtr<EngineInterface> engine, SharedPtr<SigClientInterface> cli _loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(engine)); _patch_tree_window->init(*_store); + + Glib::signal_timeout().connect(sigc::mem_fun(this, &App::animate_callback), + 100, G_PRIORITY_DEFAULT_IDLE); } @@ -172,6 +176,38 @@ App::error_message(const string& str) } +void +App::port_activity(Port* port) +{ + std::pair<ActivityPorts::iterator, bool> inserted = _activity_ports.insert(make_pair(port, false)); + if (inserted.second) + inserted.first->second = false; + + port->set_highlighted(true, false, true, false); +} + + +bool +App::animate_callback() +{ + for (ActivityPorts::iterator i = _activity_ports.begin(); i != _activity_ports.end() ; ) { + ActivityPorts::iterator next = i; + ++next; + + if ((*i).second) { // saw it last time, unhighlight and pop + (*i).first->set_highlighted(false, false, true, false); + _activity_ports.erase(i); + } else { + (*i).second = true; + } + + i = next; + } + + return true; +} + + /* bool App::idle_callback() |