38 #define lua_pindexes( L ) ( lua_gettop(L) - 1 ) 39 #define lua_pindex( index ) (index + 1) 65 MODebug2->Message(
"moLuaSoundManager > constructor L: " +
IntToStr( (
long)(L) ) );
81 lua_pushnumber(L, (lua_Number)count);
87 int id = (int) lua_tonumber (L,
lua_pindex(1) );
125 m_pTextureMan = NULL;
130 m_pTextureMan = p_pTextureMan;
138 count = m_pTextureMan->GetTextureCount();
139 lua_pushnumber(L, (lua_Number)count);
143 moText tx_error(
"moLuaTextureManager::GetTextureCount > no m_pTextureMan pointer");
144 lua_pushstring( L, tx_error );
153 if (texturename==
"") {
154 moText tx_error(
"moLuaTextureManager::GetTextureMOId > first parameter cannot be empty");
155 lua_pushstring( L, tx_error );
161 moid = m_pTextureMan->GetTextureMOId( texturename,
false );
162 lua_pushnumber(L, (lua_Number)moid);
166 moText tx_error(
"moLuaTextureManager::GetTextureMOId > no m_pTextureMan pointer");
167 lua_pushstring( L, tx_error );
175 int create_if_not_found = (int) lua_tonumber( L,
lua_pindex(1) );
179 moid = m_pTextureMan->GetTextureBuffer( texturename, create_if_not_found, buffer_format );
180 lua_pushnumber(L, (lua_Number)moid);
184 moText tx_error(
"moLuaTextureManager::GetTextureBuffer > no m_pTextureMan pointer");
185 lua_pushstring( L, tx_error );
237 int moid = (int) lua_tonumber( L,
lua_pindex(1) );
240 glid = m_pTextureMan->GetGLId( moid );
241 lua_pushnumber(L, (lua_Number)glid);
245 moText tx_error(
"moLuaTextureManager::GetGLId > no m_pTextureMan pointer");
246 lua_pushstring( L, tx_error );
252 int moid = (int) lua_tonumber( L,
lua_pindex(1) );
256 res = (int) m_pTextureMan->ValidTexture( moid );
257 lua_pushnumber(L, (lua_Number)res);
261 moText tx_error(
"moLuaTextureManager::ValidTexture > no m_pTextureMan pointer");
262 lua_pushstring( L, tx_error );
296 m_pCircularVideoBuffer = NULL;
301 m_pCircularVideoBuffer = p_pCircularVideoBuffer;
307 int at_position = (int) lua_tonumber (L,
lua_pindex(1) );
309 if (m_pCircularVideoBuffer)
310 m_pCircularVideoBuffer->StartRecording(at_position);
317 if (m_pCircularVideoBuffer)
318 m_pCircularVideoBuffer->PauseRecording();
326 if (m_pCircularVideoBuffer)
327 m_pCircularVideoBuffer->ContinueRecording();
334 if (m_pCircularVideoBuffer)
335 m_pCircularVideoBuffer->StopRecording();
343 if (m_pCircularVideoBuffer)
344 recp = m_pCircularVideoBuffer->GetRecordPosition();
345 lua_pushnumber(L, (lua_Number)recp);
352 if (m_pCircularVideoBuffer)
353 fcount = m_pCircularVideoBuffer->GetFrameCount();
354 lua_pushnumber(L, (lua_Number)fcount);
361 if (m_pCircularVideoBuffer)
362 res = m_pCircularVideoBuffer->IsRecording();
363 lua_pushboolean(L, res);
392 m_pVideoBuffer = NULL;
397 m_pVideoBuffer = p_pVideoBuffer;
404 if (m_pVideoBuffer) {
405 fcount = m_pVideoBuffer->GetFrameCount();
406 lua_pushnumber(L, (lua_Number)fcount);
441 m_pVideoBufferPath = NULL;
446 m_pVideoBufferPath = p_pVideoBufferPath;
453 if (m_pVideoBufferPath) {
454 path = m_pVideoBufferPath->GetPath();
455 lua_pushstring(L, path );
465 if (m_pVideoBufferPath) {
466 path = m_pVideoBufferPath->GetCompletePath();
467 lua_pushstring(L, path );
477 if (m_pVideoBufferPath) {
478 fcount = m_pVideoBufferPath->GetTotalFiles();
479 lua_pushnumber(L, (lua_Number)fcount);
489 if (m_pVideoBufferPath) {
490 fcount = m_pVideoBufferPath->GetImagesProcessed();
491 lua_pushnumber(L, (lua_Number)fcount);
502 if (m_pVideoBufferPath) {
503 completed = (int)m_pVideoBufferPath->LoadCompleted();
504 lua_pushnumber(L, (lua_Number)completed);
543 m_pVideoMan = p_pVideoManager;
552 int count = m_pVideoMan->GetCircularVideoBufferCount();
553 lua_pushnumber(L, (lua_Number)count);
559 int id = (int) lua_tonumber (L, 1);
565 pCirc = m_pVideoMan->GetCircularVideoBuffer(
id);
568 pLuaCirc->
Set( pCirc );
581 int count = m_pVideoMan->GetVideoBufferCount();
582 lua_pushnumber(L, (lua_Number)count);
588 int id = (int) lua_tonumber (L, 1);
594 pVid = m_pVideoMan->GetVideoBuffer(
id);
597 pLuaVid->
Set( pVid );
611 int count = m_pVideoMan->GetVideoBufferPathCount();
612 lua_pushnumber(L, (lua_Number)count);
618 int id = (int) lua_tonumber (L, 1);
624 pVid = m_pVideoMan->GetVideoBufferPath(
id);
627 pLuaVid->
Set( pVid );
667 m_pResourceManager = NULL;
672 m_pResourceManager = p_pResourceManager;
681 int count = m_pResourceManager->Resources().Count();
682 lua_pushnumber(L, (lua_Number)count);
688 int id = (int) lua_tonumber (L, 1);
689 moResource* pResource = m_pResourceManager->GetResource(
id);
691 id = pResource->
GetId();
694 lua_pushnumber(L, (lua_Number)
id);
703 if (m_pResourceManager) {
704 id = m_pResourceManager->GetResourceIndex(labelname);
707 lua_pushnumber(L, (lua_Number)
id);
718 if (lua_isnumber(L,1)) {
721 }
else if (lua_isstring(L,1)) {
740 lua_pushnumber(L, (lua_Number)
id);
747 int id = (int) lua_tonumber (L, 1);
749 moResource* pResource = m_pResourceManager->GetResource(
id);
756 lua_pushstring(L, rname);
763 int id = (int) lua_tonumber (L, 1);
765 moResource* pResource = m_pResourceManager->GetResource(
id);
772 lua_pushstring(L, rlname);
778 int id = (int) lua_tonumber (L, 1);
781 moResource* pResource = m_pResourceManager->GetResource(
id);
788 lua_pushnumber(L, (lua_Number)(
int)rtype);
795 if (pLuaTextureMan && m_pResourceManager) {
796 pLuaTextureMan->
Set( m_pResourceManager->GetTextureMan());
806 if (pLuaVideoMan && m_pResourceManager) {
807 pLuaVideoMan->
Set( m_pResourceManager->GetVideoMan());
816 if (pLuaSoundMan && m_pResourceManager) {
817 pLuaSoundMan->
Set( m_pResourceManager->GetSoundMan());
873 lua_pushnumber(L, (lua_Number)res);
881 lua_pushnumber(L, (lua_Number)res);
889 lua_pushnumber(L, (lua_Number)res);
898 lua_pushnumber(L, (lua_Number)res);
906 lua_pushnumber(L, (lua_Number)res);
914 lua_pushnumber(L, (lua_Number)res);
922 lua_pushnumber(L, (lua_Number)res);
930 lua_pushnumber(L, (lua_Number)res);
938 lua_pushnumber(L, (lua_Number)res);
947 lua_pushnumber(L, (lua_Number)res);
955 lua_pushnumber(L, (lua_Number)res);
963 lua_pushnumber(L, (lua_Number)res);
971 lua_pushnumber(L, (lua_Number)res);
979 lua_pushnumber(L, (lua_Number)res);
988 lua_pushnumber(L, (lua_Number)res);
996 lua_pushnumber(L, (lua_Number)res);
1004 lua_pushnumber(L, (lua_Number)res);
1012 lua_pushnumber(L, (lua_Number)res);
1020 lua_pushnumber(L, (lua_Number)res);
1028 lua_pushnumber(L, (lua_Number)rand);
1036 lua_pushnumber(L, (lua_Number)rand);
1046 lua_pushnumber(L, (lua_Number)rand);
1257 MOfloat x1,y1,width,height,start,stop,band;
1269 moP5::arc(x1, y1, width, height,start,stop);
1278 slices = (int) lua_tonumber (L,
lua_pindex(7));
1279 moP5::arc(x1, y1, width, height,start,stop, slices );
1288 slices = (int) lua_tonumber (L,
lua_pindex(7));
1290 moP5::arc(x1, y1, width, height,start,stop, slices, band );
1322 MOfloat x1,x2,x3,x4,y1,y2,y3,y4;
1360 slices = (int) lua_tonumber (L,
lua_pindex(5));
1507 MOfloat r=1.0f,g=1.0f,b=1.0f,grey=1.0f;
1561 MOfloat x1 = 1.0f,y1 = 1.0f, z1 = 1.0f;
1587 MOfloat x1 = 0.0f,y1 = 0.0f, z1 = 0.0f;
1614 MOfloat angle = 0.0f, x1=0.0f, y1=0.0f, z1=1.0f;
1636 lua_pushnumber(L, (lua_Number)MO_P5_RGB);
1642 lua_pushnumber(L, (lua_Number)MO_P5_HSB);
1648 lua_pushnumber(L, (lua_Number)MO_P5_HALF_PI);
1654 lua_pushnumber(L, (lua_Number)MO_P5_TWO_PI);
1660 lua_pushnumber(L, (lua_Number)MO_P5_PI);
moSoundManager * m_pSoundMan
void Set(moResourceManager *p_pResourceManager)
void Set(moTextureManager *p_pTextureMan)
static double Log2(double fValue)
void arc(float x, float y, float width, float height, float start, float stop, int slices=24, float band=0.0)
Recurso ( objeto para cargar y manipular objetos físicos de datos de imágenes, audio, video, 3d, 2d, fuentes, shaders y de cualquier otro tipo extendible por un plugin )
#define END_SCRIPT_CLASS_FUNCTIONS
void translate(float x, float y, float z=0.0f)
static double ACos(double fValue)
moResourceType
Tipos de recursos que se pueden implementar.
static double ATan2(double fY, double fX)
void triangle(float x1, float y1, float x2, float y2, float x3, float y3)
Administrador de sonidos.
static double Sin(double fValue)
static double Tan(double fValue)
static double Log(double fValue)
void Set(moVideoManager *p_pVideoMan)
void Set(moVideoBufferPath *p_pVideoBufferPath)
static double Sqr(double fValue)
void Set(moSoundManager *p_pSoundMan)
const moText & GetLabelName() const
static double SymmetricRandom(unsigned int uiSeed=0)
static T * createFromExisting(lua_State *L, T *existingobj)
#define IMPLEMENT_SCRIPT_CLASS(ClassName)
static double Floor(double fValue)
void quad(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
clase de para manejar textos
static double ATan(double fValue)
static double Log10(double fValue)
void background(float gray)
static double InvSqrt(double fValue)
Buffer de imágenes para video.
static double Sqrt(double fValue)
static double ASin(double fValue)
void ellipse(float x, float y, float width, float height, int slices=24)
void rotate(float angle, float x=0.0f, float y=0.0f, float z=1.0f)
Administrador de recursos.
moResourceType GetResourceType()
static moDebug * MODebug2
Clase de impresión de errores para depuración.
static double Cos(double fValue)
#define DEFINE_SCRIPT_CLASS_PROPERTIES(ClassName)
void Set(moCircularVideoBuffer *p_pCircularVideoBuffer)
void Push(moText p_text)
Apila el mensaje dentro de la pila de mensajes.
static double FMod(double fX, double fY)
SCRIPT_FUNCTION(moLuaSoundManager, GetSoundCount)
void strokeWeight(float width)
#define DEFINE_SCRIPT_CLASS_FUNCTIONS(ClassName)
LIBMOLDEO_API moText0 IntToStr(int a)
static double Pow(double fBase, double fExponent)
void rect(float x, float y, float width, float height)
void point(float x, float y)
static double IntervalRandom(double fMin, double fMax, unsigned int uiSeed=0)
#define SCRIPT_CONSTRUCTOR_IMPLEMENTATION(ClassName)
#define lua_pindex(index)
moSound * GetSound(moText p_name, bool create=true)
static double FAbs(double fValue)
Buffer Circular de imágenes para video.
void Message(moText p_text)
Anuncia un mensaje al usuario además de guardarlo en el log de texto.
#define SCRIPT_FUNCTION_IMPLEMENTATION(ClassName, FunctionName)
static double UnitRandom(unsigned int uiSeed=0)
#define END_SCRIPT_CLASS_PROPERTIES
void line(float x1, float y1, float x2, float y2)
static double Exp(double fValue)
static double Ceil(double fValue)
const moText & GetName() const
void Set(moVideoBuffer *p_pVideoBuffer)