The OnRecorderChanged Event

Use the VirtualUI OnRecorderChanged event to listen for any change in the Recorder status.

These are the possible status values:

State

It reports the Recorder state:

The following examples shows how to assign an event handler to this event in the most used languages:

Delphi code:

procedure TMainForm.RecorderChanged(Sender: TObject);

var msg: string;

begin

msg := '';

case VirtualUI.Recorder.State of

Inactive: msg := 'Recorder is inactive';

Playing: msg := 'Recorder is Playing';

Recording: msg := 'Recording session';

end;

ShowMessage(msg);

end;

...

VirtualUI.OnRecorderChanged := Mainform.RecorderChanged;

C++ code:

m_VirtualUI->OnRecorderChanged = RecorderChanged;

void RecorderChanged(void) {

CString stateStr;

switch (m_VirtualUI->Recorder()->State()) {

case Inactive: stateStr = _T("Recorder is inactive"); break;

case Playing: stateStr = _T("Recorder is Playing"); break;

case Recording: stateStr = _T("Recording session"); break;

}

MessageBox(0, stateStr, L"OnRecorderChanged called", 0);

}

C# code:

private void RecorderChanged(object sender, RecorderChangedArgs e)

{

string message = "";

switch (vui.Recorder.State) {

case RecorderState.Inactive:

message = "Recorder is inactive";

break;

case RecorderState.Playing:

message = "Recorder is playing";

break;

case RecorderState.Recording:

message = "Recording session";

break;

}

MessageBox.Show(message, "OnRecorderChanged called");

}

...

vui.OnRecorderChanged += RecorderChanged;

Read more:

· Recording a Session

· Playing Recorded Sessions

· Creating Your Own Player

Last updated