Selaa lähdekoodia

Delete old SLES stuff

Daniele Bartolini 12 vuotta sitten
vanhempi
sitoutus
01b5c692b1
2 muutettua tiedostoa jossa 0 lisäystä ja 320 poistoa
  1. 0 200
      engine/renderers/sles/SLESRenderer.cpp
  2. 0 120
      engine/renderers/sles/SLESRenderer.h

+ 0 - 200
engine/renderers/sles/SLESRenderer.cpp

@@ -1,200 +0,0 @@
-/*
-Copyright (c) 2013 Daniele Bartolini, Michele Rossi
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#include "SLESRenderer.h"
-
-namespace crown
-{
-
-//-----------------------------------------------------------------------------
-static const char* sl_error_to_string(SLresult error)
-{
-	switch (error)
-	{
-		case SL_RESULT_PARAMETER_INVALID: 	return "SL_RESULT_PARAMETER_INVALID";
-		case SL_RESULT_MEMORY_FAILURE: 		return "SL_RESULT_MEMORY_FAILURE";
-		case SL_RESULT_FEATURE_UNSUPPORTED: return "SL_RESULT_FEATURE_UNSUPPORTED";
-		case SL_RESULT_RESOURCE_ERROR: 		return "SL_RESULT_RESOURCE_ERROR";
-		default: 							return "SL_UNKNOWN_ERROR";
-	}
-}
-
-//-----------------------------------------------------------------------------
-#ifdef CROWN_DEBUG
-	#define SL_CHECK(function)\
-		do { SLresult error; CE_ASSERT((error = function()) == SL_RESULT_SUCCESS,\
-				"OpenSLES error: %s", sl_error_to_string(error)); } while (0)
-#else
-	#define SL_CHECK(function)\
-		function;
-#endif
-
-//-----------------------------------------------------------------------------
-AudioRenderer* AudioRenderer::create(Allocator& a)
-{
-	return CE_NEW(a, SLESRenderer);
-}
-
-//-----------------------------------------------------------------------------
-void AudioRenderer::destroy(Allocator& a, AudioRenderer* renderer)
-{
-	CE_DELETE(a, renderer);
-}
-
-//-----------------------------------------------------------------------------
-SLESRenderer::SLESRenderer() :
-	m_buffers_id_table(m_allocator, MAX_BUFFERS),
-	m_sources_id_table(m_allocator, MAX_SOURCES)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::init()
-{
-	slCreateEngine(&m_engine_obj, 0, NULL, 0, NULL, NULL);
-	(*m_engine_obj)->Realize(m_engine_obj, SL_BOOLEAN_FALSE);
-
-	(*m_engine_obj)->GetInterface(m_engine_obj, SL_IID_ENGINE, &m_engine);
-
-    const SLInterfaceID ids[5] = {SL_IID_NULL, SL_IID_NULL, SL_IID_NULL, SL_IID_NULL, SL_IID_NULL};
-    const SLboolean req[5] = {SL_BOOLEAN_FALSE, SL_BOOLEAN_FALSE, SL_BOOLEAN_FALSE, SL_BOOLEAN_FALSE, SL_BOOLEAN_FALSE};
-
-    (*m_engine)->CreateOutputMix(m_engine, &m_out_mix_obj, 1, ids, req); 
-    (*m_out_mix_obj)->Realize(m_out_mix_obj, SL_BOOLEAN_FALSE);
-
-    (*m_out_mix_obj)->GetInterface(m_out_mix_obj, SL_IID_ENVIRONMENTALREVERB, &m_out_mix_env_reverb);
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::shutdown()
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::set_listener(const Vec3& pos, const Vec3& vel, const Vec3& or_up, const Vec3& or_at) const
-{
-
-}
-
-//-----------------------------------------------------------------------------
-SoundBufferId SLESRenderer::create_buffer(const void* data, const uint32_t size, const uint32_t sample_rate, const uint32_t channels, const uint32_t bxs)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::destroy_buffer(SoundBufferId id)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-SoundSourceId SLESRenderer::create_source(const Vec3& pos, const Vec3& vel, const Vec3& dir, const bool loop)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::play_source(SoundSourceId id)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::pause_source(SoundSourceId id)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::destroy_source(SoundSourceId id)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::bind_buffer(SoundSourceId sid, SoundBufferId bid)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::set_source_min_distance(SoundSourceId id,  const float min_distance)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::set_source_max_distance(SoundSourceId id,  const float max_distance)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::set_source_position(SoundSourceId id, const Vec3& pos)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::set_source_velocity(SoundSourceId id, const Vec3& vel)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::set_source_direction(SoundSourceId id, const Vec3& dir)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::set_source_pitch(SoundSourceId id, const float pitch)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::set_source_gain(SoundSourceId id, const float gain)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-void SLESRenderer::set_source_rolloff(SoundSourceId id, const float rolloff)
-{
-
-}
-
-//-----------------------------------------------------------------------------
-bool SLESRenderer::source_playing(SoundSourceId id)
-{
-
-}
-
-} // namespace crown

+ 0 - 120
engine/renderers/sles/SLESRenderer.h

@@ -1,120 +0,0 @@
-/*
-Copyright (c) 2013 Daniele Bartolini, Michele Rossi
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#pragma once
-
-#include <SLES/OpenSLES.h>
-#include <SLES/OpenSLES_Android.h>
-
-#include "AudioRenderer.h"
-#include "HeapAllocator.h"
-
-namespace crown
-{
-
-struct SoundBuffer
-{
-	SLDataLocator_AndroidSimpleBufferQueue buffer_queue;
-};
-
-struct SoundSource
-{
-	SLDataSource source;
-};
-
-/*
-* FIXME: Can't be completed right now. It's necessary to improve ResourceManager
-* implementing support to Android Assets Manager. Otherwise we must make ugly hacks
-* using Uri Audio Players.
-*/
-class SLESRenderer : public AudioRenderer
-{
-
-public:
-
-									SLESRenderer();
-
-	void							init();
-
-	void							shutdown();
-
-	void							set_listener(const Vec3& pos, const Vec3& vel, const Vec3& or_up, const Vec3& or_at) const;
-
-	SoundBufferId					create_buffer(const void* data, const uint32_t size, const uint32_t sample_rate, const uint32_t channels, const uint32_t bxs);
-
-	void							destroy_buffer(SoundBufferId id);
-
-	SoundSourceId					create_source(const Vec3& pos, const Vec3& vel, const Vec3& dir, const bool loop);
-
-	void							play_source(SoundSourceId id);
-
-	void							pause_source(SoundSourceId id);
-
-	void							destroy_source(SoundSourceId id);
-
-	void							bind_buffer(SoundSourceId sid, SoundBufferId bid);
-
-	void							set_source_min_distance(SoundSourceId id,  const float min_distance);
-
-	void							set_source_max_distance(SoundSourceId id,  const float max_distance);
-
-	void							set_source_position(SoundSourceId id, const Vec3& pos);
-
-	void							set_source_velocity(SoundSourceId id, const Vec3& vel);
-
-	void							set_source_direction(SoundSourceId id, const Vec3& dir);
-
-	void							set_source_pitch(SoundSourceId id, const float pitch);
-
-	void							set_source_gain(SoundSourceId id, const float gain);
-
-	void							set_source_rolloff(SoundSourceId id, const float rolloff);
-
-	bool							source_playing(SoundSourceId id);
-
-private:
-
-	HeapAllocator					m_allocator;
-
-	SLObjectItf						m_engine_obj;
-	SLEngineItf						m_engine;
-
-	SLObjectItf 					m_out_mix_obj;
-	SLVolumeItf 					m_out_mix;
-	SLEnvironmentalReverbItf 		m_out_mix_env_reverb;
-
-	SLObjectItf						m_listener;
-	SL3DLocationItf					m_listener_location;
-
-
-	IdTable 						m_buffers_id_table;
-	SoundBuffer 					m_buffers[MAX_BUFFERS];
-
-	IdTable 						m_sources_id_table;
-	SoundSource 					m_sources[MAX_SOURCES];
-};
-
-} // namespace crown