REST InsertFile + AutoCue

Hey everyone,

I want to execute an "insert-"command via REST and this file has to be auto-cued. How can I do it?

command: “InsertFile C:\Track\music2039.mp3”

You must define your own INSERTFILE command in a background script:

procedure OnExecuteCommand(Command: string);
var
  pi: IPlaylistItem;
begin
  if copy(command, 1, 11) = 'INSERTFILE ' then begin
    pi := Factory.CreatePlaylistItemFromFile(copy(command, 12, maxint), AllFileImportTasks);
    CurrentPlaylist.Insert(CurrentPlaylist.GetNextIndex, pi);
  end;
end;

begin
end.

(untested)

Thx for your support.

“maxint” and “AllFileImportTasks” doesn’t work. So I change them and it works now.

[code]procedure OnExecuteCommand(Command: string);
var
pi: IPlaylistItem;
begin
if copy(command, 1, 11) = 'INSERTFILE ’ then begin
pi := Factory.CreatePlaylistItemFromFile(copy(command, 12, 255), [fitAutoCue]);
CurrentPlaylist.Insert(CurrentPlaylist.GetNextIndex, pi);
end;
end;

begin
end.[/code]