Inspect and Control PIE
Queued starts and cancellation
As soon as a PIE start request enters the queue, the editor is busy. PIEControl/GetState and GetEditorState distinguish Idle, StartQueued, and Playing, while Stop can cancel a queued start.
Read the state after requesting a start. If it is StartQueued, wait for Playing before taking an action that needs a live session. If you cancel a queued start, read the state again and check that it returns to Idle.