2009-01-15 17:09:23 -05:00
|
|
|
/*
|
2009-01-15 17:37:18 -05: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.
|
|
|
|
*
|
|
|
|
* */
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
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());
|
|
|
|
|
|
|
|
osc->set_active (true);
|
|
|
|
|
|
|
|
return osc;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 = {
|
|
|
|
name : "Open Sound Control (OSC)",
|
|
|
|
id : "uri://ardour.org/surfaces/osc:0",
|
|
|
|
ptr : 0,
|
|
|
|
module : 0,
|
2009-01-15 17:37:18 -05:00
|
|
|
mandatory : 0,
|
2009-01-15 17:09:23 -05:00
|
|
|
supports_feedback : true,
|
|
|
|
probe : probe_osc_protocol,
|
|
|
|
initialize : new_osc_protocol,
|
|
|
|
destroy : delete_osc_protocol
|
|
|
|
};
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
ControlProtocolDescriptor*
|
|
|
|
protocol_descriptor () {
|
|
|
|
return &osc_descriptor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|