context = window MixerActions = @MixerActions ConfigureTracksActions = @ConfigureTracksActions @SessionMyTrack = React.createClass({ mixins: [Reflux.listenTo(@SessionStatsStore,"onStatsChanged")] onStatsChanged: (stats) -> @setState({stats: stats[@props.clientId]}) getInitialState: () -> stats = window.SessionStatsStore.stats if stats? clientStats = stats[@props.clientId] else clientStats = null {stats: clientStats} handleMute: (e) -> e.preventDefault() unless this.props.mixers.mixer logger.debug("ignoring mute; no mixer") return muting = $(e.currentTarget).is('.enabled') # this button is annoying. the hover shows mute and it's good to use instead # MixerActions.mute([this.props.mixers.mixer, this.props.mixers.oppositeMixer], muting) render: () -> muteMixer = this.props.mixers.muteMixer vuMixer = this.props.mixers.vuMixer muteMixerId = muteMixer?.id classes = classNames({ 'track-icon-mute': true 'enabled' : !muteMixer?.mute 'muted' : muteMixer?.mute }) trackClasses = classNames({ 'session-track' : true 'my-track' : true 'has-mixer' : this.props.hasMixer 'no-mixer' : !this.props.hasMixer }) unless @props.no_pan pan = if this.props.mixers.mixer? then this.props.mixers.mixer.pan else 0 panStyle = { transform: "rotate(#{pan}deg)" WebkitTransform: "rotate(#{pan}deg)" } panJsx = `