本文整理汇总了C++中TT函数的典型用法代码示例。如果您正苦于以下问题:C++ TT函数的具体用法?C++ TT怎么用?C++ TT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: out_algorithm_message
// messages received from jcom.hub for the algorithm
void out_algorithm_message(t_out *x, t_symbol *msg, long argc, t_atom *argv)
{
if(argc < 2)
return;
if(argv->a_type == A_SYM){
// jamoma 0.4
// if((argv->a_w.w_sym == jps_slash_audio_gain_midi) || (argv->a_w.w_sym == jps_audio_gain_midi)){
// jamoma 0.5
if((argv->a_w.w_sym == gensym("/audio/gain")) || (argv->a_w.w_sym == gensym("audio/gain")) || (argv->a_w.w_sym == gensym("gain")) || (argv->a_w.w_sym == gensym("/gain"))){
// Do gain control here...
// Should be that the gain change triggers a short tt_ramp to the new value
x->attr_gain = atom_getfloat(argv+1); // store as midi values
#ifdef JCOM_OUT_TILDE
x->gain->setAttributeValue(TT("midiGain"), x->attr_gain);
#endif
}
else if((argv->a_w.w_sym == jps_audio_mute) || (argv->a_w.w_sym == jps_slash_audio_mute) || (argv->a_w.w_sym == gensym("mute")) || (argv->a_w.w_sym == gensym("/mute"))){
x->attr_mute = atom_getlong(argv+1);
#ifdef JCOM_OUT_TILDE
if(x->attr_mute)
x->gain->setAttributeValue(TT("linearGain"), 0.0);
else
x->gain->setAttributeValue(TT("midiGain"), x->attr_gain);
#endif
}
else if((argv->a_w.w_sym == jps_audio_bypass) || (argv->a_w.w_sym == jps_slash_audio_bypass) || (argv->a_w.w_sym == gensym("bypass")) || (argv->a_w.w_sym == gensym("/bypass"))){
x->attr_bypass = atom_getlong(argv+1);
#ifdef JCOM_OUT_TILDE
if(x->attr_bypass == 0)
x->xfade->setAttributeValue(TT("position"), x->attr_mix * 0.01);
else
x->xfade->setAttributeValue(TT("position"), 0.0);
#endif
}
else if((argv->a_w.w_sym == jps_audio_mix) || (argv->a_w.w_sym == jps_slash_audio_mix) || (argv->a_w.w_sym == gensym("mix")) || (argv->a_w.w_sym == gensym("/mix"))){
x->attr_mix = atom_getfloat(argv+1);
#ifdef JCOM_OUT_TILDE
if(x->attr_bypass == 0)
x->xfade->setAttributeValue(TT("position"), x->attr_mix * 0.01);
#endif
}
else if((argv->a_w.w_sym == jps_audio_meters_freeze) || (argv->a_w.w_sym == jps_slash_audio_meters_freeze) || (argv->a_w.w_sym == gensym("freeze")) || (argv->a_w.w_sym == gensym("/freeze"))){
x->attr_defeat_meters = atom_getlong(argv+1);
}
else if((argv->a_w.w_sym == jps_video_preview) || (argv->a_w.w_sym == jps_slash_video_preview) || (argv->a_w.w_sym == gensym("preview")) || (argv->a_w.w_sym == gensym("/preview")))
x->attr_preview = atom_getlong(argv+1);
}
}
示例2: amd_decode_dc_mce
static void amd_decode_dc_mce(struct mce *m)
{
u16 ec = EC(m->status);
u8 xec = XEC(m->status, xec_mask);
pr_emerg(HW_ERR "Data Cache Error: ");
if (TLB_ERROR(ec)) {
if (TT(ec) == TT_DATA) {
pr_cont("%s TLB %s.\n", LL_MSG(ec),
((xec == 2) ? "locked miss"
: (xec ? "multimatch" : "parity")));
return;
}
} else if (fam_ops->dc_mce(ec, xec))
;
else
pr_emerg(HW_ERR "Corrupted DC MCE info?\n");
}
示例3: decode_mc0_mce
static void decode_mc0_mce(struct mce *m)
{
u16 ec = EC(m->status);
u8 xec = XEC(m->status, xec_mask);
pr_emerg(HW_ERR "MC0 Error: ");
/* TLB error signatures are the same across families */
if (TLB_ERROR(ec)) {
if (TT(ec) == TT_DATA) {
pr_cont("%s TLB %s.\n", LL_MSG(ec),
((xec == 2) ? "locked miss"
: (xec ? "multimatch" : "parity")));
return;
}
} else if (fam_ops->mc0_mce(ec, xec))
;
else
pr_emerg(HW_ERR "Corrupted MC0 MCE info?\n");
}
示例4: balance_dsp
// DSP Method: Adds our perform method to the DSP call chain
void balance_dsp(t_balance *x, t_signal **sp, short *count)
{
short i, j, k, l=0;
void **audioVectors = NULL;
audioVectors = (void**)sysmem_newptr(sizeof(void*) * ((x->maxNumChannels * 3) + 1));
audioVectors[l] = x;
l++;
// audioVectors[] passed to balance_perform() as {x, audioInL[0], audioInR[0], audioOut[0], audioInL[1], audioInR[1], audioOut[1],...}
x->numChannels = 0;
x->vs = 0;
for (i=0; i < x->maxNumChannels; i++) {
j = x->maxNumChannels + i;
k = x->maxNumChannels*2 + i;
if (count[i] && count[j] && count[k]) {
x->numChannels++;
if (sp[i]->s_n > x->vs)
x->vs = sp[i]->s_n;
audioVectors[l] = sp[i]->s_vec;
l++;
audioVectors[l] = sp[j]->s_vec;
l++;
audioVectors[l] = sp[k]->s_vec;
l++;
}
}
x->audioOut->setAttributeValue(kTTSym_numChannels, x->numChannels*2);
x->audioOut->setAttributeValue(kTTSym_numChannels, x->numChannels);
x->audioIn->setAttributeValue(kTTSym_vectorSize, x->vs);
x->audioOut->setAttributeValue(kTTSym_vectorSize, x->vs);
//audioIn will be set in the perform method
x->audioOut->sendMessage(TT("alloc"));
x->balance->setAttributeValue(kTTSym_sampleRate, sp[0]->s_sr);
dsp_addv(balance_perform, l, audioVectors);
sysmem_freeptr(audioVectors);
}
示例5: TTAudioGraphObject
TTAudioGraphObject :: TTAudioGraphObject (TTValue& arguments) : TTGraphObject(arguments),
mAudioFlags(kTTAudioGraphProcessor),
mInputSignals(NULL),
mOutputSignals(NULL),
mVectorSize(0)
{
TTErr err = kTTErrNone;
TTSymbolPtr wrappedObjectName = NULL;
//TTUInt16 initialNumChannels = 1;
TTUInt16 numInlets = 1;
TTUInt16 numOutlets = 1;
TT_ASSERT(audiograph_correct_instantiation_arg_count, arguments.getSize() > 0);
arguments.get(0, &wrappedObjectName);
if (arguments.getSize() > 1)
arguments.get(1, numInlets);
if (arguments.getSize() > 2)
arguments.get(2, numOutlets);
// instantiated by the TTGraph super-class
//err = TTObjectInstantiate(wrappedObjectName, &mUnitGenerator, initialNumChannels);
err = TTObjectInstantiate(kTTSym_audiosignalarray, (TTObjectPtr*)&mInputSignals, numInlets);
err = TTObjectInstantiate(kTTSym_audiosignalarray, (TTObjectPtr*)&mOutputSignals, numOutlets);
mAudioInlets.resize(numInlets);
mInputSignals->setMaxNumAudioSignals(numInlets);
mInputSignals->numAudioSignals = numInlets; // TODO: this array num signals access is kind of clumsy and inconsistent [tap]
mAudioOutlets.resize(numOutlets);
mOutputSignals->setMaxNumAudioSignals(numOutlets);
mOutputSignals->numAudioSignals = numOutlets;
// if an object supports the 'setOwner' message, then we tell it that we want to become the owner
// this is particularly important for the dac object
TTValue v = TTPtr(this);
mKernel->sendMessage(TT("setOwner"), v);
if (!sSharedMutex)
sSharedMutex = new TTMutex(false);
}
示例6: MidiOutGetDeviceNames
void MidiOutGetDeviceNames(MidiOutPtr self)
{
TTValue v;
TTErr err;
AtomCount ac;
AtomPtr ap;
TTSymbol name;
err = self->graphObject->mKernel->sendMessage(TT("getAvailableDeviceNames"), kTTValNONE, v);
if (!err) {
ac = v.getSize();
ap = new Atom[ac];
for (AtomCount i=0; i<ac; i++) {
v.get(i, name);
atom_setsym(ap+i, gensym((char*)name.c_str()));
}
object_obex_dumpout(self, gensym("getAvailableDeviceNames"), ac, ap);
delete ap;
}
}
示例7: StencilGetStepSize
t_jit_err StencilGetStepSize(StencilObjectPtr self, Ptr attr, AtomCount* ac, AtomPtr* av)
{
TTValue v;
if (*ac && *av) {
; // memory passed-in, use it
}
else {
*av = (AtomPtr)sysmem_newptr(sizeof(Atom)*2);
}
*ac = 2;
self->stencilObject->getAttributeValue(TT("stepSize"), v);
for (AtomCount k=0; k < *ac; k++) {
TTInt32 step;
v.get(k, step);
atom_setlong((*av)+k, step);
}
return JIT_ERR_NONE;
}
示例8: HallLoginFailed
HallLoginFailed(LoginResult eRes)
{
switch(eRes)
{
case LOGIN_EXIST:
m_kTitle = TT("LoginExistTitle");
m_kContent = TT("LoginExistContent");
break;
case LOGIN_WRONG_VERSION:
m_kTitle = TT("LoginWrongTitle");
m_kContent = TT("LoginWrongContent");
break;
default:
m_kTitle = TT("LoginTitle");
m_kContent = TT("LoginContent");
break;
}
m_kEnter = TT("Confirm");
}
示例9:
NSPStatus
Namespace::namespaceAttributeSet(std::string address, TTSymbolPtr attribute, TTValue value, int instance)
{
TTErr err, err1;
TTList returnedTTNodes;
TTNodePtr firstReturnedTTNode;
if (NSPDirectory) {
// 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();
}
err = NSPDirectory->Lookup(TT(absAddress), returnedTTNodes, &firstReturnedTTNode);
if (err != kTTErrNone) {
return NSP_INVALID_ADDRESS;
}
TTObjectPtr param = firstReturnedTTNode->getObject();
if (param != NULL) {
err1 = param->setAttributeValue(attribute, value);
}
if (err1 != kTTErrNone) {
return NSP_INVALID_ATTRIBUTE;
}
return NSP_NO_ERROR;
}
return NSP_INIT_ERROR;
}
示例10: ramp_attrget
void ramp_attrget(t_ramp *x, t_symbol *msg, long argc, t_atom *argv)
{
t_atom* a;
TTSymbol* parameterName;
TTValue parameterValue;
int numValues;
int i;
TTSymbol* tempSymbol;
double tempValue;
if (!argc) {
error("jcom.ramp: not enough arguments to parameter.get");
return;
}
parameterName = TT(atom_getsym(argv)->s_name);
x->rampUnit->getAttributeValue(parameterName, parameterValue);
numValues = parameterValue.getSize();
if (numValues) {
a = (t_atom *)sysmem_newptr(sizeof(t_atom) * (numValues+1));
// First list item is name of parameter
atom_setsym(a, gensym((char*)parameterName->getCString()));
// Next the whole shebang is copied
for (i=0; i<numValues; i++) {
if (parameterValue.getType(i) == kTypeSymbol) {
parameterValue.get(i, &tempSymbol);
atom_setsym(a+i+1, gensym((char*)tempSymbol->getCString()));
}
else {
parameterValue.get(i, tempValue);
atom_setfloat(a+i+1, tempValue);
}
}
object_obex_dumpout(x, gensym("current.parameter"), numValues+1, a);
// The pointer to an atom assign in the getParameter method needs to be freed.
sysmem_freeptr(a);
}
}
示例11: AudioEffectX
BlueSaturation::BlueSaturation(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPresets, kNumParameters),
mNumChannels(2),
mOverdrive(NULL),
mInput(NULL),
mOutput(NULL)
{
TTDSPInit();
setNumInputs(2); // stereo in
setNumOutputs(2); // stereo out
setUniqueID('TTOv'); // identify
canProcessReplacing(); // supports replacing output
canDoubleReplacing(); // supports double precision processing
TTObjectInstantiate(TT("overdrive"), &mOverdrive, mNumChannels);
TTObjectInstantiate(kTTSym_audiosignal, &mInput, mNumChannels);
TTObjectInstantiate(kTTSym_audiosignal, &mOutput, mNumChannels);
mParameterList = new BlueParameter[kNumParameters];
strncpy(mParameterList[kParameterDrive].name, "drive", 256);
mParameterList[kParameterDrive].scaling = 9.0;
mParameterList[kParameterDrive].offset = 1.0;
strncpy(mParameterList[kParameterPreamp].name, "preamp", 256);
mParameterList[kParameterPreamp].scaling = 96.0;
mParameterList[kParameterPreamp].offset = -78.0;
strncpy(mParameterList[kParameterMode].name, "mode", 256);
mParameterList[kParameterMode].scaling = 2.0; // just round this one
mParameterList[kParameterMode].offset = 0.5;
strncpy(mParameterList[kParameterBlockDC].name, "dcblocker", 256);
mParameterList[kParameterBlockDC].scaling = 1.0; // just round this one
mParameterList[kParameterBlockDC].offset = 0.5;
vst_strncpy(programName, "Default", kVstMaxProgNameLen); // default program name
}
示例12: Follow
/**
* main follower routine. Fills all members and return true on success.
* Otherwise returns false if track can't be followed.
*/
inline bool Follow(TileIndex old_tile, Trackdir old_td)
{
m_old_tile = old_tile;
m_old_td = old_td;
m_err = EC_NONE;
assert(((TrackStatusToTrackdirBits(GetTileTrackStatus(m_old_tile, TT(), IsRoadTT() && m_veh != NULL ? RoadVehicle::From(m_veh)->compatible_roadtypes : 0)) & TrackdirToTrackdirBits(m_old_td)) != 0) ||
(IsTram() && GetSingleTramBit(m_old_tile) != INVALID_DIAGDIR)); // Disable the assertion for single tram bits
m_exitdir = TrackdirToExitdir(m_old_td);
if (ForcedReverse()) return true;
if (!CanExitOldTile()) return false;
FollowTileExit();
if (!QueryNewTileTrackStatus()) return TryReverse();
if (!CanEnterNewTile()) return false;
m_new_td_bits &= DiagdirReachesTrackdirs(m_exitdir);
if (m_new_td_bits == TRACKDIR_BIT_NONE) {
/* In case we can't enter the next tile, but are
* a normal road vehicle, then we can actually
* try to reverse as this is the end of the road.
* Trams can only turn on the appropriate bits in
* which case reaching this would mean a dead end
* near a building and in that case there would
* a "false" QueryNewTileTrackStatus result and
* as such reversing is already tried. The fact
* that function failed can have to do with a
* missing road bit, or inability to connect the
* different bits due to slopes. */
if (IsRoadTT() && !IsTram() && TryReverse()) return true;
m_err = EC_NO_WAY;
return false;
}
if (!Allow90degTurns()) {
m_new_td_bits &= (TrackdirBits)~(int)TrackdirCrossesTrackdirs(m_old_td);
if (m_new_td_bits == TRACKDIR_BIT_NONE) {
m_err = EC_90DEG;
return false;
}
}
return true;
}
示例13: FindInitialPos
IGL_INLINE void igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC>::
FindInitialPos(const int vert,
int &edge,
int &face)
{
int f_init;
int edge_init;
FirstPos(vert,f_init,edge_init); // todo manually the function
igl::HalfEdgeIterator<DerivedF> VFI(F,TT,TTi,f_init,edge_init);
bool vertexB = V_border[vert];
bool possible_split=false;
bool complete_turn=false;
do
{
int curr_f = VFI.Fi();
int curr_edge=VFI.Ei();
VFI.NextFE();
int next_f=VFI.Fi();
///test if I've just crossed a border
bool on_border=(TT(curr_f,curr_edge)==-1);
//bool mismatch=false;
bool seam=false;
///or if I've just crossed a seam
///if I'm on a border I MUST start from the one next t othe border
if (!vertexB)
//seam=curr_f->IsSeam(next_f);
seam=IsSeam(curr_f,next_f);
// if (vertexB)
// assert(!Handle_Singular(vert));
// ;
//assert(!vert->IsSingular());
possible_split=((on_border)||(seam));
complete_turn = next_f == f_init;
} while ((!possible_split)&&(!complete_turn));
face=VFI.Fi();
edge=VFI.Ei();
}
示例14: FFTNew
// Create
TTPtr FFTNew(SymbolPtr s, AtomCount argc, AtomPtr argv)
{
short i;
FFTPtr self = (FFTPtr)object_alloc(sFFTClass);
if (self) {
object_obex_store((TTPtr)self, _sym_dumpout, (object*)outlet_new(self, NULL)); // dumpout
self->numChannels = 1;
dsp_setup((t_pxobject*)self, self->numChannels); // Create Object and N Inlets (last argument)
self->obj.z_misc = Z_NO_INPLACE; // ESSENTIAL!
for (i=0; i< (self->numChannels*2); i++)
outlet_new((t_pxobject*)self, "signal");
TTObjectInstantiate(TT("fft"), &self->fft, self->numChannels);
TTObjectInstantiate(kTTSym_audiosignal, &self->audioIn, self->numChannels);
TTObjectInstantiate(kTTSym_audiosignal, &self->audioOut, self->numChannels);
attr_args_process(self, argc, argv);
}
return (self);
}
示例15: object_obex_store
void *dataspace_new(t_symbol *name, long argc, t_atom *argv)
{
t_dataspace *self;
TTValue none;
self = (t_dataspace *)object_alloc(dataspace_class);
if (self) {
object_obex_store((void*)self, _sym_dumpout, (object*)outlet_new(self, NULL));
// Make sure that environment sample rate is set correctly at instantiated,
// as it is used by time dataspace for conversions to and from sample
TTValue sr(sys_getsr());
ttEnvironment->setAttributeValue(kTTSym_sampleRate, sr);
self->outlet_native = outlet_new(self, 0);
TTObjectBaseInstantiate(TT("dataspace"), &self->dataspace, none);
attr_args_process(self, argc, argv);
if (!self->dataspace)
object_attr_setsym(self, gensym("dataspace"), gensym("temperature"));
}
return self;
}