コード例 #1
0
int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize)
{
	AUD_Reference<AUD_IDevice> dev;

	if(!AUD_device.isNull())
		AUD_exit();

	try
	{
		switch(device)
		{
		case AUD_NULL_DEVICE:
			dev = new AUD_NULLDevice();
			break;
#ifdef WITH_SDL
		case AUD_SDL_DEVICE:
			dev = new AUD_SDLDevice(specs, buffersize);
			break;
#endif
#ifdef WITH_OPENAL
		case AUD_OPENAL_DEVICE:
			dev = new AUD_OpenALDevice(specs, buffersize);
			break;
#endif
#ifdef WITH_JACK
		case AUD_JACK_DEVICE:
#ifdef __APPLE__
			struct stat st;
			if(stat("/Library/Frameworks/Jackmp.framework", &st) != 0)
			{
				printf("Warning: Jack Framework not installed\n");
				// No break, fall through to default, to return false
			}
			else
			{
#endif
				dev = new AUD_JackDevice("Blender", specs, buffersize);
				break;
#ifdef __APPLE__
			}
#endif
#endif
		default:
			return false;
		}

		AUD_device = dev;
		AUD_3ddevice = dynamic_cast<AUD_I3DDevice*>(AUD_device.get());

		return true;
	}
	catch(AUD_Exception&)
	{
		return false;
	}
}
コード例 #2
0
ファイル: sound.c プロジェクト: wangyxuan/blender
void BKE_sound_exit_once(void)
{
  AUD_exit(sound_device);
  sound_device = NULL;
  AUD_exitOnce();

  if (audio_device_names != NULL) {
    int i;
    for (i = 0; audio_device_names[i]; i++) {
      free(audio_device_names[i]);
    }
    free(audio_device_names);
    audio_device_names = NULL;
  }
}
コード例 #3
0
ファイル: sound.c プロジェクト: flair2005/mechanical-blender
void BKE_sound_exit_once(void)
{
	AUD_exit(sound_device);
	sound_device = NULL;
	AUD_exitOnce();

#ifdef WITH_SYSTEM_AUDASPACE
	if (audio_device_names != NULL) {
		int i;
		for (i = 0; audio_device_names[i]; i++) {
			free(audio_device_names[i]);
		}
		free(audio_device_names);
		audio_device_names = NULL;
	}
#endif
}
コード例 #4
0
ファイル: AUD_C-API.cpp プロジェクト: HVisionSensing/blendocv
int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize)
{
	AUD_Reference<AUD_IDevice> dev;

	if(!AUD_device.isNull())
		AUD_exit();

	try
	{
		switch(device)
		{
		case AUD_NULL_DEVICE:
			dev = new AUD_NULLDevice();
			break;
#ifdef WITH_SDL
		case AUD_SDL_DEVICE:
			dev = new AUD_SDLDevice(specs, buffersize);
			break;
#endif
#ifdef WITH_OPENAL
		case AUD_OPENAL_DEVICE:
			dev = new AUD_OpenALDevice(specs, buffersize);
			break;
#endif
#ifdef WITH_JACK
		case AUD_JACK_DEVICE:
			dev = new AUD_JackDevice("Blender", specs, buffersize);
			break;
#endif
		default:
			return false;
		}

		AUD_device = dev;
		AUD_3ddevice = dynamic_cast<AUD_I3DDevice*>(AUD_device.get());

		return true;
	}
	catch(AUD_Exception&)
	{
		return false;
	}
}
コード例 #5
0
ファイル: sound.c プロジェクト: flair2005/mechanical-blender
void BKE_sound_exit(void)
{
	AUD_exit(sound_device);
	sound_device = NULL;
}
コード例 #6
0
ファイル: sound.c プロジェクト: Walid-Shouman/Blender
void sound_exit_once(void)
{
	AUD_exit();
	AUD_exitOnce();
}
コード例 #7
0
ファイル: sound.c プロジェクト: Walid-Shouman/Blender
void sound_exit(void)
{
	AUD_exit();
}
コード例 #8
0
int AUD_init(AUD_DeviceType device, AUD_DeviceSpecs specs, int buffersize)
{
	boost::shared_ptr<AUD_IDevice> dev;

	if (AUD_device.get()) {
		AUD_exit();
	}

	try {
		switch(device) {
		case AUD_NULL_DEVICE:
			dev = boost::shared_ptr<AUD_IDevice>(new AUD_NULLDevice());
			break;
#ifdef WITH_SDL
		case AUD_SDL_DEVICE:
			if (SDL_Init == (void *)0) {
				printf("Warning: SDL libraries are not installed\n");
				// No break, fall through to default, to return false
			}
			else {
				dev = boost::shared_ptr<AUD_IDevice>(new AUD_SDLDevice(specs, buffersize));
				break;
			}
#endif
#ifdef WITH_OPENAL
		case AUD_OPENAL_DEVICE:
			dev = boost::shared_ptr<AUD_IDevice>(new AUD_OpenALDevice(specs, buffersize));
			break;
#endif
#ifdef WITH_JACK
		case AUD_JACK_DEVICE:
#ifdef __APPLE__
			struct stat st;
			if (stat("/Library/Frameworks/Jackmp.framework", &st) != 0) {
				printf("Warning: Jack Framework not installed\n");
				// No break, fall through to default, to return false
			}
			else
#endif
			if (!AUD_jack_supported()) {
				printf("Warning: Jack client not installed\n");
				// No break, fall through to default, to return false
			}
			else {
				dev = boost::shared_ptr<AUD_IDevice>(new AUD_JackDevice("Blender", specs, buffersize));
				break;
			}
#endif
		default:
			return false;
		}

		AUD_device = dev;
		AUD_3ddevice = dynamic_cast<AUD_I3DDevice *>(AUD_device.get());

		return true;
	}
	catch(AUD_Exception&)
	{
		return false;
	}
}
コード例 #9
0
ファイル: AUD_C-API.cpp プロジェクト: eirikhex/blender
AUD_Device* AUD_init(const char* device, AUD_DeviceSpecs specs, int buffersize, const char* name)
{
	boost::shared_ptr<AUD_IDevice> dev;

	if (AUD_device.get()) {
		AUD_exit(NULL);
	}

	std::string dname = device;

	try {
		if(dname == "Null") {
			dev = boost::shared_ptr<AUD_IDevice>(new AUD_NULLDevice());
		}
#ifdef WITH_SDL
		else if(dname == "SDL")
		{
			dev = boost::shared_ptr<AUD_IDevice>(new AUD_SDLDevice(specs, buffersize));
		}
#endif
#ifdef WITH_OPENAL
		else if(dname == "OpenAL")
		{
			dev = boost::shared_ptr<AUD_IDevice>(new AUD_OpenALDevice(specs, buffersize));
		}
#endif
#ifdef WITH_JACK
		else if(dname == "Jack")
		{
#ifdef __APPLE__
			struct stat st;
			if (stat("/Library/Frameworks/Jackmp.framework", &st) != 0) {
				printf("Warning: Jack Framework not installed\n");
				return NULL;
			}
			else
#endif
			if (!AUD_jack_supported()) {
				printf("Warning: Jack cllient not installed\n");
				return NULL;
			}
			else {
				dev = boost::shared_ptr<AUD_IDevice>(new AUD_JackDevice(name, specs, buffersize));
			}
		}
#endif
		else
		{
			return NULL;
		}

		AUD_device = dev;
		AUD_3ddevice = dynamic_cast<AUD_I3DDevice *>(AUD_device.get());

		return (AUD_Device*)1;
	}
	catch(AUD_Exception&)
	{
		return NULL;
	}
}
コード例 #10
0
ファイル: sound.c プロジェクト: Andrewson3D/blender-for-vray
void BKE_sound_exit(void)
{
	AUD_exit();
}