annotate trunk/src/Modules/Output/OSCOutput.h @ 706:f8e90b5d85fd tip

Delete CARFAC code from this repository. It has been moved to https://github.com/google/carfac Please email me with your github username to get access. I've also created a new mailing list to discuss CARFAC development: https://groups.google.com/forum/#!forum/carfac-dev
author ronw@google.com
date Thu, 18 Jul 2013 20:56:51 +0000
parents 4b37b53105a3
children
rev   line source
tomwalters@570 1 // Copyright 2012, Tom Walters
tomwalters@570 2 //
tomwalters@570 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@570 4 // http://www.acousticscale.org/AIMC
tomwalters@570 5 //
tomwalters@570 6 // Licensed under the Apache License, Version 2.0 (the "License");
tomwalters@570 7 // you may not use this file except in compliance with the License.
tomwalters@570 8 // You may obtain a copy of the License at
tomwalters@570 9 //
tomwalters@570 10 // http://www.apache.org/licenses/LICENSE-2.0
tomwalters@570 11 //
tomwalters@570 12 // Unless required by applicable law or agreed to in writing, software
tomwalters@570 13 // distributed under the License is distributed on an "AS IS" BASIS,
tomwalters@570 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tomwalters@570 15 // See the License for the specific language governing permissions and
tomwalters@570 16 // limitations under the License.
tomwalters@570 17
tomwalters@570 18 /*!
tomwalters@570 19 * \author Tom Walters <tom@acousticscale.org>
tomwalters@570 20 * \date created 2012/02/17
tomwalters@570 21 * \version \$Id$
tomwalters@570 22 */
tomwalters@570 23
tomwalters@570 24 #ifndef AIMC_MODULES_OUTPUT_OSC_H_
tomwalters@570 25 #define AIMC_MODULES_OUTPUT_OSC_H_
tomwalters@570 26
tomwalters@570 27 #include "Support/Module.h"
tomwalters@570 28
tomwalters@570 29 #include <string>
tomwalters@570 30
tomwalters@570 31 #include "osc/OscOutboundPacketStream.h"
tomwalters@570 32 #include "ip/UdpSocket.h"
tomwalters@570 33
tomwalters@570 34 namespace aimc {
tomwalters@570 35 class OSCOutput : public Module {
tomwalters@570 36 public:
tomwalters@570 37 explicit OSCOutput(Parameters *pParam);
tomwalters@570 38 virtual ~OSCOutput();
tomwalters@570 39
tomwalters@570 40 /*! \brief Process a buffer
tomwalters@570 41 */
tomwalters@570 42 virtual void Process(const SignalBank &input);
tomwalters@570 43
tomwalters@570 44 private:
tomwalters@570 45 /*! \brief Reset the internal state of the module
tomwalters@570 46 */
tomwalters@570 47 virtual void ResetInternal();
tomwalters@570 48
tomwalters@570 49 /*! \brief Prepare the module
tomwalters@570 50 * \param input Input signal
tomwalters@570 51 * \param output true on success false on failure
tomwalters@570 52 */
tomwalters@570 53 virtual bool InitializeInternal(const SignalBank &input);
tomwalters@570 54
tomwalters@570 55 float sample_rate_;
tomwalters@570 56 int buffer_length_;
tomwalters@570 57 int channel_count_;
tomwalters@570 58 string address_;
tomwalters@570 59 int port_;
tomwalters@570 60 int output_buffer_size_;
tomwalters@570 61
tomwalters@570 62 UdpTransmitSocket* transmit_socket_;
tomwalters@570 63 osc::OutboundPacketStream* packet_stream_;
tomwalters@570 64 char* buffer_;
tomwalters@570 65 };
tomwalters@570 66 } // namespace aimc
tomwalters@570 67
tomwalters@570 68 #endif // AIMC_MODULES_OUTPUT_OSC_H_