// * *************************** Sound ******************************************************************************* // * Modes and treatments selections ****************** //************************* MEDIA ************************************************************************************ DEFINE_SCRIPT_REN(MEDIA_Create, CM, CATEGORY(Media) PARAM_STRING(MediaName) PARAM_INT_OPT(dummy, 0), "load a media
Example
[CM cam1] for a webcam
[CM mr.jpg] for a jpegfile", { if (*MediaName) { if (CreateMedia(MediaName,0,dummy) == -1) { sprintf(LuaErrors, "Error Creating Media %s", MediaName); RETURN_BOOL(0); } else { RETURN_BOOL(1); } } else { RETURN_BOOL(1); } }) DEFINE_SCRIPT_REN(MEDIA_BWSet, SetMediaBW, CATEGORY(Media) PARAM_MEDIA(Mi1), "", { ID_MEDIA[Mi1]->ulColorMode = 1; if (ID_MEDIA[Mi1]->ulAssociatedTextureIndex != -1) DI->SetTextureColorMode(ID_MEDIA[Mi1]->ulAssociatedTextureIndex,1); }) DEFINE_SCRIPT_REN(MEDIA_RGBASet, SetMediaRGBA, CATEGORY(Media) PARAM_MEDIA(Mi1), "", { ID_MEDIA[Mi1]->ulColorMode = 0; if (ID_MEDIA[Mi1]->ulAssociatedTextureIndex != -1) DI->SetTextureColorMode(ID_MEDIA[Mi1]->ulAssociatedTextureIndex,0); }) DEFINE_SCRIPT(MEDIA_NicknameSet, CATEGORY(Media) PARAM_MEDIA(Media) PARAM_STRING(Nickname), "Set a nick name for picking, usable as an object in the UI", { strcpy(ID_MEDIA[Media]->Nickname, Nickname); }) DEFINE_SCRIPT(MEDIA_IsError, CATEGORY(Media) PARAM_MEDIA(Media), "load a media
Example
[CM cam1] for a webcam
[CM mr.jpg] for a jpegfile", { RETURN_BOOL(ID_MEDIA[Media]->GetType() == IOtype_ERR); }) DEFINE_SCRIPT_REN(MEDIA_Mosaic, Mosaic, CATEGORY(Media), "Display all media", { Mosaique(); }) DEFINE_SCRIPT_REN(MEDIA_Destroy, DestroyMedia, CATEGORY(Media) PARAM_MEDIA_OPT(media, -1), "Destroy all medias", { MyDebug(L); if (media != -1) DestroyMedia(media); }) DEFINE_SCRIPT(MEDIA_DestroyAll, CATEGORY(Media), "Destroy all medias", { DestroyAllMedia(); }) DEFINE_SCRIPT_REN(MEDIA_DestroyVirtualy, VirtualDestroyMedia, CATEGORY(Media), "Destroy all medias, exept if they are recreated after", { VirtuallyDestroyAllMedia(); }) DEFINE_SCRIPT_REN(MEDIA_Redir, MediaRedir, CATEGORY(Media) PARAM_MEDIA(DestMedia) PARAM_MEDIA(SrcMedia) , "When rendering, use MediaNmaeSource instead of MediaNameDst
Must be recall each frame
Can be call several times in a frame", { ID_MEDIA[DestMedia]->ulMediaRedirectValue = SrcMedia; }) DEFINE_SCRIPT_REN(MEDIA_TargetRenderBegin, BeginRenderTarget, CATEGORY(Media) PARAM_MEDIA(Mi) PARAM_INT_OPT(SaveFrontBuffer,0), "Begin rendering in the media. SaveFrontBuffer to 1 will not affect the front buffer, but will be slower in OpenGL.", { DI->BeginTextureTarget(ID_MEDIA[Mi]->ulAssociatedTextureIndex,SaveFrontBuffer); }) DEFINE_SCRIPT_REN(MEDIA_TargetRenderEnd, EndRenderTarget, CATEGORY(Media) PARAM_MEDIA(Mi) PARAM_INT_OPT(UpdateSoftBuffer,0), "End rendering in the media (UpdateSoftBuffer = 1 if needed for streaming for exemple)", { DI->EndTextureTarget(ID_MEDIA[Mi]->ulAssociatedTextureIndex,UpdateSoftBuffer); }) DEFINE_SCRIPT(MEDIA_Exist, CATEGORY(Media) PARAM_MEDIA_OPT(Mi, -1), "Verify if media is defined", { RETURN_BOOL((Mi != -1)); }) DEFINE_SCRIPT(MEDIA_AllowOnlyAlpha, CATEGORY(Media) PARAM_INT_OPT(onlyAlpha, 1), "Verify if media is defined", { extern u32 AllowOnlyAlpha; AllowOnlyAlpha = onlyAlpha; }) DEFINE_SCRIPT_REN(MEDIA_FrameCount, GetMediaNumFrames, CATEGORY(Media) PARAM_MEDIA(Mi), "return the media's number of frames", { RETURN_INT((ID_MEDIA[Mi]->dTotalTime * ID_MEDIA[Mi]->dAvgFramePerSecond + 0.5f)); }) DEFINE_SCRIPT_REN(MEDIA_FrameGet, GetMediaFrame, CATEGORY(Media) PARAM_MEDIA(Mi), "return the current Media frame", { RETURN_INT(ID_MEDIA[Mi]->ulCurrentFrame); }) DEFINE_SCRIPT_REN(MEDIA_FrameSet, SetMediaFrame, CATEGORY(Media) PARAM_MEDIA(Mi) PARAM_INT(FrameIndex), "Set media frame", { ID_MEDIA[Mi]->dCurrentTime = FRAME_TO_TIME(FrameIndex, ID_MEDIA[Mi]->dAvgFramePerSecond); ID_MEDIA[Mi]->ulCurrentFrame = FrameIndex; }) DEFINE_SCRIPT(MEDIA_TimeSet, CATEGORY(Media) PARAM_MEDIA(Mi) PARAM_FLOAT(TimeIndex), "Set media time in seconds", { if (ID_MEDIA[Mi]->GetType() == IOtype_DSWAV || ID_MEDIA[Mi]->GetType() == IOtype_SOUND || ID_MEDIA[Mi]->GetType() == IOtype_AVI) { ID_MEDIA[Mi]->dCurrentTime = TimeIndex; ID_MEDIA[Mi]->ulCurrentFrame = TIME_TO_FRAME(TimeIndex, ID_MEDIA[Mi]->dAvgFramePerSecond); } }) DEFINE_SCRIPT(MEDIA_TimeGet, CATEGORY(Media) PARAM_MEDIA(Mi) PARAM_INT_OPT(forceGet, 0), "Set media time in seconds", { if (ID_MEDIA[Mi]->GetType() == IOtype_DSWAV || ID_MEDIA[Mi]->GetType() == IOtype_SOUND || ID_MEDIA[Mi]->GetType() == IOtype_AVI) { if (forceGet) ID_MEDIA[Mi]->GetData(5); RETURN_FLOAT((float)ID_MEDIA[Mi]->dCurrentTime); } else { RETURN_FLOAT(0.0f); } }) DEFINE_SCRIPT(MEDIA_FPSGet, CATEGORY(Media) PARAM_MEDIA(Mi), "Get media average FPS", { if (ID_MEDIA[Mi]->GetType() == IOtype_SOUND || ID_MEDIA[Mi]->GetType() == IOtype_AVI) { RETURN_FLOAT(ID_MEDIA[Mi]->dAvgFramePerSecond); } }) DEFINE_SCRIPT(MEDIA_DurationGet, CATEGORY(Media) PARAM_MEDIA(Mi), "Set media time in seconds", { if (ID_MEDIA[Mi]->GetType() == IOtype_DSWAV || ID_MEDIA[Mi]->GetType() == IOtype_SOUND || ID_MEDIA[Mi]->GetType() == IOtype_AVI) { RETURN_FLOAT(ID_MEDIA[Mi]->dTotalTime); } }) DEFINE_SCRIPT(MEDIA_RateSet, CATEGORY(Media) PARAM_MEDIA(Mi) PARAM_FLOAT_OPT(rate, 1.0), "for video and audio. Set media rate (speed) 1-> normal speed", { if (ID_MEDIA[Mi]->GetType() == IOtype_DSWAV || ID_MEDIA[Mi]->GetType() == IOtype_SOUND || ID_MEDIA[Mi]->GetType() == IOtype_AVI) { ID_MEDIA[Mi]->SetData(4, &rate); } }) DEFINE_SCRIPT(MEDIA_RateGet, CATEGORY(Media) PARAM_MEDIA(Mi), "for video and audio. Get media rate (speed) 1-> normal speed", { if (ID_MEDIA[Mi]->GetType() == IOtype_DSWAV || ID_MEDIA[Mi]->GetType() == IOtype_SOUND || ID_MEDIA[Mi]->GetType() == IOtype_AVI) { void *dataPtr; dataPtr = ID_MEDIA[Mi]->GetData(4); if (dataPtr) { RETURN_FLOAT(*((float *)dataPtr));} } }) DEFINE_SCRIPT(MEDIA_CamPluggedTest, CATEGORY(Media) PARAM_MEDIA(Mi), "Verify if camera is plugged", { RETURN_BOOL((ID_MEDIA[Mi]->GetType() == IOtype_CAM && ID_MEDIA[Mi]->GetData(3) != NULL)); }) DEFINE_SCRIPT_REN(MEDIA_WidthGet, GetMediaW, CATEGORY(Media) PARAM_MEDIA(MediaIndex),"Get the width of the specifyed media in pixels", { if (ID_MEDIA[MediaIndex]->GetType() == IOtype_JPEG) { RETURN_INT(ID_MEDIA[MediaIndex]->Image.SX<<0); } else { RETURN_INT(ID_MEDIA[MediaIndex]->Image.SX); } }) DEFINE_SCRIPT_REN(MEDIA_HeightGet, GetMediaH, CATEGORY(Media) PARAM_MEDIA(MediaIndex),"Get the height of the specifyed media in pixels", { if (ID_MEDIA[MediaIndex]->GetType() == IOtype_JPEG) { RETURN_INT(ID_MEDIA[MediaIndex]->Image.SY<<0); } else { RETURN_INT(ID_MEDIA[MediaIndex]->Image.SY); } }) DEFINE_SCRIPT(MEDIA_Count, CATEGORY(Media Text) PARAM_INT(param), "masking method: bit1: if set, count media number using nbReferences
bit2: if set do not count virtually destroyed media", { int counter = 0; for (int Mi=0; MiVirtuallyDestroyed)) { if (param & 1) counter += ID_MEDIA[Mi]->nbReferences; else counter++; } } RETURN_INT(counter); }) DEFINE_SCRIPT(MEDIA_TextureCount, CATEGORY(Media Text) PARAM_INT(param), "get texture number", { int counter = 0; for (int texIdx=0; texIdxAllRef[texIdx].OGLRef != 0xFFFFFFFF) { if (!(param & 1) || (DI->AllRef[texIdx].OGLRef != 0xFFFFFFFE)) counter++; } } RETURN_INT(counter); }) #ifdef ONLINE_MODE DEFINE_SCRIPT(MEDIA_FromActiveX, CATEGORY(Media) PARAM_MEDIA(Media) PARAM_INT(browser) PARAM_INT(w) PARAM_INT(h) PARAM_INT_OPT(x,0) PARAM_INT_OPT(y,0) PARAM_INT_OPT(UpdateHW,1), "Fill media with the content of activeX", { bool value = MediaToScreen(Media, Account.getBrowserHandle(browser), w, h, x, y); if (value && UpdateHW && ID_MEDIA[Media]->ulAssociatedTextureIndex != -1) DI->UpdateTexture_BM_2_HW(ID_MEDIA[Media]->ulAssociatedTextureIndex); RETURN_BOOL(value) }) #endif DEFINE_SCRIPT(TEXT_BoundsGet, CATEGORY(Media Text) PARAM_STRING(Text) PARAM_MEDIA_OPT(FontName, -1), "Get the bounds of the specifyed text using the specified font (if no font specified, use default one)", { SIZE GetTextBounds(u8 *Txt, INPUT_IO *fontMedia); SIZE bounds; if (FontName != -1) bounds = GetTextBounds((u8 *)Text, ID_MEDIA[FontName]); else bounds = GetTextBounds((u8 *)Text, NULL); RETURN_POINT2(bounds.cx, bounds.cy); }) DEFINE_SCRIPT_REN(MEDIA_FocaleSet, SetFocale, CATEGORY(Media) PARAM_MEDIA(Mi1) PARAM_FLOAT(NewFocale) PARAM_INT_OPT(beginIndex, -1) PARAM_INT_OPT(endIndex, -1), "Specify the focale of the specifyed media. Default is 2.5", { if (beginIndex != -1 && ID_MEDIA[Mi1]->Tracks) { TrackPlayer_Descriptors *Pdesc; Pdesc = ID_MEDIA[Mi1]->Tracks->GetDescriptor(beginIndex); Pdesc -> CurrentFocal = NewFocale; if (endIndex != -1) { while (beginIndex < endIndex) { beginIndex++; Pdesc = ID_MEDIA[Mi1]->Tracks->GetDescriptor(beginIndex); Pdesc -> CurrentFocal = NewFocale; }; } } else ID_MEDIA[Mi1]->MediaFocale = NewFocale; }) DEFINE_SCRIPT_REN(MEDIA_FocaleGet, GetFocale, CATEGORY(Media) PARAM_MEDIA(Mi1) PARAM_INT_OPT(beginIndex, -1) PARAM_INT_OPT(endIndex, -1), "Get the focale of the specifyed media. Default", { int nbResult = 0; float resultList[512]; if (beginIndex != -1 && ID_MEDIA[Mi1]->Tracks && (beginIndex < ID_MEDIA[Mi1]->Tracks->ulNumberOfDescriptors)) { resultList[nbResult++] = ID_MEDIA[Mi1]->Tracks->DescriptorsPtrs[beginIndex].CurrentFocal; if (endIndex != -1) { if (endIndex >= ID_MEDIA[Mi1]->Tracks->ulNumberOfDescriptors) endIndex = ID_MEDIA[Mi1]->Tracks->ulNumberOfDescriptors-1; while (beginIndex < endIndex) { beginIndex++; resultList[nbResult++] = ID_MEDIA[Mi1]->Tracks->DescriptorsPtrs[beginIndex].CurrentFocal; }; } } else resultList[nbResult++] = ID_MEDIA[Mi1]->MediaFocale; if (nbResult == 1) { RETURN_FLOAT(resultList[0]); } else if (nbResult > 1) { RETURN_TABLE_FLOAT(resultList, nbResult); } }) DEFINE_SCRIPT(MEDIA_Play, CATEGORY(Media) PARAM_MEDIA(Media) PARAM_INT_OPT(Repeat, 0) PARAM_FLOAT_OPT(FadeTime, 0), "Play media", { ID_MEDIA[Media]->lTimeState = 1; if (Repeat) ID_MEDIA[Media]->ulMediaParams |= 0x1; else ID_MEDIA[Media]->ulMediaParams &= ~0x1; if (FadeTime != 0) { int tmpData = 1; ID_MEDIA[Media]->SetData(0, &tmpData); tmpData = FadeTime * 1000; ID_MEDIA[Media]->SetData(1, &tmpData); } }) DEFINE_SCRIPT(MEDIA_Pause, CATEGORY(Media) PARAM_MEDIA(Media) PARAM_FLOAT_OPT(FadeTime, 0), "Pause media", { ID_MEDIA[Media]->lTimeState = 0; if (FadeTime != 0) { int tmpData = 2; ID_MEDIA[Media]->SetData(0, &tmpData); tmpData = FadeTime * 1000; ID_MEDIA[Media]->SetData(1, &tmpData); } }) DEFINE_SCRIPT(MEDIA_Stop, CATEGORY(Media) PARAM_MEDIA(Media) PARAM_FLOAT_OPT(FadeTime, 0), "Stop media (restart at the begining on next play", { if (FadeTime == 0) { ID_MEDIA[Media]->dCurrentTime = 0.0f; ID_MEDIA[Media]->ulCurrentFrame = 0; } else { int tmpData = 2; ID_MEDIA[Media]->SetData(0, &tmpData); tmpData = FadeTime * 1000; ID_MEDIA[Media]->SetData(1, &tmpData); } ID_MEDIA[Media]->lTimeState = 255; }) DEFINE_SCRIPT(MEDIA_PlayTest, CATEGORY(Media) PARAM_MEDIA(Media), "Return if media is currently playing", { RETURN_BOOL(ID_MEDIA[Media]->lTimeState == 1); }) DEFINE_SCRIPT(SOUND_Frequency, CATEGORY(Media Sound) PARAM_MEDIA(Media) PARAM_FLOAT_OPT(Frenquency, 1), "Only for WAVE Files !!
ratio of default frequency", { if (ID_MEDIA[Media]->GetType() == IOtype_DSWAV) ID_MEDIA[Media]->SetData(2, &Frenquency); }) DEFINE_SCRIPT(SOUND_Volume, CATEGORY(Media Sound) PARAM_MEDIA(Media) PARAM_FLOAT_OPT(Volume, 1), "ratio of max volume", { if (ID_MEDIA[Media]->GetType() == IOtype_DSWAV || ID_MEDIA[Media]->GetType() == IOtype_AVI || ID_MEDIA[Media]->GetType() == IOtype_SOUND) ID_MEDIA[Media]->SetData(3, &Volume); }) DEFINE_SCRIPT(SOUND_Mute, CATEGORY(Media Sound) PARAM_MEDIA(Media) PARAM_INT_OPT(Mute, 1), "Play media", { if (Mute) ID_MEDIA[Media]->ulMediaParams |= 0x2; else ID_MEDIA[Media]->ulMediaParams &= ~0x2; }) DEFINE_SCRIPT(SOUND_MuteAll, CATEGORY(Media Sound) PARAM_INT_OPT(Mute, 1), "Play media", { if (Mute) { for (int Mi=0; MiulMediaParams |= 0x2; } else { for (int Mi=0; MiulMediaParams &= ~0x2; } }) DEFINE_SCRIPT_REN(AVI_UncompressSet, SetAviInFiles, CATEGORY(Media AVI) PARAM_INT_OPT(set, 1), "Stock the Avi file into image file", { AVIMegaRedirect = set; if (set) ForceTraking++; else ForceTraking--; }) DEFINE_SCRIPT_REN(AVI_FPSSet, SetAviFPS, CATEGORY(Media AVI) PARAM_INT(FramePerSecond), "Set the frame per second of AVI media", { AVIMegaFPS = FramePerSecond; }) DEFINE_SCRIPT_REN(AVI_IsCutDetected, AVICutDetected, CATEGORY(Media AVI), "return 1 if tracked media has detected a movie cut, 0 else", { RETURN_BOOL(WSPC && (WSPC->INTERP_MatchingPercent < 8.0f)); }) #ifndef SKIMMED_NET DEFINE_SCRIPT_REN(STRI_Specify, SpecifySTRI, CATEGORY(Media STRI) PARAM_MEDIA(Mi1) PARAM_IP(ulIP), "define the connected user. if not defined (0.0.0.0), use auto-connect mode", { if (ID_MEDIA[Mi1]->GetType() == IOtype_STRI) { void STRI_SETPARAMS(INPUT_IO *pSTRI,u32 ulIP); STRI_SETPARAMS(ID_MEDIA[Mi1],ulIP); } }) DEFINE_SCRIPT_REN(STRO_Specify, SpecifySTRO, CATEGORY(Media STRO) PARAM_MEDIA(STRO_Media) PARAM_MEDIA(STRO_Input), "Example:SpecifySTRO <0STRO> <0 REVR>
then the reverse mapping (0 REVR)is broadcasted over IP", { if (ID_MEDIA[STRO_Media]->GetType() == IOtype_STRO) { void StreamOut_SETSOURCE(INPUT_IO *pSTRO,u32 SourceIndex); StreamOut_SETSOURCE(ID_MEDIA[STRO_Media], STRO_Input); } }) DEFINE_SCRIPT_REN(STRO_CompQualitySet, SetCompQualitySTRO, CATEGORY(Media STRO) PARAM_MEDIA(STRO_Medianame) PARAM_FLOAT(Quality) PARAM_FLOAT(Resposiveness), "Sets compression reference quality (from which final quality is computed according to STRO size) and resposiveness (%). WARNING ! The application must be restarted after having set this, otherwise there won't be any change", { float Q = Quality; float R = Resposiveness; if ((Q > 0 && Q <= 100) && (R > 0 && R <= 100)) { void StreamOut_SETCOMPQUALITY(INPUT_IO *pSTRO,u32 Q); void StreamOut_SETCOMPRESP(INPUT_IO *pSTRO,u32 R); StreamOut_SETCOMPQUALITY(ID_MEDIA[STRO_Medianame],Q); StreamOut_SETCOMPRESP(ID_MEDIA[STRO_Medianame],R); } }) #endif DEFINE_SCRIPT_REN(BLUR_Specify, SpecifyBLUR, CATEGORY(Media BLUR) PARAM_MEDIA(BLUR_Media) PARAM_MEDIA(BLUR_Input) PARAM_FLOAT(BlurFactor), "Example:SpecifyBLUR <0 BLUR> <0 REVR> 0.2", { if (ID_MEDIA[BLUR_Media]->GetType() == IOtype_BLUR) { void BLUR_SETPARAMS(INPUT_IO *pBLUR,u32 BlurSource,float BlurFactor); BLUR_SETPARAMS(ID_MEDIA[BLUR_Media],BLUR_Input,BlurFactor); } }) DEFINE_SCRIPT_REN(DIFF_Specify, SpecifyDiff, CATEGORY(Media DIFF) PARAM_MEDIA(DIFF_Media) PARAM_MEDIA(DIFF_Input1) PARAM_MEDIA(DIFF_Input2), "", { if (ID_MEDIA[DIFF_Media]->GetType() == IOtype_DIFF) { void DIFF_SETPARAMS(INPUT_IO *pDIFF,u32 DIFFSource1,u32 DIFFSource2); DIFF_SETPARAMS(ID_MEDIA[DIFF_Media],DIFF_Input1,DIFF_Input2); } }) DEFINE_SCRIPT_REN(REVR_SizeSet, SetReverseRenderingSize, CATEGORY(Media Reverse Rendering) PARAM_MEDIA(Mi) PARAM_INT(SizeX) PARAM_INT_OPT(SizeY, -1), "define width and height of the reverse rendering map", { if (SizeY == -1) SizeY = SizeX; void ReverseRender_SETPARAMS(INPUT_IO *pREVR, u32 sizeX, u32 sizeY); ReverseRender_SETPARAMS(ID_MEDIA[Mi], SizeX, SizeY); }) DEFINE_SCRIPT_REN(REVR_MaskSet, SetReverseRenderingMask, CATEGORY(Media Reverse Rendering) PARAM_MEDIA(Mi) PARAM_MEDIA(MediaMask), "define the update mask for the revr. If mediamask == mediaindex then desactive masking", { void ReverseRender_SETMASK(INPUT_IO *pREVR, u32 MaskmediaIndex); if (MediaMask == Mi ) ReverseRender_SETMASK(ID_MEDIA[Mi], -1); else ReverseRender_SETMASK(ID_MEDIA[Mi], MediaMask); }) DEFINE_SCRIPT(TEXT_Get, CATEGORY(Media Text) PARAM_MEDIA(MediaIndex), "return Content of the media if it's a text", { if ((ID_MEDIA[MediaIndex]->GetType() == IOtype_TEXT) && (((TEXT_Grabber *)ID_MEDIA[MediaIndex])->TEXT)) { RETURN_STRING((((TEXT_Grabber *)ID_MEDIA[MediaIndex])->TEXT)); } }) DEFINE_SCRIPT(TEXT_Set, CATEGORY(Media Text) PARAM_MEDIA(MediaIndex) PARAM_STRING(String), "Set Content of the media if it's a text", { char Buffer[2048]; memset(Buffer, 0, sizeof(Buffer)); strncpy(Buffer, String, min(strlen(String), 2047)); if ((ID_MEDIA[MediaIndex]->GetType() == IOtype_TEXT)) { ((TEXT_Grabber *)ID_MEDIA[MediaIndex])->UPDATETEXT(Buffer); if (pTG==ID_MEDIA[MediaIndex]) { strcpy(CurrentlyEditedText,pTG->TEXT); } } }) DEFINE_SCRIPT(TEXT_SetFont, CATEGORY(Media Text) PARAM_MEDIA(MediaTextIndex) PARAM_MEDIA_OPT(MediaFontIndex,-1), "Set the font of the media", { if ((ID_MEDIA[MediaTextIndex]->GetType() == IOtype_TEXT)) { ((TEXT_Grabber *)ID_MEDIA[MediaTextIndex])->SetFont(MediaFontIndex); } }) DEFINE_SCRIPT(TEXT_SetFocus, CATEGORY(Media Text) PARAM_MEDIA(MediaTextIndex), "Set the keyboard focus to MediaTextIndex", { if ((ID_MEDIA[MediaTextIndex]->GetType() == IOtype_TEXT)) { GetTextFocus((TEXT_Grabber *)ID_MEDIA[MediaTextIndex]); } }) DEFINE_SCRIPT(TEXT_LooseFocus, CATEGORY(Media Text) , "Loose the keyboard focus if any", { LooseFocus(); }) DEFINE_SCRIPT(TEXT_GetFocus, CATEGORY(Media Text) , "Get focused media text", { if (pTG) { RETURN_STRING((char*)pTG->MediaName); } }) DEFINE_SCRIPT(DBG_FILTER, CATEGORY(Debug), "Filers ...", { void ExeFilterTest(); ExeFilterTest(); }) DEFINE_SCRIPT(AE_SetZColor, CATEGORY(After effect) PARAM_FLOAT(Z) PARAM_COLOR(color), "Set the color if Z inferior to Zbuffer (Z superior to ZBuffer set if Z is negative)", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->AfterEffect(5,color,Z,0.0f); }) DEFINE_SCRIPT(AE_AlphaToColor, CATEGORY(After effect) PARAM_INT(InvertAlpha), "Transform color in alpha", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->AfterEffect(6,0,InvertAlpha,0.0f); }) DEFINE_SCRIPT(AE_Erode, CATEGORY(After effect) PARAM_FLOAT(Factor), "Erode white over black", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->AfterEffect(7,0,Factor,0.0f); }) DEFINE_SCRIPT(AE_LayerMultiply, CATEGORY(After effect) PARAM_INT(LayerN), "Multiply frame buffer with layer", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->LayerOperation(3,LayerN,0xffffffff,0.0f,0.0f); }) DEFINE_SCRIPT(AE_BW, CATEGORY(After effect) PARAM_FLOAT(Factor), "Set a BW Param", { if (!(SkipFunctions & SKIP_EFFECTS)) { DI->LayerOperation(0,NUMBER_OF_WORKING_REF - 1 ,0xffffffff,0.0f,0.0f); DI->LayerOperation(1,NUMBER_OF_WORKING_REF - 1 ,0xffffffff,1.0f - Factor,0.0f); } }) DEFINE_SCRIPT(AE_ColorFilter, CATEGORY(After effect) PARAM_FLOAT(R) PARAM_FLOAT(G) PARAM_FLOAT(B), "Multiply screen with specifyed color (exemple SEPIA->AE_ColorFilter(1,0.6, 0.3) )", { if (!(SkipFunctions & SKIP_EFFECTS)) { DI->AfterEffect(12,0,R,G,B,0,0); } }) DEFINE_SCRIPT(AE_ColorScreen, CATEGORY(After effect) PARAM_FLOAT(R) PARAM_FLOAT(G) PARAM_FLOAT(B), "Add screen with specifyed color", { if (!(SkipFunctions & SKIP_EFFECTS)) { DI->AfterEffect(11,0,R,G,B,0,0); } }) DEFINE_SCRIPT(AE_Contrast, CATEGORY(After effect) PARAM_FLOAT(Factor), "Set Contrast (1.0 is the neutral factor)", { if (!(SkipFunctions & SKIP_EFFECTS)) { DI->AfterEffect(8,0,Factor,0); } }) DEFINE_SCRIPT(AE_Brightness, CATEGORY(After effect) PARAM_FLOAT(Factor), "Set Brighness (1.0 is the neutral factor)", { if (!(SkipFunctions & SKIP_EFFECTS)) { DI->AfterEffect(9,0,Factor,0); } }) DEFINE_SCRIPT(AE_Blur, CATEGORY(After effect) PARAM_FLOAT(Factor), "Add a blur after effect the current viewport", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->AfterEffect(0,0,Factor,0.0f); }) DEFINE_SCRIPT(AE_MotionBlur, CATEGORY(After effect) PARAM_FLOAT(FactorX) PARAM_FLOAT(FactorY), "Add a motion blur after effect to the current viewport", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->AfterEffect(1,0,FactorX,FactorY); }) DEFINE_SCRIPT(AE_ZoomSmooth, CATEGORY(After effect) PARAM_FLOAT(Factor) PARAM_FLOAT_OPT(CenterX,0.5f) PARAM_FLOAT_OPT(CenterY,0.5f), "Add a zoom smooth after effect to the current viewport
CenterX and CenterY are between 0 and 1", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->AfterEffect(2,0,Factor,CenterX,CenterY); }) DEFINE_SCRIPT(AE_GodRay, CATEGORY(After effect) PARAM_FLOAT(LengthFactor) PARAM_FLOAT(StrengthFactor) PARAM_FLOAT_OPT(CenterX,0.5f) PARAM_FLOAT_OPT(CenterY,0.5f), "Add a GodRay after effect to the current viewport
CenterX and CenterY are between 0 and 1", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->AfterEffect(4,0,LengthFactor,CenterX,CenterY,StrengthFactor); }) DEFINE_SCRIPT(AE_Invert, CATEGORY(After effect) PARAM_FLOAT(Factor), "Invert current screen", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->AfterEffect(3,0,Factor,0); }) DEFINE_SCRIPT(AE_InvertAlpha, CATEGORY(After effect) PARAM_FLOAT(Factor), "Invert Alpha current screen", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->AfterEffect(18,0,Factor,0); }) DEFINE_SCRIPT(AE_AlphaPremult, CATEGORY(After effect), "Multiply screen alpha with screen color", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->AfterEffect(13,0,0,0); }) DEFINE_SCRIPT(AE_LayerUseInWMPaint, CATEGORY(After effect) PARAM_INT(LayerN), "Set a layer for refrash screen if needed", { WMPaintLayer = LayerN; }) DEFINE_SCRIPT(AE_LayerSave, CATEGORY(After effect) PARAM_INT(LayerN) PARAM_INT_OPT(SaveAlpha,0), "Save current frame buffer into layer index. Set SaveAlpha to 1 if yout want to keep current alpha buffer in the layer", { if (SaveAlpha) SaveAlpha = 1; if (!(SkipFunctions & SKIP_EFFECTS)) DI->LayerOperation(0,LayerN,SaveAlpha ^ 1,0.0f,0.0f); }) DEFINE_SCRIPT(AE_LayerBlend, CATEGORY(After effect) PARAM_INT(LayerN) PARAM_FLOAT_OPT(Factor, 0.0f), "Blend frame buffer with layer and factor opacity", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->LayerOperation(1,LayerN,0xffffffff,Factor,0.0f); }) DEFINE_SCRIPT(AE_LayerBlendPreviousAlpha, CATEGORY(After effect) PARAM_INT(LayerN), "Blend frame buffer with layer and factor opacity", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->LayerOperation(4,LayerN,0xffffffff,0.0,0.0f); }) DEFINE_SCRIPT(AE_LayerScreen, CATEGORY(After effect) PARAM_INT(LayerN) PARAM_FLOAT(Factor), "Screen frame buffer with layer and factor opacity", { if (!(SkipFunctions & SKIP_EFFECTS)) DI->LayerOperation(2,LayerN,0xffffffff,Factor,0.0f); }) DEFINE_SCRIPT_REN(ZCC_Pack, ZCC_PACK, CATEGORY(ZCC) PARAM_STRING(Filename) PARAM_INT_OPT(ALLCURRENT,0) PARAM_INT_OPT(crypt, 0), "create e ZCC with all the file previously called with ZCC_ADDFILE, and if ALLCURRENT add current LOADED scenes, anims, media and particules ", { char FileBuffer[2048]; strcpy(FileBuffer, Filename); PackFileCrypt = crypt; PACK(FileBuffer,ALLCURRENT); }) DEFINE_SCRIPT_REN(ZCC_Unpack,ZCC_UNPACK, CATEGORY(ZCC) PARAM_STRING(Filename) PARAM_INT_OPT(LAUCHLUA,0) PARAM_INT_OPT(OVERRIDE,0) , "Decompress a ZCC file. if you want to lauch main lua included in the ZCC, set LAUCHLUA to 1. OVERRIDE mode to 1 if you want to overide (ecraser!) files", { char FileBuffer[2048]; strcpy(FileBuffer, Filename); UNPACK(FileBuffer,LAUCHLUA,OVERRIDE); }) DEFINE_SCRIPT(ZCC_InfosGet, CATEGORY(ZCC) PARAM_STRING(Filename), "Get the file contents of a ZCC file in a table.", { char FileBuffer[2048]; strcpy(FileBuffer, Filename); int ZccInfosInLuaSize = 0; char **ZccInfosInLua = GETZCCFILES(FileBuffer,&ZccInfosInLuaSize); for (int i=0; iGetType() == IOtype_DUMY) { ID_MEDIA[MediaDummy]->Image = ID_MEDIA[Media]->Image; ID_MEDIA[MediaDummy]->Image.SetBase(ID_MEDIA[Media]->Image.GetBase()); ID_MEDIA[MediaDummy]->Image.MoveBase(X + Y*ID_MEDIA[MediaDummy]->Image.PITCH); ID_MEDIA[MediaDummy]->Image.SX = SX; ID_MEDIA[MediaDummy]->Image.SY = SY; } })