2 * Copyright (C) 2009-2015 Paul Davis <paul@linuxaudiosystems.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #ifdef PLATFORM_WINDOWS
31 #include "pbd/error.h"
32 #include "pbd/crossthread.h"
38 #ifndef PLATFORM_WINDOWS
39 #include "crossthread.posix.cc"
41 #include "crossthread.win.cc"
45 cross_thread_channel_call_receive_slot (GIOChannel*, GIOCondition condition, void *data)
47 CrossThreadChannel* ctc = static_cast<CrossThreadChannel*>(data);
48 return ctc->receive_slot (Glib::IOCondition (condition));
52 CrossThreadChannel::set_receive_handler (sigc::slot<bool,Glib::IOCondition> s)
58 CrossThreadChannel::attach (Glib::RefPtr<Glib::MainContext> context)
60 receive_source = g_io_create_watch (receive_channel, GIOCondition(G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL));
61 g_source_set_callback (receive_source, (GSourceFunc) cross_thread_channel_call_receive_slot, this, NULL);
62 g_source_attach (receive_source, context->gobj());