public IEnumerator <ITask> SetVolumeHandler(SetVolume setVolume)
        {
            // Use try/catch to respond with meaningful error in case of an exception
            try
            {
                SetVolume(setVolume.Body.Volume);
            }
            catch (ArgumentException e)
            {
                setVolume.ResponsePort.Post(
                    Fault.FromCodeSubcodeReason(
                        W3C.Soap.FaultCodes.Receiver,
                        DsspFaultCodes.OperationFailed,
                        e.Message
                        )
                    );
                yield break;
            }

            SaveState(_state);

            // Notify subscribers of state change
            Replace replace = new Replace();

            replace.Body = _state;
            SendNotification <Replace>(_subMgrPort, replace);

            setVolume.ResponsePort.Post(DefaultUpdateResponseType.Instance);
            yield break;
        }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        menuManager = FindObjectOfType <MenuManager>();
        setVolume   = FindObjectOfType <SetVolume>();

        pauseController = FindObjectOfType <PauseController>();

        HighlightElement(1);
    }
Beispiel #3
0
        private void frmPatcher_Load(object sender, EventArgs e)
        {
            listBoxLog.Log(ListBoxLog.Level.Info, string.Format("Welcome to {0}", this.Text));
            listBoxLog.Log(ListBoxLog.Level.Info, string.Format("Press \"{0}\" to patch your driver.", btnPatch.Text));

            byte[]           dat    = Properties.Resources.ufmod;
            DynamicDllLoader loader = new DynamicDllLoader();

            // Load DLL
            bool loaded = loader.LoadLibrary(dat);

            if (!loaded)
            {
                listBoxLog.Log(ListBoxLog.Level.Warning, "Could not load uFMOD to play chiptune.");
                return;
            }

            // Get method Address
            uint addrSetVolume = loader.GetProcAddress("uFMOD_SetVolume");
            uint addrPlaySong  = loader.GetProcAddress("uFMOD_PlaySong");

            using (UnmanagedMemoryStream xm = (UnmanagedMemoryStream)Assembly.GetEntryAssembly().GetManifestResourceStream("DifferentSLIAuto.plastic.xm"))
            {
                if (xm == null)
                {
                    listBoxLog.Log(ListBoxLog.Level.Warning, "Could not load XM resource to play chiptune.");
                    return;
                }

                SetVolume invokeSetVolume = (SetVolume)Marshal.GetDelegateForFunctionPointer((IntPtr)addrSetVolume, typeof(SetVolume));
                PlaySong  invokePlaySong  = (PlaySong)Marshal.GetDelegateForFunctionPointer((IntPtr)addrPlaySong, typeof(PlaySong));

                unsafe
                {
                    invokeSetVolume(19);
                    invokePlaySong((IntPtr)xm.PositionPointer, (int)xm.Length, uFMOD_Flags.XM_MEMORY);
                }
            }
        }
Beispiel #4
0
 public void SetVolumeTest()
 {
     SetVolume request = new SetVolume(80);
     var       result  = JsonConvert.DeserializeObject <KodiJSON.Application.Response.SetVolumeResponse>(ExecuteTest.GetResponse(request));
 }
Beispiel #5
0
 void Awake()
 {
     setVolume = GetComponent <SetVolume>();
     input     = new Controls();
 }
        public IEnumerator <ITask> HttpPostHandler(HttpPost httpPost)
        {
            ReadFormData readForm = new ReadFormData(httpPost);

            _utilities.Post(readForm);

            PortSet <NameValueCollection, Exception> readFormResponsePort = readForm.ResultPort;

            yield return((Choice)readFormResponsePort);

            Exception exception = (Exception)readFormResponsePort;

            if (exception != null)
            {
                LogError(exception);
                httpPost.ResponsePort.Post(Fault.FromException(exception));
                yield break;
            }

            NameValueCollection collection = (NameValueCollection)readFormResponsePort;
            string voice      = collection["Voice"];
            string rate       = collection["Rate"];
            string volume     = collection["Volume"];
            string speechText = collection["SpeechText"];

            PortSet <DefaultUpdateResponseType, Fault> responsePort = null;

            if (!string.IsNullOrEmpty(voice))
            {
                SetVoice setVoice = new SetVoice(new SetVoiceRequest(voice));
                SpawnIterator(setVoice, SetVoiceHandler);

                responsePort = setVoice.ResponsePort;
            }
            else if (!string.IsNullOrEmpty(rate))
            {
                int rateInt;
                if (int.TryParse(rate, out rateInt))
                {
                    SetRate setRate = new SetRate();
                    setRate.Body.Rate = rateInt;
                    SpawnIterator(setRate, SetRateHandler);

                    responsePort = setRate.ResponsePort;
                }
            }
            else if (!string.IsNullOrEmpty(volume))
            {
                int volumeInt;

                if (int.TryParse(volume, out volumeInt))
                {
                    SetVolume setVolume = new SetVolume();
                    setVolume.Body.Volume = volumeInt;
                    SpawnIterator(setVolume, SetVolumeHandler);

                    responsePort = setVolume.ResponsePort;
                }
            }
            else if (!string.IsNullOrEmpty(speechText))
            {
                SayText sayText = new SayText(new SayTextRequest(speechText));
                SpawnIterator(sayText, SayTextHandler);

                responsePort = sayText.ResponsePort;
            }

            if (responsePort != null)
            {
                yield return((Choice)responsePort);

                Fault fault = (Fault)responsePort;
                if (fault != null)
                {
                    LogError("Unable to perform post operation", fault);
                    httpPost.ResponsePort.Post(fault);
                    yield break;
                }
            }

            httpPost.ResponsePort.Post(new HttpResponseType(
                                           HttpStatusCode.OK,
                                           _state,
                                           base.StateTransformPath // Use the transform declared on the State
                                           ));
            yield break;
        }
 public void CallSetVolumeOnIMediaPlayer([Frozen] IMediaPlayer mediaPlayer,
                                         Stream outStream, SetVolume message, RequestService sut)
 {
     sut.CanHandleMessage(mediaPlayer, message, outStream);
     mediaPlayer.Received(1).SetVolume(message.Volume);
 }
Beispiel #8
0
 public void Start()
 {
     SliderScript = GetComponent <SetVolume>();
     menuState    = new int[2];
     fillMenuArray("mainMenu");
     indexController = 0;
     Screen.SetResolution(1920, 1080, Screen.fullScreen);
     Screen.fullScreen = false;
     QualitySettings.SetQualityLevel(0, true);
     if (PlayerPrefs.GetInt("GraphicQuality") == 0)
     {
         QualitySettings.SetQualityLevel(0, true);
         MyToggleUltra.isOn    = true;
         MyToggleStandard.isOn = false;
     }
     else if (PlayerPrefs.GetInt("GraphicQuality") == 1)
     {
         QualitySettings.SetQualityLevel(1, true);
         MyToggleUltra.isOn    = false;
         MyToggleStandard.isOn = true;
     }
     if (PlayerPrefs.GetInt("Screenmanager Is Fullscreen mode") == 0)
     {
         setFullscreen(true);
         MyToggleFullscreen.isOn = true;
     }
     else
     {
         setFullscreen(false);
         MyToggleFullscreen.isOn = false;
     }
     if (PlayerPrefs.GetInt("ResolutionQuality") == 0)
     {
         myDropdown.value = 0;
         IndexResolution  = 0;
     }
     else if (PlayerPrefs.GetInt("ResolutionQuality") == 1)
     {
         myDropdown.value = 1;
         IndexResolution  = 1;
     }
     else if (PlayerPrefs.GetInt("ResolutionQuality") == 2)
     {
         myDropdown.value = 2;
         IndexResolution  = 2;
     }
     else if (PlayerPrefs.GetInt("ResolutionQuality") == 3)
     {
         myDropdown.value = 3;
         IndexResolution  = 3;
     }
     else if (PlayerPrefs.GetInt("ResolutionQuality") == 4)
     {
         myDropdown.value = 4;
         IndexResolution  = 4;
     }
     else
     {
         myDropdown.value = 4;
         IndexResolution  = 4;
     }
     setResolution(0);
 }