<plugin resizable="true">
	<port id="ssel" value="ssel[inst]" />

	<vbox spacing="4">
		<!-- Area selector -->
		<align hpos="-1">
			<hbox spacing="8">
				<label text="labels.working_area" />
				<combo id="msel" halign="1" />
			</hbox>
		</align>
		
		<!-- Instrument editor -->
		<grid rows="2" cols="2" visibility=":msel ieq 0" spacing="4" expand="true">
			<cgroup id="inst">
				<grid rows="4" cols="6" spacing="4">
					<!-- Row 1 -->
					<label text="labels.channel" />
					<label text="labels.mus.note" />
					<label text="labels.midi.midi_num" />
					<cell rows="4"><vsep /></cell>
					<label text="labels.dynamics" />
					<label text="labels.time_drifting" />

					<!-- Row 2 -->
					<combo id="chan[inst]" fill="true" />
					<hbox fill="true" spacing="2">
						<combo id="note[inst]" fill="true" />
						<combo id="oct[inst]" fill="true" />
					</hbox>
					<midinote id="mn[inst]" note_id="note[inst]" octave_id="oct[inst]" format="i3" text_color="green" />
					<cell rows="2"><knob id="dyna[inst]" scale_color="green" /></cell>
					<cell rows="2"><knob id="drft[inst]" scale_color="green" /></cell>
					
					<!-- Row 3 -->
					<label text="labels.group" />
					<align hpos="0">
						<hbox spacing="4">
							<button id="mtg[inst]" color="yellow" led="true" size="12" />
							<label text="labels.muting" />
						</hbox>
					</align>
					<cell rows="2">
						<button id="ion[inst]" size="32" led="true" color="yellow" text="labels.chan.ON" />
					</cell>
					
					<!-- Row 4 -->
					<combo id="mgrp[inst]" />
					<align hpos="0">
						<hbox spacing="4">
							<button id="nto[inst]" color="green" led="true" size="12" />
							<label text="labels.midi.note_off" />
						</hbox>
					</align>
					<value id="dyna[inst]" same_line="true" />
					<value id="drft[inst]" same_line="true" />
				</grid>
			</cgroup>
			<group text="groups.audio_output">
				<grid rows="3" cols="6">
					<label text="labels.muting" />
					<hbox spacing="4" fill="false">
						<button id="noff" led="true" color="green" size="12" />
						<label text="labels.midi.note_off" />
					</hbox>
					<label text="labels.signal.dry" />
					<label text="labels.signal.wet" />
					<label text="labels.output" />
					<label text="labels.mute" />
					
					<button id="muting" size="24" color="yellow" led="true" />
					<knob id="fout" />
					<knob id="dry" />
					<knob id="wet" />
					<knob id="g_out" />
					<button id="mute" size="32" />
					
					<label />
					<value id="fout" />
					<value id="dry" />
					<value id="wet" />
					<value id="g_out" />
					<led id="mute" color="red" />
				</grid>
			</group>
			<cgroup id="ssel[inst]" expand="true">
				<vbox>
					<!-- File editor -->
					<file expand="true"
						id="sf[inst][ssel]" head_id="hc[inst][ssel]" tail_id="tc[inst][ssel]"
						fadein_id="fi[inst][ssel]" fadeout_id="fo[inst][ssel]" length_id="fl[inst][ssel]"
						status_id="fs[inst][ssel]" mesh_id="fd[inst][ssel]"
						width="320" height="160"
						path_id="ui:dlg_sample_path"
						bind="makeup=mk[inst][ssel],predelay=pd[inst][ssel]"
					/>
						
					<grid rows="3" cols="8" spacing="2">
						<label text="labels.sedit.reverse" />
						<label text="labels.sedit.head_cut" />
						<label text="labels.sedit.tail_cut" />
						<label text="labels.sedit.fade_in" />
						<label text="labels.sedit.fade_out" />
						<label text="labels.sedit.makeup" />
						<label text="labels.sedit.predelay" />
						<label text="labels.sedit.listen" />
						
						<button id="rs[inst][ssel]" size="32" />
						<knob id="hc[inst][ssel]" size="20" />
						<knob id="tc[inst][ssel]" size="20" />
						<knob id="fi[inst][ssel]" size="20" scale_color="yellow" />
						<knob id="fo[inst][ssel]" size="20" scale_color="yellow" />
						<knob id="mk[inst][ssel]" size="20" />
						<knob id="pd[inst][ssel]" size="20" />
						<button id="ls[inst][ssel]" size="32" toggle="false" />
						
						<led id="rs[inst][ssel]" />
						<value id="hc[inst][ssel]" />
						<value id="tc[inst][ssel]" />
						<value id="fi[inst][ssel]" />
						<value id="fo[inst][ssel]" />
						<value id="mk[inst][ssel]" />
						<value id="pd[inst][ssel]" />
						<led id="ls[inst][ssel]" />
					</grid>
				</vbox>
			</cgroup>
			<group text="groups.sample_matrix" expand="true">
				<!-- Sample matrix -->
				<grid rows="11" cols="9" transpose="true">
					<label text="labels.sedit.sample_num" fill="true" halign="0" />
					<label text="labels.sedit.enabled" fill="true" halign="0" />
					<label text="labels.sedit.active" fill="true" halign="0" />
					<label text="labels.midi.velocity" fill="true" halign="0" />
					<label text="labels.units.:pc" fill="true" halign="0" />
					<label text="labels.signal.pan_left" fill="true" halign="0" />
					<label text="labels.units.:pc" fill="true" halign="0" />
					<label text="labels.signal.pan_right" fill="true" halign="0" />
					<label text="labels.units.:pc" fill="true" halign="0" />
					<label text="labels.sedit.listen" fill="true" halign="0" />
					<label text="labels.midi.note_on" fill="true" halign="0" />

					<ui:for id="i" first="0" last="7" >
						<label text="${i}" />
						<button id="on[inst]_${i}" size="16" color="yellow" led="true" />
						<led id="ac[inst]_${i}" color="yellow" size="6" />
						<knob id="vl[inst]_${i}" size="20" scale_color="magenta" />
						<value id="vl[inst]_${i}" detailed="false" />
						<knob id="pl[inst]_${i}" size="20" balance="0.5" scale_color="red" />
						<value id="pl[inst]_${i}" detailed="false" />
						<knob id="pr[inst]_${i}" size="20" balance="0.5" scale_color="cyan" />
						<value id="pr[inst]_${i}" detailed="false" />
						<button id="ls[inst]_${i}" size="32" toggle="false" />
						<led id="no[inst]_${i}" />
					</ui:for>
				</grid>
			</group>
		</grid>
					
		<!-- Mixer -->
		<ui:for id="m" first="0" last="3">
			<group text="groups.instrument_mixer" visibility=":msel ieq ${:m+1}" expand="true">
				<grid rows="13" cols="13" transpose="true" hspacing="2" vspacing="2">
					<label text="labels.instrument_num" fill="true" halign="0" />
					<label text="labels.sedit.enabled" fill="true" halign="0" />
					<label text="labels.mix_gain" fill="true" halign="0" />
					<label text="labels.units.:db" fill="true" halign="0" />
					<label text="labels.signal.pan_left" fill="true" halign="0" />
					<label text="labels.units.:pc" fill="true" halign="0" />
					<label text="labels.signal.pan_right" fill="true" halign="0" />
					<label text="labels.units.:pc" fill="true" halign="0" />
					<label text="labels.group" fill="true" halign="0" />
					<label text="labels.midi.midi_num" fill="true" halign="0" />
					<label text="labels.midi.note_on" fill="true" halign="0" />
					<label text="labels.listen" fill="true" halign="0" />
					<label />
					
					<ui:for id="i" first="${:m*12}" last="${:m*12+11}" >
						<label text="${i}" />
						<button id="ion_${i}" size="16" color="yellow" led="true" />
						<knob id="imix_${i}" size="20"/>
						<value id="imix_${i}" detailed="false" />
						<knob id="panl_${i}" size="20" balance="0.5" scale_color="red" />
						<value id="panl_${i}" detailed="false" />
						<knob id="panr_${i}" size="20" balance="0.5" scale_color="cyan" />
						<value id="panr_${i}" detailed="false" />
						<combo id="mgrp_${i}" />
						<midinote id="mn_${i}" note_id="note_${i}" octave_id="oct_${i}" format="i3" text_color="green" />
						<led id="iact_${i}" />
						<button id="trg_${i}" size="32" toggle="false" />
						<led id="trg_${i}" />
					</ui:for>
				</grid>
			</group>
		</ui:for>
		
	</vbox>
</plugin>