import React from 'react'; import {connect} from 'react-redux'; import classnames from 'classnames'; import {BANDS, WINDOWS} from '../constants'; import { setEqBand, setPreamp, setEqToMax, setEqToMid, setEqToMin } from '../actionCreators'; import { SET_FOCUSED_WINDOW } from '../actionTypes'; import Band from './Band'; import EqOn from './EqOn'; import EqAuto from './EqAuto'; import EqGraph from './EqGraph'; import '../../css/equalizer-window.css'; const bandClassName = (band) => `band-${band}`; class EqualizerWindow extends React.Component { constructor(props) { super(props); this.setHertzValue = this.setHertzValue.bind(this); } setHertzValue(hertz) { return (e) => { this.props.dispatch( setEqBand(hertz, e.target.value) ); }; } render() { const {doubled} = this.props.display; const className = classnames({ window: true, selected: this.props.windows.focused === WINDOWS.EQUALIZER, closed: !this.props.windows.equalizer, draggable: true, doubled }); return (