示例#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
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
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
void BKE_sound_exit(void)
{
	AUD_exit(sound_device);
	sound_device = NULL;
}
示例#6
0
void sound_exit_once(void)
{
	AUD_exit();
	AUD_exitOnce();
}
示例#7
0
void sound_exit(void)
{
	AUD_exit();
}
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_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
void BKE_sound_exit(void)
{
	AUD_exit();
}