summaryrefslogtreecommitdiff
path: root/src/live.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/live.hpp')
-rw-r--r--src/live.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/live.hpp b/src/live.hpp
new file mode 100644
index 0000000..b49db8c
--- /dev/null
+++ b/src/live.hpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2020-2021 Vasile Vilvoiu <vasi.vilvoiu@gmail.com>
+ *
+ * specgram is free software; you can redistribute it and/or modify
+ * it under the terms of the MIT license. See LICENSE for details.
+ */
+#ifndef _LIVE_HPP_
+#define _LIVE_HPP_
+
+#include "configuration.hpp"
+#include "renderer.hpp"
+#include "color-map.hpp"
+#include <SFML/Graphics.hpp>
+
+class LiveOutput {
+private:
+ /* configuration */
+ const Configuration configuration_;
+ Renderer renderer_;
+
+ /* live window */
+ sf::RenderWindow window_;
+
+ /* raw FFT history */
+ std::vector<uint8_t> fft_area_;
+
+public:
+ LiveOutput() = delete;
+ LiveOutput(const LiveOutput &c) = delete;
+ LiveOutput(LiveOutput &&) = delete;
+ LiveOutput & operator=(const LiveOutput&) = delete;
+
+ LiveOutput(const Configuration& conf, const ColorMap& cmap, const ValueMap& vmap);
+
+ void AddWindow(const std::vector<uint8_t>& window, const RealWindow& win_values);
+ bool HandleEvents();
+ void Render();
+};
+
+#endif \ No newline at end of file