mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
Add OpenGL waterfall renderer
This commit is contained in:
+30
-9
@@ -431,7 +431,7 @@ type
|
||||
PbSpectrum: TControl;
|
||||
PbRuler: TPaintBox; // полоса частотных меток между спектром и водопадом
|
||||
PanelSplitter: TPanel; // перетаскиваемый разделитель спектр/водопад
|
||||
PbWaterfall: TPaintBox;
|
||||
PbWaterfall: TControl;
|
||||
|
||||
// ---- Status bar ----
|
||||
StatusPanel: TMainStatusBar;
|
||||
@@ -1469,6 +1469,8 @@ begin
|
||||
FSplitterDrag := False;
|
||||
|
||||
FUseOpenGLSpectrum := HasOpenGLSpectrumSwitch;
|
||||
if FUseOpenGLSpectrum then
|
||||
FWaterfallFrameInterval := 1;
|
||||
if FUseOpenGLSpectrum then
|
||||
FSpecView := TSpectrumViewOpenGL.Create
|
||||
else
|
||||
@@ -2186,12 +2188,26 @@ begin
|
||||
PanelSplitter.OnMouseMove := SplitterMouseMove;
|
||||
PanelSplitter.OnMouseUp := SplitterMouseUp;
|
||||
|
||||
PbWaterfall := TPaintBox.Create(Self);
|
||||
if FUseOpenGLSpectrum then
|
||||
begin
|
||||
PbWaterfall := TOpenGLControl.Create(Self);
|
||||
TOpenGLControl(PbWaterfall).AutoResizeViewport := False;
|
||||
TOpenGLControl(PbWaterfall).DoubleBuffered := True;
|
||||
TOpenGLControl(PbWaterfall).OnPaint := FSpecView.PaintWaterfall;
|
||||
TOpenGLControl(PbWaterfall).OnMouseDown := PbWaterfallMouseDown;
|
||||
TOpenGLControl(PbWaterfall).OnMouseMove := PbWaterfallMouseMove;
|
||||
TOpenGLControl(PbWaterfall).OnMouseUp := PbWaterfallMouseUp;
|
||||
TSpectrumViewOpenGL(FSpecView).AttachWaterfallControl(TOpenGLControl(PbWaterfall));
|
||||
end
|
||||
else
|
||||
begin
|
||||
PbWaterfall := TPaintBox.Create(Self);
|
||||
TPaintBox(PbWaterfall).OnPaint := FSpecView.PaintWaterfall;
|
||||
TPaintBox(PbWaterfall).OnMouseDown := PbWaterfallMouseDown;
|
||||
TPaintBox(PbWaterfall).OnMouseMove := PbWaterfallMouseMove;
|
||||
TPaintBox(PbWaterfall).OnMouseUp := PbWaterfallMouseUp;
|
||||
end;
|
||||
PbWaterfall.Parent := PanelRight;
|
||||
PbWaterfall.OnPaint := FSpecView.PaintWaterfall;
|
||||
PbWaterfall.OnMouseDown := PbWaterfallMouseDown;
|
||||
PbWaterfall.OnMouseMove := PbWaterfallMouseMove;
|
||||
PbWaterfall.OnMouseUp := PbWaterfallMouseUp;
|
||||
|
||||
// Initial layout
|
||||
ResizeSpectrumPanels;
|
||||
@@ -2616,7 +2632,8 @@ begin
|
||||
|
||||
if PbSpectrum is TPaintBox then
|
||||
TPaintBox(PbSpectrum).Color := T.BG;
|
||||
PbWaterfall.Color := T.BG;
|
||||
if PbWaterfall is TPaintBox then
|
||||
TPaintBox(PbWaterfall).Color := T.BG;
|
||||
if PanelSMeterRight <> nil then PanelSMeterRight.Color := T.Panel;
|
||||
if PbSMeterRight <> nil then PbSMeterRight.Color := T.Panel;
|
||||
ApplyStatusTheme(T);
|
||||
@@ -7025,8 +7042,12 @@ begin
|
||||
if FPS > 100 then FPS := 100;
|
||||
FDisplayFPS := FPS;
|
||||
FSpectrumTimer.Interval := 1000 div FPS;
|
||||
// Thetis по умолчанию обновляет водопад через один display frame.
|
||||
FWaterfallFrameInterval := 2;
|
||||
// CPU path keeps the historical every-other-frame waterfall update.
|
||||
// OpenGL uploads only one texture row per frame, so it can match display FPS.
|
||||
if FUseOpenGLSpectrum then
|
||||
FWaterfallFrameInterval := 1
|
||||
else
|
||||
FWaterfallFrameInterval := 2;
|
||||
FWaterfallFrameCounter := 0;
|
||||
FWaterfallDirty := True;
|
||||
FSpecView.WfFrameInterval := FWaterfallFrameInterval;
|
||||
|
||||
Reference in New Issue
Block a user