summaryrefslogtreecommitdiff
path: root/daemon/src/Sinewave.h
blob: ed0d1de4acf22fe7b3afbe42e4c68a1bfdd70bbb (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
34
#pragma once

#include <cmath>
#include <chrono>

#include "Assembly.h"


class Sinewave
{
	using clock = std::chrono::high_resolution_clock;

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;

	double get_point() const;

private:
	const std::chrono::high_resolution_clock::time_point m_start_time;

	double m_amplitude;
	double m_frequency;
	double m_phase;
};