2013-01-07 13:28:09 -05:00
|
|
|
/*
|
2019-08-03 08:34:29 -04:00
|
|
|
* Copyright (C) 2008-2015 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.
|
|
|
|
*/
|
2013-01-07 13:28:09 -05:00
|
|
|
|
|
|
|
#include "pbd/failed_constructor.h"
|
|
|
|
#include "pbd/error.h"
|
2008-12-12 09:43:24 -05:00
|
|
|
|
2009-10-29 20:21:40 -04:00
|
|
|
#include "ardour/session.h"
|
2013-01-07 13:28:09 -05:00
|
|
|
#include "control_protocol/control_protocol.h"
|
2008-12-12 09:43:24 -05:00
|
|
|
|
2013-01-07 13:28:09 -05:00
|
|
|
#include "wiimote.h"
|
2008-12-12 09:43:24 -05:00
|
|
|
|
2013-01-07 13:28:09 -05:00
|
|
|
using namespace ARDOUR;
|
|
|
|
using namespace PBD;
|
2008-12-12 09:43:24 -05:00
|
|
|
|
2013-09-03 08:33:51 -04:00
|
|
|
static ControlProtocol*
|
2023-04-30 21:32:00 -04:00
|
|
|
new_wiimote_protocol (Session* s)
|
2008-12-12 09:43:24 -05:00
|
|
|
{
|
2013-01-07 13:28:09 -05:00
|
|
|
WiimoteControlProtocol* wmcp = new WiimoteControlProtocol (*s);
|
|
|
|
wmcp->set_active (true);
|
2008-12-12 09:43:24 -05:00
|
|
|
return wmcp;
|
|
|
|
}
|
|
|
|
|
2013-09-03 08:33:51 -04:00
|
|
|
static void
|
2023-04-30 21:32:00 -04:00
|
|
|
delete_wiimote_protocol (ControlProtocol* cp)
|
2008-12-12 09:43:24 -05:00
|
|
|
{
|
|
|
|
delete cp;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ControlProtocolDescriptor wiimote_descriptor = {
|
2023-04-30 21:32:00 -04:00
|
|
|
/* name */ "Wiimote",
|
|
|
|
/* id */ "uri://ardour.org/surfaces/wiimote:0",
|
|
|
|
/* module */ 0,
|
|
|
|
/* available */ 0,
|
|
|
|
/* probe_port */ 0,
|
|
|
|
/* match usb */ 0,
|
|
|
|
/* initialize */ new_wiimote_protocol,
|
|
|
|
/* destroy */ delete_wiimote_protocol,
|
2008-12-12 09:43:24 -05:00
|
|
|
};
|
2013-01-07 13:28:09 -05:00
|
|
|
|
2014-01-25 13:57:28 -05:00
|
|
|
extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &wiimote_descriptor; }
|
2008-12-12 09:43:24 -05:00
|
|
|
|