2009-01-15 17:09:23 -05:00
|
|
|
/*
|
2015-10-04 14:51:05 -04:00
|
|
|
* Copyright (C) 2009 Paul Davis
|
2009-01-15 17:09:23 -05:00
|
|
|
*
|
|
|
|
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2015-10-04 14:51:05 -04:00
|
|
|
*
|
2009-01-15 17:09:23 -05:00
|
|
|
* */
|
|
|
|
|
2009-10-30 11:30:22 -04:00
|
|
|
#include "ardour/rc_configuration.h"
|
2009-10-29 20:21:40 -04:00
|
|
|
#include "control_protocol/control_protocol.h"
|
2009-01-15 17:09:23 -05:00
|
|
|
#include "osc.h"
|
|
|
|
|
|
|
|
using namespace ARDOUR;
|
2015-04-15 17:21:47 -04:00
|
|
|
using namespace ArdourSurface;
|
2009-01-15 17:09:23 -05:00
|
|
|
|
2013-09-03 08:33:51 -04:00
|
|
|
static ControlProtocol*
|
2009-07-21 11:55:17 -04:00
|
|
|
new_osc_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
|
2009-01-15 17:09:23 -05:00
|
|
|
{
|
|
|
|
OSC* osc = new OSC (*s, Config->get_osc_port());
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2009-01-15 17:09:23 -05:00
|
|
|
osc->set_active (true);
|
|
|
|
|
|
|
|
return osc;
|
|
|
|
}
|
|
|
|
|
2013-09-03 08:33:51 -04:00
|
|
|
static void
|
2009-07-21 11:55:17 -04:00
|
|
|
delete_osc_protocol (ControlProtocolDescriptor* /*descriptor*/, ControlProtocol* cp)
|
2009-01-15 17:09:23 -05:00
|
|
|
{
|
|
|
|
delete cp;
|
|
|
|
}
|
|
|
|
|
2013-09-03 08:33:51 -04:00
|
|
|
static bool
|
2009-07-21 11:55:17 -04:00
|
|
|
probe_osc_protocol (ControlProtocolDescriptor* /*descriptor*/)
|
2009-01-15 17:09:23 -05:00
|
|
|
{
|
|
|
|
return true; // we can always do OSC
|
|
|
|
}
|
|
|
|
|
|
|
|
static ControlProtocolDescriptor osc_descriptor = {
|
2014-07-22 17:19:46 -04:00
|
|
|
/*name : */ "Open Sound Control (OSC)",
|
|
|
|
/*id : */ "uri://ardour.org/surfaces/osc:0",
|
|
|
|
/*ptr : */ 0,
|
|
|
|
/*module : */ 0,
|
|
|
|
/*mandatory : */ 0,
|
|
|
|
/*supports_feedback : */ true,
|
|
|
|
/*probe : */ probe_osc_protocol,
|
|
|
|
/*initialize : */ new_osc_protocol,
|
|
|
|
/*destroy : */ delete_osc_protocol
|
2009-01-15 17:09:23 -05:00
|
|
|
};
|
|
|
|
|
2014-01-25 13:57:28 -05:00
|
|
|
extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &osc_descriptor; }
|
2009-01-15 17:09:23 -05:00
|
|
|
|