General info | Getting started | Samples | Components reference | FAQ | Solutions |

Components reference


Acts as both server and client components and useful for chat (voice, text) applications development.

Set Active property to True to activate Server mode. In this mode component can receive and respond on remote connection requests. Set Active to False to deactivate the Server.

Use Connect and Disconnect methods to interact with remote servers. Whenever you call the Connect method, component will switch to Client mode, and try to connect to remote side. After successful connection, component will stay in this mode until Disconnect method is called, Active property is set to False, or remote side drops the connection. In any case component will switch back to Server mode. The only exception is when you set Active property to False, in which case component will be deactivated.

To send and receive text messages use SendText method and OnReceiveText event.


IvcproMediaGateEvents (IDispatch)
Can be implemeted by client to hook events
void OnAcceptClient(long ConnId, bool* accept)Fires when server accepts new client connection. Set the accept parameter to True to accept connection. Call GetClientParam method to receive client parameters, such as ip-address, port number, etc.
void OnClientConnect(long ConnId)Fires when new client connects to server
void OnClientDisconnect(long ConnId)Fires when client disconnects from server
void OnReceiveText(long ConnId, BSTR Text)Fires when component receives a text from remote side.

Dispatch interface for MediaGate component
void Connect(BSTR host)Call this method to switch component to Client mode, and try to connect to remote side
void Disconnect()Closes connection with remote side and switches component to Server mode
void DisconnectClient(long ConnId)Disconnects client from server using client connection ID
bool FormatChoose(BSTR Title, long Handle)Creates an ACM-defined dialog box that enables the user to select a waveform-audio format. Title parameter indicates dialog's title, Handle - parent handle of dialog window. If Handle is 0 then ActiveX component handle is used
long GetClientConnId(long ClientIndex)Returns ClientId for given index. ClientIndex may be from 0 to ClientCount - 1
BSTR GetClientParam(long ConnId, vcClientParam ParamType)Returns client parameter such as ip-address, port number etc. using client connection ID and param type
bool GetInternalActive(vcMediaGateInternal Internal)Returns True if internal component (WaveIn, CodecIn, IpServer, IpClient, CodecOut, WaveOut) is active
long GetVolume(bool VolumeIn, long Channel)Returns current volume value. Result values range is 0...300 (logarithmic scale). VolumeIn parameter indicates recording (True) or playback (False) volume level
void SendText(long ConnId, BSTR text)Sends text message to client indicated by ConnId parameter over network. If component is in client mode, ConnId parameter is ignored
void SetInternalActive(vcMediaGateInternal Internal, bool Active)Set value for Active property of internal component
bool ActiveSet to true to activate (open) the component. All other properties should be set to proper values before activation. Set to false to deactivate (close) the component
BSTR BindToSpecifies the IP address the socket should bind to. Default '' means that the socket should bind to the first available network interface.
long BytesReceivedReturns number or bytes component has received from the network
long BytesSentReturns number or bytes component has sent to the network
long ClientCountReturns current number of clients connected
BSTR ConversationFileNameFile name (.wav) to save conversation in
bool ConversationSaveToFileWhen true saves conversation to .wav file on disk
long DataSizeInReturns data written into but not yet processed by the pipe
long DataSizeOutReturns data size available to read from the pipe
long DeviceIdSpecifies device ID for the wave device
bool EnablePlaybackEnables or disables audio playback
bool EnableRecordingEnables or disables audio recording
long FormatTagSpecifies audio format tag for the wave device
bool IsFormatProviderWhen true the component will assign stream format to the consumer (if any). This simplifies the process of distributing stream format among linked components. For example WaveRiff component can assign PCM format to linked WaveOutDevice component, so WAVe file will be played back correctly
bool IsClientActiveIndicates if client is active
bool IsServerActiveIndicates if server is active
long MaxClientsSpecifies maximum number of clients that can connect to server. "-1" value means no limit, "0" value means no clients
long MinActiveTimeSpecifies the minimum amount of time (in milliseconds) for recorder to be active once activated
long MinVolumeLevelMinimum volume level for recording
long PcmBitsPerSampleSpecifies number of bits per sample for wave device
long PcmNumChannelsSpecifies number of channels per sample for wave device
long PcmSamplesPerSecSpecifies number of samples per second for wave device
BSTR PortSpecifies port number for the client/server TCP/IP socket
unaProtoType ProtoSpecifies Proto for the TCP/IP socket (TCP or UDP)
bool SyncEventsSpecifies whether events calls synchronized through main thread

See also...

Base interfaces

Wave processing components:
WaveIn, WaveOut, WaveCodec, WaveRiff, WaveMixer, WaveResampler, Equalizer, WaveMultiBandSplitter

Legacy IP components:
IpServer, IpClient, IpBroadcastServer, IpBroadcastClient, ConferenceServer

RTP streaming components:
IPReceiver, IPTransmitter, RTPConfClient, RTPConfServer

Misc. components:
VolumeControl, DisplayBands

VCX Library 3.0 © 2012 Lake of Soft
All rights reserved.