Esempio n. 1
0
 public void StopFramework()
 {
     if (Status != FrameworkStatus.STOP)
     {
         if (EnableLipVersion == SupportedLipVersion.version1)
         {
             Error result = SRanipal_API.Release(SRanipal_Lip.ANIPAL_TYPE_LIP);
             if (result == Error.WORK)
             {
                 Debug.Log("[SRanipal] Release Lip : " + result);
             }
             else
             {
                 Debug.LogError("[SRanipal] Release Lip : " + result);
             }
         }
         else
         {
             Error result = SRanipal_API.Release(SRanipal_Lip_v2.ANIPAL_TYPE_LIP_V2);
             if (result == Error.WORK)
             {
                 Debug.Log("[SRanipal] Release Version 2 Lip : " + result);
             }
             else
             {
                 Debug.LogError("[SRanipal] Release Version 2 Lip : " + result);
             }
         }
     }
     else
     {
         Debug.Log("[SRanipal] Stop Framework : module not on");
     }
     Status = FrameworkStatus.STOP;
 }
        public static void Stop()
        {
            CancellationToken.Cancel();

            if (EyeEnabled)
            {
                SRanipal_API.Release(SRanipal_Eye_v2.ANIPAL_TYPE_EYE_V2);
            }
            if (FaceEnabled)
            {
                SRanipal_API.Release(SRanipal_Lip_v2.ANIPAL_TYPE_LIP_V2);
            }

            CancellationToken.Dispose();
        }
        public static void Initialize(bool eye = true, bool lip = true)
        {
            MelonLogger.Msg($"Initializing SRanipal...");

            Error eyeError = Error.UNDEFINED, faceError = Error.UNDEFINED;

            if (eye)
            {
                if (EyeEnabled)
                {
                    MelonLogger.Msg("Releasing previously initialized eye module...");
                    SRanipal_API.Release(SRanipal_Eye_v2.ANIPAL_TYPE_EYE_V2);
                }

                eyeError = SRanipal_API.Initial(SRanipal_Eye_v2.ANIPAL_TYPE_EYE_V2, IntPtr.Zero);
            }

            if (lip)
            {
                if (FaceEnabled)
                {
                    MelonLogger.Msg("Releasing previously initialized lip module...");
                    SRanipal_API.Release(SRanipal_Lip_v2.ANIPAL_TYPE_LIP_V2);
                }

                faceError = SRanipal_API.Initial(SRanipal_Lip_v2.ANIPAL_TYPE_LIP_V2, IntPtr.Zero);
            }

            HandleErrors(eyeError, faceError);

            if (SceneManager.GetActiveScene().buildIndex == -1 && QuickModeMenu.MainMenu != null)
            {
                MainMod.MainThreadExecutionQueue.Add(() => QuickModeMenu.MainMenu.UpdateEnabledTabs(EyeEnabled, FaceEnabled));
            }

            if (!SRanipalWorker.IsAlive)
            {
                SRanipalWorker.Start();
            }
        }
 public void StopFramework()
 {
     if (Status != FrameworkStatus.NOT_SUPPORT)
     {
         if (Status != FrameworkStatus.STOP)
         {
             if (EnableEyeVersion == SupportedEyeVersion.version1)
             {
                 Error result = SRanipal_API.Release(SRanipal_Eye.ANIPAL_TYPE_EYE);
                 if (result == Error.WORK)
                 {
                     Debug.Log("[SRanipal] Release Eye : " + result);
                 }
                 else
                 {
                     Debug.LogError("[SRanipal] Release Eye : " + result);
                 }
             }
             else
             {
                 Error result = SRanipal_API.Release(SRanipal_Eye_v2.ANIPAL_TYPE_EYE_V2);
                 if (result == Error.WORK)
                 {
                     Debug.Log("[SRanipal] Release Eye v2: " + result);
                 }
                 else
                 {
                     Debug.LogError("[SRanipal] Release Eye v2: " + result);
                 }
             }
         }
         else
         {
             Debug.Log("[SRanipal] Stop Framework : module not on");
         }
     }
     Status = FrameworkStatus.STOP;
 }
Esempio n. 5
0
        public static void Initialize(bool eye = true, bool lip = true)
        {
            MelonLogger.Msg($"Initializing SRanipal...");

            Error eyeError = Error.UNDEFINED, faceError = Error.UNDEFINED;

            if (eye)
            {
                if (EyeEnabled)
                {
                    MelonLogger.Msg("Releasing previously initialized eye module...");
                    SRanipal_API.Release(SRanipal_Eye_v2.ANIPAL_TYPE_EYE_V2);
                }

                eyeError = SRanipal_API.Initial(SRanipal_Eye_v2.ANIPAL_TYPE_EYE_V2, IntPtr.Zero);
            }

            /*if (lip)
             * {
             *  if (FaceEnabled)
             *  {
             *      MelonLogger.Msg("Releasing previously initialized lip module...");
             *      SRanipal_API.Release(SRanipal_Lip_v2.ANIPAL_TYPE_LIP_V2);
             *  }
             *
             *  faceError = SRanipal_API.Initial(SRanipal_Lip_v2.ANIPAL_TYPE_LIP_V2, IntPtr.Zero);
             * }*/

            HandleErrors(eyeError, faceError);

            //if (SceneManager.GetActiveScene().buildIndex == -1)
            //    MainMod.MainThreadExecutionQueue.Add(QuickModeMenu.CheckIfShouldInit);

            if (!SRanipalWorker.IsAlive)
            {
                SRanipalWorker.Start();
            }
        }
Esempio n. 6
0
 public void StopFramework()
 {
     if (SRanipal_Eye.IsViveProEye())
     {
         if (Status != FrameworkStatus.STOP)
         {
             Error result = SRanipal_API.Release(SRanipal_Eye.ANIPAL_TYPE_EYE);
             if (result == Error.WORK)
             {
                 Debug.Log("[SRanipal] Release Eye : " + result);
             }
             else
             {
                 Debug.LogError("[SRanipal] Release Eye : " + result);
             }
         }
         else
         {
             Debug.Log("[SRanipal] Stop Framework : module not on");
         }
     }
     Status = FrameworkStatus.STOP;
 }