Unit ASswitch

ASSwitcher Component 1.2.1 Copyright © 1997 Andrey Abakumov (aga@oficina.rnd.su) Sergey Hrusch The switch of a type TrackBar, but only round. Can show a scale and values. The component is written under influence of a seen similar by the form component from a package Gadgets for Windows 1.1 Universal Dynamics. Many thanks: Ali Butaev behind component TWave E-mail: alee@datacom.ru Alistair George behind found errors E-mail: bigal@xtra.co.nz and other. Properties: Position - current position on the switch; Max - maximum value (Min - allways zero); PrintValues - to print or not print values (it is better to not print if values more 25) SoundType - disabled playing if SoundType=wssNone of a sound at switching, enabled and (SoundType=wssExe) to keep in EXE the file, enabled and (SoundType=wssWav) to keep in Wav the file, SoundChange - choice of a sound file or sound resource ResourceType - type of a resource if SoundType=wssExe WaveOptions - woSync - The sound is played synchronously and the function does not return until the sound ends. woNoDefault - If the sound can't be found, the function returns silently without playing the default sound. woLoop - The sound will continue to play repeatedly. woNoStop - If a sound is currently playing, the function will immediately return FALSE without playing the requested sound. How to make *.WAV in resource? Create file filename.rc For example: CLICK WAVE filename.wav - CLICK is resource name, WAVE is your filetype, plus filename To create *.res file (brcc32 filename.rc) In Object Inspector, AASwitcher properties must be defined as follows: CLICK WAVE ^^^ - you must specify ResourceType property ^^^^^ - you must specify ResourceName. Also select sound type eg WssEXE } //To include resource in our EXE place after {$R *.DFM} //{$R yourresourcefilename.res} <---Insert the following without the comments(//

Classes

TASSoundFileChange -
TASSwitcher -

Functions

Register -

Types

TWaveOption
TWaveOptions
TWhereSoundStore

Constants

Variables

BigRad
Blick
eA
eAngle
EndA
endX
endY
eX
eY
Flag
hText
i
iGrad
j
midAngle
midAngle1
Offset
Offset2
Offset4
p
p1
p2
p4
PointX
PointX1
PointY
PointY1
Priv
r
R1
RadTick
rGrad
sA
sAngle
sinMidAngle
SmallRad
SoundFile
SoundFile1
StartA
stX
stY
sX
sY
t
t1
t1_
TickCount
TmpAn
TmpAn1
wText
X1
X_
Y1
Y_


Functions


procedure Register;


Types


TWaveOption = (woSync, woNoDefault, woLoop, woNoStop);

TWaveOptions = set of TWaveOption

TWhereSoundStore = (wssExe,wssWav,wssNone);

Constants


Variables

BigRad : Real

Blick : Boolean

eA : TPoint

eAngle : Integer

EndA : Integer

endX : Integer

endY : Integer

eX : Real

eY : Real

Flag : Boolean

hText : Integer

i : Integer

iGrad : Integer

j : Integer

midAngle : Integer

midAngle1 : Real

Offset : Integer

Offset2 : Integer

Offset4 : Integer

p : Real

p1 : Real

p2 : Real

p4 : Real

PointX : Real

CoordPointX, CoordPointY:Integer;

PointX1 : Real

PointY : Real

PointY1 : Real

Priv : Boolean

r : Real

R1 : Real

RadTick : Real

rGrad : Real

sA : TPoint

sAngle : Integer

sinMidAngle : Real

SmallRad : Real

SoundFile : PChar

SoundFile1 : PChar

StartA : Integer

stX : Integer

midX,midY,

stY : Integer

sX : Real

sY : Real

t : Real

t1 : Real

t1_ : Integer

x:Integer;

TickCount : Integer

TmpAn : Integer

TmpAn1 : Integer

wText : Integer

X1 : Integer

X_ : Integer

Y1 : Integer

Y_ : Integer