DECL(AL_DIRECTION),
DECL(AL_VELOCITY),
DECL(AL_LOOPING),
+#ifdef __TIZEN__
+ DECL(AL_LOOP_COUNT),
+#endif
DECL(AL_BUFFER),
DECL(AL_GAIN),
DECL(AL_MIN_GAIN),
ALbufferlistitem *BufferListItem;
ALuint DataPosInt, DataPosFrac;
ALboolean Looping;
+#ifdef __TIZEN__
+ ALuint LoopCount;
+#endif
ALuint increment;
ALenum State;
ALuint OutPos;
DataPosInt = Source->position;
DataPosFrac = Source->position_fraction;
Looping = Source->Looping;
+#ifdef __TIZEN__
+ LoopCount = Source->LoopCount;
+#endif
NumChannels = Source->NumChannels;
SampleSize = Source->SampleSize;
increment = voice->Step;
if(!(BufferListItem=BufferListItem->next))
{
+#ifdef __TIZEN__
+ if(Looping || LoopCount > 1)
+ {
+ BufferListItem = ATOMIC_LOAD(&Source->queue);
+ --Source->LoopCount;
+ }
+#else
if(Looping)
BufferListItem = ATOMIC_LOAD(&Source->queue);
+#endif
else
{
State = AL_STOPPED;
SET(PKG_CONFIG_CFLAGS -DAL_LIBTYPE_STATIC ${PKG_CONFIG_CFLAGS})
ENDIF()
+IF(DEFINED ENV{TIZEN_BUILD})
+ SET(PKG_CONFIG_CFLAGS "${PKG_CONFIG_CFLAGS} -D__TIZEN__")
+ENDIF()
+
# Needed for openal.pc.in
SET(prefix ${CMAKE_INSTALL_PREFIX})
SET(exec_prefix "\${prefix}")
ALuint position;
ALuint position_fraction;
+#ifdef __TIZEN__
+ /**
+ * Number of repeats Source should be played before finishing playback.
+ */
+ ALuint LoopCount;
+#endif
+
/** Source Buffer Queue info. */
ATOMIC(ALbufferlistitem*) queue;
ATOMIC(ALbufferlistitem*) current_buffer;
case AL_DISTANCE_MODEL:
case AL_SOURCE_RELATIVE:
case AL_LOOPING:
+#ifdef __TIZEN__
+ case AL_LOOP_COUNT:
+#endif
case AL_BUFFER:
case AL_SOURCE_STATE:
case AL_BUFFERS_QUEUED:
Source->Looping = (ALboolean)*values;
return AL_TRUE;
+#ifdef __TIZEN__
+ case AL_LOOP_COUNT:
+ {
+ ALuint uValue = (ALuint)(*values);
+ if(uValue > 0)
+ {
+ Source->LoopCount = uValue;
+ Source->Looping = AL_FALSE;
+ }
+ else if(uValue == 0)
+ {
+ Source->LoopCount = uValue;
+ Source->Looping = AL_TRUE;
+ }
+ return AL_TRUE;
+ }
+#endif
+
case AL_BUFFER:
CHECKVAL(*values == 0 || (buffer=LookupBuffer(device, *values)) != NULL);
ALCcontext_DecRef(Context);
}
-
AL_API ALvoid AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value)
{
ALCcontext *Context;
Source->MaxDistance = FLT_MAX;
Source->RollOffFactor = 1.0f;
Source->Looping = AL_FALSE;
+#ifdef __TIZEN__
+ Source->LoopCount = 1;
+#endif
Source->Gain = 1.0f;
Source->MinGain = 0.0f;
Source->MaxGain = 1.0f;
*/
#define AL_LOOPING 0x1007
+#ifdef __TIZEN__
+/**
+ * Indicate whether source is looping.
+ * Type: ALuint
+ * Range: [0 - UINT_MAX]
+ * Default: 1
+ */
+#define AL_LOOP_COUNT 0x1008
+#endif
+
/**
* Source buffer.
* Type: ALuint
%build
export CFLAGS+=" -D__TIZEN__ -DUSE_DLOG "
+export TIZEN_BUILD=1
%cmake .
make %{?_smp_mflags}