context = window logger = context.JK.logger ChannelGroupIds = context.JK.ChannelGroupIds CategoryGroupIds = context.JK.CategoryGroupIds MIX_MODES = context.JK.MIX_MODES @SessionTrackGain = React.createClass({ propTypes: { gainType: React.PropTypes.string controlGroup: React.PropTypes.string } getInitialState: () -> { mixers: @props.mixers, behaviors: @props.behaviors || {} } faderChanged: (e, data) -> $target = $(this) groupId = $target.data('groupId') mixers = @state.mixers.mixer # if this is a media track, jam track , or media category, affect volume of both mixer and opposing mixer if @state.mixers.mixer.group_id == ChannelGroupIds.MediaTrackGroup || @state.mixers.mixer.group_id == ChannelGroupIds.JamTrackGroup || ((@state.mixers.mixer.group_id == ChannelGroupIds.MonitorCatGroup || @state.mixers.mixer.group_id == ChannelGroupIds.MasterCatGroup) && @state.mixers.mixer.name == CategoryGroupIds.MediaTrack) MixerActions.faderChanged(data, [@state.mixers.mixer, @state.mixers.oppositeMixer], @props.gainType, @props.controlGroup) else MixerActions.faderChanged(data, mixers, @props.gainType, @props.controlGroup) render: () -> # mixer can be a single item or array mixer = @state.mixers?.mixer if mixer && $.isArray(mixer) mixer = mixer[0] mixerId = mixer?.id `