Skip to content

IGUI Interface

Program user interface. Use this interface to refresh the user interface after updating the catalog.

Methods

Method Returns Description
Refresh(string hint) void Refresh windows. Pass empty string for all, or "bin,playlist,companion" for limited refresh
RunCommand(string command_name) void Run a command (anything you can bind a hotkey to)
SetQuery(VideoQuery video_query, SceneQuery scene_query) void Run a query and set it to the UI. Pass null for scene_query to only search videos
IsWindowOpened(string WindowName) bool Check if a window is opened
SetCancelSupported(bool can_cancel) void Tell the UI if the script can be cancelled
IsCancelRequested() bool Check if user has requested to cancel the script
SetProgress(int value, int min, int max, string message) void Update console progress bar. Pass -1 for value to hide.

Window Names

The following window names can be used with IsWindowOpened():

Window Name Description
VideoDetail Video details panel
Attract Attract mode
AttractCover Attract cover mode
VideoWall Video wall view
AttractWall Attract wall mode
Player Video player
SelectedVideo Selected video panel
Help Help window
Scene Scene browser
Console Script console
CompanionImages Companion images
CompanionImageBrowser Companion image browser
Covers Cover view
Preview Preview window
Keywording Keywording panel
Documentation Documentation
Actions Actions panel
Cast Cast panel
Folder Folder browser
Search Search panel
Videos Videos list
Bins Bins panel
AddVideos Add videos dialog
Actors Actors panel
Playlist Playlist panel

Example

IGUI gui = scripting.GetGUI();

// Show progress
gui.SetCancelSupported(true);
for (int i = 0; i <= 100; i += 10)
{
    if (gui.IsCancelRequested())
    {
        console.WriteLine("Cancelled by user");
        break;
    }
    gui.SetProgress(i, 0, 100, $"Processing... {i}%");
    // Do work...
}
gui.SetProgress(-1, 0, 100, ""); // Hide progress

// Refresh the UI after changes
gui.Refresh("");

// Check if player is open
if (gui.IsWindowOpened("Player"))
{
    console.WriteLine("Player is open");
}

See Also