Professor-Melvin / ElgatoWaveLinkSDK

SDK For Elgato Wave Link Software
GNU General Public License v3.0
9 stars 1 forks source link

SetInputMixer #2

Closed eliasstepanik closed 2 years ago

eliasstepanik commented 2 years ago

Hello, i would like to use the SetInputMixer Code.

You wrote "Need to look at the JS plugin for more details on this". Could you give me a link to the JS plugin?

eliasstepanik commented 2 years ago

It seems that Wavelinks Websocket is not running correctly.

When I send Send.json it replys wtih Reply.json and does nothing.

Send.json

{
    "jsonrpc": "2.0",
    "method": "setInputMixer",
    "params": {
        "bgColor": "#B521FF",
        "filters": [
            {
                "active": true,
                "filterID": "9D156679-24B9-4BAF-A1A0-9442FD89C24B",
                "name": "ReaComp (ReaPlugs Edition)",
                "pluginID": "7265636d"
            }
        ],
        "iconData": "",
        "inputType": 3,
        "isAvailable": true,
        "isLocalInMuted": false,
        "isStreamInMuted": true,
        "localMixFilterBypass": false,
        "localVolumeIn": 30,
        "mixId": "pcm_out_01_v_04_sd4",
        "mixerName": "Browser",
        "streamMixFilterBypass": false,
        "streamVolumeIn": 30
    }
}

Reply.json

{
    "id": 0,
    "jsonrpc": "2.0",
    "result": {
        "bgColor": "#B521FF",
        "filters": [
            {
                "active": true,
                "filterID": "9D156679-24B9-4BAF-A1A0-9442FD89C24B",
                "name": "ReaComp (ReaPlugs Edition)",
                "pluginID": "7265636d"
            }
        ],
        "iconData": "",
        "inputType": 3,
        "isAvailable": true,
        "isLocalInMuted": false,
        "isStreamInMuted": true,
        "localMixFilterBypass": false,
        "localVolumeIn": 100,
        "mixId": "pcm_out_01_v_04_sd4",
        "mixerName": "Browser",
        "streamMixFilterBypass": false,
        "streamVolumeIn": 100
    }
}
eliasstepanik commented 2 years ago

I tried to build the setInputMixer call out of the JS Plugin (call.json) then tried to send it via Postman and it crashed.

I think the Websocket function setInputMixer is broken..

call.json

{
    "method": "setInputMixer",
    {
        "mixId": "pcm_out_01_v_04_sd4",
        "slider": "local",
        "localVolumeIn": 30,
        "isLocalInMuted": true,
        "streamVolumeIn": 30,
        "isStreamInMuted": true,
        "filters": [
            {
                "active": true,
                "filterID": "9D156679-24B9-4BAF-A1A0-9442FD89C24B",
                "name": "ReaComp (ReaPlugs Edition)",
                "pluginID": "7265636d"
            }
        ],
        "localMixFilterBypass": false,
        "streamMixFilterBypass": false
    }
}

reference.js

setInputMixer(mixId, slider) {
    this.mixers.forEach(mixer => {
        if (mixer.mixerId == mixId) {
            this.rpc.call("setInputMixer", {
                "mixId":                 mixer.mixerId,
                "slider":                slider,
                "localVolumeIn":         mixer.localVolIn,
                "isLocalInMuted":        mixer.isLocalMuteIn,
                "streamVolumeIn":        mixer.streamVolIn,
                "isStreamInMuted":       mixer.isStreamMuteIn,
                "filters":               mixer.filters,
                "localMixFilterBypass":  mixer.localMixFilterBypass,
                "streamMixFilterBypass": mixer.streamMixFilterBypass
            }).then((result) => {
                mixer.isAvailable           = result["isAvailable"];
                mixer.localVolIn            = result["localVolumeIn"];
                mixer.isLocalMuteIn         = result["isLocalInMuted"];
                mixer.streamVolIn           = result["streamVolumeIn"];
                mixer.isStreamMuteIn        = result["isStreamInMuted"];
                mixer.localMixFilterBypass  = result["localMixFilterBypass"];
                mixer.streamMixFilterBypass = result["streamMixFilterBypass"];
                mixer.filters               = result["filters"];                    
                this.emit("inputMixerChanged", mixer.mixerId);
            });
        }
    });
}
Professor-Melvin commented 2 years ago

Hey, I can't get switchMonitoring or setInputMixer to act correctly, I'd say we're sending something wrong rather than their websocket being broken seeing as the stream deck plugin works correctly. So I'm assuming we're not sending the correct data and so the websocket is freaking out

I've recently moved country and I've still not fully setup my office, (Currently only using my work laptop) so I don't have my wave setup to test any of this probably. I'll try have a look at this later next week

Professor-Melvin commented 2 years ago

Looking at the reply you're getting with an empty Id value, I'm guessing maybe we need to give it some sort of MessageId to keep track of replies?? Maybe try sending your send.json with a random Id, that might do something

eliasstepanik commented 2 years ago

I will try to do that on Monday because i'm currently not at home. And only got my Laptop with me.

eliasstepanik commented 2 years ago

I tried sending an ID but that didn´t work.

Professor-Melvin commented 2 years ago

This has been fixed in the latest build, I'll be pushing it to NuGet once the pipeline completes

The issue was you have to pass through which mix you want to change Ex. local vs stream, looking at the JS library there is a "all" option but I couldn't get that to work So I'm only going to support that for now till I have the time to investigate it further