tomwalters@570: // Copyright 2012, Tom Walters tomwalters@570: // tomwalters@570: // AIM-C: A C++ implementation of the Auditory Image Model tomwalters@570: // http://www.acousticscale.org/AIMC tomwalters@570: // tomwalters@570: // Licensed under the Apache License, Version 2.0 (the "License"); tomwalters@570: // you may not use this file except in compliance with the License. tomwalters@570: // You may obtain a copy of the License at tomwalters@570: // tomwalters@570: // http://www.apache.org/licenses/LICENSE-2.0 tomwalters@570: // tomwalters@570: // Unless required by applicable law or agreed to in writing, software tomwalters@570: // distributed under the License is distributed on an "AS IS" BASIS, tomwalters@570: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. tomwalters@570: // See the License for the specific language governing permissions and tomwalters@570: // limitations under the License. tomwalters@570: tomwalters@570: /*! tomwalters@570: * \author Tom Walters tomwalters@570: * \date created 2012/02/17 tomwalters@570: * \version \$Id$ tomwalters@570: */ tomwalters@570: tomwalters@570: #ifndef AIMC_MODULES_OUTPUT_OSC_H_ tomwalters@570: #define AIMC_MODULES_OUTPUT_OSC_H_ tomwalters@570: tomwalters@570: #include "Support/Module.h" tomwalters@570: tomwalters@570: #include tomwalters@570: tomwalters@570: #include "osc/OscOutboundPacketStream.h" tomwalters@570: #include "ip/UdpSocket.h" tomwalters@570: tomwalters@570: namespace aimc { tomwalters@570: class OSCOutput : public Module { tomwalters@570: public: tomwalters@570: explicit OSCOutput(Parameters *pParam); tomwalters@570: virtual ~OSCOutput(); tomwalters@570: tomwalters@570: /*! \brief Process a buffer tomwalters@570: */ tomwalters@570: virtual void Process(const SignalBank &input); tomwalters@570: tomwalters@570: private: tomwalters@570: /*! \brief Reset the internal state of the module tomwalters@570: */ tomwalters@570: virtual void ResetInternal(); tomwalters@570: tomwalters@570: /*! \brief Prepare the module tomwalters@570: * \param input Input signal tomwalters@570: * \param output true on success false on failure tomwalters@570: */ tomwalters@570: virtual bool InitializeInternal(const SignalBank &input); tomwalters@570: tomwalters@570: float sample_rate_; tomwalters@570: int buffer_length_; tomwalters@570: int channel_count_; tomwalters@570: string address_; tomwalters@570: int port_; tomwalters@570: int output_buffer_size_; tomwalters@570: tomwalters@570: UdpTransmitSocket* transmit_socket_; tomwalters@570: osc::OutboundPacketStream* packet_stream_; tomwalters@570: char* buffer_; tomwalters@570: }; tomwalters@570: } // namespace aimc tomwalters@570: tomwalters@570: #endif // AIMC_MODULES_OUTPUT_OSC_H_