Skip to content

ISelection Interface

Current selection in the application. Use this interface to get and set the current selection in the video catalog.

Methods

Video Selection

Method Returns Description
GetSelectedVideos() List<long> Get a list of currently selected video IDs. Returns empty list if no selection.
SetSelectedVideos(List<long> new_selection) void Set the selected videos in the program
SetSelectedVideo(long video_id) void Select one video in the catalog window
SetNoSelectedVideo() void Clear video selection

Thumbnail Selection

Method Returns Description
GetSelectedThumbnails() List<long> Get a list of currently selected thumbnail IDs
SetSelectedThumbnails(List<long> new_selection) void Set the selected thumbnails
SetSelectedThumbnail(long thumbnail_id) void Select one thumbnail

Playlist Selection

Method Returns Description
GetSelectedPlaylist() VideoPlaylist Get currently selected playlist. Returns null if none selected.
SetSelectedPlaylist(long playlist_id) void Set the currently selected playlist
SetSelectedPlaylistClip(int clip_id) void Set the currently selected playlist clip

Bin Selection

Method Returns Description
GetSelectedBin() Bin Get currently selected bin. Returns null if none selected.
SetSelectedBin(long bin_id) void Set the currently selected bin

Actor Selection

Method Returns Description
GetSelectedActor() Actor Get currently selected actor. Returns null if none selected.
SetSelectedActor(long actor_id) void Set the currently selected actor

Example

ISelection selection = scripting.GetSelection();

// Get all selected videos
List<long> videoIds = selection.GetSelectedVideos();
console.WriteLine($"Selected {videoIds.Count} videos");

// Select a specific video
selection.SetSelectedVideo(123);

// Work with playlists
var playlist = selection.GetSelectedPlaylist();
if (playlist != null)
{
    console.WriteLine($"Selected playlist: {playlist.Name}");
}

See Also