$ = jQuery
context = window
context.JK ||= {}
MIX_MODES = context.JK.MIX_MODES

context.JK.SessionMasterMixDialog = class SessionMasterMixDialog
  constructor: (@app) ->
    @rest = context.JK.Rest()
    @logger = context.JK.logger
    @screen = null
    @dialogId = 'session-master-mix-dialog'
    @dialog = null
    @closeBtn = null

  initialize:() =>
    dialogBindings =
      'beforeShow' : @beforeShow
      'afterShow' : @afterShow
      'afterHide' : @afterHide


    @dialog = $('[layout-id="' + @dialogId + '"]')
    @app.bindDialog(@dialogId, dialogBindings)
    @content = @dialog.find(".dialog-inner")

  beforeShow:() =>
    @logger.debug("session-master-mix-dlg: beforeShow")
    context.jamClient.SetMixerMode(MIX_MODES.MASTER)

  afterShow:() =>
    @logger.debug("session-master-mix-dlg: afterShow")

  afterHide:() =>
    context.jamClient.SetMixerMode(MIX_MODES.PERSONAL)


