Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.

Commit

Permalink
- Initial complete revision of the ALUT port (includes support and in…
Browse files Browse the repository at this point in the history
…structions for building using make).
  • Loading branch information
chrisculy committed Oct 4, 2011
1 parent 5825494 commit 57ed486
Show file tree
Hide file tree
Showing 28 changed files with 3,324 additions and 0 deletions.
387 changes: 387 additions & 0 deletions .cproject

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,8 @@

/Device-Debug
/Device-Profile
/Device-Release
/Simulator
/Simulator-Coverage
/Simulator-Profile
/Device-Coverage
77 changes: 77 additions & 0 deletions .project
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>alut</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/alut/Device-Debug}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
</natures>
</projectDescription>
8 changes: 8 additions & 0 deletions Makefile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,8 @@
LIST=CPU
ifndef QRECURSE
QRECURSE=recurse.mk
ifdef QCONFIG
QRDIR=$(dir $(QCONFIG))
endif
endif
include $(QRDIR)$(QRECURSE)
10 changes: 10 additions & 0 deletions README
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ make install DESTDIR=/foo/bar
file could result to unwanted behaviour. file could result to unwanted behaviour.




Building for QNX from Windows
==================================
Run cmd.exe and execute the following commands:
> cd [bbndk] where [bbndk] is where the QNX NDK was installed (i.e. C:\bbndk)
> NativeSDK-env.bat
> cd [alut] where [alut] is the directory where Lua was extracted to
> make
Following this, the relevant binaries should reside in the arm/ and x86/ subdirectory.


Support Support
======= =======


Expand Down
8 changes: 8 additions & 0 deletions arm/Makefile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,8 @@
LIST=VARIANT
ifndef QRECURSE
QRECURSE=recurse.mk
ifdef QCONFIG
QRDIR=$(dir $(QCONFIG))
endif
endif
include $(QRDIR)$(QRECURSE)
1 change: 1 addition & 0 deletions arm/a.le.v7/Makefile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
include ../../common.mk
1 change: 1 addition & 0 deletions arm/so.le.v7.g/Makefile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
include ../../common.mk
1 change: 1 addition & 0 deletions arm/so.le.v7/Makefile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
include ../../common.mk
25 changes: 25 additions & 0 deletions common.mk
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,25 @@
ifndef QCONFIG
QCONFIG=qconfig.mk
endif
include $(QCONFIG)

define PINFO
PINFO DESCRIPTION=ALUT
endef

NAME=alut

#===== EXTRA_INCVPATH - a space-separated list of directories to search for include files.
PUBLIC_INCVPATH=$(PROJECT_ROOT)/include
EXTRA_INCVPATH+=$(PROJECT_ROOT)/src/Include \
$(PROJECT_ROOT)/../openal/include

#===== EXTRA_SRCVPATH - a space-separated list of directories to search for source files.
EXTRA_SRCVPATH+=$(PROJECT_ROOT)/src

INSTALLDIR=$(firstword $(INSTALLDIR_$(OS)) usr/lib)

include $(MKFILES_ROOT)/qtargets.mk

OPTIMIZE_TYPE_g=none
OPTIMIZE_TYPE=$(OPTIMIZE_TYPE_$(filter g, $(VARIANTS)))
126 changes: 126 additions & 0 deletions include/AL/alut.h
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,126 @@
#if !defined(AL_ALUT_H)
#define AL_ALUT_H

#if defined(_MSC_VER)
#include <alc.h>
#include <al.h>
#elif defined(__APPLE__)
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#endif

#if defined(__cplusplus)
extern "C" {
#endif

#if defined(_WIN32) && !defined(_XBOX)
#if defined (ALUT_BUILD_LIBRARY)
#define ALUT_API __declspec(dllexport)
#else
#define ALUT_API __declspec(dllimport)
#endif
#else
#if defined(ALUT_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
#define ALUT_API __attribute__((visibility("default")))
#else
#define ALUT_API extern
#endif
#endif

#if defined(_WIN32)
#define ALUT_APIENTRY __cdecl
#else
#define ALUT_APIENTRY
#endif

#if defined(__MWERKS_)
#pragma export on
#endif

/* Flag deprecated functions if possible (VisualC++ .NET and GCC >= 3.1.1). */
#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(MIDL_PASS)
#define ALUT_ATTRIBUTE_DEPRECATED __declspec(deprecated)
#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 1))))
#define ALUT_ATTRIBUTE_DEPRECATED __attribute__((deprecated))
#else
#define ALUT_ATTRIBUTE_DEPRECATED
#endif

#define ALUT_API_MAJOR_VERSION 1
#define ALUT_API_MINOR_VERSION 1

#define ALUT_ERROR_NO_ERROR 0
#define ALUT_ERROR_OUT_OF_MEMORY 0x200
#define ALUT_ERROR_INVALID_ENUM 0x201
#define ALUT_ERROR_INVALID_VALUE 0x202
#define ALUT_ERROR_INVALID_OPERATION 0x203
#define ALUT_ERROR_NO_CURRENT_CONTEXT 0x204
#define ALUT_ERROR_AL_ERROR_ON_ENTRY 0x205
#define ALUT_ERROR_ALC_ERROR_ON_ENTRY 0x206
#define ALUT_ERROR_OPEN_DEVICE 0x207
#define ALUT_ERROR_CLOSE_DEVICE 0x208
#define ALUT_ERROR_CREATE_CONTEXT 0x209
#define ALUT_ERROR_MAKE_CONTEXT_CURRENT 0x20A
#define ALUT_ERROR_DESTROY_CONTEXT 0x20B
#define ALUT_ERROR_GEN_BUFFERS 0x20C
#define ALUT_ERROR_BUFFER_DATA 0x20D
#define ALUT_ERROR_IO_ERROR 0x20E
#define ALUT_ERROR_UNSUPPORTED_FILE_TYPE 0x20F
#define ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE 0x210
#define ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA 0x211

#define ALUT_WAVEFORM_SINE 0x100
#define ALUT_WAVEFORM_SQUARE 0x101
#define ALUT_WAVEFORM_SAWTOOTH 0x102
#define ALUT_WAVEFORM_WHITENOISE 0x103
#define ALUT_WAVEFORM_IMPULSE 0x104

#define ALUT_LOADER_BUFFER 0x300
#define ALUT_LOADER_MEMORY 0x301

ALUT_API ALboolean ALUT_APIENTRY alutInit (int *argcp, char **argv);
ALUT_API ALboolean ALUT_APIENTRY alutInitWithoutContext (int *argcp, char **argv);
ALUT_API ALboolean ALUT_APIENTRY alutExit (void);

ALUT_API ALenum ALUT_APIENTRY alutGetError (void);
ALUT_API const char *ALUT_APIENTRY alutGetErrorString (ALenum error);

ALUT_API ALuint ALUT_APIENTRY alutCreateBufferFromFile (const char *fileName);
ALUT_API ALuint ALUT_APIENTRY alutCreateBufferFromFileImage (const ALvoid *data, ALsizei length);
ALUT_API ALuint ALUT_APIENTRY alutCreateBufferHelloWorld (void);
ALUT_API ALuint ALUT_APIENTRY alutCreateBufferWaveform (ALenum waveshape, ALfloat frequency, ALfloat phase, ALfloat duration);

ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryFromFile (const char *fileName, ALenum *format, ALsizei *size, ALfloat *frequency);
ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryFromFileImage (const ALvoid *data, ALsizei length, ALenum *format, ALsizei *size, ALfloat *frequency);
ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryHelloWorld (ALenum *format, ALsizei *size, ALfloat *frequency);
ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryWaveform (ALenum waveshape, ALfloat frequency, ALfloat phase, ALfloat duration, ALenum *format, ALsizei *size, ALfloat *freq);

ALUT_API const char *ALUT_APIENTRY alutGetMIMETypes (ALenum loader);

ALUT_API ALint ALUT_APIENTRY alutGetMajorVersion (void);
ALUT_API ALint ALUT_APIENTRY alutGetMinorVersion (void);

ALUT_API ALboolean ALUT_APIENTRY alutSleep (ALfloat duration);

/* Nasty Compatibility stuff, WARNING: THESE FUNCTIONS ARE STRONGLY DEPRECATED */
#if defined(__APPLE__)
ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVFile (ALbyte *fileName, ALenum *format, void **data, ALsizei *size, ALsizei *frequency);
ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVMemory (ALbyte *buffer, ALenum *format, void **data, ALsizei *size, ALsizei *frequency);
#else
ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVFile (ALbyte *fileName, ALenum *format, void **data, ALsizei *size, ALsizei *frequency, ALboolean *loop);
ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVMemory (ALbyte *buffer, ALenum *format, void **data, ALsizei *size, ALsizei *frequency, ALboolean *loop);
#endif
ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutUnloadWAV (ALenum format, ALvoid *data, ALsizei size, ALsizei frequency);

#if defined(__MWERKS_)
#pragma export off
#endif

#if defined(__cplusplus)
}
#endif

#endif
13 changes: 13 additions & 0 deletions src/README
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,13 @@
The files in this directory contain the code of the ALUT library. They typically
compile to make 'libalut.so' on *nix platforms or to 'alut.dll' for Windows
platforms.

There is also a header file 'alut.h' in ../include/AL which gets installed into
$(includedir)/AL/alut.h on *nix platforms and someplace else entirely on
Windows platforms.

The file 'helloworld.wav' is the original voice recording of Steve Baker saying
this immortal phrase. It is converted into a large hexadecimal data block inside
alutWaveform.c - but this file is retained in version control just in case
anyone ever feels like re-doing it. The format is 16bit PCM, 1 channel, 44.1kHz
sample rate.
Loading

0 comments on commit 57ed486

Please sign in to comment.