14 #include "funcsynth.h"
15 #include "ui_funcsynthform.h"
16 #include "interface.h"
18 #include "xnodeconnector.h"
19 #include <QPushButton>
20 #include <qstatusbar.h>
23 XFuncSynth::XFuncSynth(
const char *name,
bool runtime,
24 Transaction &tr_meas,
const shared_ptr<XMeasure> &meas) :
26 m_output(create<
XBoolNode>(
"Output", true)),
29 m_function(create<
XComboNode>(
"Function", false)),
36 m_form->statusBar()->hide();
37 m_form->setWindowTitle(i18n(
"Func. Synth. - ") + getLabel() );
39 m_conOutput = xqcon_create<XQToggleButtonConnector>(m_output, m_form->m_ckbOutput);
40 m_conTrig = xqcon_create<XQButtonConnector>(m_trig, m_form->m_btnTrig);
41 m_conMode = xqcon_create<XQComboBoxConnector>(m_mode, m_form->m_cmbMode,
Snapshot( *m_mode));
42 m_conFreq = xqcon_create<XQLineEditConnector>(m_freq, m_form->m_edFreq);
43 m_conFunction = xqcon_create<XQComboBoxConnector>(m_function, m_form->m_cmbFunc,
Snapshot( *m_function));
44 m_conAmp = xqcon_create<XQLineEditConnector>(m_amp, m_form->m_edAmp);
45 m_conPhase = xqcon_create<XQLineEditConnector>(m_phase, m_form->m_edPhase);
46 m_conOffset = xqcon_create<XQLineEditConnector>(m_offset, m_form->m_edOffset);
48 m_output->setUIEnabled(
false);
49 m_trig->setUIEnabled(
false);
50 m_mode->setUIEnabled(
false);
51 m_freq->setUIEnabled(
false);
52 m_function->setUIEnabled(
false);
53 m_amp->setUIEnabled(
false);
54 m_phase->setUIEnabled(
false);
55 m_offset->setUIEnabled(
false);
67 m_output->setUIEnabled(
true);
68 m_trig->setUIEnabled(
true);
69 m_mode->setUIEnabled(
true);
70 m_freq->setUIEnabled(
true);
71 m_function->setUIEnabled(
true);
72 m_amp->setUIEnabled(
true);
73 m_phase->setUIEnabled(
true);
74 m_offset->setUIEnabled(
true);
77 m_lsnOutput = tr[ *
output()].onValueChanged().connectWeakly(
78 shared_from_this(), &XFuncSynth::onOutputChanged);
79 m_lsnMode = tr[ *mode()].onValueChanged().connectWeakly(
80 shared_from_this(), &XFuncSynth::onModeChanged);
81 m_lsnFreq = tr[ *
freq()].onValueChanged().connectWeakly(
82 shared_from_this(), &XFuncSynth::onFreqChanged);
83 m_lsnFunction = tr[ *
function()].onValueChanged().connectWeakly(
84 shared_from_this(), &XFuncSynth::onFunctionChanged);
85 m_lsnAmp = tr[ *
amp()].onValueChanged().connectWeakly(
86 shared_from_this(), &XFuncSynth::onAmpChanged);
87 m_lsnPhase = tr[ *
phase()].onValueChanged().connectWeakly(
88 shared_from_this(), &XFuncSynth::onPhaseChanged);
89 m_lsnOffset = tr[ *
offset()].onValueChanged().connectWeakly(
90 shared_from_this(), &XFuncSynth::onOffsetChanged);
94 m_lsnTrig = tr[ *
trig()].onTouch().connectWeakly(
95 shared_from_this(), &XFuncSynth::onTrigTouched);
104 m_lsnFunction.reset();
109 m_output->setUIEnabled(
false);
110 m_trig->setUIEnabled(
false);
111 m_mode->setUIEnabled(
false);
112 m_freq->setUIEnabled(
false);
113 m_function->setUIEnabled(
false);
114 m_amp->setUIEnabled(
false);
115 m_phase->setUIEnabled(
false);
116 m_offset->setUIEnabled(
false);