/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * OlaCallbackClient.h * This is the main client API to OLA. Unlike the OlaClient class it uses * Callbacks for all notifications. * Copyright (C) 2010 Simon Newton */ #ifndef OLA_OLACALLBACKCLIENT_H_ #define OLA_OLACALLBACKCLIENT_H_ #include #include #include #include #include #include #include #include #include #include #include namespace ola { using std::string; class OlaCallbackClient: public ola::rdm::RDMAPIImplInterface { public: explicit OlaCallbackClient(ola::network::ConnectedSocket *socket); ~OlaCallbackClient(); bool Setup(); bool Stop(); // plugin methods bool FetchPluginList( SingleUseCallback2&, const string&> *callback); bool FetchPluginDescription( ola_plugin_id plugin_id, SingleUseCallback2 *callback); // device methods bool FetchDeviceInfo( ola_plugin_id filter, SingleUseCallback2&, const string&> *callback); bool FetchCandidatePorts( unsigned int universe_id, SingleUseCallback2&, const string&> *callback); bool FetchCandidatePorts( SingleUseCallback2&, const string&> *callback); bool ConfigureDevice( unsigned int device_alias, const string &msg, SingleUseCallback2 *callback); // port methods bool SetPortPriorityInherit( unsigned int device_alias, unsigned int port, PortDirection port_direction, SingleUseCallback1 *callback); bool SetPortPriorityOverride( unsigned int device_alias, unsigned int port, PortDirection port_direction, uint8_t value, SingleUseCallback1 *callback); // universe methods bool FetchUniverseList( SingleUseCallback2&, const string &> *callback); bool FetchUniverseInfo( unsigned int universe, SingleUseCallback2 *callback); bool SetUniverseName( unsigned int uni, const string &name, SingleUseCallback1 *callback); bool SetUniverseMergeMode( unsigned int uni, OlaUniverse::merge_mode mode, SingleUseCallback1 *callback); // patching bool Patch( unsigned int device_alias, unsigned int port, ola::PortDirection port_direction, ola::PatchAction action, unsigned int uni, SingleUseCallback1 *callback); // dmx methods void SetDmxCallback( Callback3 *callback); bool RegisterUniverse( unsigned int universe, ola::RegisterAction register_action, SingleUseCallback1 *callback); bool SendDmx( unsigned int universe, const DmxBuffer &data, SingleUseCallback1 *callback); bool FetchDmx( unsigned int universe, SingleUseCallback2 *callback); // rdm methods bool FetchUIDList( unsigned int universe, SingleUseCallback2 *callback); bool ForceDiscovery( unsigned int universe, ola::SingleUseCallback1 *callback); bool SetSourceUID(const ola::rdm::UID &uid, ola::SingleUseCallback1 *callback); bool RDMGet(ola::rdm::RDMAPIImplInterface::rdm_callback *callback, unsigned int universe, const ola::rdm::UID &uid, uint16_t sub_device, uint16_t pid, const uint8_t *data, unsigned int data_length); bool RDMSet(ola::rdm::RDMAPIImplInterface::rdm_callback *callback, unsigned int universe, const ola::rdm::UID &uid, uint16_t sub_device, uint16_t pid, const uint8_t *data, unsigned int data_length); private: OlaCallbackClient(const OlaCallbackClient&); OlaCallbackClient operator=(const OlaCallbackClient&); class OlaClientCore *m_core; }; } // ola #endif // OLA_OLACALLBACKCLIENT_H_