Пример #1
0
    void OnEnable()
    {
        if (!SystemInfo.graphicsDeviceVersion.StartsWith("OpenGL"))
        {
            enabled = false;
            return;
        }

        sdiEnabled     = false;
        InputCoroutine = SdiInputCoroutine();


#if !UNITY_EDITOR
        if (!GLNvSdiOptions.Load(UtyGLNvSdi.ConfigFileName, ref options))
        {
            GLNvSdiOptions.Save(UtyGLNvSdi.ConfigFileName, options);
        }
#endif

        if (options.logToFile)
        {
            UtyGLNvSdi.SdiSetupLogFile();
        }

        options.inputCaptureFields = false;

        StartCoroutine(InputCoroutine);
    }
Пример #2
0
    void OnEnable()
    {
        if (!SystemInfo.graphicsDeviceVersion.StartsWith("OpenGL"))
        {
            enabled = false;
            return;
        }

        sdiEnabled  = false;
        IOCoroutine = SdiIOCoroutine();

        timeCodeData = new int[8] {
            0, 0, 0, 0, 0, 0, 0, 0
        };
        timeCodeHandle = GCHandle.Alloc(timeCodeData, GCHandleType.Pinned);

#if !UNITY_EDITOR
        if (!GLNvSdiOptions.Load(UtyGLNvSdi.ConfigFileName, ref options))
        {
            GLNvSdiOptions.Save(UtyGLNvSdi.ConfigFileName, options);
        }
#endif

        if (options.logToFile)
        {
            UtyGLNvSdi.SdiSetupLogFile();
        }

        StartCoroutine(IOCoroutine);
    }
Пример #3
0
 static public bool Load(string xmlFileName, ref GLNvSdiOptions rOptions)
 {
     try
     {
         XmlSerializer        xmlReader  = new XmlSerializer(typeof(GLNvSdiOptions));
         System.IO.TextReader textReader = new System.IO.StreamReader(xmlFileName);
         rOptions = (GLNvSdiOptions)xmlReader.Deserialize(textReader);
         textReader.Close();
         return(true);
     }
     catch (System.Exception e)
     {
         UnityEngine.Debug.LogError("Error: " + e.Message);
         return(false);
     }
 }
Пример #4
0
    static public bool Save(string xmlFileName, GLNvSdiOptions options)
    {
        try
        {
            System.IO.FileInfo fileInfo = new System.IO.FileInfo(xmlFileName);
            if (!fileInfo.Exists)
            {
                System.IO.Directory.CreateDirectory(fileInfo.Directory.FullName);
            }

            XmlSerializer        serializer = new XmlSerializer(typeof(GLNvSdiOptions));
            System.IO.TextWriter textWriter = new System.IO.StreamWriter(xmlFileName);
            serializer.Serialize(textWriter, options);
            textWriter.Close();
            return(true);
        }
        catch (System.Exception e)
        {
            UnityEngine.Debug.LogError("Error: " + e.Message);
            return(false);
        }
    }
Пример #5
0
    void Start()
    {
        if (utySdi == null)
        {
            utySdi = FindObjectOfType <UtyGLNvSdi>();
        }

        if (utySdi == null)
        {
            Debug.LogError("Could not find sdi object. Disabling sdi UI");
            enabled = false;
            return;
        }

        options = utySdi.options;

        OnReloadUI();

        Invoke("OnResetDropFramesIn", 3.0f);
        Invoke("OnResetDropFramesOut", 3.0f);
        Invoke("OnReloadUI", 3.5f);
    }