⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mahvsw.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 3 页
字号:
	void *	ext_args					/* for future extension */
)
{
	/*	Prohibit access when HV is already created. */
	if(gHvswInfo.sdHvFuncId == func_id) {
		return (MASMW_ERROR);
	}

	return (__MaSound_Standby(func_id, file_id, ext_args));
}

/****************************************************************************
 *	MaSound_Seek
 *
 *	Function:
 *			Performs seeking processing of Stream Converter.
 *	Argument:
 *			func_id		function id
 *			file_id		file id
 *			pos			playing position from top or start point [ms]
 *			flag		unused 0
 *			ext_args	for future extension
 *	Return:
 *			0			success
 *			< 0			error code
 *
 ****************************************************************************/
SINT32 MaSound_Seek
(
	SINT32	func_id,					/* function id */
	SINT32	file_id,					/* file id */
	UINT32	pos,						/* start position (msec) */
	UINT8	flag,						/* flag */
	void *	ext_args					/* for future extension */
)
{
	/*	Prohibit access when HV is already created. */
	if(gHvswInfo.sdHvFuncId == func_id) {
		return (MASMW_ERROR);
	}

	return (__MaSound_Seek(func_id, file_id, pos, flag, ext_args));
}

/****************************************************************************
 *	MaSound_Start
 *
 *	Function:
 *			Performs starting process of Stream Converter.
 *	Argument:
 *			func_id		function id
 *			file_id		file id
 *			play_mode	playing mode
 *			ext_args	for future extension
 *	Return:
 *			0			success
 *			< 0			error code
 *
 ****************************************************************************/
SINT32 MaSound_Start
(
	SINT32	func_id,					/* function id */
	SINT32	file_id,					/* file id */
	UINT16	play_mode,					/* playing mode */
	void *	ext_args					/* for future extension */
)
{
	/*	Prohibit access when HV is already created. */
	if(gHvswInfo.sdHvFuncId == func_id) {
		return (MASMW_ERROR);
	}

	return (__MaSound_Start(func_id, file_id, play_mode, ext_args));
}

/****************************************************************************
 *	MaSound_Pause
 *
 *	Function:
 *			Stops sequence data reproduction temporarily.
 *			For audio systems, this operation is same as Stop.
 *	Argument:
 *			func_id		function id
 *			file_id		file id
 *			ext_args	for future extenstion
 *	Return:
 *			0			success
 *			< 0			error code
 *
 ****************************************************************************/
SINT32 MaSound_Pause
(
	SINT32	func_id,					/* function id */
	SINT32	file_id,					/* file id */
	void *	ext_args					/* for future extension */
)
{
	SINT32	sdRet = MASMW_ERROR;

	MASNDSEQ_DBGMSG(("MaSound_Pause: id=%ld hd=%ld\n", func_id, file_id));

	/*	Prohibit access when HV is already created. */
	if(gHvswInfo.sdHvFuncId == func_id) {
		return (MASMW_ERROR);
	}

	sdRet = __MaSound_Pause(func_id, file_id, ext_args);
	if(	(sdRet == MASMW_SUCCESS)		&&
		(gHvswInfo.sdHvFuncId >= 0)		&&
		(gHvswInfo.sdFuncId == func_id)	&&
		(gHvswInfo.sdFileId == file_id)) {

		MaHvsw_HvNoteOff();
	}

	return (sdRet);
}

/****************************************************************************
 *	MaSound_Restart
 *
 *	Function:
 *			Cancels pause of sequence data reproduction.
 *			For audio systems, this operation is the same as Start.
 *	Argument:
 *			func_id		function id
 *			file_id		file id
 *			ext_args	for future extension
 *	Return:
 *			0			success
 *			< 0			error code
 *
 ****************************************************************************/
SINT32 MaSound_Restart
(
	SINT32	func_id,					/* function id */
	SINT32	file_id,					/* file id */
	void *	ext_args					/* for future extension */
)
{
	/*	Prohibit access when HV is already created. */
	if(gHvswInfo.sdHvFuncId == func_id) {
		return (MASMW_ERROR);
	}

	return (__MaSound_Restart(func_id, file_id, ext_args));
}

/****************************************************************************
 *	MaSound_Stop
 *
 *	Function:
 *			Performs stopping processing of Stream Converter.
 *	Argument:
 *			func_id		function id
 *			file_id		file id
 *			ext_args	for future extension
 *	Return:
 *			0			success
 *			< 0			error code
 *
 ****************************************************************************/
SINT32 MaSound_Stop
(
	SINT32	func_id,					/* function id */
	SINT32	file_id,					/* file id */
	void *	ext_args					/* for future extension */
)
{
	SINT32	sdRet = MASMW_ERROR;

	MASNDSEQ_DBGMSG(("MaSound_Stop: id=%ld hd=%ld\n", func_id, file_id));

	/*	Prohibit access when HV is already created. */
	if(gHvswInfo.sdHvFuncId == func_id) {
		return (MASMW_ERROR);
	}

	sdRet = __MaSound_Stop(func_id, file_id, ext_args);
	if(	(sdRet == MASMW_SUCCESS)		&&
		(gHvswInfo.sdHvFuncId >= 0)		&&
		(gHvswInfo.sdFuncId == func_id)	&&
		(gHvswInfo.sdFileId == file_id)) {

		MaHvsw_HvNoteOff();
	}

	return (sdRet);
}

/****************************************************************************
 *	MaSound_Close
 *
 *	Function:
 *			Performs closing processing of Stream Converter.
 *	Argument:
 *			func_id		function id
 *			file_id		file id
 *			ext_args	for future extension
 *	Return:
 *			0			success
 *			< 0			error code
 *
 ****************************************************************************/
SINT32 MaSound_Close
(
	SINT32	func_id,					/* function id */
	SINT32	file_id,					/* file id */
	void *	ext_args					/* for future extension */
)
{
	SINT32	sdRet = MASMW_ERROR;

	MASNDSEQ_DBGMSG(("MaSound_Close: id=%ld hd=%ld\n", func_id, file_id));

	/*	Prohibit access when HV is already created. */
	if(gHvswInfo.sdHvFuncId == func_id) {
		return (MASMW_ERROR);
	}

	sdRet = __MaSound_Close(func_id, file_id, ext_args);
	if(	(sdRet == MASMW_SUCCESS)		&&
		(gHvswInfo.sdHvFuncId >= 0)		&&
		(gHvswInfo.sdFuncId == func_id)	&&
		(gHvswInfo.sdFileId == file_id)) {

		MaHvsw_HvNoteOff();
		__MaSound_Delete(gHvswInfo.sdHvFuncId);
		__MaSound_DeviceControl(MASMW_SET_HVTYPE, (UINT8)gHvswInfo.sdDefaultHvLanguage, 0, 0);
		MaHvsw_Initialize();
	}

	return (sdRet);
}

/****************************************************************************
 *	MaSound_Unload
 *
 *	Function:
 *			Performs unloading processing of Stream Converter.
 *	Argument:
 *			func_id		function id
 *			file_id		file id
 *			ext_args	for future extension
 *	Return:
 *			0			success
 *			< 0			error code
 *
 ****************************************************************************/
SINT32 MaSound_Unload
(
	SINT32	func_id,					/* function id */
	SINT32	file_id,					/* file id */
	void *	ext_args					/* for future extension */
)
{
	UINT32		i;
	SINT32		sdRet;
	PMAHVSWHOOK	pHook;

	/*	Prohibit access when HV is already created. */
	if(gHvswInfo.sdHvFuncId == func_id) {
		return (MASMW_ERROR);
	}

	sdRet = __MaSound_Unload(func_id, file_id, ext_args);
	if(sdRet < MASMW_SUCCESS)	return (sdRet);

	for(i = 0; i < MAHVSW_MAX_CALLBACK; i++) {
		pHook = &(gHvswInfo.sHook[i]);
		if((pHook->sdFuncId == func_id) && (pHook->sdFileId == file_id)) {
			/*	Initialize hook information	*/
			pHook->sdFuncId			= -1;
			pHook->sdFileId			= -1;
			pHook->pfnCallbackFunc	= NULL;
			break;
		}
	}

	return (sdRet);
}

/****************************************************************************
 *	MaSound_Delete
 *
 *	Function:
 *			Deletes Stream Converter that has been registered with func_id.
 *	Argument:
 *			func_id		function id
 *	Return:
 *			0			success
 *			< 0			error code
 *
 ****************************************************************************/
SINT32 MaSound_Delete
(
	SINT32	func_id						/* function id */
)
{
	/*	Prohibit access when HV is already created. */
	if(gHvswInfo.sdHvFuncId == func_id) {
		return (MASMW_ERROR);
	}

	return (__MaSound_Delete(func_id));
}

/****************************************************************************
 *	MaSound_DeviceControl
 *
 *	Function:
 *			Control the hardware.
 *	Argument:
 *			cmd		command number
 *			param1	parameter 1
 *			param2	parameter 2
 *			param3	parameter 3
 *	Return:
 *			>= 0	success
 *			< 0		error code
 *
 ****************************************************************************/
SINT32 MaSound_DeviceControl
(
	UINT8	cmd,						/* command number */
	UINT8	param1,						/* parameter 1 */
	UINT8	param2,						/* parameter 2 */
	UINT8	param3						/* parameter 3 */
)
{
	return (__MaSound_DeviceControl(cmd, param1, param2, param3));
}

/****************************************************************************
 *	MaSound_Initialize
 *
 *	Function:
 *			Initialize the MA Sound Sequencer.
 *	Argument:
 *			None
 *	Return:
 *			0		success
 *			< 0		error code
 *
 ****************************************************************************/
SINT32 MaSound_Initialize
(
	void
)
{
	UINT32		i;
	SINT32		sdRet;
	PMAHVSWHOOK	pHook;

	sdRet = __MaSound_Initialize();
	if(sdRet == MASMW_SUCCESS) {
		gHvswInfo.sdDefaultHvLanguage = MASMW_DEFAULT_HVTYPE;
		MaHvsw_Initialize();
		for(i = 0; i < MAHVSW_MAX_CALLBACK; i++) {
			pHook = &(gHvswInfo.sHook[i]);
			pHook->sdFuncId			= -1;
			pHook->sdFileId			= -1;
			pHook->pfnCallbackFunc	= NULL;
		}
	}

	return (sdRet);
}

/****************************************************************************
 *	MaSound_Terminate
 *
 *	Function:
 *			Terminate the MA Sound Sequencer.
 *	Argument:
 *			None
 *	Return:
 *			0		success
 *			< 0		error code
 *
 ****************************************************************************/
SINT32 MaSound_Terminate
(
	void
)
{
	return (__MaSound_Terminate());
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -