Home Units Hierarchy Routines All identifiers

Class unavclScriptor

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unavclScriptor = class(tComponent)

Description

The syntax of VC 2.5 Pro script is simple.

1) Creating a component 2) Assigning property value 3) Special commands 4) General syntax issues

———————- 1) Creating a component ———————-

To create a component, specify component's name and the base class you with to create:

<componentName> = <baseClassName>;

For example, to create a recording device component use the following operator:

myRecorder = unavclWaveInDevice;

The following base class names are supported:

// wave classes // unavclWaveInDevice - wave in device (recorder) component unavclWaveOutDevice - wave out device (playback) component

unavclWaveCodecDevice - Audio Compression Manager (ACM) codec device component unavclWaveRiff - WAVe reader and writer component unavclWaveMixer - PCM mixer device component unavclWaveResampler - PCM resampler device component

// IP classes // unavclIPClient - IP (TCP/UDP) client component unavclIPServer - IP (TCP/UDP) server component

unavclIPBroadcastClient - IP (UDP) broadcast client component unavclIPBroadcastServer - IP (UDP) broadcast server component

—————————- 2) Assigning property values —————————-

To assign a value for component's property, use the following operator:

<componentName>.<propertyName> = <value>;

Following properties are supported:

'className', // RO: string - all classes 'name', // RW: string - all classes

'availableDataLenIn', // RO: unsigned - all VC classes 'availableDataLenOut', // RO: unsigned - all VC classes 'inBytes', // RO: int64 - all VC classes 'outBytes', // RO: int64 - all VC classes

'active', // RW: bool - all VC classes 'consumer', // RW: component - all VC classes 'dumpInput', // RW: strign - all VC classes 'dumpOutput', // RW: string - all VC classes 'isFormatProvider', // RW: bool - all VC classes 'autoActivate', // RW: bool - all VC classes

'onDataAvailable', // RW: event - all VC classes

'deviceId', // RW: integer - all VC WAVE classes 'formatTag', // RW: unsigned - all VC WAVE classes 'formatTagImmunable', // RW: bool - all VC WAVE classes 'mapped', // RW: bool - all VC WAVE classes 'direct', // RW: bool - all VC WAVE classes 'overNum', // RW: unsigned - all VC WAVE classes 'realTime', // RW: bool - all VC WAVE classes 'loop', // RW: bool - all VC WAVE classes 'inputIsPcm', // RW: bool - all VC WAVE classes 'pcm_SamplesPerSec', // RW: unsigned - all VC WAVE classes 'pcm_BitsPerSample', // RW: unsigned - all VC WAVE classes 'pcm_NumChannels', // RW: unsigned - all VC WAVE classes 'calcVolume', // RW: bool - all VC WAVE classes

'addSilence', // RW: bool - TunavclMixer and TunavclResampler

'minActiveTime', // RW: unsigned - TunavclWaveInDevice 'minVolumeLevel', // RW: unsigned - TunavclWaveInDevice

'isInput', // RW: bool - TunavclWaveRiff 'fileName', // RW: string - TunavclWaveRiff

'dst_SamplesPerSec', // RW: unsigned - TunavclWaveResampler 'dst_BitsPerSample', // RW: unsigned - TunavclWaveResampler 'dst_NumChannels', // RW: unsigned - TunavclWaveResampler

'port', // RW: string - all VC IP classes

'host', // RW: string - all VC TCP/IP classes 'proto', // RW: string - all VC TCP/IP classes

'waveFormatTag', // RW: unsigned - all VC UDP BROADCAST classes 'waveSamplesPerSec', // RW: unsigned - all VC UDP BROADCAST classes 'waveNumChannels', // RW: unsigned - all VC UDP BROADCAST classes 'waveNumBits', // RW: unsigned - all VC UDP BROADCAST classes

'packetsSent', // RO: unsigned - TunavclIPBroadcastServer

'packetsLost', // RO: unsigned - TunavclIPBroadcastClient 'packetsReceived', // RO: unsigned - TunavclIPBroadcastClient 'remoteHost', // RO: unsigned - TunavclIPBroadcastClient 'remotePort' // RO: unsigned - TunavclIPBroadcastClient

To specify boolean value, use 'true' or 'false' keywords, for example:

myRecorder.active = true; // activate recorder

This assigns boolean value 'true' to the active property of myRecorder component.

To specify string value, enclose it into ' ' (single quotes). Double single quote ('') inside the string indicates one single quote.

proto property can has 'TCP' or 'UDP' values only.

You can reference the component by it's name:

myPlayback = unavclWaveOutDevice; myRecorder.consumer = myPlayback; // link recorder to payback device, making a loop

You can also use 'null' keyword to remove the consumer or destroy the component:

myRecorder.consumer = null; // assigns nil to consumer (removes consumer) myPlayback = null; // destroys myPlayback component

——————- 3) Special commands ——————-

There are also several commands which executes some special action:

<command>;

Following commands are recognized:

clear; // clears all created components pause; // pauses execution of script for 1 second

———————— 4) General syntax issues ————————

All operators, component names and keywords are NOT case sensitive.

Operators must be terminated by ";" symbol.

Comments should be enclosed in a pair of curved bracers, or started with // sequence.

Hierarchy

Overview

Methods

Public destructor Destroy(); override;
Public function executeScript(const script: string): HRESULT;
Public function getComponentName(index: unsigned; out componentName: string): HRESULT;
Public function getComponentProperty(const componentName, propertyName: string; out value: string): HRESULT;
Public function getErrorCodeString(code: HRESULT): string;
Public function setComponentProperty(const componentName, propertyName: string; const value: string): HRESULT;
Public procedure AfterConstruction(); override;
Protected procedure Notification(component: tComponent; operation: tOperation); override;

Properties

Public property componentCount: unsigned read getComponentCount;
Public property errorLine: unsigned read f_errorLine;
Published property onScriptExecute: tNotifyEvent read f_onSE write f_onSE;

Description

Methods

Public destructor Destroy(); override;
 
Public function executeScript(const script: string): HRESULT;

Executes the script.

Parameters
script
Script text to execute.
Returns

S_OK if no error ocurred.

Public function getComponentName(index: unsigned; out componentName: string): HRESULT;

Returns component name.

Parameters
index
Index of component (from 0 to unavclScriptor.componentCount - 1).
componentName
[OUT]Component name.
Returns

S_OK if successfull.

Public function getComponentProperty(const componentName, propertyName: string; out value: string): HRESULT;

Returns component's property.

Parameters
componentName
Specifies component.
propetyName
Specifies component's property.
value
[OUT] Property value.
Returns

S_OK if successfull.

Public function getErrorCodeString(code: HRESULT): string;

Returns error string.

Parameters
code
Error code to retrieve error text for.
Returns

Error string for specified error code.

Public function setComponentProperty(const componentName, propertyName: string; const value: string): HRESULT;

Sets component's property value.

Parameters
componentName
Specifies component.
proprtyName
Specifies component's property.
value
Property value.
Returns

S_OK if successfull.

Public procedure AfterConstruction(); override;
 
Protected procedure Notification(component: tComponent; operation: tOperation); override;
 

Properties

Public property componentCount: unsigned read getComponentCount;

Number of components.

Public property errorLine: unsigned read f_errorLine;

Line number where error ocurred.

Published property onScriptExecute: tNotifyEvent read f_onSE write f_onSE;

Fired before script is about to be executed.

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09