context = window logger = context.JK.logger MixerActions = @MixerActions MIX_MODES = context.JK.MIX_MODES @SessionMetronome = React.createClass({ mixins: [@MasterPersonalMixersMixin] handleMute: (e) -> e.preventDefault() muting = $(e.currentTarget).is('.enabled') # this button is annoying. the hover shows mute and it's good to use instead # MixerActions.mute([@mixer()], muting) render: () -> # today, all mixers are the same for a remote participant; so just grab the 1st mixers = @mixers() muteMixer = mixers.muteMixer vuMixer = mixers.vuMixer muteMixerId = muteMixer?.id classes = classNames({ 'track-icon-mute': true 'enabled' : !muteMixer?.mute 'muted' : muteMixer?.mute }) componentClasses = classNames({ "session-track" : true "metronome" : true "in-jam-track" : @props.location == 'jam-track' "no-mixer" : @props.mode == MIX_MODES.MASTER # show it as disabled if in master mode "in-jam-track" : @props.location == 'jam-track' }) pan = if mixers.mixer? then mixers.mixer?.pan else 0 panStyle = { transform: "rotate(#{pan}deg)" WebkitTransform: "rotate(#{pan}deg)" } `
Metronome


` componentDidMount: () -> $root = $(this.getDOMNode()) $topParent = $root.closest('.top-parent') $mute = $root.find('.track-icon-mute') $pan = $root.find('.track-icon-pan') if @props.mode context.JK.helpBubble($root.find('.disabled-track-overlay'), 'master-metronome-notice', {}, {positions:['top'], offsetParent: $topParent}) context.JK.interactReactBubble( $mute, 'SessionTrackVolumeHover', () => {mixers:@mixers(), trackType: 'SessionMetronome', mode: @props.mode} , {width:235, positions:['right', 'left'], offsetParent:$topParent}) context.JK.interactReactBubble( $pan, 'SessionTrackPanHover', () => {mixers:@mixers()} , {width:331, positions:['right', 'left'], offsetParent:$topParent}) })