Since DANCE 1.5a, it is possible to define your own feet shape instead of the predefined, by binding a new foot paint procedure with a DLL. With this interface, you can also change the names of the "Styles of Steps"
DANCE - the dance patterns database is a relatvly stable program. This might be different, using unknown code - although I filter wrong inputs.
I do not take any responsibility for the contents
and use of unknown DLL's
- the reasons are understandable, aren't they.
{$F+}{FAR calls must be used}
library Dncfform;
uses wintypes,winprocs; {include necessary
units}
type
screen_coordinates_function = function (r : real) : longint;
var
xb,yb : screen_coordinates_function;
function dummy_xb(r : real) : longint; begin dummy_xb := trunc(r);
end;
function dummy_yb(r : real) : longint; begin dummy_yb := trunc(r); end;
{function with which you can change the contents
of the "Style of Steps" Comboboxes}
function
DANCE_ModidyString : string; export;
begin
DANCE_ModidyString := 'normal step/jump';
end;
{Prozedure, die die Adressen der
Koordinaten-Funktionen von DANCE ausliest procedure with sets the addresses
of the coordinates functions}
procedure
DANCE_RemoteProcedure(x,y : tfarproc); export;
begin try @xb := x; @yb := y; except xb := dummy_xb; yb := dummy_yb; end;
end;
{the most important part of the DLL - the paint
procedure}
procedure
DANCE_MyShowFuss(surface : hdc; pair,dancer,foot : byte; x,y,a : word;
styleofstep : byte); export;
begin
try
{write down your paint commands
here}
except
end;
end;
exports
DANCE_MyShowFuss index 1,
DANCE_RemoteProcedure index 2,
DANCE_ModidyString index 3;
begin
xb := dummy_xb; yb := dummy_yb;
end.
As there are not Delphi specific commands used in this function, you can use other languages to create your own feet form DLL. I have only tested this structure with Delphi 1.0. As DANCE is a 16 bit program, the feet form DLL should be the same.
type
screen_coordinates_function = function (r : real) : longint;
xb,yb : screen_coordinates_function;
xb ( ) and yb ( ) which calculate the koordinates on the canvas from the coordinates on the dance floor. Therefore they must joined to DANCE by the DANCE_RemoteProcedure . This happens automatically, then the DLL is loaded.
function
DANCE_ModidyString : string; export;
With the help of this function, you can change the contence of the "style of step" comboboxes, so that they fit to your new painting methode. This function is called automatically, too, when the DLL is loaded. It must return a string, which contains the different "styles of steps", seperated by a "/".
procedure
DANCE_RemoteProcedure(x,y : tfarproc);
export;
This procedure is called when the DLL is loaded, to get the adresses of the
funktions xb
and xb
from the DANCE main modul.
procedure
DANCE_MyShowFuss(surface : hdc; pair,dancer,foot : byte; x,y,a : word;
styleofstep : byte);
export;
The function DANCE_MyShowFuss is the basic function of the feet form DLL.
It has the following parameters:
surface | This parameter describes the canvas and is a HDC handle. You can paint on it whit GDI functions. | ||||||||
pair | Contains the number of the dancepair | ||||||||
dancer | This paramter has two values: 1 (= gent) or 2 (= lady) | ||||||||
foot | This parameter has also two values: 1 (= left foor) or 2 (= right foot) | ||||||||
x | x is the x-coordinate of the feet in mm on the dancefloor and can vary between 0 and 1200. You can calculate the coordinate on the canvas with the function xb(x) | ||||||||
y | y is the y-coordinate of the feet in mm on the dancefloor and can vary between 0 and 1200. You can calculate the coordinate on the canvas with the function yb(y) | ||||||||
a | a is the angle of the foot and can vary form 0 to 360. 0 is equal to a foot pointing to the top. | ||||||||
styleofstep |
|
In the unregistered version of DANCE, there is always (dancer =1) and (styleofstep = 0 or styleofstep > 99)
Including your feet form DLL to a DNC file is really simply. You must only insert the command
\fussform_dll{<name of DLL>}
in your DNC file in front of "\schritt{0}
". Do not use
quotation marks when when writing the name of the DLL e.g.
\fussform_dll{ffdemo.dll}