Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Mar 6, 2022
1 parent 7f9227b commit 1454aaf
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
Binary file modified librecorder32.dll
Binary file not shown.
Binary file modified librecorder64.dll
Binary file not shown.
39 changes: 33 additions & 6 deletions recorder.simba
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
procedure StartRecording(Window: PtrUInt; Seconds: Integer; Directory: String; Debugging: Boolean = False);
const
RECORDING_SCRIPT := IncludeTrailingPathDelimiter({$macro CURRENT_DIRECTORY}) + 'dorecording.simba';
type
TRecorder = record
PID: Integer;
Debugging: Boolean;
end;

var
Recorder: TRecorder;

procedure TRecorder.Start(Window: PtrUInt; Seconds: Integer; Directory: String); overload;

function ScriptPID: Integer;
begin
{$IFDEF SIMBA1400}
Result := GetProcessID()
{$ELSE}
Result := GetScriptPID();
{$ENDIF}
end;

function RecorderScript: String;
begin
Result := IncludeTrailingPathDelimiter({$macro CURRENT_DIRECTORY}) + 'subprocess.simba';
end;

begin
RunScript(RECORDING_SCRIPT, [
'ScriptPID=' + ToString({$IFDEF SIMBA1400}GetProcessID(){$ELSE}GetScriptPID(){$ENDIF}),
Self.PID := RunScript(RecorderScript(), [
'ScriptPID=' + ToString(ScriptPID()),
'Window=' + ToString(Window),
'Seconds=' + ToString(Seconds),
'Directory=' + ToString(Directory),
'Debugging=' + ToString(Debugging)
'Debugging=' + ToString(Self.Debugging)
]);
end;

procedure TRecorder.Start(Seconds: Integer; Directory: String); overload;
begin
Start(GetTargetWindow(), Seconds, Directory);
end;
2 changes: 1 addition & 1 deletion dorecording.simba → subprocess.simba
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ end;

function GetTerminated(Sender: TRecorder): Boolean;
begin
Result := not IsProcessRunning(PID);
Result := (not IsProcessRunning(PID)) or (not Client.GetIOManager().TargetValid());
end;

function GetParam(Name: String): Variant;
Expand Down

0 comments on commit 1454aaf

Please sign in to comment.