Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
 public static void StartAndroidActivity(
     string package,
     string intent   = null,
     string dataType = null,
     string dataUri  = null
     )
 {
     PythonInterop.CallBuiltin("StartAndroidActivity", package, intent, dataType, dataUri);
 }
Ejemplo n.º 5
0
        /// <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);
        }
Ejemplo n.º 6
0
        /// <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);
        }
Ejemplo n.º 7
0
        /// <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);
        }
Ejemplo n.º 8
0
        /// <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);
        }
Ejemplo n.º 9
0
        /// <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);
        }
Ejemplo n.º 10
0
        /// <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);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Send a page down event to the pagecontrol with given id.
 /// </summary>
 public static void PageDown()
 {
     PythonInterop.CallBuiltin("PageDown");
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Minimizes Kodi
 /// </summary>
 public static void Minimize()
 {
     PythonInterop.CallBuiltin("Minimize");
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Triggers a scan of local add-on directories.
 /// </summary>
 public static void UpdateLocalAddons()
 {
     PythonInterop.CallBuiltin("UpdateLocalAddons");
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Runs the specified plugin/script
 /// </summary>
 /// <param name="id"></param>
 public static void RunAddon(int id)
 {
     PythonInterop.CallBuiltin("RunAddon", new List <object> {
         id
     });
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Force weather data refresh
 /// </summary>
 public static void Refresh()
 {
     PythonInterop.CallBuiltin("Weather.Refresh");
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Switch to previous weather location
 /// </summary>
 public static void LocationPrevious()
 {
     PythonInterop.CallBuiltin("Weather.LocationPrevious");
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Reload RSS feeds from RSSFeeds.xml
 /// </summary>
 public static void RefreshRSS()
 {
     PythonInterop.CallBuiltin("RefreshRSS");
 }
Ejemplo n.º 18
0
 /// <summary>
 ///	Send a page up event to the pagecontrol with given id.
 /// </summary>
 public static void PageUp()
 {
     PythonInterop.CallBuiltin("PageUp");
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Will play the inserted CD or DVD media from the DVD-ROM drive.
 /// </summary>
 public static void PlayDVD()
 {
     PythonInterop.CallBuiltin("PlayDVD");
 }
Ejemplo n.º 20
0
 /// <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);
 }
Ejemplo n.º 21
0
 public static void Seek(TimeSpan position)
 {
     PythonInterop.CallBuiltin("Seek", position.TotalSeconds);
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Toggle DPMS mode manually
 /// </summary>
 public static void ToggleDPMS()
 {
     PythonInterop.CallBuiltin("ToggleDPMS");
 }
Ejemplo n.º 23
0
 /// <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);
 }
Ejemplo n.º 24
0
 public static void Seek(TimeSpan position)
 {
     PythonInterop.CallBuiltin("Seek", new List <object> {
         position.TotalSeconds
     });
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Switch to next weather location
 /// </summary>
 public static void LocationNext()
 {
     PythonInterop.CallBuiltin("Weather.LocationNext");
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Restarts Kodi (only implemented under Windows and Linux)
 /// </summary>
 public static void RestartApp()
 {
     PythonInterop.CallBuiltin("RestartApp");
 }
Ejemplo n.º 27
0
 /// <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
     });
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Quits Kodi
 /// </summary>
 public static void Quit()
 {
     PythonInterop.CallBuiltin("Quit");
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Triggers a forced update of enabled add-on repositories.
 /// </summary>
 public static void UpdateAddonRepos()
 {
     PythonInterop.CallBuiltin("UpdateAddonRepos");
 }
Ejemplo n.º 30
0
 /// <summary>
 ///	Mutes (or unmutes) the volume.
 /// </summary>
 public static void Mute()
 {
     PythonInterop.CallBuiltin("Mute");
 }