Esempio n. 1
0
AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, float start)
{
	try
	{
		ReadDevice* device = new ReadDevice(convCToDSpec(specs));
		device->setQuality(true);
		device->setVolume(volume);

		Sequence* f = dynamic_cast<Sequence*>(sequencer->get());

		f->setSpecs(convCToSpec(specs.specs));

		AUD_Handle handle = device->play(f->createQualityReader());
		if(handle.get())
		{
			handle->seek(start);
		}

		return new AUD_Device(device);
	}
	catch(Exception&)
	{
		return nullptr;
	}
}
Esempio n. 2
0
AUD_Handle *AUD_playDevice(AUD_Device *device, AUD_Sound *sound, float seek)
{
	assert(device);
	assert(sound);

	try {
		AUD_Handle handle = (*device)->play(*sound);
		if (handle.get()) {
			handle->seek(seek);
			return new AUD_Handle(handle);
		}
	}
	catch(AUD_Exception&)
	{
	}
	return NULL;
}
Esempio n. 3
0
AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, float start)
{
	try
	{
		AUD_ReadDevice* device = new AUD_ReadDevice(specs);
		device->setQuality(true);
		device->setVolume(volume);

		dynamic_cast<AUD_SequencerFactory*>(sequencer->get())->setSpecs(specs.specs);

		AUD_Handle handle = device->play(*sequencer);
		if(!handle.isNull())
			handle->seek(start);

		return new AUD_Device(device);
	}
	catch(AUD_Exception&)
	{
		return NULL;
	}
}