本文整理汇总了C++中TTAddress::c_str方法的典型用法代码示例。如果您正苦于以下问题:C++ TTAddress::c_str方法的具体用法?C++ TTAddress::c_str怎么用?C++ TTAddress::c_str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTAddress
的用法示例。
在下文中一共展示了TTAddress::c_str方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeInternals_data
TTErr removeInternals_data(TTPtr self, TTAddress address, TTAddress name)
{
WrappedModularInstancePtr x = (WrappedModularInstancePtr)self;
TTValue v;
TTAddress dataAddress;
TTErr err;
err = x->internals->lookup(name, v);
if (!err) {
dataAddress = v[1];
JamomaDebug object_post((t_object*)x, "Remove internal %s object at : %s", name.c_str(), dataAddress.c_str());
MaxApplication.send("ObjectUnregister", dataAddress);
x->internals->remove(name);
}
return kTTErrNone;
}
示例2: makeInternals_sender
TTErr makeInternals_sender(TTPtr self, TTAddress address, TTSymbol name, TTObject& returnedSender, TTBoolean appendNameAsAttribute)
{
WrappedModularInstancePtr x = (WrappedModularInstancePtr)self;
TTValue v;
TTAddress adrs;
// check the internals do not exist yet
if (!x->internals->lookup(name, v)) {
returnedSender = v[0];
JamomaDebug object_post((t_object*)x, "makeInternals_sender : \"%s\" internal already exists", name.c_str());
return kTTErrNone;
}
returnedSender = TTObject(kTTSym_Sender);
// edit address
if (appendNameAsAttribute)
adrs = address.appendAttribute(name);
else
adrs = address.appendAddress(TTAddress(name.c_str()));
// default registration case : store object only (see in unregister method)
x->internals->append(name, returnedSender);
// set address attribute
returnedSender.set(kTTSym_address, adrs);
JamomaDebug object_post((t_object*)x, "makes internal \"%s\" sender to bind on : %s", name.c_str(), adrs.c_str());
return kTTErrNone;
}
示例3: makeInternals_receiver
TTErr makeInternals_receiver(TTPtr self, TTAddress address, TTSymbol name, t_symbol *callbackMethod, TTObject& returnedReceiver, TTBoolean deferlow, TTBoolean appendNameAsAttribute)
{
WrappedModularInstancePtr x = (WrappedModularInstancePtr)self;
TTValue v, args, baton;
TTObject returnValueCallback, empty;
TTAddress adrs;
// check the internals do not exist yet
if (!x->internals->lookup(name, v)) {
returnedReceiver = v[0];
JamomaDebug object_post((t_object*)x, "makeInternals_receiver : \"%s\" internal already exists", name.c_str());
returnedReceiver.send("Get");
return kTTErrNone;
}
// prepare arguments
// we don't want the address back
args.append(empty);
returnValueCallback = TTObject("callback");
baton = TTValue(TTPtr(x), TTPtr(callbackMethod), deferlow);
returnValueCallback.set(kTTSym_baton, baton);
returnValueCallback.set(kTTSym_function, TTPtr(&jamoma_callback_return_value));
args.append(returnValueCallback);
returnedReceiver = TTObject(kTTSym_Receiver, args);
// edit address
if (appendNameAsAttribute)
adrs = address.appendAttribute(name);
else
adrs = address.appendAddress(TTAddress(name.c_str()));
// default registration case : store object only (see in unregister method)
x->internals->append(name, returnedReceiver);
// set address attribute (after registration as the value can be updated in the same time)
returnedReceiver.set(kTTSym_address, adrs);
JamomaDebug object_post((t_object*)x, "makes internal \"%s\" receiver to bind on : %s", name.c_str(), adrs.c_str());
return kTTErrNone;
}
示例4: wrappedModularClass_unregister
void wrappedModularClass_unregister(WrappedModularInstancePtr x)
{
TTValue keys, v;
TTSymbol name;
TTAddress objectAddress;
TTErr err;
#ifndef ARRAY_EXTERNAL
x->subscriberObject = TTObject();
// check the wrappedObject is still valid because it could have been released in spec->_free method
if (x->wrappedObject.valid()) {
// don't release the local application
if (!(x->wrappedObject.instance() == accessApplicationLocal)) {
if (x->wrappedObject.instance()->getReferenceCount() > 1)
object_error((t_object*)x, "there are still unreleased reference of the wrappedObject (refcount = %d)", x->wrappedObject.instance()->getReferenceCount() - 1);
// this line should release the last instance of the wrapped object
// otherwise there is something wrong
x->wrappedObject = TTObject();
}
}
#endif
if (!x->internals->isEmpty()) {
err = x->internals->getKeys(keys);
if (!err) {
x->iterateInternals = YES;
for (int i = 0; i < (TTInt32) keys.size(); i++) {
name = keys[i];
err = x->internals->lookup(name, v);
if (!err) {
TTObject o = v[0];
if (o.name() == kTTSym_Sender || o.name() == kTTSym_Receiver || o.name() == kTTSym_Viewer)
o.set(kTTSym_address, kTTAdrsEmpty);
// absolute registration case : remove the address
if (v.size() == 2) {
objectAddress = v[1];
JamomaDebug object_post((t_object*)x, "Remove internal %s object at : %s", name.c_str(), objectAddress.c_str());
MaxApplication.send("ObjectUnregister", objectAddress);
}
}
}
x->iterateInternals = NO;
}
x->internals->clear();
}
}
示例5: makeInternals_viewer
TTErr makeInternals_viewer(TTPtr self, TTAddress address, TTSymbol name, t_symbol *callbackMethod, TTObject& returnedViewer, TTBoolean deferlow)
{
WrappedModularInstancePtr x = (WrappedModularInstancePtr)self;
TTValue v, baton;
TTAddress adrs;
// check the internals do not exist yet
if (!x->internals->lookup(name, v)) {
returnedViewer = v[0];
JamomaDebug object_post((t_object*)x, "makeInternals_viewer : \"%s\" internal already exists", name.c_str());
return kTTErrNone;
}
returnedViewer = TTObject(kTTSym_Viewer);
baton = TTValue(TTPtr(x), TTPtr(callbackMethod), deferlow);
returnedViewer.set(kTTSym_baton, baton);
returnedViewer.set(kTTSym_function, TTPtr(&jamoma_callback_return_value));
// edit address
adrs = address.appendAddress(TTAddress(name));
// default registration case : store object only (see in unregister method)
x->internals->append(name, returnedViewer);
// set address attribute (after registration as the value can be updated in the same time)
returnedViewer.set(kTTSym_address, adrs);
JamomaDebug object_post((t_object*)x, "makes internal \"%s\" viewer to bind on : %s", name.c_str(), adrs.c_str());
return kTTErrNone;
}