From 26293db40f8ac62f3971e0e9dbbc0bf3439e61c0 Mon Sep 17 00:00:00 2001 From: Vasile Vilvoiu Date: Tue, 29 Dec 2020 19:33:03 +0200 Subject: Initial commit --- src/value-map.hpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/value-map.hpp (limited to 'src/value-map.hpp') diff --git a/src/value-map.hpp b/src/value-map.hpp new file mode 100644 index 0000000..b1cf604 --- /dev/null +++ b/src/value-map.hpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020-2021 Vasile Vilvoiu + * + * specgram is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef _VALUE_MAP_HPP_ +#define _VALUE_MAP_HPP_ + +#include "input-parser.hpp" + +#include +#include +#include + +enum class ValueMapType { + kdBFS +}; + +class ValueMap { +protected: + const double lower_; + const double upper_; + + ValueMap(double lower_, double upper); +public: + ValueMap() = delete; + + auto GetLowerBound() const { return lower_; } + auto GetUpperBound() const { return upper_; } + + virtual RealWindow Map(const RealWindow& input) = 0; + virtual std::string GetUnit() const = 0; + virtual std::string GetName() const = 0; +}; + +class dBFSValueMap : public ValueMap { +private: +public: + explicit dBFSValueMap(double mindb); + + RealWindow Map(const RealWindow& input) override; + std::string GetUnit() const override { return "dBFS"; } + std::string GetName() const override { return "dBFS"; } +}; + +#endif \ No newline at end of file -- cgit v1.2.3