summaryrefslogtreecommitdiffstats
path: root/Master/Modellbildung_und_Simulation/Aufgabenblatt1/SineGenerator/src/MainController.h
blob: 6852e517ab6599f10ffd24d72e3529129d27f365 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * MainController.h
 *
 *  Created on: 31.03.2011
 *      Author: sven
 */

#ifndef MAINCONTROLLER_H_
#define MAINCONTROLLER_H_

#ifndef SINEGENERATORPARAMETERS_H_
	#include "SineGeneratorParameters.h"
#endif
#ifndef _GTKMM_H
	#include <gtkmm.h>
#endif

class MainController {
public:
	MainController();
	virtual ~MainController();
	void startApp(Gtk::Main&);
private:
	static const unsigned short DEFAULT_FREQUENCY;
	static const unsigned short DEFAULT_AMPLITUDE;
	static const unsigned short DEFAULT_PHASE;
	static const unsigned short DEFAULT_LENGTH;
	static const char* DEFAULT_WAVEFILENAME;
	static const char* UI_FILENAME;

	Gtk::Window* mPtrMainWin;
	Gtk::SpinButton* mPtrFreqField;
	Gtk::SpinButton* mPtrAmpField;
	Gtk::SpinButton* mPtrPhaseField;
	Gtk::SpinButton* mPtrLengthField;
	Gtk::Entry* mPtrBitrateEntry;
	Gtk::Entry* mPtrSamplerateEntry;
	Gtk::Entry* mPtrFilenameEntry;
	Gtk::Button* mPtrStartBtn;
	SineGeneratorParameters mParams;
	Gtk::Adjustment mFreqAdj;
	Gtk::Adjustment mAmpAdj;
	Gtk::Adjustment mPhaseAdj;
	Gtk::Adjustment mLengthAdj;

	void on_startbutton_clicked();
	void on_freq_changed();
	void on_amp_changed();
	void on_phase_changed();
	void on_length_changed();
	void on_filename_changed();
};

#endif /* MAINCONTROLLER_H_ */