This document covers the reusable IntegerSlider control used across the app for integer-valued ranges.
IntegerSlider is a WPF UserControl that pairs a label, a custom thumb, a floating value popup, and optional tick labels. It is used when the UI needs an integer range with visual position feedback, not a plain Slider.
IntegerSlider is used in these places:
Components/EncoderPreviewPanel.xamlfor preview position selectionComponents/VpyPreviewPanel.xamlfor VapourSynth preview position selectionComponents/EncoderRateControlPanel.xamlfor CRF and ABR controlsComponents/EncoderCustomParamsPanel.xamlfor keyframe interval controlsComponents/EncodingMonitor.xamlfor sample interval controlViews/SampleClipModal.xamlfor clip durationViews/ParallelismConfModal.xamlfor thread countViews/FilterScribeModal.xamlfor crop and scale values
<comps:IntegerSlider Grid.Column="1"
Minimum="0"
Maximum="{Binding MaxValue}"
Value="{Binding CurrentValue, Mode=TwoWay}"
TickLabels="{Binding Labels}"
TickCount="5"
LabelWidth="0"
HorizontalAlignment="Stretch" />MinimumandMaximumdefine the integer range.Valueis the bound selection.TickLabelssupplies the displayed labels under the track.TickCountkeeps the track layout stable when labels are present.Stepsnaps movement to a fixed integer increment.SnapToTickskeeps the selected value aligned to ticks.IsLogarithmicswitches the position math to a logarithmic scale.
In ImgABPvVM, the preview slider is initialized from source ffprobe data. When source stats are available, PreviewPositionSeconds starts near the middle of the available range; otherwise it starts at 0.
- The thumb position is calculated from
Minimum,Maximum, andValue. - The popup and tick labels use the same range math, so they stay aligned with the thumb.
MaximumandTickCountchanges re-clamp the current value.