本文整理汇总了C++中TTValue::append方法的典型用法代码示例。如果您正苦于以下问题:C++ TTValue::append方法的具体用法?C++ TTValue::append怎么用?C++ TTValue::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTValue
的用法示例。
在下文中一共展示了TTValue::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TTObjectHandle
NSPStatus
Namespace::namespaceValueSend(std::string address, TTSymbolPtr attribute, TTValue value, int instance)
{
TTSenderPtr sender = NULL;
// prepare arguments : see TTSender.h to know which args are needed
TTValue args;
args.clear();
args.append(GalamusApplication);
// add Application name to the address
std::string absAddress = AppName + address;
// add instance number
if (instance != 0) {
absAddress += ".";
stringstream st;
st << instance;
absAddress += st.str();
}
args.append(TT(absAddress));
args.append(attribute);
TTObjectInstantiate(TTSymbol("Sender"), TTObjectHandle(&sender), args);
sender->sendMessage(kTTSym_Send, value);
// note : the value is returned by the Data and the Receiver
//TTObjectRelease(TTObjectHandle(&sender));// throw an exception on windows
return NSP_NO_ERROR;
}
示例2: TTScoreTimeProcessCreate
TTErr TTScoreTimeProcessCreate(TTTimeProcessPtr *timeProcess, const std::string timeProcessClass, TTTimeEventPtr startEvent, TTTimeEventPtr endEvent, TTTimeContainerPtr timeContainer)
{
TTValue args;
*timeProcess = NULL;
if (timeContainer) {
TTValue out;
TTErr err;
args = TTSymbol(timeProcessClass);
args.append(TTObjectBasePtr(startEvent));
args.append(TTObjectBasePtr(endEvent));
err = timeContainer->sendMessage(TTSymbol("TimeProcessCreate"), args, out);
if (!err)
*timeProcess = TTTimeProcessPtr(TTObjectBasePtr(out[0]));
return err;
}
else {
args = TTObjectBasePtr(startEvent);
args.append(TTObjectBasePtr(endEvent));
return TTObjectBaseInstantiate(timeProcessClass.c_str(), TTObjectBaseHandle(timeProcess), args);
}
}
示例3: ramp_setFunctionParameter
void ramp_setFunctionParameter(t_ramp *obj, t_symbol *msg, long argc, t_atom *argv)
{
TTSymbol* parameterName;
TTValue newValue;
int i;
TTValue v;
if (argc < 2) {
error("jcom.map: not enough arguments to setParameter");
return;
}
// get the correct TT name for the parameter given the Max name
parameterName = TT(atom_getsym(argv)->s_name);
obj->parameterNames->lookup(parameterName, v);
v.get(0, ¶meterName);
for (i=1; i<=(argc-1); i++) {
if (argv[i].a_type == A_SYM)
newValue.append(TT(atom_getsym(argv+1)->s_name));
else
newValue.append(atom_getfloat(argv+i));
}
obj->rampUnit->setFunctionParameterValue(parameterName, newValue);
}
示例4: rampSetup
TTErr TTData::rampSetup()
{
TTValue args;
// 1. destroy the old ramp object
if (mRamper.valid()) {
mRamper = TTObject();
externalRampTime = 0;
}
// 2. create the new ramp object
// For some types ramping doesn't make sense, so they will be set to none
if (mType == kTTSym_none || mType == kTTSym_string || mType == kTTSym_generic)
mRampDrive = kTTSym_none;
else {
// don't create ramper for external ramp drive
if (mRampDrive == kTTSym_external || mRampDrive == kTTSym_none)
return kTTErrNone;
args.append((TTPtr)&TTDataRampCallback);
args.append((TTPtr)this); // we have to store this as a pointer
mRamper = TTObject("Ramp", args);
mRamper.set("drive", mRampDrive);
}
#ifndef TT_NO_DSP
// 3. reset the ramp function
return setRampFunction(mRampFunction);
#else
return kTTErrNone;
#endif
}
示例5: getUnitNames
void RampLib::getUnitNames(TTValue& unitNames)
{
unitNames.clear();
unitNames.append(TT("async"));
unitNames.append(TT("none"));
unitNames.append(TT("queue"));
unitNames.append(TT("scheduler"));
}
示例6: void
NSPStatus
Namespace::namespaceParameterCreate(std::string address, int instanceNumber, void* object, void (*returnValueCallback) (TTPtr, TTValue&)
, void (*returnAddressCallback)(TTPtr, TTValue&))
{
// Create a TTData
TTDataPtr data = NULL;
TTCallbackPtr p_returnValueCallback, p_returnAddressCallback;
TTValuePtr p_returnValueBaton, p_returnAddressBaton;
// prepare arguments : see TTData.h to know which args are needed
TTValue args;
args.clear();
p_returnValueCallback = NULL;
TTObjectInstantiate(TTSymbol("callback"), TTObjectHandle(&p_returnValueCallback), kTTValNONE);
p_returnValueBaton = new TTValue(TTPtr(object));
p_returnValueCallback->setAttributeValue(kTTSym_baton, TTPtr(p_returnValueBaton));
p_returnValueCallback->setAttributeValue(kTTSym_function, TTPtr(returnValueCallback));
args.append(p_returnValueCallback);
p_returnAddressCallback = NULL;
TTObjectInstantiate(TTSymbol("callback"), TTObjectHandle(&p_returnAddressCallback), kTTValNONE);
p_returnAddressBaton = new TTValue(TTPtr(object));
p_returnAddressCallback->setAttributeValue(kTTSym_baton, TTPtr(p_returnAddressBaton));
p_returnAddressCallback->setAttributeValue(kTTSym_function, TTPtr(p_returnAddressCallback));
args.append(p_returnAddressCallback);
// Register a TTObject into the NSPDirectory
TTNodePtr returnedNode;
TTBoolean newInstanceCreated;
for (int i = 0; i < instanceNumber; i++) {
data = NULL;
returnedNode = NULL;
newInstanceCreated = NULL;
// create an instance of TTData
TTObjectInstantiate(TTSymbol("Data"), TTObjectHandle(&data), args);
std::string absAddress = AppName + address;
// add instance number
if (i != 0) {
absAddress += ".";
stringstream st;
st << i;
absAddress += st.str();
}
// add the parameter data in the namespace directory
NSPDirectory->TTNodeCreate(TT(absAddress), (TTObjectPtr)data, NULL, &returnedNode, &newInstanceCreated);
// note : our myRegistrationObserver is informed if declared
}
return NSP_NO_ERROR;
}
示例7: getrange
TTErr TTAttribute::getrange(TTValue& currentRange)
{
currentRange.clear();
currentRange.push_back(rangeLowBound);
currentRange.append(rangeHighBound);
return kTTErrNone;
}
示例8: returnValue
TTErr TTData::returnValue()
{
// used a new value to protect the internal value
TTValue v = mValue;;
// COMMENT: This is a temporary solution to have audio rate ramping outside the #TTData
// TODO: JamomaCore #212 : when Trond ports dataspace ramp we need to think about how that works with audio rate ramps
if (mRampDrive == kTTSym_external) {
if (externalRampTime > 0)
v.append(externalRampTime);
}
// we have had our value set at least once
// only parameters notify their initialisation
if (mService == kTTSym_parameter && !mInitialized) {
mInitialized = YES;
initializedAttribute->sendNotification(kTTSym_notify, YES); // we use kTTSym_notify because we know that observers are TTCallback
}
else if (!mInitialized)
mInitialized = YES;
// return the value to his owner
this->deliver(v);
// notify each observers
valueAttribute->sendNotification(kTTSym_notify, v); // we use kTTSym_notify because we know that observers are TTCallback
return kTTErrNone;
}
示例9: main
int TTCLASSWRAPPERMAX_EXPORT main(void)
{
WrappedClassOptionsPtr options = new WrappedClassOptions;
TTValue value;
TTDSPInit();
value.clear();
value.append(TT("srRatio"));
value.append(TT("bitdepth"));
// TODO: experimental:
// options->append(TT("additionalSignalInputSetsAttribute"), value);
return wrapTTClassAsMaxClass(TT("degrade"), "jcom.degrade~", NULL, options);
}
示例10: calculate
TTErr TTAudioObjectBase::calculate(const TTValue& x, TTValue& y)
{
TTErr err = kTTErrGeneric;
if (valid) {
TTFloat64 in;
TTFloat64 out;
TTUInt32 size;
lock();
// at the moment we are iterating through the values using the same call to the object
// however, if the calculation involves the history of previous input or output
// then this will not work --
// TODO: there needs to be a way to request a calculation of a list on the object if it defines such a method
y.clear();
size = x.size();
for (TTUInt32 i=0; i<size; i++) {
x.get(i, in);
err = (this->*currentCalculateMethod)(in, out, NULL);
y.append(out);
}
unlock();
}
return err;
}
示例11: TTValueFromAtoms
TTErr TTValueFromAtoms(TTValue& v, long ac, t_atom* av)
{
v.clear();
// For now we assume floats for speed (e.g. in the performance sensitive j.unit object)
for (int i=0; i<ac; i++)
v.append((TTFloat64)atom_getfloat(av+i));
return kTTErrNone;
}
示例12: add
TTObjectBasePtr OSCSenderManager::add(TTSymbol applicationName, TTSymbol ip, TTUInt16 port)
{
TTValue v;
TTObjectBasePtr anObject = NULL;
TTErr err;
err = TTObjectBaseInstantiate(TTSymbol("osc.send"), &anObject, kTTValNONE);
if (!err) {
anObject->setAttributeValue(TTSymbol("address"), ip);
anObject->setAttributeValue(TTSymbol("port"), port);
v.append(anObject);
v.append(ip);
v.append(port);
mSenders->append(applicationName, v);
}
return anObject;
}
示例13: ramp_attrset
void ramp_attrset(t_ramp *x, t_symbol *msg, long argc, t_atom *argv)
{
TTSymbol* parameterName;
TTValue newValue;
int i;
if (argc < 2) {
error("jcom.ramp: not enough arguments to setParameter");
return;
}
parameterName = TT(atom_getsym(argv)->s_name);
for (i=1; i<=(argc-1); i++) {
if (argv[i].a_type == A_SYM)
newValue.append(TT(atom_getsym(argv+1)->s_name));
else
newValue.append(atom_getfloat(argv+i));
}
x->rampUnit->setAttributeValue(parameterName, newValue);
}
示例14: assignToValue
void TTList::assignToValue(TTValue& value)
{
TTListIter iter;
value.clear();
lock();
for (iter = theList.begin(); iter != theList.end(); iter++) {
value.append(*iter);
}
unlock();
}
示例15: wrapTTClassAsMaxClass
int C74_EXPORT main(void)
{
WrappedClassOptionsPtr options = new WrappedClassOptions;
TTValue value;
TTDSPInit();
value.clear();
value.append(TT("drive"));
options->append(TT("additionalSignalInputSetsAttribute"), value);
return wrapTTClassAsMaxClass(TT("overdrive"), "j.overdrive~", NULL, options);
}