-
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1e74da
commit 26853fc
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { useState } from "react" | ||
import { useObject } from "../hooks/useObject" | ||
import Slider from "./Slider" | ||
|
||
export default function HDRSliders(props) { | ||
const { monitor, name, hdrFeatures } = props | ||
const [sdrLevel, setSDRLevel] = useState(monitor?.sdrLevel) | ||
|
||
let extraHTML = [] | ||
|
||
// SDR Brightness | ||
extraHTML.push( | ||
<div className="feature-row feature-sdr" key={monitor.key + "_sdr"}> | ||
<div className="feature-icon"><span className="text vfix">SDR</span></div> | ||
<Slider type="sdr" monitorID={monitor.id} level={sdrLevel} monitorName={monitor.name} monitortype={monitor.type} onChange={val => { setSDRLevel( val ); setSDRBrightness(monitor.id, parseInt(val)) }} scrollAmount={props.scrollAmount} /> | ||
</div> | ||
) | ||
|
||
return ( | ||
<> | ||
{extraHTML} | ||
</> | ||
) | ||
} | ||
|
||
function setSDRBrightness(monitor, code, value) { | ||
window.dispatchEvent(new CustomEvent("set-sdr-brightness", { | ||
detail: { | ||
monitor, | ||
value | ||
} | ||
})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters