hedgewars/uVideoRec.pas
changeset 15272 22f2fd8a3d2c
parent 14957 8e4e508d153c
child 15341 f53bfe04065e
equal deleted inserted replaced
15271:b58f98bbc120 15272:22f2fd8a3d2c
    46 
    46 
    47 procedure initModule;
    47 procedure initModule;
    48 procedure freeModule;
    48 procedure freeModule;
    49 
    49 
    50 implementation
    50 implementation
    51 uses uVariables, GLunit, SDLh, SysUtils, uUtils, uIO, uMisc, uTypes, uDebug;
    51 uses uVariables, GLunit, SDLh, SysUtils, uUtils, uSound, uIO, uMisc, uTypes, uDebug;
    52 
    52 
    53 type TAddFileLogRaw = procedure (s: pchar); cdecl;
    53 type TAddFileLogRaw = procedure (s: pchar); cdecl;
    54 const AvwrapperLibName = 'libavwrapper';
    54 const AvwrapperLibName = 'libavwrapper';
    55 
    55 
    56 function AVWrapper_Init(
    56 function AVWrapper_Init(
   284     frequency, channels: LongInt;
   284     frequency, channels: LongInt;
   285     result: LongInt;
   285     result: LongInt;
   286 begin
   286 begin
   287     result:= 0;
   287     result:= 0;
   288     AddFileLog('BeginPreRecording');
   288     AddFileLog('BeginPreRecording');
       
   289     // Videos don't work if /lua command was used, so we forbid them
       
   290     if luaCmdUsed then
       
   291         begin
       
   292         // TODO: Show message to player
       
   293         PlaySound(sndDenied);
       
   294         AddFileLog('Pre-recording prevented; /lua command was used before');
       
   295         exit;
       
   296         end;
   289 
   297 
   290     thumbnailSaved:= false;
   298     thumbnailSaved:= false;
   291     RecPrefix:= 'hw-' + FormatDateTime('YYYY-MM-DD_HH-mm-ss-z', TDateTime(Now()));
   299     RecPrefix:= 'hw-' + FormatDateTime('YYYY-MM-DD_HH-mm-ss-z', TDateTime(Now()));
   292 
   300 
   293     // If this video is recorded from demo executed directly (without frontend)
   301     // If this video is recorded from demo executed directly (without frontend)