text
stringlengths
0
2.2M
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdint.h>
#include "FifoControllerBase.h"
#include "FifoController.h"
namespace oboe {
FifoController::FifoController(uint32_t numFrames)
: FifoControllerBase(numFrames)
{
setReadCounter(0);
setWriteCounter(0);
}
} // namespace oboe
// copyright (c) openFrameworks team 2010-2017
// copyright (c) Damian Stewart 2007-2009
#include "ofxOscMessage.h"
#include "ofLog.h"
#include "ofUtils.h"
//--------------------------------------------------------------
ofxOscMessage::ofxOscMessage() : remoteHost(""), remotePort(0) {}
//--------------------------------------------------------------
ofxOscMessage::~ofxOscMessage(){
clear();
}
//--------------------------------------------------------------
ofxOscMessage::ofxOscMessage(const ofxOscMessage &other){
copy(other);
}
//--------------------------------------------------------------
ofxOscMessage& ofxOscMessage::operator=(const ofxOscMessage &other){
return copy(other);
}
//--------------------------------------------------------------
ofxOscMessage& ofxOscMessage::copy(const ofxOscMessage &other){
if(this == &other) return *this;
clear();
// copy address & remote info
address = other.address;
remoteHost = other.remoteHost;
remotePort = other.remotePort;
// copy arguments
for(std::size_t i = 0; i < other.args.size(); ++i){
switch(other.getArgType(i)){
case OFXOSC_TYPE_TRUE: case OFXOSC_TYPE_FALSE:
args.push_back(new ofxOscArgBool(other.getArgAsBool(i)));
break;
case OFXOSC_TYPE_INT32:
args.push_back(new ofxOscArgInt32(other.getArgAsInt32(i)));
break;
case OFXOSC_TYPE_INT64:
args.push_back(new ofxOscArgInt64(other.getArgAsInt64(i)));
break;
case OFXOSC_TYPE_FLOAT:
args.push_back(new ofxOscArgFloat(other.getArgAsFloat(i)));
break;
case OFXOSC_TYPE_DOUBLE:
args.push_back(new ofxOscArgDouble(other.getArgAsDouble(i)));
break;
case OFXOSC_TYPE_STRING:
args.push_back(new ofxOscArgString(other.getArgAsString(i)));
break;
case OFXOSC_TYPE_SYMBOL:
args.push_back(new ofxOscArgSymbol(other.getArgAsSymbol(i)));
break;
case OFXOSC_TYPE_CHAR:
args.push_back(new ofxOscArgChar(other.getArgAsChar(i)));
break;
case OFXOSC_TYPE_MIDI_MESSAGE:
args.push_back(new ofxOscArgMidiMessage(other.getArgAsMidiMessage(i)));
break;
case OFXOSC_TYPE_TRIGGER:
args.push_back(new ofxOscArgTrigger());
break;
case OFXOSC_TYPE_TIMETAG:
args.push_back(new ofxOscArgTimetag(other.getArgAsTimetag(i)));
break;