Example #1
0
    // Use this for initialization
    void makeAPIRequest(string child)   //bubbled from child
    {
        requestFactory = VentanaRequestFactory.Instance;
        switch (child)
        {
        case "play":
            Debug.Log("Bubbled play");
            StartCoroutine(requestFactory.GetFromMusicAPIEndpoint(playCommand, VentanaID, null));
            break;

        case "pause":
            Debug.Log("Bubbled pause");
            StartCoroutine(requestFactory.GetFromMusicAPIEndpoint(playCommand, VentanaID, null));
            break;

        case "next":
            Debug.Log("Bubbled next");
            StartCoroutine(requestFactory.GetFromMusicAPIEndpoint(nextCommand, VentanaID, null));
            break;

        case "previous":
            Debug.Log("Bubbled previous");
            StartCoroutine(requestFactory.GetFromMusicAPIEndpoint(previousCommand, VentanaID, null));
            break;

        case "status":
            //Debug.Log("Bubbled albumArt");
            StartCoroutine(requestFactory.GetFromMusicAPIEndpoint(statusCommand, this.VentanaID, GetRequestCompleted));
            break;

        default:
            Debug.Log("No good bubble called");
            break;
        }
    }
    void OnSliderChangeRequest(KnobHandler.SliderLevels levels)
    {
        VentanaRequestFactory requestFactory = VentanaRequestFactory.Instance;

        Debug.Log("Requesting a: " + levels.XAxisLevel + (levels.XAxisLevel > 0 ? " increase" : " decrease"));
        int baseLevel = levels.XAxisLevel * brightnessMultipler;

        StartCoroutine(requestFactory.PostToLightAPIEndpoint(brightCommand, VentanaID, baseLevel.ToString()));
    }
Example #3
0
    void OnSliderChangeRequest(KnobHandler.SliderLevels levels)
    {
        VentanaRequestFactory requestFactory = VentanaRequestFactory.Instance;

        Debug.Log("Requesting a: " + levels.XAxisLevel + (levels.XAxisLevel > 0 ? " increase" : " decrease"));
        int baseLevel = levels.XAxisLevel * volumeMultiplier;

        StartCoroutine(requestFactory.PostToMusicAPIEndpoint("volume", VentanaID, (levels.XAxisLevel > 0 ? "+" : "") + baseLevel.ToString()));
    }
    void makeAPIRequest(string child)
    {
        VentanaRequestFactory requestFactory = VentanaRequestFactory.Instance;

        switch (child)
        {
        case "light":
            StartCoroutine(requestFactory.PostToLightAPIEndpoint(poweredCommand, VentanaID, ""));
            break;

        default:
            break;
        }
    }
    void makeAPIRequest(string child)
    {
        VentanaRequestFactory requestFactory = VentanaRequestFactory.Instance;

        switch (child)
        {
        case "Toggle0":
            Debug.Log("Toggled 0");
            StartCoroutine(requestFactory.PostToLightAPIEndpoint(poweredCommand, VentanaID, "0"));
            break;

        case "Toggle1":
            Debug.Log("Toggled 1");
            StartCoroutine(requestFactory.PostToLightAPIEndpoint(poweredCommand, VentanaID, "1"));
            break;

        default:
            break;
        }
    }
Example #6
0
 // Use this for initialization
 void Start()
 {
     base.Start();
     requestFactory = VentanaRequestFactory.Instance;
     requestAlbum();
 }