public XbmcPlayer() { this.Instance = PyVariableManager.Get.NewVariable(evalCode: "self.new_player()"); // We now register this type so that PostEvent will be able to invoke onMessage in this class Console.WriteLine("=> Registering EventClass " + typeof(XbmcPlayer).FullName); KodiBridge.RegisterPlayer(this); }
public Player() { PyEventClassBuilder cb = new PyEventClassBuilder("xbmc.Player", typeof(Player)); cb.Methods.AddRange(this.eventNames); cb.Install(); this.Instance = cb.NewInstance(flags: PyVariableFlags.Player); Console.WriteLine("=> Registering EventClass " + typeof(Player).FullName); KodiBridge.RegisterEventClass(typeof(Player), this); }
/// <summary> /// Deletes the specified python variable /// </summary> /// <param name="variableName">Name of the variable to delete</param> public static void DestroyVariable(string variableName) { if (_variables.ContainsKey(variableName)) { Messages.PythonDeleteVariableMessage msg = new Messages.PythonDeleteVariableMessage { VariableName = variableName }; KodiBridge.SendMessage(msg); _variables.Remove(variableName); } }
public Monitor() { PyEventClassBuilder cb = new PyEventClassBuilder("xbmc.Monitor", typeof(Monitor)); cb.Methods.AddRange(this.eventNames); cb.Install(); this.Instance = cb.NewInstance(flags: PyVariableFlags.Monitor); // We now register this type so that PostEvent will be able to invoke onMessage in this class Console.WriteLine("=> Registering EventClass " + typeof(Monitor).FullName); KodiBridge.RegisterEventClass(typeof(Monitor), this); }
public void Dispose() { Instance.Dispose(); KodiBridge.UnregisterEventClass(this); }
public string Send() { Reply = KodiBridge.SendMessage(this.Request); OnReply?.Invoke(this, new MessageReplyEventArgs(Reply)); return(Reply); }