summaryrefslogtreecommitdiff
path: root/daemon/src/Sinewave.h
blob: d8988ad3a2f5ff963753ff3658a976433fc08954 (plain)
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
30
31
32
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();
};