diff --git a/server/classes/sound.js b/server/classes/sound.js index 62beab2ec..3e4227c11 100644 --- a/server/classes/sound.js +++ b/server/classes/sound.js @@ -10,6 +10,6 @@ export default class Sound { this.playbackRate = params.playbackRate || 1; this.channel = params.channel || [0, 1]; this.looping = params.looping || false; - this.preserveChannels = params.preserveChannels || false; + this.preserveChannels = params.preserveChannels === false ? false : true; } } diff --git a/src/components/macros/playSound.js b/src/components/macros/playSound.js index 639129a38..588ff59ac 100644 --- a/src/components/macros/playSound.js +++ b/src/components/macros/playSound.js @@ -1,12 +1,17 @@ import React from "react"; -import {FormGroup, Label, Input, Button} from "helpers/reactstrap"; +import { FormGroup, Label, Input, Button, Popover, PopoverHeader, PopoverBody } from "helpers/reactstrap"; import SoundPicker from "helpers/soundPicker"; import playSoundHOC from "components/generic/SoundPlayer"; -function PlaySound({updateArgs, args, stations, clients, playSound}) { +function PlaySound({ updateArgs, args, stations, clients, playSound }) { + let [showChannelPopover, setShowChannelPopover] = React.useState(false); + let [showOverridesPopover, setShowOverridesPopover] = React.useState(false); + const toggleChannelPopover = () => setShowChannelPopover(!showChannelPopover); + const toggleOverridesPopover = () => setShowOverridesPopover(!showOverridesPopover); + const sound = args.sound || {}; const updateSound = (which, val) => { - updateArgs("sound", {...sound, [which]: val}); + updateArgs("sound", { ...sound, [which]: val }); }; React.useEffect(() => { if (!args.station) { @@ -66,9 +71,9 @@ function PlaySound({updateArgs, args, stations, clients, playSound}) { -
+
updateSound("playbackRate", e.target.value)} /> +
+ + updateSound("preserveChannels", e.target.checked)} + /> +
updateSound("channel", e.target.value.split(","))} /> -
- - updateSound("preserveChannels", e.target.checked)} - /> -
+