Ejemplo n.º 1
0
AudioSamplePtr ETHAudioResourceManager::GetPointer(AudioPtr audio,
										  const str_type::string &fileRelativePath, const str_type::string &programPath,
										  const str_type::string &searchPath, const GS_SAMPLE_TYPE type)
{
	if (fileRelativePath == GS_L(""))
		return AudioSamplePtr();

	if (!m_resource.empty())
	{
		str_type::string fileName = ETHGlobal::GetFileName(fileRelativePath);
		std::map<str_type::string, AudioSamplePtr>::iterator iter = m_resource.find(fileName);
		if (iter != m_resource.end())
			return iter->second;
	}

	// we can set a search path to search the file in case
	// it hasn't been loaded yet
	if (searchPath != GS_L(""))
	{
		str_type::string fileName = ETHGlobal::GetFileName(fileRelativePath);

		str_type::string path = programPath;
		path += searchPath;
		path += fileName;
		AddFile(audio, path, type);
		return GetPointer(audio, fileName, programPath, GS_L(""), type);
	}
	return AudioSamplePtr();
}
Ejemplo n.º 2
0
AudioSamplePtr AudiereContext::LoadSampleFromFileInMemory(void *pBuffer, const unsigned int bufferLength, const GS_SAMPLE_TYPE type)
{
	AudioSamplePtr audio = AudioSamplePtr(new AudiereSample);
	if (!audio->LoadSampleFromFileInMemory(weak_this, pBuffer, bufferLength, type))
	{
		return AudioSamplePtr();
	}
	return audio;
}
Ejemplo n.º 3
0
AudioSamplePtr AudiereContext::LoadSampleFromFile(const std::wstring& fileName, const Platform::FileManagerPtr& fileManager, const GS_SAMPLE_TYPE type)
{
	AudioSamplePtr audio = AudioSamplePtr(new AudiereSample);
	if (!audio->LoadSampleFromFile(weak_this, fileName, fileManager, type))
	{
		return AudioSamplePtr();
	}
	return audio;
}
Ejemplo n.º 4
0
AudioSamplePtr IrrKlangAudio::LoadSampleFromFile(
	const str_type::string& fileName,
	const Platform::FileManagerPtr& fileManager,
	const Audio::SAMPLE_TYPE type)
{
	AudioSamplePtr audio = AudioSamplePtr(new IrrKlangAudioSample);
	if (!audio->LoadSampleFromFile(weak_this, fileName, fileManager, type))
	{
		return AudioSamplePtr();
	}
	return audio;
}
Ejemplo n.º 5
0
AudioSamplePtr IrrKlangAudio::LoadSampleFromFileInMemory(
	void *pBuffer,
	const unsigned int bufferLength,
	const Audio::SAMPLE_TYPE type)
{
	AudioSamplePtr audio = AudioSamplePtr(new IrrKlangAudioSample);
	if (!audio->LoadSampleFromFileInMemory(weak_this, pBuffer, bufferLength, type))
	{
		return AudioSamplePtr();
	}
	return audio;
}
Ejemplo n.º 6
0
AudioSamplePtr AndroidAudioContext::LoadSampleFromFileInMemory(
	void *pBuffer,
	const unsigned int bufferLength,
	const Audio::SAMPLE_TYPE type)
{
	return AudioSamplePtr();
}
Ejemplo n.º 7
0
AudioSamplePtr ETHAudioResourceManager::AddFile(AudioPtr audio, const str_type::string &path, const GS_SAMPLE_TYPE type)
{
	if (!m_resource.empty())
	{
		str_type::string fileName = ETHGlobal::GetFileName(path);
		std::map<str_type::string, AudioSamplePtr>::iterator iter = m_resource.find(fileName);
		if (iter != m_resource.end())
			return iter->second;
	}

	AudioSamplePtr pSample;
	str_type::string fixedName(path);
	Platform::FixSlashes(fixedName);
	if (!(pSample = audio->LoadSampleFromFile(fixedName, type)))
	{
		pSample.reset();
		ETH_STREAM_DECL(ss) << GS_L("(Not loaded) \"") << fixedName << GS_L("\"");
		ETHResourceProvider::Log(ss.str(), Platform::Logger::ERROR);
		return AudioSamplePtr();
	}
	//#ifdef _DEBUG
	str_type::string fileName = ETHGlobal::GetFileName(path);
	ETH_STREAM_DECL(ss) << GS_L("(Loaded) ") << fileName;
	ETHResourceProvider::Log(ss.str(), Platform::Logger::INFO);
	//#endif
	m_resource[fileName] = pSample;
	return pSample;
}
Ejemplo n.º 8
0
AudioSamplePtr AndroidAudioContext::LoadSampleFromFile(
	const str_type::string& fileName,
	const Platform::FileManagerPtr& fileManager,
	const Audio::SAMPLE_TYPE type)
{
	AudioSamplePtr sample = AudioSamplePtr(new AndroidAudioSample);
	sample->LoadSampleFromFile(weak_this, fileName, fileManager, type);
	return sample;
}
Ejemplo n.º 9
0
void ParticleEditor::DeleteSoundFX()
{
	if (m_manager)
	{
		m_manager->SetSoundEffect(AudioSamplePtr());
		m_system.soundFXFile = GS_L("");
		m_manager->SetSystem(m_system);
	}
}
Ejemplo n.º 10
0
AudioSamplePtr AndroidAudioContext::LoadSampleFromFile(const str_type::string& fileName, const GS_SAMPLE_TYPE type)
{
	AudioSamplePtr sample = AudioSamplePtr(new AndroidAudioSample);
	sample->LoadSampleFromFile(weak_this, fileName, type);
	return sample;
}