File: TuningContext.h

package info (click to toggle)
cubicsdr 0.2.7%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,604 kB
  • sloc: cpp: 32,850; sh: 60; makefile: 6
file content (29 lines) | stat: -rw-r--r-- 1,033 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+

#pragma once

#include "PrimaryGLContext.h"
#include "Gradient.h"

class TuningCanvas;

class TuningContext: public PrimaryGLContext {
public:
    TuningContext(TuningCanvas *canvas, wxGLContext *sharedContext);

    void DrawBegin();
    void Draw(float r, float g, float b, float a, float p1, float p2);
    void DrawTuner(long long freq, int count, float displayPos, float displayWidth);
    static void DrawTunerDigitBox(int index, int count, float displayPos, float displayWidth, const RGBA4f& c);
    int GetTunerDigitIndex(float mPos, int count, float displayPos, float displayWidth);
    void DrawTunerBarIndexed(int start, int end, int count, float displayPos, float displayWidth, const RGBA4f& color, float alpha, bool top, bool bottom);

    void DrawDemodFreqBw(long long freq, unsigned int bw, long long center);
    void DrawEnd();

private:
    std::locale comma_locale;
    std::stringstream freqStr;
    std::stringstream freqStrFormatted;
};