예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 /// <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);
     }
 }
예제 #4
0
        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);
        }
예제 #5
0
 public void Dispose()
 {
     Instance.Dispose();
     KodiBridge.UnregisterEventClass(this);
 }
예제 #6
0
 public string Send()
 {
     Reply = KodiBridge.SendMessage(this.Request);
     OnReply?.Invoke(this, new MessageReplyEventArgs(Reply));
     return(Reply);
 }