Skip to content

Commit cd566f6

Browse files
committed
add &metersource url parameter
1 parent 0cbffca commit cd566f6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ There are two different way to set settings, either by editing the default value
4949
#### When using url parameters:
5050
The first url parameter needs to use a ? instead of &. Also it's possible that you may need to url-encode your host/password values if they contain special characters (esp. ?&=). Just type your host/password into [this website](https://urlencode.org/), click encode and use the displayed value in the url.
5151

52-
#### Available parameters:
52+
#### Available parameters (all optional):
5353
- &host= (url param) / var obsHost = (file): This configures the ip or hostname and port of the machine running obs-websocket. It defaults to localhost/127.0.0.1 so only needs to be added if you're connecting from a different machine then the local one.
5454
- &password= (url param) / var obsPassword = (file): This configures the password used to authenticate with obs-websocket. Only needed if you have enabled authentication in obs-websocket.
5555
- &hidebottom (url param) / (no file param): This hides the server address for monitor1 and recording path for monitor 2 to not overlay with the multiview scene name labels.
5656
- &secure (url param) / obsProtocol = (file): Only use this if you know exactly what you are doing! Can be used to switch to wss for the websocket connection when using a wss proxy.
57+
- &metersource (url param) / (no file param): Statically selects which meters to show. 1=postfader (post-fader post-mute), 2=prefader(pre-fader pre-mute). Default is dynamic switching between 1 (source unmuted) and 2 (source muted). Only works for monitor3.html
5758

5859
If you have any problems, just open a Github issue or join my [Discord Server](https://discord.gg/PCYQJwX).
5960

display3.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
function reloadSourceFilterList(sourceName) {
131131
if (obs.identified && sourceName in inputStates) return obs.call('GetSourceFilterList', { sourceName }).then(({ filters }) => { inputStates[sourceName].filters = filters.filter((filter) => filter.filterEnabled); });
132132
}
133+
133134
obs.on("InputVolumeMeters", ({ inputs }) => {
134135
let i = 0;
135136
for (let { inputName, inputLevelsMul } of inputs) {
@@ -155,10 +156,11 @@
155156
if (inputLevelsMul.length == 1) inputLevelsMul.push([0, 0, 0]);
156157
for (const level of inputLevelsMul) {
157158
if (j>=2) break; // just do two channels
158-
const value = mul_to_decibel(inputStates[inputName].muted ? level[2] : level[1]); // highest sound...
159+
const meterlevel = urlParams.has("metersource") ? level[parseInt(urlParams.get("metersource"))] : inputStates[inputName].muted ? level[2] : level[1]
160+
const value = mul_to_decibel(meterlevel);
159161
document.querySelector(`#meter-${i}>div.Volume`).innerText = (value == Infinity) ? "-∞" : -Math.round(value);
160-
if (j==0) document.querySelector(`#meter-${i}>div.VUMeter>div.Left`).style.setProperty('--amount', value_to_perc(value));
161-
if (j==1) document.querySelector(`#meter-${i}>div.VUMeter>div.Right`).style.setProperty('--amount', value_to_perc(value));
162+
if (j==0) document.querySelector(`#meter-${i}>div.VUMeter>div.Left`).style.setProperty('--amount', value_to_perc(value));
163+
if (j==1) document.querySelector(`#meter-${i}>div.VUMeter>div.Right`).style.setProperty('--amount', value_to_perc(value));
162164
j++;
163165
}
164166
i++;

0 commit comments

Comments
 (0)