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