2008-06-02 17:41:35 -04:00
|
|
|
/*
|
2019-08-02 23:10:55 -04:00
|
|
|
* Copyright (C) 1998-2016 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* This program 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 more 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/receiver.h"
|
|
|
|
#include "pbd/transmitter.h"
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2009-05-12 13:03:42 -04:00
|
|
|
using namespace std;
|
2008-06-02 17:41:35 -04:00
|
|
|
using namespace sigc;
|
|
|
|
|
|
|
|
Receiver::Receiver () {}
|
|
|
|
|
|
|
|
Receiver::~Receiver ()
|
|
|
|
|
|
|
|
{
|
|
|
|
hangup ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Receiver::hangup ()
|
|
|
|
{
|
2016-08-14 08:33:23 -04:00
|
|
|
connections.drop_connections ();
|
2008-06-02 17:41:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Receiver::listen_to (Transmitter &transmitter)
|
|
|
|
|
|
|
|
{
|
2024-11-17 14:20:21 -05:00
|
|
|
/* odd syntax here because std's placeholders (_1, _2) are in an
|
|
|
|
anonymous namespace which causes ambiguity with sigc++
|
2016-08-14 08:33:23 -04:00
|
|
|
*/
|
2024-10-18 19:51:44 -04:00
|
|
|
transmitter.sender().connect_same_thread (connections, std::bind (&Receiver::receive, this, std::placeholders::_1, std::placeholders::_2));
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
}
|