summaryrefslogtreecommitdiffstats
path: root/Master/Modellbildung_und_Simulation/Aufgabenblatt1/SineGenerator/src/SineGenerator.h
blob: d946bfa18f1fb6b0ca18b4f2a0041e9a0af4e326 (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
35
36
37
38
/*
 * SineGenerator.h
 *
 *  Created on: 31.03.2011
 *      Author: sven
 */

#ifndef SINEGENERATOR_H_
#define SINEGENERATOR_H_

#ifndef SINEGENERATORPARAMETERS_H_
	#include "SineGeneratorParameters.h"
#endif
#ifndef _GLIBCXX_FSTREAM
	#include <fstream>
#endif
#ifndef _GLIBCXX_VECTOR
	#include <vector>
#endif

typedef std::vector<short> WaveData;
typedef WaveData::iterator DataIter;

class SineGenerator {
public:
	SineGenerator(SineGeneratorParameters&);
	virtual ~SineGenerator();
	void generateWavefile();
private:
	static const double PI;
	SineGeneratorParameters& mParams;
	WaveData mData;
	void writeWaveHeader(std::ofstream&);
	void writeWaveData(std::ofstream&);
	void generateData();
};

#endif /* SINEGENERATOR_H_ */