• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ slotRawPtr函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中slotRawPtr函数的典型用法代码示例。如果您正苦于以下问题:C++ slotRawPtr函数的具体用法?C++ slotRawPtr怎么用?C++ slotRawPtr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了slotRawPtr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: prTempoClock_SetTempoAtBeat

int prTempoClock_SetTempoAtBeat(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a = g->sp - 2;
	PyrSlot *b = g->sp - 1;
	PyrSlot *c = g->sp;

	TempoClock *clock = (TempoClock*)slotRawPtr(&slotRawObject(a)->slots[1]);
	if (!clock) {
		error("clock is not running.\n");
		return errFailed;
	}

	double tempo, beat;
	int err = slotDoubleVal(b, &tempo);
	if (err) return errFailed;
	if (tempo <= 0.) {
		error("invalid tempo %g\n", tempo);
		return errFailed;
	}

	err = slotDoubleVal(c, &beat);
	if (err) return errFailed;

	clock->SetTempoAtBeat(tempo, beat);

	return errNone;
}
开发者ID:ELVIS-Project,项目名称:VISIntervalSonifier,代码行数:27,代码来源:PyrSched.cpp


示例2: prFilePutFloatLE

int prFilePutFloatLE(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a, *b;
	PyrFile *pfile;
	FILE *file;

	a = g->sp - 1;
	b = g->sp;

	pfile = (PyrFile*)slotRawObject(a);
	file = (FILE*)slotRawPtr(&pfile->fileptr);
	if (file == NULL) {
		dumpObjectSlot(a);
		return errFailed;
	}

	float val;
	int err = slotFloatVal(b, &val);
	if (err) return err;

	SC_IOStream<FILE*> scio(file);
	scio.writeFloat_le(val);

	return errNone;
}
开发者ID:dpalkowski,项目名称:iSuperColliderKit,代码行数:25,代码来源:PyrFilePrim.cpp


示例3: prTempoClock_SetAll

int prTempoClock_SetAll(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a = g->sp - 3;
	PyrSlot *b = g->sp - 2;
	PyrSlot *c = g->sp - 1;
	PyrSlot *d = g->sp;

	TempoClock *clock = (TempoClock*)slotRawPtr(&slotRawObject(a)->slots[1]);
	if (!clock) {
		error("clock is not running.\n");
		return errFailed;
	}

	double tempo, beat, secs;
	int err = slotDoubleVal(b, &tempo);
	if (err) return errFailed;

	err = slotDoubleVal(c, &beat);
	if (err) return errFailed;

	err = slotDoubleVal(d, &secs);
	if (err) return errFailed;

	clock->SetAll(tempo, beat, secs);

	return errNone;
}
开发者ID:ELVIS-Project,项目名称:VISIntervalSonifier,代码行数:27,代码来源:PyrSched.cpp


示例4: prSFWrite

int prSFWrite(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a, *b;

	a = g->sp - 1;
	b = g->sp;

	SNDFILE *file = (SNDFILE*)slotRawPtr(&slotRawObject(a)->slots[0]);

	if (!isKindOfSlot(b, class_rawarray)) return errWrongType;

	switch (slotRawObject(b)->obj_format) {
		case obj_int16 :
			sf_write_short(file, (short*)slotRawInt8Array(b)->b, slotRawObject(b)->size);
			break;
		case obj_int32 :
			sf_write_int(file, (int*)slotRawInt8Array(b)->b, slotRawObject(b)->size);
			break;
		case obj_float :
			sf_write_float(file, (float*)slotRawInt8Array(b)->b, slotRawObject(b)->size);
			break;
		case obj_double :
			sf_write_double(file, (double*)slotRawInt8Array(b)->b, slotRawObject(b)->size);
			break;
		default:
			error("sample format not supported.\n");
			return errFailed;
	}

	return errNone;
}
开发者ID:dpalkowski,项目名称:iSuperColliderKit,代码行数:31,代码来源:PyrFilePrim.cpp


示例5: prSetControlBusValues

int prSetControlBusValues(VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a = g->sp - 2;
	PyrSlot *b = g->sp - 1;
	PyrSlot *c = g->sp;

	assert(IsObj(a));
	PyrObject * self = slotRawObject(a);
	int ptrIndex       = 0;
	PyrSlot * ptrSlot = self->slots + ptrIndex;
	if (NotPtr(ptrSlot))
		return errFailed;

	if (!IsInt(b))
		return errFailed;

	int busIndex = slotRawInt(b);

	if (!IsObj(c))
		return errFailed;

	PyrObject * values = slotRawObject(c);
	server_shared_memory_client * client = (server_shared_memory_client*)slotRawPtr(ptrSlot);
	float * control_busses = client->get_control_busses() + busIndex;

	for (int i = 0; i != values->size; ++i) {
		float value;
		int error = slotFloatVal(values->slots + i, &value);
		if (error != errNone)
			return error;

		control_busses[i] = value;
	}
	return errNone;
}
开发者ID:robertol80,项目名称:supercollider,代码行数:35,代码来源:OSCData.cpp


示例6: prSetControlBusValue

int prSetControlBusValue(VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a = g->sp - 2;
	PyrSlot *b = g->sp - 1;
	PyrSlot *c = g->sp;

	assert(IsObj(a));
	PyrObject * self = slotRawObject(a);
	int ptrIndex       = 0;
	PyrSlot * ptrSlot = self->slots + ptrIndex;
	if (NotPtr(ptrSlot))
		return errFailed;

	if (!IsInt(b))
		return errFailed;

	int busIndex = slotRawInt(b);

	if (NotPtr(ptrSlot))
		return errFailed;

	float value;
	int error = slotFloatVal(c, &value);
	if (error != errNone)
		return error;

	server_shared_memory_client * client = (server_shared_memory_client*)slotRawPtr(ptrSlot);

	client->get_control_busses()[busIndex] = value;
	return errNone;
}
开发者ID:robertol80,项目名称:supercollider,代码行数:31,代码来源:OSCData.cpp


示例7: prTempoClock_Sched

int prTempoClock_Sched(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a = g->sp - 2;
	PyrSlot *b = g->sp - 1;
	PyrSlot *c = g->sp;
	double delta, beats;
	int err;

	TempoClock *clock = (TempoClock*)slotRawPtr(&slotRawObject(a)->slots[1]);
	if (!clock) {
		error("clock is not running.\n");
		return errFailed;
	}

	if (!SlotEq(&g->thread->clock, a)) {
		beats = clock->ElapsedBeats();
		//post("shouldn't call TempoClock-sched from a different clock. Use schedAbs.\n");
		//return errFailed;
	} else {
		err = slotDoubleVal(&g->thread->beats, &beats);
		if (err) return errNone; // return nil OK, just don't schedule
	}

	err = slotDoubleVal(b, &delta);
	if (err) return errNone; // return nil OK, just don't schedule
	beats += delta;
	if (beats == dInfinity)
		return errNone; // return nil OK, just don't schedule

	clock->Add(beats, c);

	return errNone;
}
开发者ID:ELVIS-Project,项目名称:VISIntervalSonifier,代码行数:33,代码来源:PyrSched.cpp


示例8: prTempoClock_Dump

int prTempoClock_Dump(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a = g->sp;
	TempoClock *clock = (TempoClock*)slotRawPtr(&slotRawObject(a)->slots[1]);
	if (clock) clock->Dump();

	return errNone;
}
开发者ID:ELVIS-Project,项目名称:VISIntervalSonifier,代码行数:8,代码来源:PyrSched.cpp


示例9: finalize_image_object

int finalize_image_object( struct VMGlobals *g, struct PyrObject *obj )
{
    SharedImage *shared_image_ptr =
            reinterpret_cast<SharedImage*>( slotRawPtr(obj->slots) );
    delete shared_image_ptr;
    SetNil( obj->slots+0 );
    return errNone;
}
开发者ID:Lucideam,项目名称:supercollider,代码行数:8,代码来源:prim_QImage.cpp


示例10: read

 static QObjectProxy* read( PyrSlot *slot )
 {
   PyrSlot *proxySlot = slotRawObject( slot )->slots;
   if( IsPtr( proxySlot ) )
     return (QObjectProxy*) slotRawPtr( proxySlot );
   else
     return 0;
 }
开发者ID:dashaxiong,项目名称:supercollider,代码行数:8,代码来源:type_codec.hpp


示例11: qcDebugMsg

int QcTreeWidget::Item::finalize( VMGlobals *g, PyrObject *obj )
{
  qcDebugMsg(1,"finalizing QTreeViewItem!");
  if( IsPtr( obj->slots+0 ) ) {
    QcTreeWidget::ItemPtr *ptr = static_cast<QcTreeWidget::ItemPtr*>( slotRawPtr(obj->slots+0) );
    delete ptr;
  }
  return errNone;
}
开发者ID:8c6794b6,项目名称:supercollider,代码行数:9,代码来源:QcTreeWidget.cpp


示例12: returnFromBlock

HOT void returnFromBlock(VMGlobals *g)
{
	PyrFrame *curframe;
	PyrFrame *returnFrame;
	PyrFrame *homeContext;
	PyrBlock *block;
	PyrMethod *meth;
	PyrMethodRaw *methraw;
	PyrMethodRaw *blockraw;

	//if (gTraceInterpreter) postfl("->returnFromBlock\n");
	//printf("->returnFromBlock\n");
#ifdef GC_SANITYCHECK
	g->gc->SanityCheck();
	CallStackSanity(g, "returnFromBlock");
#endif
	curframe = g->frame;

//again:
	returnFrame = slotRawFrame(&curframe->caller);
	if (returnFrame) {
		block = slotRawBlock(&curframe->method);
		blockraw = METHRAW(block);

		g->frame = returnFrame;
		g->ip = (unsigned char *)slotRawPtr(&returnFrame->ip);
		g->block = slotRawBlock(&returnFrame->method);
		homeContext = slotRawFrame(&returnFrame->homeContext);
		meth = slotRawMethod(&homeContext->method);
		methraw = METHRAW(meth);
		slotCopy(&g->receiver, &homeContext->vars[0]); //??
		g->method = meth;

		meth = slotRawMethod(&curframe->method);
		methraw = METHRAW(meth);
		if (!methraw->needsHeapContext) {
			g->gc->Free(curframe);
		} else {
			SetInt(&curframe->caller, 0);
		}

	} else {
		////// this should never happen .
		error("return from Function at top of call stack.\n");
		g->method = NULL;
		g->block = NULL;
		g->frame = NULL;
		g->sp = g->gc->Stack()->slots - 1;
		longjmp(g->escapeInterpreter, 1);
	}
	//if (gTraceInterpreter) postfl("<-returnFromBlock\n");
#ifdef GC_SANITYCHECK
	g->gc->SanityCheck();
	CallStackSanity(g, "returnFromBlock");
#endif
}
开发者ID:dpalkowski,项目名称:iSuperColliderKit,代码行数:56,代码来源:PyrMessage.cpp


示例13: prNetAddr_Disconnect

static int prNetAddr_Disconnect(VMGlobals *g, int numArgsPushed)
{
	PyrSlot* netAddrSlot = g->sp;
	PyrObject* netAddrObj = slotRawObject(netAddrSlot);

	SC_TcpClientPort *comPort = (SC_TcpClientPort*)slotRawPtr(netAddrObj->slots + ivxNetAddr_Socket);
	if (comPort) comPort->Close();

	return errNone;
}
开发者ID:robertol80,项目名称:supercollider,代码行数:10,代码来源:OSCData.cpp


示例14: prTempoClock_Free

int prTempoClock_Free(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a = g->sp;
	TempoClock *clock = (TempoClock*)slotRawPtr(&slotRawObject(a)->slots[1]);
	if (!clock) return errNone;	// not running

	SetNil(slotRawObject(a)->slots + 1);
	clock->StopReq();

	return errNone;
}
开发者ID:ELVIS-Project,项目名称:VISIntervalSonifier,代码行数:11,代码来源:PyrSched.cpp


示例15: prFileFlush

int prFileFlush(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a;
	PyrFile *pfile;
	FILE *file;

	a = g->sp;
	pfile = (PyrFile*)slotRawObject(a);
	file = (FILE*)slotRawPtr(&pfile->fileptr);
	if (file != NULL) fflush(file);
	return errNone;
}
开发者ID:dpalkowski,项目名称:iSuperColliderKit,代码行数:12,代码来源:PyrFilePrim.cpp


示例16: Finalize

void PyrGC::Finalize(PyrObject *finalizer)
{
	if (!IsPtr(finalizer->slots+0)) return;
	if (!IsObj(finalizer->slots+1)) return;

	ObjFuncPtr func = (ObjFuncPtr)slotRawPtr(&finalizer->slots[0]);
	PyrObject *obj = slotRawObject(&finalizer->slots[1]);
	//post("FINALIZE %s %p\n", slotRawSymbol(&obj->classptr->name)->name, obj);
	(func)(mVMGlobals, obj);

	SetNil(obj->slots+0);
	SetNil(obj->slots+1);
}
开发者ID:ASauer,项目名称:supercollider,代码行数:13,代码来源:GC.cpp


示例17: prTempoClock_ElapsedBeats

int prTempoClock_ElapsedBeats(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a = g->sp;
	TempoClock *clock = (TempoClock*)slotRawPtr(&slotRawObject(a)->slots[1]);
	if (!clock) {
		error("clock is not running.\n");
		return errFailed;
	}

	SetFloat(a, clock->ElapsedBeats());

	return errNone;
}
开发者ID:ELVIS-Project,项目名称:VISIntervalSonifier,代码行数:13,代码来源:PyrSched.cpp


示例18: prSFClose

int prSFClose(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a;

	a = g->sp;

	SNDFILE *file = (SNDFILE*)slotRawPtr(&slotRawObject(a)->slots[0]);
	if (file) {
		sf_close(file);
		SetNil(slotRawObject(a)->slots + 0);
	}

	return errNone;
}
开发者ID:dpalkowski,项目名称:iSuperColliderKit,代码行数:14,代码来源:PyrFilePrim.cpp


示例19: prFileClose

int prFileClose(struct VMGlobals *g, int numArgsPushed)
{
	PyrSlot *a;
	PyrFile *pfile;
	FILE *file;

	a = g->sp;
	pfile = (PyrFile*)slotRawObject(a);
	file = (FILE*)slotRawPtr(&pfile->fileptr);
	if (file == NULL) return errNone;
	SetPtr(&pfile->fileptr, NULL);
	if (fclose(file)) return errFailed;
	return errNone;
}
开发者ID:dpalkowski,项目名称:iSuperColliderKit,代码行数:14,代码来源:PyrFilePrim.cpp


示例20: prSFHeaderInfoString

int prSFHeaderInfoString(struct VMGlobals *g, int numArgsPushed)
{

	PyrSlot *a;
	a = g->sp;
	SNDFILE *file = (SNDFILE*)slotRawPtr(&slotRawObject(a)->slots[0]);
	if(file){
		static	char	strbuffer [(1 << 16)] ;
		sf_command (file, SFC_GET_LOG_INFO, strbuffer, (1 << 16)) ;
		PyrString *pstring = newPyrString(g->gc, strbuffer, 0, true);
		// post(strbuffer);
		SetObject(a, pstring);
		return errNone;
	}
	return errFailed;
}
开发者ID:dpalkowski,项目名称:iSuperColliderKit,代码行数:16,代码来源:PyrFilePrim.cpp



注:本文中的slotRawPtr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ slotSelectionChanged函数代码示例发布时间:2022-05-30
下一篇:
C++ slotRawObject函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap