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:
Set the record filename to the VirtualUI.Recorder component and call its Rec() method to record an application session. The VirtualUI.Recorder object is used in both the recording and the playing process. These operations can be presented, for example, as two buttons in the application: "Rec" and "Stop".
In order to record a session, follow these steps:
Choose a file name and location for storing the session. Don't include the extension: sessions will be stored automatically as .dat and .idx.
Set the Filename as follows:
Delphi code:
VirtualUI.Recorder.Filename := 'C:\Sessions\VirtualUISession';
C++ code:
VirtualUI m_VirtualUI = new VirtualUI();
...
...
m_VirtualUI->Recorder()->Filename(L"C:\Sessions\VirtualUISession");
C# code:
private VirtualUI vui = new VirtualUI();
...
...
vui.Recorder.Filename = "C:\Sessions\VirtualUISession";
You can specify more than one track for each session. This allows you to, for example, store different application operations. Later, you can play play the complete session or a specific track. These tracks are indicated during the sessions recording. Call the Rec() method and pass the track name as an argument in the Label parameter:
Delphi code:
VirtualUI.Recorder.Rec('Track 1');
C++ code:
m_VirtualUI->Recorder()->Rec(L"Track 1");
C# code:
vui.Recorder.Rec(“Track 1”);
In order to stop the recording, call the Stop method:
Delphi code:
VirtualUI.Recorder.Stop('Track 1');
C++ code:
m_VirtualUI->Recorder()->Stop();
C# code:
Afterwards, you can start another recording with the Rec method. If you keep the same track name, the recording will resume and the session will be stored after the previous session in the same file, in a new track. Change the track name to avoid ending up with two tracks with the same name in the same session recording.
Read more:
Thinfinity® VirtualUI introduces this feature to help users have a record of their own VirtualUI web-enabled applications' sessions.
In order to enable your application to store sessions of a running VirtualUI-enabled application and then play them, VirtualUI includes a new Recorder component, available for all the supported programming languages. Later, you can play this session from the browser using a special VirtualUI application profile, or you could also implement your own custom session player using the SDK in any of the supported languages.
Read more:
·
·
·
·
·
·
·