summaryrefslogtreecommitdiff
path: root/daemon/src/Sinewave.h
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/src/Sinewave.h')
-rw-r--r--daemon/src/Sinewave.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/daemon/src/Sinewave.h b/daemon/src/Sinewave.h
new file mode 100644
index 0000000..d8988ad
--- /dev/null
+++ b/daemon/src/Sinewave.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <string>
+#include <math.h>
+#include <chrono>
+
+#include "Assembly.h"
+
+class Sinewave {
+
+public:
+ Sinewave();
+
+ void apply(AssemblyContext ctx);
+
+ void set_amplitude(double amplitude);
+ void set_frequency(double frequency);
+ void set_phase(double phase);
+
+ double get_amplitude() const;
+ double get_frequency() const;
+ double get_phase() const;
+
+private:
+ std::chrono::time_point<std::chrono::high_resolution_clock> m_start_time, m_current_time;
+ std::chrono::duration<double> m_duration_time;
+
+ double m_amplitude;
+ double m_frequency;
+ double m_phase;
+
+ double get_point();
+};