コード例 #1
0
        public static bool IsSetupAvailable()
        {
            string str = Settings.Instance.Type;

            if (!File.Exists(Config.GetFile(Config.Dir.Config, "MiniDisplay.xml")))
            {
                return(false);
            }
            if (str == null ||
                (str != "DebugForm" && str != "iMONLCDg" && str != "MatrixMX" && str != "MatrixGX" && str != "VLSYS_Mplay"))
            {
                return(false);
            }
            if (Settings.Instance.DisableGUISetup)
            {
                return(false);
            }
            bool enabled = false;

            using (Profile.Settings xmlreader = new Profile.MPSettings())
            {
                enabled = MediaPortal.GUI.Library.PluginManager.IsPluginNameEnabled2("MiniDisplay");
            }
            return(enabled);
        }
コード例 #2
0
 //This function is broken cause it simply calls IsAnyCardRecording
 //We just left it here for compatibility.
 public static bool IsCaptureCardViewing()
 {
     if (!UseTVServer)
     {
         return(false);
     }
     //See if any card is timeshifting?
     return((bool)DynaInvoke.InvokeMethod(Config.GetFolder(Config.Dir.Base) + @"\TvControl.dll", "TvServer", "IsAnyCardRecording", null));
 }
コード例 #3
0
        public static bool IsCaptureCardRecording()
        {
            if (!UseTVServer)
            {
                return(false);
            }

            //Now see if we are recording
            return((bool)DynaInvoke.InvokeMethod(Config.GetFolder(Config.Dir.Base) + @"\TvControl.dll", "TvServer", "IsAnyCardRecording", null));
        }
コード例 #4
0
        private void LoadExternalPlayers()
        {
            Log.Info("Loading external players plugins");
            string[] fileList = Util.Utils.GetFiles(Config.GetSubFolder(Config.Dir.Plugins, "ExternalPlayers"), "dll");
            foreach (string fileName in fileList)
            {
                try
                {
                    Assembly assem = Assembly.LoadFrom(fileName);
                    if (assem != null)
                    {
                        Type[] types = assem.GetExportedTypes();
                        foreach (Type t in types)
                        {
                            try
                            {
                                if (t.IsClass)
                                {
                                    if (t.IsSubclassOf(typeof(IExternalPlayer)))
                                    {
                                        if (!CompatibilityManager.IsPluginCompatible(t))
                                        {
                                            Log.Error(
                                                "  external player: {0} is tagged as incompatible with the current MediaPortal version and won't be loaded!",
                                                t.FullName);
                                            continue;
                                        }

                                        object newObj = (object)Activator.CreateInstance(t);
                                        Log.Info("  found plugin:{0} in {1}", t.ToString(), fileName);

                                        IExternalPlayer player = (IExternalPlayer)newObj;
                                        Log.Info("  player:{0}.  author: {1}", player.PlayerName, player.AuthorName);
                                        _externalPlayerList.Add(player);
                                    }
                                }
                            }
                            catch (Exception e)
                            {
                                Log.Info("Error loading external player: {0}", t.ToString());
                                Log.Info("Error: {0}", e.StackTrace);
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Log.Info("Error loading external player: {0}", e);
                }
            }
            _externalPlayersLoaded = true;
        }