1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4
* Copyright (C) Christophe Andral 2010 <christophe@andral.fr>
6
* wm2midi is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License as published by the
8
* Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* wm2midi is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
* See the GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
28
Emitter::Emitter(Bloc* bloc_parent, std::string emitter_name) :
29
Port( bloc_parent, Port::OUTPUT, emitter_name ),
39
Emitter::connect(Receiver* receiver)
41
receivers.insert( receiver );
45
Emitter::emit(double value)
47
if (receivers.empty()) return;
48
Log::TRACE("Emit %s value:%f", name.c_str(), value);
49
std::set<Receiver*>::const_iterator cur(receivers.begin()), end(receivers.end());
52
(*cur)->on_receive( this, value );
b'\\ No newline at end of file'