commit x64 compilation from lulu cause the other branch dont seems to compile properly at home
This commit is contained in:
44
include/modules/script_squirrel/legacy/sound_binding.cpp
Normal file
44
include/modules/script_squirrel/legacy/sound_binding.cpp
Normal file
@ -0,0 +1,44 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#include "squirrel.h"
|
||||
#include "script_squirrel/legacy/binding_helpers.h"
|
||||
#include "core/sound.h"
|
||||
|
||||
using namespace GS::Audio;
|
||||
using namespace GS::Script;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
SQInteger SoundGetDuration(HSQUIRRELVM vm)
|
||||
{
|
||||
__SQ_GETSINGLESAFEPTR(s, Sound, typetag_Sound)
|
||||
__SQ_RETURNINT(s->mixer_data.IsValid() ? s->mixer_data->Get()->duration.toMs() : -1)
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void RegisterSoundBinding(HSQUIRRELVM vm)
|
||||
{
|
||||
/*#
|
||||
Topic: Sound
|
||||
Desc: A sound object stores audio data that can be played back by the sound mixer.
|
||||
Type: Sound
|
||||
Related: Mixer
|
||||
#*/
|
||||
|
||||
/*#
|
||||
Section: SoundGeneric
|
||||
Desc: Generic functions
|
||||
#*/
|
||||
/*#
|
||||
Func: SoundGetDuration
|
||||
Proto: int:sound
|
||||
Desc: Returns the sound duration in milliseconds.
|
||||
#*/
|
||||
sq_register(vm, SoundGetDuration, "SoundGetDuration", _SC(".x"));
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user