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

📄 org_tritonus_lowlevel_alsa_alsapcmhwparams.c

📁 linux下建立JAVA虚拟机的源码KAFFE
💻 C
📖 第 1 页 / 共 2 页
字号:
/* *	org_tritonus_lowlevel_alsa_AlsaPcmHWParams.c *//* *  Copyright (c) 1999 - 2001 by Matthias Pfisterer <Matthias.Pfisterer@gmx.de> * *   This program is free software; you can redistribute it and/or modify *   it under the terms of the GNU Library General Public License as published *   by the Free Software Foundation; either version 2 of the License, or *   (at your option) any later version. * *   This program is distributed in the hope that it will be useful, *   but WITHOUT ANY WARRANTY; without even the implied warranty of *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *   GNU Library General Public License for more details. * *   You should have received a copy of the GNU Library General Public *   License along with this program; if not, write to the Free Software *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */#include "org_tritonus_lowlevel_alsa_AlsaPcmHWParams.h"#include "common.h"snd_pcm_format_mask_t*getFormatMaskNativeHandle(JNIEnv* env, jobject obj);HandleFieldHandler(snd_pcm_hw_params_t*)/* */static voidsetDirection(JNIEnv* env, jint nDirection, jintArray anDirection){	if (anDirection != NULL)	{		checkArrayLength(env, anDirection, 1);		(*env)->SetIntArrayRegion(env, anDirection, 0, 1, &nDirection);	}}snd_pcm_hw_params_t*getHWParamsNativeHandle(JNIEnv* env, jobject obj){	return getHandle(env, obj);}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    malloc * Signature: ()I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_malloc(JNIEnv* env, jobject obj){	snd_pcm_hw_params_t*	handle;	int			nReturn;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_malloc(): begin\n"); }	nReturn = snd_pcm_hw_params_malloc(&handle);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_malloc(): handle: %p\n", handle); }	setHandle(env, obj, handle);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_malloc(): end\n"); }	return nReturn;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    free * Signature: ()V */JNIEXPORT void JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_free(JNIEnv* env, jobject obj){	snd_pcm_hw_params_t*	handle;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_free(): begin\n"); }	handle = getHandle(env, obj);	snd_pcm_hw_params_free(handle);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_free(): end\n"); }}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getRate * Signature: ([J)I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRate___3J(JNIEnv* env, jobject obj, jlongArray alValues){	snd_pcm_hw_params_t*	handle;	int			nReturn;	unsigned int		nNumerator;	unsigned int		nDenominator;	jlong			values[2];	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRate(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_rate_numden(handle, &nNumerator, &nDenominator);	checkArrayLength(env, alValues, 2);	values[0] = nNumerator;	values[1] = nDenominator;	(*env)->SetLongArrayRegion(env, alValues, 0, 2, values);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRate(): end\n"); }	return nReturn;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getSBits * Signature: ()I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getSBits(JNIEnv* env, jobject obj){	snd_pcm_hw_params_t*	handle;	int			nReturn;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getSBits(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_sbits(handle);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getSBits(): end\n"); }	return nReturn;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getFifoSize * Signature: ()I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getFifoSize(JNIEnv* env, jobject obj){	snd_pcm_hw_params_t*	handle;	int			nReturn;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getFifoSize(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_fifo_size(handle);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getFifoSize(): end\n"); }	return nReturn;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getAccess * Signature: ()I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getAccess(JNIEnv* env, jobject obj){	snd_pcm_hw_params_t*	handle;	snd_pcm_access_t		access;	int						nReturn;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getAccess(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_access(handle, &access);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getAccess(): end\n"); }	return access;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getFormat * Signature: ()I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getFormat(JNIEnv* env, jobject obj){	snd_pcm_hw_params_t*	handle;	snd_pcm_format_t	nValue;	int					nReturn;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getFormat(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_format(handle, &nValue);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getFormat(): end\n"); }	return nValue;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getFormatMask * Signature: (Lorg/tritonus/lowlevel/alsa/AlsaPcm$HWParams$FormatMask;)V */JNIEXPORT void JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getFormatMask(JNIEnv* env, jobject obj, jobject objFormatMask){	snd_pcm_hw_params_t*	handle;	snd_pcm_format_mask_t*	formatMask;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getFormatMask(): begin\n"); }	handle = getHandle(env, obj);	formatMask = getFormatMaskNativeHandle(env, objFormatMask);	snd_pcm_hw_params_get_format_mask(handle, formatMask);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getFormatMask(): end\n"); }}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getSubformat * Signature: ()I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getSubformat(JNIEnv* env, jobject obj){	snd_pcm_hw_params_t*	handle;	snd_pcm_subformat_t	nValue;	int					nReturn;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getSubformat(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_subformat(handle, &nValue);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getSubformat(): end\n"); }	return nValue;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getChannels * Signature: ()I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getChannels(JNIEnv* env, jobject obj){	snd_pcm_hw_params_t*	handle;	unsigned int	nValue;	int				nReturn;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getChannels(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_channels(handle, &nValue);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getChannels(): end\n"); }	return nValue;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getChannelsMin * Signature: ()I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getChannelsMin(JNIEnv* env, jobject obj){	snd_pcm_hw_params_t*	handle;	unsigned int	nValue;	int				nReturn;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getChannelsMin(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_channels_min(handle, &nValue);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getChannelsMin(): end\n"); }	return nValue;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getChannelsMax * Signature: ()I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getChannelsMax(JNIEnv* env, jobject obj){	snd_pcm_hw_params_t*	handle;	unsigned int	nValue;	int				nReturn;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getChannelsMax(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_channels_max(handle, &nValue);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getChannelsMax(): end\n"); }	return nValue;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getRate * Signature: ([I)I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRate___3I(JNIEnv* env, jobject obj, jintArray anDirection){	snd_pcm_hw_params_t*	handle;	int				nReturn;	unsigned int	nValue;	int				nDirection;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRate(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_rate(handle, &nValue, &nDirection);	setDirection(env, nDirection, anDirection);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRate(): end\n"); }	return nValue;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getRateMin * Signature: ([I)I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRateMin(JNIEnv* env, jobject obj, jintArray anDirection){	snd_pcm_hw_params_t*	handle;	int				nReturn;	unsigned int	nValue;	int				nDirection;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRateMin(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_rate_min(handle, &nValue, &nDirection);	setDirection(env, nDirection, anDirection);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRateMin(): end\n"); }	return nValue;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getRateMax * Signature: ([I)I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRateMax(JNIEnv* env, jobject obj, jintArray anDirection){	snd_pcm_hw_params_t*	handle;	int				nReturn;	unsigned int	nValue;	int				nDirection;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRateMax(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_rate_max(handle, &nValue, &nDirection);	setDirection(env, nDirection, anDirection);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getRateMax(): end\n"); }	return nValue;}/* * Class:     org_tritonus_lowlevel_alsa_AlsaPcmHWParams * Method:    getPeriodTime * Signature: ([I)I */JNIEXPORT jint JNICALLJava_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getPeriodTime(JNIEnv* env, jobject obj, jintArray anDirection){	snd_pcm_hw_params_t*	handle;	int				nReturn;	unsigned int	nValue;	int				nDirection;	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getPeriodTime(): begin\n"); }	handle = getHandle(env, obj);	nReturn = snd_pcm_hw_params_get_period_time(handle, &nValue, &nDirection);	setDirection(env, nDirection, anDirection);	if (debug_flag) { fprintf(debug_file, "Java_org_tritonus_lowlevel_alsa_AlsaPcmHWParams_getPeriodTime(): end\n"); }	return nValue;

⌨️ 快捷键说明

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