Plugins
KnobMan has a interface to plug-in modules that expand the functionality.
Plugins should be placed in the 'Plugin' directory under the KnobMan.exe.
HorzVert
Horizontal/Vertical exchange for Sliders.
HorzVert will try convert horizontal slider <=> vertical slider
BY
- OutputSizeX / OutputSizeY exchange
- Primitive H-Lines/V-Lines change
- Primitive Aspect change
- OffsetX/Y exchange
- RotCenterX/Y exchange
- MaskType Horizontal/Vertical change
May not work properly if you use...
- non-square image primitives
- triangle / line primitives
- angles / mask rotations effects
But probably help you if need Horizontal/Vertical Sliders
Plugin I/F
The Plugins are windows executable that have ".exe" extension. The exe files placed in 'Plugins' directory will be listed to 'Plugins' menu.
Plugins can communicate with KnobMan using just only WM_SETTEXT and WM_GETTEXT messages. The target window handle is passed by commandline. Followings are a code fragment for getting target window handle.
int APIENTRY _tWinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR lpCmdLine,int nCmdShow) {
HWND hwndTarget=(HWND)atoi(lpCmdLine);
After get the window handle, the plugins can control KnobMan by special format WM_SETTEXT that set the text of "KnobManCtl:xxxx". For example,...
char *str="KnobManCtl:SetValue Layer1.OffsetX1=0.0"; SendMessage(hwndTarget,WM_SETTEXT,0,(LPARAM)str);will set a value of Layer1 OffsetX1 to 0.0
- "KnobManCtl:Exit" :Plugin should send this message when exit.
- "KnobManCtl:LayerX.GetValue param" :Get a parameter value from KnobMan. the return value can be retrieve by WM_GETTEXT message
- "KnobManCtl:LayerX.SetValue param=value" :Set a value to a parameter
Prefs. instead of LayerX.
- "Prefs.Layers" :the number of the layers
- "Prefs.PreviewFrames" :PreviewFrames parameter
- "Prefs.RenderFrames" :RenderFrames parameter
- "Prefs.OutputSizeX" :OutputSizeX parameter
- "Prefs.OutputSizeY" :OutputSizeY parameter
- "Align" :Align parameter horizontal=1 vertical=0
- "Primitive" :Primitive type
- "Color" :Color parameter for primitives
- "Text" :Text parameter for 'Text' primitive
- "Shape" :Shape parameter for 'Shape' primitive
- "Font" :Font parameter for 'Text' primitive
- "File" :Filename for 'Image' primitive
- "FontSize" :FontSize parameter for 'Text' primitive
- "Italic" :Italic parameter for 'Text' primitive
- "Bold" :Bold parameter for 'Text' primitive
- "PrimFill" :Fill parameter for 'Shape' primitive
- "PrimGridSize" :GridSize parameter for 'Shape' primitive
- "PrimGridVisible" :Grid Visible parameter for 'Shape' primitive
- "PrimGridEnable" :Grid Enable parameter for 'Shape' primitive
- "Aspect" :Aspect parameter for primitives
- "Emboss" :Emboss parameter for primitives
- "TextureType" :Texture Type parameter for primitives
- "Texture" :Texture parameter for primitives
- "TexZoom" :Texture Zoom parameter for primitives
- "Specular" :Specular parameter for primitives
- "Diffuse" :Diffuse parameter for primitives
- "Width" :Width prameter for primitives
- "Ambient" :Ambient parameter for 'Sphere' primitive
- "AngleStep" :Angle Step parameter for 'RadLine' or 'WaveCircle' primitives
- "SpecularWidth" :Specular Width parameter for primitives
- "Round" :Round parameter for primitives
- "Length" :Length parameter for primitives
- "Antialias" :Antialias parameter
- "AnimUnfold" :Unfold parameter
- "AnimStep" :Anim Step parameter
- "OffsetX1" :OffsetX for first frame
- "OffsetX2" :OffsetX for the last frame
- "OffsetY1" :OffsetY for first frame
- "OffsetY2" :OffsetY for the last frame
- "OffsetXAnim" :OffsetX animation enable=1 disable=0
- "OffsetYAnim" :OffsetY animation enable=1 disable=0
- "RotCenterX" :RotCenterX parameter
- "RotCenterY" :RotCenterY parameter
- "Angle1" :Angle parameter for first frame
- "Angle2" :Angle parameter for the last frame
- "AngleAnim" :Angle animation enable=1 disable=0
- "Zoom1" :Zoom parameter for first frame
- "Zoom2" :Zoom parameter for the last frame
- "ZoomAnim" :Zoom animation enable=1 disable=0
- "Alpha1" :Alpha parameter for first frame
- "Alpha2" :Alpha parameter for the last fame
- "AlphaAnim" :Alpha animation enable=1 disable=0
- "Brightness1" :Brightness parameter for first frame
- "Brightness2" :Brightness parameter for the last frame
- "BrightnessAnim" :Brightness animation enable=1 disable=0
- "Contrast1" :Contrast parameter for first frame
- "Contrast2" :Contrast parameter for the last frame
- "ContrastAnim" :Contrast animation enable=1 disable=0
- "Saturation1" :Saturation parameter for first frame
- "Saturation2" :Saturation parameter for the last frame
- "SaturationAnim" :Saturation animation enable=1 disable=0
- "Hue1" :Hue parameter for first frame
- "Hue2" :Hue parameter for the last frame
- "HueAnim" :Hue animation enable=1 disable=0
- "UseMask" :Use AnimMask enable=1 disable=0
- "MaskStart1" :Mask Start parameter for first frame
- "MaskStart2" :Mask Start parameter for the last frame
- "MaskStartAnim" :Mask Start animation enable=1 disable=0
- "MaskStop1" :Mask Stop parameter for first frame
- "MaskStop2" :Mask Stop paremeter for the last frame
- "MaskStopAnim" :Mask Stop animation enable=1 disable=0
- "MaskType" :Mask Type parameter
- "MaskGradation" :Mask Gradation parameter
- "UseFMask" :Use Frame Mask enable=1 disable=0
- "FMaskStart" :Frame Mask Start parameter
- "FMaskStop" :Frame Mask Stop parameter
- "Shadow Offset" :Shadow Offset parameter
- "Shadow Density" :Shadow Density parameter
- "Shadow Diffuse" :Shadow Diffuse parameter
- "EdgeOffset" :Edge Offset parameter
- "EdgeDendisy" :Edge Density parameter
- "LightGradation" :Light Gradation parameter
- "LightDir" :Light Dir parameter
// HorzVert.cpp : KnobMan Plugin
//
// Usage:
// Place the .exe file to 'Plugins' directory
// You can run plugin from 'Plugins' menu.
//
// HorzVert will try convert horizontal slider <=> vertical slider
// BY
// OutputSizeX / OutputSizeY exchange
// Primitive H-Lines/V-Lines change
// Primitive Aspect change
// OffsetX/Y exchange
// RotCenterX/Y exchange
// MaskType Horizontal/Vertical change
//
// May not work properly if you use...
// * non-square image primitives
// * triangle / line primitives
// * angles / mask rotations effects
// But probably help you if need Horizontal/Vertical Sliders
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
float GetValue(HWND hwnd,int iLayer,char *strKey) {
static char str[100];
if(iLayer)
sprintf(str,"KnobManCtl:GetValue Layer%d.%s",iLayer,strKey);
else
sprintf(str,"KnobManCtl:GetValue Prefs.%s",strKey);
SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)str);
SendMessage(hwnd,WM_GETTEXT,100,(LPARAM)str);
return atof(str);
}
char *GetValueText(HWND hwnd,int iLayer,char *strKey) {
static char str[100];
if(iLayer)
sprintf(str,"KnobManCtl:GetValue Layer%d.%s",iLayer,strKey);
else
sprintf(str,"KnobManCtl:GetValue Prefs.%s",strKey);
SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)str);
SendMessage(hwnd,WM_GETTEXT,100,(LPARAM)str);
return str;
}
void SetValue(HWND hwnd,int iLayer,char *strKey,float fVal) {
char str[100];
if(iLayer)
sprintf(str,"KnobManCtl:SetValue Layer%d.%s=%f",iLayer,strKey,fVal);
else
sprintf(str,"KnobManCtl:SetValue Prefs.%s=%f",strKey,fVal);
SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)str);
}
void SetValue(HWND hwnd,int iLayer,char *strKey,char *strVal) {
char str[256];
if(iLayer)
sprintf(str,"KnobManCtl:SetValue Layer%d.%s=%s",iLayer,strKey,strVal);
else
sprintf(str,"KnobManCtl:SetValue Prefs.%s=%s",strKey,strVal);
SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)str);
}
void ExitPlugin(HWND hwnd) {
SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)"KnobManCtl:Exit");
}
int APIENTRY _tWinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR lpCmdLine,int nCmdShow) {
int i,iMaxLayer;
float f,fX,fY;
char str[100];
char *p;
int r;
r=MessageBox(NULL,"HorzVert: Horizontal/Vertical exchange for Sliders.\n\n"
"HorzVert will try convert horizontal slider <=> vertical slider\n"
" BY\n"
" OutputSizeX / OutputSizeY exchange\n"
" Primitive H-Lines/V-Lines change\n"
" Primitive Aspect change\n"
" OffsetX/Y exchange\n"
" RotCenterX/Y exchange\n"
" MaskType Horizontal/Vertical change\n"
"\n"
"May not work properly if you use...\n"
" * non-square image primitives\n"
" * triangle / line primitives\n"
" * angles / mask rotations effects\n"
"But probably help you if need Horizontal/Vertical Sliders\n"
,"HorzVert",MB_OKCANCEL);
if(r==IDCANCEL)
return 0;
HWND hwndTarget=(HWND)atoi(lpCmdLine);
iMaxLayer=(int)GetValue(hwndTarget,0,"Layers");
fX=GetValue(hwndTarget,0,"OutputSizeX");
fY=GetValue(hwndTarget,0,"OutputSizeY");
SetValue(hwndTarget,0,"OutputSizeX",fY);
SetValue(hwndTarget,0,"OutputSizeY",fX);
for(i=1;i<=iMaxLayer;++i) {
p=GetValueText(hwndTarget,i,"Primitive");
if(strcmp(p,"H-Lines")==0)
SetValue(hwndTarget,i,"Primitive","V-Lines");
else if(strcmp(p,"V-Lines")==0)
SetValue(hwndTarget,i,"Primitive","H-Lines");
f=GetValue(hwndTarget,i,"Aspect");
SetValue(hwndTarget,i,"Aspect",-f);
fX=GetValue(hwndTarget,i,"OffsetX1");
fY=GetValue(hwndTarget,i,"OffsetY1");
SetValue(hwndTarget,i,"OffsetX1",fY);
SetValue(hwndTarget,i,"OffsetY1",fX);
fX=GetValue(hwndTarget,i,"OffsetX2");
fY=GetValue(hwndTarget,i,"OffsetY2");
SetValue(hwndTarget,i,"OffsetX2",fY);
SetValue(hwndTarget,i,"OffsetY2",fX);
fX=GetValue(hwndTarget,i,"OffsetXAnim");
fY=GetValue(hwndTarget,i,"OffsetYAnim");
SetValue(hwndTarget,i,"OffsetXAnim",fY);
SetValue(hwndTarget,i,"OffsetYAnim",fX);
fX=GetValue(hwndTarget,i,"RotCenterX");
fY=GetValue(hwndTarget,i,"RotCenterY");
SetValue(hwndTarget,i,"RotCenterX",fY);
SetValue(hwndTarget,i,"RotCenterY",fX);
p=GetValueText(hwndTarget,i,"MaskType");
if(strcmp(p,"Horizontal")==0)
SetValue(hwndTarget,i,"MaskType","Vertical");
else if(strcmp(p,"Vertical")==0)
SetValue(hwndTarget,i,"MaskType","Horizontal");
}
ExitPlugin(hwndTarget);
MessageBox(NULL,"Finished","HorzVert",MB_OK);
return 0;
}
Return

Jpn
Eng
English Entries Feed