<plugin resizable="true">
	<vbox spacing="4">
		<!-- Head settings -->
		<hbox fill="true" bg.color="bg_schema">
			<label text="labels.mode" pad.l="6" pad.v="4"/>
			<combo id="mode" pad.h="6" pad.v="4"/>
			<vsep bg.color="bg" pad.h="2" hreduce="true" hexpand="false"/>
			<button ui:inject="Button_cyan" text="actions.freeze" size="16" width="64" id="freeze" pad.h="6"/>
			<vsep bg.color="bg" pad.h="2" hreduce="true" hexpand="false"/>
			<button ui:inject="Button_magenta" text="actions.linear_frequency" size="16" width="64" id="linfreq" pad.h="6"/>
			<vsep bg.color="bg" pad.h="2" hreduce="true" hexpand="false"/>
			<button ui:inject="Button_orange" text="labels.chan.inspect" size="16" width="64" id="insp_on" pad.h="6"/>
			<knob id="insp_r" scale.size="3" scolor="orange" size="10" pad.h="6"/>
			<value id="insp_r" width.min="48" same_line="true" fill="true" halign="1" pad.r="6"/>
			<void hexpand="true" hfill="true"/>
		</hbox>

		<hbox expand="true" spacing="4">
			<vbox spacing="4" expand="true">

				<!-- Analyzer, Mastering -->
				<group ui:inject="GraphGroup" ipadding="0" text="labels.graphs.frequency" expand="true" visibility=":mode ile 1">
					<graph ui:id="main_graph" width.min="832" height.min="400" expand="true" fill="true">
						<origin hpos="-1" vpos="-1" visibility="false"/>

						<!-- Secondary grid -->
						<ui:with color="graph_sec">
							<ui:with visibility="!:linfreq">
								<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>
							<ui:for id="f" first="1000" last="23000" step="1000">
								<marker v="${:f}" visibility=":linfreq"/>
							</ui:for>

							<ui:for id="g" first="-60" last="12" step="24">
								<marker v="${g} db" ox="1" oy="0"/>
							</ui:for>

							<ui:for id="t" first="-42" last="-6" step="12">
								<marker v="${t} db" ox="1" oy="0" visibility=":zoom le -18 db"/>
							</ui:for>
							<ui:for id="t" first="-33" last="-15" step="6">
								<marker v="${t} db" ox="1" oy="0" visibility=":zoom le -33 db"/>
							</ui:for>
						</ui:with>

						<!-- Primary Grid -->
						<ui:with color="graph_prim">
							<marker v="100" visibility="!:linfreq"/>
							<marker v="1000" visibility="!:linfreq"/>
							<marker v="10000" visibility="!:linfreq"/>

							<marker v="0 db" ox="1" oy="0"/>
							<marker v="-24 db" ox="1" oy="0"/>
							<marker v="-48 db" ox="1" oy="0"/>

							<marker v="1" ox="2" oy="0" visibility="false"/>
							<marker v="24000" visibility="false"/>
						</ui:with>

						<!-- Piano keys -->
						<embed oy="3" 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 and !:linfreq">
							<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="3" y="44" halign="1" valign="1" pgroup="0" priority="10" visibility=":_ui_graph_piano_layout and !:linfreq" 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>

						<!-- Meshes -->
						<mesh xi="0" yi="3" id="spd" width="1" color="cyan" fill.color="cyan" fill.color.a="0.9" color.a="0.5" fill="true" visibility=":mtrack"/>
						<mesh xi="0" yi="1" id="spd" width=":lthick+1" color="mono" visibility_id="on_0"/>
						<mesh id="ifmesh" width="3" color="cyan" fill.color="cyan" fill.color.a="0.8" fill="true" visibility=":insp_id > 0.5" />

						<!-- Axis -->
						<axis ui:id="main_graph_ox" angle="0.0" min="10" max="24000" log="!:linfreq" visibility="false"/>
						<axis angle="0.5" min="-72 db / :zoom" max="24 db * :zoom" log="true" visibility="false"/>
						<axis angle="0.5" min="-1" max="1" visibility="false"/>
						<axis min="0" max=":_a_scaled_height" visibility="false" angle="0.5"/>

						<!-- Marker horizontal line -->
						<marker id="mlval" ox="1" oy="0" width="2" hwidth="2" color="graph_marker_line" hcolor="graph_marker_line_hover" pointer="vsize" visibility=":mline" editable="true"/>

						<!-- Marker -->
						<marker id="sel" ox="0" oy="1" width="2" hwidth="2" pointer="hsize" editable="true" color="graph_marker_mono" hcolor="graph_marker_mono"/>

						<!-- Text -->
						<ui:with ox="0" oy="2" y="0" halign="1" valign="1" visibility="!:linfreq">
							<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 ox="0" oy="2" y="0" halign="1" valign="1" visibility=":linfreq">
							<text x="10" text="graph.units.hz"/>
							<ui:for id="f" first="1" last="23">
								<text x="${:f * 1000}" text="graph.values.x_k" text:value="${f}"/>
							</ui:for>
						</ui:with>

						<ui:for id="t" first="-60" last="12" step="12">
							<text x="10" y="${t} db" text="${t}" halign="1" valign="1"/>
						</ui:for>
						<text x="10" y="1" ox="0" oy="2" text="graph.units.db" halign="1" valign="-1"/>
						<ui:with x="10" halign="1" valign="1" visibility=":zoom le -18 db">
							<text y="-42 db" text="-42"/>
							<text y="-30 db" text="-30"/>
							<text y="-18 db" text="-18"/>
							<text y="-6 db" text="-6"/>
						</ui:with>
						<ui:with x="10" halign="1" valign="1" visibility=":zoom le -33 db">
							<text y="-33 db" text="-33"/>
							<text y="-27 db" text="-27"/>
							<text y="-21 db" text="-21"/>
							<text y="-15 db" text="-33"/>
						</ui:with>

						<!-- Measure text -->
						<text ui:id="mline_level" visibility=":mline" valign="(:mlval lt 0 db) ? 1 : -1" text.valign="(:mlval lt 0 db) ? -1 : 1" ox="0" oy="1" x="24000" y=":mlval" halign="-1" color="graph_marker_line" font.bold="true"/>

						<!-- Selector text -->
						<text ui:id="selector_freq_0" x=":sel" color="graph_marker_mono" visibility="((:mode ieq 0) or (:mode ieq 1))" halign="(:sel lt (:linfreq ? 12000 : 500)) ? 1 : -1" text.halign="(:sel lt (:linfreq ? 12000 : 500)) ? -1 : 1" ox="0" oy="2" y="1" valign="-1" pad.h="4" font.bold="true"/>
					</graph>
				</group>

				<!-- Spectralizer (1 channel) -->
				<group ui:inject="GraphGroup" ipadding="0" text="labels.graphs.frequency" expand="true" visibility=":mode ieq 2">
					<graph ui:id="spc_single_graph" width.min="738" height.min="415" expand="true" fill="true">
						<origin hpos="-1" vpos="1" visibility="false"/>						
						<origin hpos="-1" vpos="-1" visibility="false"/>

						<!-- Frame buffer -->
						<fbuffer id="fb" width="1" height="1" hpos="-1" vpos="1" transparency="0.25" angle="0" mode=":spm" color="mono" color.hue=":spc / 1.0"/>

						<!-- Secondary grid -->
						<ui:with color="graph_prim" color.a="0.5">
							<ui:with visibility="!:linfreq">
								<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>
							<ui:for id="f" first="1000" last="23000" step="1000">
								<marker v="${:f}" visibility=":linfreq"/>
							</ui:for>

							<ui:for id="t" first="1" last="7" step="2">
								<marker v="${t}" ox="1" oy="0"/>
							</ui:for>
						</ui:with>

						<!-- Primary grid -->
						<ui:with color="graph_prim">
							<marker v="100" visibility="!:linfreq"/>
							<marker v="1000" visibility="!:linfreq"/>
							<marker v="10000" visibility="!:linfreq"/>
							<ui:for id="t" first="2" last="6" step="2">
								<marker v="${t}" ox="1" oy="0"/>
							</ui:for>
							<marker v="8" ox="1" oy="0" visibility="false"/>
							<marker v="24000" ox="0" oy="1" visibility="false"/>
						</ui:with>

						<!-- Piano keys -->
						<embed ox="0" oy="2" o="1" start.x="midi_freq_start(12, 127)" start.y="20" end.x="midi_freq_end(12, 127)" end.y="44" valign="1" alpha="0.35" visibility=":_ui_graph_piano_layout and !:linfreq">
							<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" o="1" y="44" halign="1" valign="1" pgroup="0" priority="10" visibility=":_ui_graph_piano_layout and !:linfreq" 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>

						<!-- Axis -->
						<axis angle="0.0" ui:id="spc_single_graph_ox" min="10" max="24000" log="!:linfreq" visibility="false"/>
						<axis angle="1.5" min="0" max="8" log="false" visibility="false"/>
						<axis min="0" max=":_a_scaled_height" visibility="false" angle="0.5"/>

						<marker id="sel" ox="0" oy="1" width="2" hwidth="2" color="graph_marker_line" hcolor="graph_marker_line" pointer="hsize" editable="true"/>
						<text ox="0" oy="1" y="0" valign="-1" color="graph_marker_line" pad.h="4" font.bold="true" ui:id="global_selector_spc" text="xxx" x=":sel" halign="(:sel lt 500) ? 1 : -1" text.halign="(:sel lt 500) ? -1 : 1"/>

						<!-- Text -->
						<ui:with y="8" halign="1" valign="1" color="graph_prim" visibility="!:linfreq">
							<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 y="8" halign="1" valign="1" color="graph_prim" visibility=":linfreq">
							<text x="10" text="graph.units.hz"/>
							<ui:for id="f" first="1" last="23">
								<text x="${:f * 1000}" text="graph.values.x_k" text:value="${f}"/>
							</ui:for>
						</ui:with>

						<text x="10" y="0" text="graph.axis.time" halign="1" valign="-1" color="graph_prim"/>
						<ui:for id="t" first="1" last="7">
							<text x="10" y="${t}" text="${t}" halign="1" valign="1" color="graph_prim"/>
						</ui:for>
					</graph>
				</group>

				<!-- Bottom menu -->
				<hbox pad.l="6" pad.r="6" pad.t="4" pad.b="4" bg.color="bg_schema">

					<hbox spacing="8">
						<label text="labels.fft.window"/>
						<combo id="wnd" pad.r="15"/>
						<label text="labels.fft.tolerance"/>
						<combo id="tol" pad.r="15"/>
						<label text="labels.fft.envelope"/>
						<combo id="env" pad.r="15"/>
					</hbox>

					<void hexpand="true"/>
					<hbox spacing="8">
						<label text="labels.line_size" visibility=":mode ilt 2"/>
						<combo id="lthick" visibility=":mode ilt 2"/>
						<hbox fill="false" spacing="4" pad.h="4" visibility=":mode ilt 2">
							<button ui:inject="Button_cyan" text="labels.history" id="mtrack" size="16"/>
							<button ui:inject="Button_cyan" text="labels.clear" id="mreset" size="16"/>
						</hbox>
						<button ui:inject="Button_cyan" text="labels.metering.measure_line" id="mline" size="16" visibility=":mode ilt 2" pad.l="15"/>
					</hbox>
				</hbox>
			</vbox>

			<!-- Zoom Fader -->
			<vbox visibility=":mode ile 1" 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>

			<!-- Metering -->
			<group text="groups.metering" vexpand="true" bg.color="bg" ipadding="0">
				<grid rows="21" cols="1" expand="true">
					<ui:with bg.color="bg_schema">
						<vbox width.min="107" padding="6">
							<label text="labels.metering.preamp" pad.b="6"/>
							<hbox>
								<knob id="pamp" width="60"/>
								<value id="pamp" sline="true" width="60"/>
							</hbox>
						</vbox>

						<hsep bg.color="bg" pad.v="2" vreduce="true" vexpand="false"/>

						<vbox padding="6">
							<label text="labels.metering.reactivity" width="58" pad.b="6"/>
							<hbox>
								<knob id="react" width="60"/>
								<value id="react" sline="true" width="60"/>
							</hbox>
						</vbox>

						<hsep bg.color="bg" pad.v="2" vreduce="true" vexpand="false" visibility=":mode ile 1"/>

						<vbox visibility=":mode ile 1" padding="6">
							<label text="labels.metering.selector" width="58" pad.b="6"/>
							<hbox>
								<knob id="sel" scolor="mono" width="60"/>
								<value id="sel" sline="true" width="60"/>
							</hbox>
						</vbox>

						<hsep bg.color="bg" pad.v="2" vreduce="true" vexpand="false"/>

						<vbox padding="6">
							<label text="labels.chan.shift" width="58" pad.b="6"/>
							<hbox>
								<knob id="sh_0" scolor="mono" width="60"/>
								<value id="sh_0" detailed="true" sline="true" width="60"/>
							</hbox>
						</vbox>

						<hsep bg.color="bg" pad.v="2" vreduce="true" vexpand="false"/>

						<vbox padding="6">
							<shmlink id="ret_0" value.maxlen="6" text.clip="true" hfill="true"/>
						</vbox>

						<hsep bg.color="bg" pad.v="2" vreduce="true" vexpand="false"/>

						<vbox padding="6">
							<button ui:inject="Button_cyan" id="frz_0" text="labels.chan.hold" height="16" font.size="12" hfill="true"/>
						</vbox>

						<hsep bg.color="bg" pad.v="2" vreduce="true" vexpand="false" visibility=":mode ige 2"/>

						<vbox visibility=":mode ige 2" padding="6">
							<button ui:inject="Button_yellow" text="labels.log_dots" id="splog" height="16" font.size="12" hfill="true"/>
						</vbox>

						<hsep bg.color="bg" pad.v="2" vreduce="true" vexpand="false" visibility=":mode ige 2"/>

						<vbox visibility=":mode ige 2" padding="6">
							<label text="labels.spectrogram" pad.b="6"/>
							<combo id="spm"/>
						</vbox>

						<hsep bg.color="bg" pad.v="2" vreduce="true" vexpand="false" visibility=":mode ile 1"/>

						<vbox visibility=":mode ile 1" padding="6" vfill="false">
							<label text="labels.metering.fft_frequency:hz" pad.b="6"/>
							<indicator id="freq" format="f6.1!" tcolor="mono"/>
						</vbox>

						<hsep bg.color="bg" pad.v="2" vreduce="true" vexpand="false" visibility=":mode ile 1"/>

						<vbox visibility=":mode ile 1" padding="6" vfill="false">
							<label text="labels.metering.level:db" pad.b="6"/>
							<indicator id="lvl" format="+-f5.1!" tcolor="mono"/>
						</vbox>

						<hsep bg.color="bg" pad.v="2" vreduce="true" vexpand="false"/>

						<void vexpand="true" height.min="8"/>
					</ui:with>
				</grid>
			</group>
		</hbox>
	</vbox>
</plugin>
