public static void StartAndroidActivity( string package, string intent = null, string dataType = null, string dataUri = null ) { List <string> arguments = new List <string> { package }; if (intent != null) { arguments.Add(intent); } if (dataType != null) { arguments.Add(dataType); } if (dataType != null) { arguments.Add(dataType); } PythonInterop.CallBuiltin("StartAndroidActivity", arguments); }
/// <summary> /// Runs the python script. /// You must specify the full path to the script. /// As of 2007/02/24, all extra parameters are passed to the script as arguments and can be accessed by python using sys.argv /// </summary> /// <param name="script"> the URL to the python script. </param> /// <param name="args"></param> public static void RunScript(string script, params object[] args) { object[] builtinArgs = new object[args.Length + 1]; builtinArgs[0] = script; Array.Copy(args, 0, builtinArgs, 1, args.Length); PythonInterop.CallBuiltin("RunScript", script, args); }
/// <summary> /// Executes the specified script given its addon-id /// </summary> /// <param name="addonId">the addon-ID to the script add-on</param> /// <param name="args"></param> public static void RunScript(int addonId, params object[] args) { object[] builtinArgs = new object[args.Length + 1]; builtinArgs[0] = addonId; Array.Copy(args, 0, builtinArgs, 1, args.Length); PythonInterop.CallBuiltin("RunScript", addonId, args); }
public static void StartAndroidActivity( string package, string intent = null, string dataType = null, string dataUri = null ) { PythonInterop.CallBuiltin("StartAndroidActivity", package, intent, dataType, dataUri); }
/// <summary> /// Pops up a keyboard dialog and allows the user to input a string which can be used in a label control elsewhere in the skin /// via the info tag Skin.String(string) /// </summary> /// <param name="value">If specified the keyboard dialog does not pop up and the string is set directly.</param> public static void SetString(string setting, object value = null) { List <object> arguments = new List <object> { setting }; if (value != null) { arguments.Add(value); } PythonInterop.CallBuiltin("Skin.SetString", arguments); }
/// <summary> /// Pops up a keyboard dialog and allows the user to input a numerical. /// </summary> /// <param name="value">If specified the keyboard dialog does not pop up and the numeric value is set directly.</param> public static void SetNumeric(object number, object value) { List <object> arguments = new List <object> { number }; if (value != null) { arguments.Add(value); } PythonInterop.CallBuiltin("Skin.SetNumeric", arguments); }
/// <summary> /// Pops up a folder browser and allows the user to select a folder of images to be used in a multi image control else where in the skin /// via the info tag Skin.String(string). /// </summary> /// <param name="folderpath">If specified the file browser will start in that folder</param> public static void SetPath(string setting, string folderpath = null) { List <string> arguments = new List <string> { setting }; if (folderpath != null) { arguments.Add(folderpath); } PythonInterop.CallBuiltin("Skin.SetPath", arguments); }
/// <summary> /// Takes a Screenshot. Only .png files are supported /// </summary> /// <param name="filenameAndPath">filename (including the path)</param> /// <param name="sync">whether to run synchronously</param> public static void TakeScreenshot(string filenameAndPath = null, bool?sync = null) { List <object> arguments = new List <object>(); if (filenameAndPath != null) { arguments.Add(filenameAndPath); } if (sync != null) { arguments.Add(sync); } PythonInterop.CallBuiltin("TakeScreenshot", arguments); }
/// <summary> /// Pops up a file browser and allows the user to select an image file to be used in an image control elsewhere in the skin /// via the info tag Skin.String(string). /// </summary> /// <param name="value">If specified the keyboard dialog does not pop up and the image path is set directly.</param> /// <param name="folderpath">If specified the file browser will start in that folder</param> public static void SetImage(string setting, object value = null, string folderpath = null) { List <object> arguments = new List <object> { setting }; if (value != null) { arguments.Add(value); } if (folderpath != null) { arguments.Add(folderpath); } PythonInterop.CallBuiltin("Skin.SetImage", arguments); }
/// <summary> /// Will display a notification dialog with the specified header and message /// </summary> /// <param name="header"></param> /// <param name="message"></param> /// <param name="duration">length of time in milliseconds</param> /// <param name="iconPath">icon image</param> public static void Notification(string header = "", string message = "", TimeSpan?duration = null, string iconPath = null) { List <string> arguments = new List <string> { header, message }; if (duration != null) { arguments.Add(duration.Value.TotalMilliseconds.ToString()); } if (iconPath != null) { arguments.Add(iconPath); } PythonInterop.CallBuiltin("Notification", arguments); }
/// <summary> /// Send a page down event to the pagecontrol with given id. /// </summary> public static void PageDown() { PythonInterop.CallBuiltin("PageDown"); }
/// <summary> /// Minimizes Kodi /// </summary> public static void Minimize() { PythonInterop.CallBuiltin("Minimize"); }
/// <summary> /// Triggers a scan of local add-on directories. /// </summary> public static void UpdateLocalAddons() { PythonInterop.CallBuiltin("UpdateLocalAddons"); }
/// <summary> /// Runs the specified plugin/script /// </summary> /// <param name="id"></param> public static void RunAddon(int id) { PythonInterop.CallBuiltin("RunAddon", new List <object> { id }); }
/// <summary> /// Force weather data refresh /// </summary> public static void Refresh() { PythonInterop.CallBuiltin("Weather.Refresh"); }
/// <summary> /// Switch to previous weather location /// </summary> public static void LocationPrevious() { PythonInterop.CallBuiltin("Weather.LocationPrevious"); }
/// <summary> /// Reload RSS feeds from RSSFeeds.xml /// </summary> public static void RefreshRSS() { PythonInterop.CallBuiltin("RefreshRSS"); }
/// <summary> /// Send a page up event to the pagecontrol with given id. /// </summary> public static void PageUp() { PythonInterop.CallBuiltin("PageUp"); }
/// <summary> /// Will play the inserted CD or DVD media from the DVD-ROM drive. /// </summary> public static void PlayDVD() { PythonInterop.CallBuiltin("PlayDVD"); }
/// <summary> /// Sets the volume to the percentage specified. Optionally, show the Volume Dialog in Kodi when setting the volume. /// </summary> /// <param name="percent">Volume level</param> /// <param name="showVolumeBar">Show the volume bar</param> public static void SetVolume(int percent, bool showVolumeBar = false) { PythonInterop.CallBuiltin("SetVolume", percent, (showVolumeBar) ? "showVolumeBar" : null); }
public static void Seek(TimeSpan position) { PythonInterop.CallBuiltin("Seek", position.TotalSeconds); }
/// <summary> /// Toggle DPMS mode manually /// </summary> public static void ToggleDPMS() { PythonInterop.CallBuiltin("ToggleDPMS"); }
/// <summary> /// Switch to given weather location /// </summary> /// <param name="locationIndex">A number between 1 and 3</param> public static void LocationSet(int locationIndex) { PythonInterop.CallBuiltin("Weather.LocationSet", locationIndex); }
public static void Seek(TimeSpan position) { PythonInterop.CallBuiltin("Seek", new List <object> { position.TotalSeconds }); }
/// <summary> /// Switch to next weather location /// </summary> public static void LocationNext() { PythonInterop.CallBuiltin("Weather.LocationNext"); }
/// <summary> /// Restarts Kodi (only implemented under Windows and Linux) /// </summary> public static void RestartApp() { PythonInterop.CallBuiltin("RestartApp"); }
/// <summary> /// Open a settings dialog for the addon of the given id /// </summary> /// <param name="id"></param> public static void OpenSettings(int id) { PythonInterop.CallBuiltin("Addon.OpenSettings", new List <object> { id }); }
/// <summary> /// Quits Kodi /// </summary> public static void Quit() { PythonInterop.CallBuiltin("Quit"); }
/// <summary> /// Triggers a forced update of enabled add-on repositories. /// </summary> public static void UpdateAddonRepos() { PythonInterop.CallBuiltin("UpdateAddonRepos"); }
/// <summary> /// Mutes (or unmutes) the volume. /// </summary> public static void Mute() { PythonInterop.CallBuiltin("Mute"); }