<plugin resizable="true">

	<vbox vspacing="4" hspacing="4" expand="true">

		<grid rows="2" cols="5" vspacing="4" hspacing="4" expand="true">

			<group ui:inject="GraphGroup" ipadding="0" expand="true" fill="true" text="labels.graphs.spectrum">
				<graph width.min="640" height.min="320" expand="true" fill="true">
					<origin hpos="-1" vpos="-1" visible="false"/>

					<!-- Additional grid -->
					<ui:with color="graph_alt_1">
						<ui:for id="f" first="20" last="90" step="10">
							<marker v="${:f}"/>
							<marker v="${:f*10}"/>
							<marker v="${:f*100}"/>
						</ui:for>
						<marker v="20000"/>
						<ui:with ox="1" oy="0">
							<marker v="+12 db"/>
							<marker v="-12 db"/>
							<marker v="-36 db"/>
							<marker v="-60 db"/>

							<ui:for id="g" first="-42" last="6" step="12">
								<marker v="${g} db" visibility=":zoom le -9 db"/>
							</ui:for>
							<ui:for id="g" first="-21" last="3" step="6">
								<marker v="${g} db" visibility=":zoom le -15 db"/>
							</ui:for>
						</ui:with>
					</ui:with>

					<!-- Secondary grid -->
					<ui:with color="graph_sec">
						<marker v="100"/>
						<marker v="1000"/>
						<marker v="10000"/>
						<marker value="0 db" ox="1" oy="0"/>
						<marker value="-24 db" ox="1" oy="0"/>
						<marker value="-48 db" ox="1" oy="0"/>
					</ui:with>

					<!-- Piano keys -->
					<!-- <embed oy="2" start.x="midi_freq_start(12, 127)" start.y="0.12" end.x="midi_freq_end(12, 127)" end.y="0.07" valign="1" alpha="0" visibility=":_ui_graph_piano_layout">
						<piano natural="false" note.min="12" note.max="127" height="24" editable="false" selectable="false" border="0"/>
					</embed> -->

					<!-- Octave text -->
					<!-- <ui:with ox="0" oy="2" y="0.07" halign="1" valign="1" pgroup="0" priority="10" visibility=":_ui_graph_piano_layout" pad.b="26">
						<ui:for id="octave" first="0" last="9">
							<text x="midi_freq(12 * ${:octave + 1})" text="lists.notes.fmt.c" text:octave="${octave}" valign="1" halign="0"/>
						</ui:for>
					</ui:with> -->

					<!-- Piano keys -->
					<embed oy="4" start.x="midi_freq_start(12, 127)" start.y="20" end.x="midi_freq_end(12, 127)" end.y="44" valign="1" alpha="0" visibility=":_ui_graph_piano_layout">
						<piano natural="false" note.min="12" note.max="127" height="24" editable="false" selectable="false" border="0"/>
					</embed>

					<!-- Octave text -->
					<ui:with ox="0" oy="4" y="44" halign="1" valign="1" pgroup="0" priority="10" visibility=":_ui_graph_piano_layout" pad.b="2">
						<ui:for id="octave" first="0" last="9">
							<text x="midi_freq(12 * ${:octave + 1})" text="lists.notes.fmt.c" text:octave="${octave}" valign="1" halign="0"/>
						</ui:for>
					</ui:with>

					<!-- Band markers -->
					<ui:with
						width="2"
						fill="0.5"
						color.a="0.2"
						hcolor.a="0.8"
						lcolor.a="0.8"
						hlcolor.a="0.8"
						rcolor.a="0.8"
						hrcolor.a="0.8"
						color="graph_marker_cycle"
						hcolor="graph_marker_cycle"
						lcolor="graph_marker_cycle"
						hlcolor="graph_marker_cycle"
						rcolor="graph_marker_cycle"
						hrcolor="graph_marker_cycle">
						<marker v="10" color.hue=":hue_0" hcolor.hue=":hue_0" rborder="16" rcolor.hue=":hue_0" hrborder="16" hrcolor.hue=":hue_0"/>
						<marker id="fre_0" color.hue=":hue_0" hcolor.hue=":hue_0" lborder="16" lcolor.hue=":hue_0" hlborder="16" hlcolor.hue=":hue_0"/>
						<ui:for id="i" first="1" last="7">
							<marker id="sf_${i}" ui:id="split_marker_${i}" visibility=":frs_${i} igt 0" editable="true" color.hue=":hue_${i}" hcolor.hue=":hue_${i}" rborder="16" rcolor.hue=":hue_${i}" hrborder="16" hrcolor.hue=":hue_${i}" pointer="hsize"/>

							<marker id="fre_${i}" visibility=":frs_${i} igt 0" color.hue=":hue_${i}" hcolor.hue=":hue_${i}" lborder="16" lcolor.hue=":hue_${i}" hlborder="16" hlcolor.hue=":hue_${i}"/>

						</ui:for>
					</ui:with>

					<!-- Meshes -->
					<mesh id="bfc_0" width="2" fill="true" smooth="true" color="graph_mesh_cycle" color.hue=":hue_0" fcolor="graph_mesh_cycle" fcolor.hue=":hue_0" fcolor.a="0.9" visibility=":flt"/>

					<ui:for id="i" first="1" last="7">
						<mesh id="bfc_${i}" width="2" fill="true" smooth="true" color="graph_mesh_cycle" color.hue=":hue_${i}" fcolor="graph_mesh_cycle" fcolor.hue=":hue_${i}" fcolor.a="0.9" visibility=":flt and (:frs_${i} igt 0)"/>
					</ui:for>
					<mesh id="ifg_l" oy=":_ui_zoomable_spectrum_graph ? 1 : 3" width="0" color="left_in" color.a="0.8" fcolor.a="0.8" fill="true" fcolor="left_in" visibility=":ife_l"/>
					<mesh id="ifg_r" oy=":_ui_zoomable_spectrum_graph ? 1 : 3" width="0" color="right_in" color.a="0.8" fcolor.a="0.8" fill="true" fcolor="right_in" visibility=":ife_r"/>
					<mesh id="ofg_l" oy=":_ui_zoomable_spectrum_graph ? 1 : 3" width="2" color="left" visibility=":ofe_l"/>
					<mesh id="ofg_r" oy=":_ui_zoomable_spectrum_graph ? 1 : 3" width="2" color="right" visibility=":ofe_r"/>

					<mesh id="ag" width="3" color="bright_cyan" smooth="true" visibility=":crv"/>

					<!-- Boundaries -->
					<marker v="1" ox="2" oy="0" color="graph_prim" visibility="false"/>
					<marker v="24000" color="graph_prim" visibility="false"/>

					<!-- Axis -->
					<axis min="10" max="24000" angle="0.0" log="true" visibility="false"/>
					<axis min="-72 db / (:zoom ** 3)" max="24 db * :zoom" color="graph_prim" angle="0.5" log="true"/>
					<axis min="-1" max="1" visibility="false" angle="0.5"/>
					<axis min="-72 db" max="24 db" color="graph_prim" angle="0.5" log="true" visibility="false"/>
					<axis min="0" max=":_a_scaled_height" visibility="false" angle="0.5"/>

					<!-- Text -->
					<ui:with ox="0" oy="2" y="0" halign="1" valign="1">
						<text x="10" text="graph.units.hz"/>
						<text x="20" text="20"/>
						<text x="30" text="30"/>
						<text x="50" text="50"/>
						<text x="100" text="100"/>
						<text x="200" text="200"/>
						<text x="300" text="300"/>
						<text x="500" text="500"/>
						<text x="1000" text="graph.values.x_k" text:value="1"/>
						<text x="2000" text="graph.values.x_k" text:value="2"/>
						<text x="3000" text="graph.values.x_k" text:value="3"/>
						<text x="5000" text="graph.values.x_k" text:value="5"/>
						<text x="10000" text="graph.values.x_k" text:value="10"/>
						<text x="20000" text="graph.values.x_k" text:value="20"/>
					</ui:with>
					<ui:with x="10" halign="1" valign="1">
						<ui:for id="g" first="-60" last="12" step="12">
							<text y="${g} db" text="${g}"/>
						</ui:for>
						<text y="0 db" ox="0" oy="2" text="graph.units.db" valign="-1"/>
						<ui:for id="g" first="-42" last="6" step="12">
							<text y="${g} db" text="${g}" visibility=":zoom le -9 db"/>
						</ui:for>
						<ui:for id="g" first="-21" last="3" step="6">
							<text y="${g} db" text="${g}" visibility=":zoom le -15 db"/>
						</ui:for>
					</ui:with>

					<ui:for id="i" first="1" last="7">
						<ui:with ox="0" oy="2" y="1" valign="-1" color="graph_marker_cycle" visibility="false" pad.h="4" font.bold="true">
							<text ui:id="split_note_${i}" x=":sf_${i}" halign="(:sf_${i} lt 500) ? 1 : -1" text.halign="(:sf_${i} lt 500) ? -1 : 1" color.hue="${(:i-1) * 0.125}"/>
						</ui:with>
					</ui:for>
				</graph>
			</group>
			<!-- zoom -->
			<cell rows="2">
				<vbox vexpand="true" bg.color="bg_schema">
					<label font.name="lsp-icons" font.size="12" font.antialias="true" text="icons.main.zoom" color="text_icon" pad.b="4" pad.t="4"/>
					<fader id="zoom" angle="1" vexpand="true" bg.inherit="true" flat="true"/>
					<value id="zoom" width="40"/>
				</vbox>
			</cell>
			<!-- meter in -->
			<cell rows="2">
				<vbox vexpand="true" bg.color="bg_schema">
					<label text="labels.chan.in" pad.b="3" pad.t="3"/>
					<ledmeter vexpand="true" angle="1">
						<ledchannel id="ilm_l" min="-72 db" max="12 db" log="true" type="rms_peak" peak.visibility="true" value.color="left_in"/>
						<ledchannel id="ilm_r" min="-72 db" max="12 db" log="true" type="rms_peak" peak.visibility="true" value.color="right_in"/>
					</ledmeter>
				</vbox>
			</cell>

			<!-- meter out -->
			<cell rows="2">
				<vbox vexpand="true" bg.color="bg_schema">
					<label text="labels.chan.out" pad.b="3" pad.t="3"/>
					<ledmeter vexpand="true" angle="1">
						<ledchannel id="olm_l" min="-72 db" max="12 db" log="true" type="rms_peak" peak.visibility="true" value.color="left"/>
						<ledchannel id="olm_r" min="-72 db" max="12 db" log="true" type="rms_peak" peak.visibility="true" value.color="right"/>
					</ledmeter>
				</vbox>
			</cell>

			<!-- signal -->
			<cell rows="2">
				<vbox spacing="4">
					<group text="groups.signal" expand="true">
						<grid rows="2" cols="2" hspacing="4">
							<knob id="g_in" pad.r="4"/>
							<vbox vfill="false">
								<label text="labels.input" halign="0"/>
								<value id="g_in" sline="true" halign="0"/>
							</vbox>

							<knob id="g_out" pad.r="4"/>
							<vbox vfill="false">
								<label text="labels.output" expand="true" halign="0"/>
								<value id="g_out" width.min="50" sline="true" halign="0"/>
							</vbox>
						</grid>
					</group>

					<!-- Analysis -->
					<group text="groups.analysis" expand="true" ipadding="0">
						<vbox>
							<grid rows="4" cols="2">
								<align halign="-1" pad.t="4" pad.l="6">
									<label text="labels.fft.fft_in"/>
								</align>
								<hbox spacing="4" pad.v="4" pad.h="6" hfill="false"><button id="ife_l" text="labels.chan.L_eft" size="19" ui:inject="Button_left_8"/>
									<button id="ife_r" text="labels.chan.R_ight" size="19" ui:inject="Button_right_8"/></hbox>

								<cell cols="2"><hsep pad.v="2" bg.color="bg" vreduce="true"/></cell>

								<align halign="-1" pad.t="4" pad.l="6">
									<label text="labels.fft.fft_out" halign="0"/>
								</align>
								<hbox spacing="4" pad.v="4" pad.h="6" hfill="false"><button id="ofe_l" text="labels.chan.L_eft" size="19" ui:inject="Button_left_8"/>
									<button id="ofe_r" text="labels.chan.R_ight" size="19" ui:inject="Button_right_8"/></hbox>

								<cell cols="2"><hsep pad.v="2" bg.color="bg" vreduce="true"/></cell>
							</grid>

							<grid rows="2" cols="2" transpose="false" expand="true" hspacing="4">
								<knob id="react" size="20" pad.r="4" pad.l="6"/>
								<vbox vfill="false" pad.r="6">
									<label text="labels.metering.reactivity" halign="0"/>
									<value id="react" width.min="50" sline="true" halign="0"/>
								</vbox>

								<knob id="shift" size="20" pad.r="4" pad.l="6"/>
								<vbox vfill="false" pad.r="6">
									<label text="labels.metering.shift" halign="0"/>
									<value id="shift" width.min="50" sline="true" halign="0"/>
								</vbox>
							</grid>
						</vbox>
					</group>
				</vbox>
			</cell>

			<!-- bottom line -->
			<hbox spacing="8" vreduce="true" bg.color="bg_schema" pad.h="6">
				<label text="labels.mode:"/>
				<combo id="mode" pad.r="8" pad.v="4"/>
				<void hexpand="true"/>
				<button id="smapply" text="labels.chan.sm_apply" size="22" pad.v="4" ui:inject="Button_green"/>
				<vsep pad.h="2" bg.color="bg" reduce="true"/>
				<button id="flt" text="labels.filters" size="22" pad.v="4" ui:inject="Button_yellow"/>
				<button id="crv" text="labels.curve" size="22" pad.v="4" ui:inject="Button_cyan"/>
			</hbox>
		</grid>

		<void height="4" bg.color="bg" vreduce="true"/>

		<!-- Controls -->

		<group text="groups.processor" ipadding="0">
			<grid rows="7" cols="41" transpose="true">

				<label text="labels.band" pad.v="4" vreduce="true"/>
				<label text="labels.slope"/>
				<void/>
				<vbox>
					<label text="labels.range"/>
					<label text="labels.units.:hz"/>
				</vbox>
				<label text="labels.gain"/>
				<label text="labels.controls" pad.h="6" hreduce="true"/>
				<label text="labels.delay"/>

				<!-- Bands 0-7 -->
				<ui:for id="i" first="0" last="7">
					<!-- Separator -->
					<cell rows="7"><vsep pad.h="2" bg.color="bg" hreduce="true"/></cell>

					<!-- Band number -->
					<cell cols="4">
						<label text="${:i+1}" bright="((${i} ieq 0) or (:frs_${i} igt 0)) ? 1.0 : 0.75" bg.bright="((${i} ieq 0) or (:frs_${i} igt 0)) ? 1.0 : :const_bg_darken"/>
					</cell>

					<!-- Slope selector -->
					<!-- c1 -->
					<ui:if test=":i ieq 0">
						<cell cols="4"><label bg.bright="((${i} ieq 0) or (:frs_${i} igt 0)) ? 1.0 : :const_bg_darken"/></cell>
					</ui:if>
					<ui:if test=":i igt 0">
						<cell cols="4"><combo id="frs_${i}" pad.b="4" pad.h="6" bg.bright="((${i} ieq 0) or (:frs_${i} igt 0)) ? 1.0 : :const_bg_darken" bright="((${i} ieq 0) or (:frs_${i} igt 0)) ? 1.0 : 0.75"/></cell>
					</ui:if>

					<cell cols="4"><void height="4" vreduce="true" bg.color="bg"/></cell>

					<!-- Band parameters -->
					<ui:with bg.bright="((${i} ieq 0) or (:frs_${i} igt 0)) ? 1.0 : :const_bg_darken">
						<ui:if test=":i ieq 0">
							<cell cols="2" fill="false">
								<vbox width.min="30">
									<label text="0"/>
									<value id="fre_${i}" sline="true" detailed="false" bright="((${i} ieq 0) or (:frs_${i} igt 0)) ? 1.0 : 0.75"/>
								</vbox>
							</cell>
						</ui:if>
						<ui:if test=":i igt 0">
							<knob id="sf_${i}" scolor.hue=":hue_${i}" pad.l="6" pad.v="4" scolor="((${i} ieq 0) or (:frs_${i} igt 0)) ? 'kscale' : 'kscale_inactive'"/>
						</ui:if>
						<knob id="bg_${i}" scolor.hue=":hue_${i}" pad.v="4" pad.l="6" scolor="((${i} ieq 0) or (:frs_${i} igt 0)) ? 'kscale' : 'kscale_inactive'"/>
						<cell cols="2">
							<grid rows="2" cols="1" hspacing="4" pad.h="6" pad.b="4">
								<hbox pad.t="4">
									<button id="bs_${i}" text="labels.chan.solo" height="19" hfill="true" ui:inject="Button_green_8"/>

									<button id="bm_${i}" text="labels.chan.mute" height="19" hfill="true" ui:inject="Button_red_8" pad.l="4"/>
								</hbox>
								<button id="bp_${i}" text="labels.chan.phase" height="19" hfill="true" ui:inject="Button_yellow_8" pad.v="4"/>
							</grid>
						</cell>
						<knob id="bd_${i}" scolor.hue=":hue_${i}" pad.l="6" pad.b="4" scolor="((${i} ieq 0) or (:frs_${i} igt 0)) ? 'kscale' : 'kscale_inactive'"/>
						<!-- c2 -->
						<ui:with bright="((${i} ieq 0) or (:frs_${i} igt 0)) ? 1.0 : 0.75">
							<ui:if test=":i igt 0">
								<vbox width.min="30">
									<value id="sf_${i}" visibility=":frs_${i} igt 0" detailed="false"/>
									<value id="fre_${i}" visibility=":frs_${i} igt 0" detailed="false"/>
									<label text="labels.chan.off" visibility=":frs_${i} ile 0"/>
								</vbox>
							</ui:if>
							<value id="bg_${i}" width.min="32" pad.h="6"/>
							<value id="bd_${i}" width.min="32" pad.h="6"/>
						</ui:with>
					</ui:with>

					<!-- c4 -->
					<cell rows="4"><void width="4" bg.color="bg" hreduce="true"/></cell>

					<!-- c5 -->
					<cell rows="4" hreduce="true">
						<ledmeter angle="1" bg.bright="((${i} ieq 0) or (:frs_${i} igt 0)) ? 1.0 : :const_bg_darken" bright="((${i} ieq 0) or (:frs_${i} igt 0)) ? 1.0 : 0.75">
							<ledchannel id="blm_${i}l" min="-72 db" max="12 db" log="true" type="rms_peak" peak.visibility="true" value.color="left"/>
							<ledchannel id="blm_${i}r" min="-72 db" max="12 db" log="true" type="rms_peak" peak.visibility="true" value.color="right"/>
						</ledmeter>
					</cell>
				</ui:for>
			</grid>
		</group>
	</vbox>

</plugin>
