static bool _initialize(bool with_context, int argc, char** argv) { bool result = with_context ?(OALPLUS_ALFUNC(alut,Init)(&argc, argv) == AL_TRUE) :(OALPLUS_ALFUNC(alut,InitWithoutContext)(&argc, argv)==AL_TRUE); OALPLUS_CHECK_ALUT(OALPLUS_ERROR_INFO(alut, Init)); return result; }
/** * @see Position * @see Velocity * @see Orientation * @see OrientationUp * * @alsymbols * @alfunref{Listenerfv} * @aldefref{ORIENTATION} */ static ListenerOrientation Orientation(void) { ListenerOrientation result; OALPLUS_ALFUNC(GetListenerfv)(AL_ORIENTATION, result._v); OALPLUS_VERIFY_SIMPLE(GetListenerfv); return result; }
/** * @alsymbols * @alutfunref{Exit} */ ~ALUtilityToolkit(void) { if(_initialized) { OALPLUS_ALFUNC(alut,Exit)(); } }
/** * @see Position * @see Velocity * @see OrientationAt * * @alsymbols * @alfunref{Listenerfv} * @aldefref{ORIENTATION} */ static Vec3f OrientationUp(void) { ALfloat v[6]; OALPLUS_ALFUNC(GetListenerfv)(AL_ORIENTATION, v); OALPLUS_VERIFY_SIMPLE(GetListenerfv); return Vec3f(v+3, 3); }
/** This version loads both the raw data and the normalized samples * into two buffers and also returns the format and the sampling * frequency. * * @see LoadMemoryFromFileNormalized * @see LoadMemoryHelloWorldNormalized * * @alsymbols * @alutfunref{LoadMemoryFromFile} */ void LoadMemoryFromFile( std::vector<ALubyte>& raw, std::vector<ALfloat>& norm, const ALchar* file_path, DataFormat* data_format, ALfloat* frequency ) const { ::ALenum format = 0; ::ALsizei size = 0; ::ALvoid* ptr = OALPLUS_ALFUNC(alut,LoadMemoryFromFile)( file_path, &format, &size, frequency ); OALPLUS_CHECK_ALUT(OALPLUS_ERROR_INFO(alut, LoadMemoryFromFile)); _free_on_scope_exit cleaner = { ptr }; OALPLUS_FAKE_USE(cleaner); if(data_format) *data_format = DataFormat(format); raw = _load_memory(ptr, size); norm = _load_mem_norm(ptr, format, size); }
/** * @see CreateBufferFromFile * * @alsymbols * @alutfunref{CreateBufferHelloWorld} */ Buffer CreateBufferHelloWorld(void) const { assert(_initialized); ALuint name = OALPLUS_ALFUNC(alut,CreateBufferHelloWorld)(); OALPLUS_VERIFY_ALUT(OALPLUS_ERROR_INFO(alut, CreateBufferHelloWorld)); return Buffer::FromRawName(name); }
/** * @see CreateBufferHelloWorld * * @alsymbols * @alutfunref{CreateBufferFromFile} */ Buffer CreateBufferFromFile(const ALchar* file_path) const { assert(_initialized); ALuint name = OALPLUS_ALFUNC(alut,CreateBufferFromFile)(file_path); OALPLUS_VERIFY_ALUT(OALPLUS_ERROR_INFO(alut, CreateBufferFromFile)); return Buffer::FromRawName(name); }
static ALboolean IsA(ALuint name) { assert(name != 0); ALboolean result = OALPLUS_ALFUNC(IsBuffer)(name); OALPLUS_VERIFY_SIMPLE(IsBuffer); return result; }
/** * @see Position * @see Orientation * @throws Error * * @alsymbols * @alfunref{Listenerfv} * @aldefref{VELOCITY} */ static void Velocity(const Vec3f& velocity) { OALPLUS_ALFUNC(Listenerfv)( AL_VELOCITY, velocity.Data() ); OALPLUS_VERIFY_SIMPLE(Listenerfv); }
/** * * @alsymbols * @alfunref{Listenerf} * @aldefref{GAIN} */ static void Gain(ALfloat value) { OALPLUS_ALFUNC(Listenerf)( AL_GAIN, value ); OALPLUS_VERIFY_SIMPLE(Listenerf); }
/** * @see Velocity * @see Orientation * @throws Error * * @alsymbols * @alfunref{Listenerfv} * @aldefref{POSITION} */ static void Position(const Vec3f& position) { OALPLUS_ALFUNC(Listenerfv)( AL_POSITION, position.Data() ); OALPLUS_VERIFY_SIMPLE(Listenerfv); }
/** * @see Position * @see Orientation * @throws Error * * @alsymbols * @alfunref{Listener3f} * @aldefref{VELOCITY} */ static void Velocity(ALfloat x, ALfloat y, ALfloat z) { OALPLUS_ALFUNC(Listener3f)( AL_VELOCITY, x, y, z ); OALPLUS_VERIFY_SIMPLE(Listener3f); }
/** * @see Velocity * @see Orientation * @throws Error * * @alsymbols * @alfunref{Listener3f} * @aldefref{POSITION} */ static void Position(ALfloat x, ALfloat y, ALfloat z) { OALPLUS_ALFUNC(Listener3f)( AL_POSITION, x, y, z ); OALPLUS_VERIFY_SIMPLE(Listener3f); }
/** * @see Position * @see Velocity * @throws Error * * @alsymbols * @alfunref{Listenerfv} * @aldefref{ORIENTATION} */ static void Orientation(const Vec3f& at, const Vec3f& up) { ALfloat v[6] = { at[0], at[1], at[2], up[0], up[1], up[2], }; OALPLUS_ALFUNC(Listenerfv)(AL_ORIENTATION, v); OALPLUS_VERIFY_SIMPLE(Listenerfv); }
/** * @alsymbols * @alfunref{GetFloatv} * @aldefref{SPEED_OF_SOUND} */ static ALfloat SpeedOfSound(void) { ALfloat result; OALPLUS_ALFUNC(GetFloatv( AL_SPEED_OF_SOUND, &result )); OALPLUS_VERIFY_SIMPLE(GetFloatv); return result; }
/** * @see Velocity * @see Orientation * * @alsymbols * @alfunref{GetListenerfv} * @aldefref{POSITION} */ static Vec3f Position(void) { ALfloat result[3]; OALPLUS_ALFUNC(GetListenerfv)( AL_POSITION, result ); OALPLUS_VERIFY_SIMPLE(GetListenerfv); return Vec3f(result); }
/** * * @alsymbols * @alfunref{GetListenerfv} * @aldefref{GAIN} */ static ALfloat Gain(void) { ALfloat result; OALPLUS_ALFUNC(GetListenerfv)( AL_GAIN, &result ); OALPLUS_VERIFY_SIMPLE(GetListenerfv); return result; }
/** * @alsymbols * @alfunref{GetFloatv} * @aldefref{DOPPLER_FACTOR} */ static ALfloat DopplerFactor(void) { ALfloat result; OALPLUS_ALFUNC(GetFloatv( AL_DOPPLER_FACTOR, &result )); OALPLUS_VERIFY_SIMPLE(GetFloatv); return result; }
/** * @alsymbols * @alfunref{GetIntegerv} * @aldefref{DISTANCE_MODEL} */ static oalplus::DistanceModel DistanceModel(void) { ALint result; OALPLUS_ALFUNC(GetIntegerv( AL_DISTANCE_MODEL, &result )); OALPLUS_VERIFY_SIMPLE(GetIntegerv); return oalplus::DistanceModel(result); }
/** * @see Position * @see Orientation * * @alsymbols * @alfunref{GetListenerfv} * @aldefref{VELOCITY} */ static Vec3f Velocity(void) { ALfloat result[3]; OALPLUS_ALFUNC(GetListenerfv)( AL_VELOCITY, result ); OALPLUS_VERIFY_SIMPLE(GetListenerfv); return Vec3f(result); }
/** * @see Position * @see Velocity * @throws Error * @see OrientationAt * @see OrientationUp * * @alsymbols * @alfunref{Listenerfv} * @aldefref{ORIENTATION} */ static void Orientation( ALfloat at_x, ALfloat at_y, ALfloat at_z, ALfloat up_x, ALfloat up_y, ALfloat up_z ) { ALfloat v[6] = {at_x, at_y, at_z, up_x, up_y, up_z}; OALPLUS_ALFUNC(Listenerfv)(AL_ORIENTATION, v); OALPLUS_VERIFY_SIMPLE(Listenerfv); }
/** * @alsymbols * @alfunref{GetBuffer} * @aldefref{CHANNELS} */ ALsizei Channels(void) const { ALint result = 0; OALPLUS_ALFUNC(GetBufferiv)( _name, AL_CHANNELS, &result ); OALPLUS_VERIFY( GetBufferiv, ObjectError, Object(*this) ); return ALsizei(result); }
/** * @alsymbols * @alfunref{GetBuffer} * @aldefref{SIZE} */ ALsizei Size(void) const { ALint result = 0; OALPLUS_ALFUNC(GetBufferiv)( _name, AL_SIZE, &result ); OALPLUS_VERIFY( GetBufferiv, ObjectError, Object(*this) ); return ALsizei(result); }
/** * @alsymbols * @alfunref{GetBuffer} * @aldefref{FREQUENCY} */ ALsizei Frequency(void) const { ALint result = 0; OALPLUS_ALFUNC(GetBufferiv)( _name, AL_FREQUENCY, &result ); OALPLUS_VERIFY( GetBufferiv, ObjectError, Object(*this) ); return ALsizei(result); }
/** * @alsymbols * @alfunref{BufferData} */ void Data( DataFormat format, const ALvoid* data, ALsizei size, ALsizei frequency ) { OALPLUS_ALFUNC(BufferData)( ALuint(this->_name), ALenum(format), data, size, frequency ); OALPLUS_CHECK( BufferData, ObjectError, Object(*this) ); }
/** This version normalizes the sound samples. * * @see LoadMemoryFromFileNormalized * * @alsymbols * @alutfunref{LoadMemoryHelloWorld} */ std::vector<ALfloat> LoadMemoryHelloWorldNormalized( DataFormat* data_format, ALfloat* frequency ) const { ::ALenum format = 0; ::ALsizei size = 0; ::ALvoid* ptr = OALPLUS_ALFUNC(alut,LoadMemoryHelloWorld)( &format, &size, frequency ); OALPLUS_CHECK_ALUT(OALPLUS_ERROR_INFO(alut, LoadMemoryHelloWorld)); _free_on_scope_exit cleaner = { ptr }; OALPLUS_FAKE_USE(cleaner); if(data_format) *data_format = DataFormat(format); return _load_mem_norm(ptr, format, size); }
/** * @alsymbols * @alfunref{GetString} */ static const ALchar* GetString(StringQuery query) { const ALchar* str = OALPLUS_ALFUNC(GetString)(ALenum(query)); OALPLUS_VERIFY_SIMPLE(GetString); return str; }
/** * @alsymbols * @alfunref{SpeedOfSound} */ static void SpeedOfSound(ALfloat speed_of_sound) { OALPLUS_ALFUNC(SpeedOfSound(speed_of_sound)); OALPLUS_CHECK_SIMPLE(SpeedOfSound); }
/** * @alsymbols * @alfunref{DopplerFactor} */ static void DopplerFactor(ALfloat doppler_factor) { OALPLUS_ALFUNC(DopplerFactor(doppler_factor)); OALPLUS_CHECK_SIMPLE(DopplerFactor); }
/** * @alsymbols * @alfunref{DistanceModel} */ static void DistanceModel(oalplus::DistanceModel dist_model) { OALPLUS_ALFUNC(DistanceModel(ALenum(dist_model))); OALPLUS_VERIFY_SIMPLE(DistanceModel); }