示例#1
0
void ParamManager::
initialize() {
  BotParam* botParam = mBotWrapper->getBotParam();
  if (botParam == NULL) return;
  bot_param_add_update_subscriber(mBotWrapper->getBotParam(),
                                  ::onParamChange, this);
  onParamChange();
}
示例#2
0
Reverb1::Reverb1(Context& ctx, QWidget *parent) :
	RackElement(ctx, parent), AllPassReverb() {

	connector = new PinConnector(ctx, this, this);

	setMinimumSize(760,64);
	setMaximumSize(760,64);

	for (unsigned int i = 0; i < 4; ++i) {
		elements.gates[i].kDelay = new Knob("delay", 0, 100, 30, 5, this);
		elements.gates[i].kPosGain = new Knob("gain+", 0, 100, 0, 5, this);
		elements.gates[i].kNegGain = new Knob("gain-", 0, 100, 0, 5, this);
	}
	elements.kDryWet = new Knob("dry/wet", 0, 100, 50, 5, this);
	elements.kDryWet->connectTo((int)AllPassReverbParams::DRY_WET, this, SLOT(onParamChange()));

	elements.gates[0].kDelay->connectTo((int)AllPassReverbParams::GATE1A_DELAY, this, SLOT(onParamChange()));
	elements.gates[0].kPosGain->connectTo((int)AllPassReverbParams::GATE1A_POS_GAIN, this, SLOT(onParamChange()));
	elements.gates[0].kNegGain->connectTo((int)AllPassReverbParams::GATE1A_NEG_GAIN, this, SLOT(onParamChange()));

	elements.gates[1].kDelay->connectTo((int)AllPassReverbParams::GATE1B_DELAY, this, SLOT(onParamChange()));
	elements.gates[1].kPosGain->connectTo((int)AllPassReverbParams::GATE1B_POS_GAIN, this, SLOT(onParamChange()));
	elements.gates[1].kNegGain->connectTo((int)AllPassReverbParams::GATE1B_NEG_GAIN, this, SLOT(onParamChange()));

	elements.gates[2].kDelay->connectTo((int)AllPassReverbParams::GATE2A_DELAY, this, SLOT(onParamChange()));
	elements.gates[2].kPosGain->connectTo((int)AllPassReverbParams::GATE2A_POS_GAIN, this, SLOT(onParamChange()));
	elements.gates[2].kNegGain->connectTo((int)AllPassReverbParams::GATE2A_NEG_GAIN, this, SLOT(onParamChange()));

	elements.gates[3].kDelay->connectTo((int)AllPassReverbParams::GATE2B_DELAY, this, SLOT(onParamChange()));
	elements.gates[3].kPosGain->connectTo((int)AllPassReverbParams::GATE2B_POS_GAIN, this, SLOT(onParamChange()));
	elements.gates[3].kNegGain->connectTo((int)AllPassReverbParams::GATE2B_NEG_GAIN, this, SLOT(onParamChange()));

	btn = new QPushButton(this);
	connect(btn, SIGNAL(clicked()), this, SLOT(onToggleLCDmode()));

	analysis.lcd = new LCD(this);
	analysis.lcd->setCentered(true);
	analysis.needsUpdate = true;

}
示例#3
0
文件: Mixer1.cpp 项目: k-a-z-u/KSynth
Mixer1::Mixer1(Context& ctx, QWidget *parent) :
	RackElement(ctx, parent), SimpleMixer() {

	setSize(760, 192);

	elements.connector = new PinConnector(ctx, this, this);

	elements.vuMeter = new VUMeter(this);
	elements.sldMainVol = new Slider1("main", 0, 127, 100, 5, this);
	elements.sldMainVol->addSnap(100, 5);

	for (unsigned int i = 0; i < 9; ++i) {
		elements.gslots[i].sldVolume = new Slider1("vol " + std::to_string(i+1), 0, 127, 100, 5, this);
		elements.gslots[i].sldVolume->addSnap(100, 5);
		elements.gslots[i].vuMeter = new VUMeter(this);
		elements.gslots[i].kHighPass = new Knob(" HP", 0, 100, 0, 5, this);
		elements.gslots[i].kLowPass = new Knob(" LP", 0, 100, 0, 5, this);
		elements.gslots[i].kPan = new Knob("pan", 0, 100, 50, 5, this);
		elements.gslots[i].kPan->addSnap(50, 4);
		elements.gslots[i].ledLowPass = new LED1(this);
		elements.gslots[i].ledHighPass = new LED1(this);
	}

	elements.sldMainVol->connectTo((int)SimpleMixerParams::MASTER_VOLUME, this, SLOT(onParamChange()));

	elements.gslots[0].sldVolume->connectTo((int)SimpleMixerParams::SLOT1_VOLUME, this, SLOT(onParamChange()));
	elements.gslots[1].sldVolume->connectTo((int)SimpleMixerParams::SLOT2_VOLUME, this, SLOT(onParamChange()));
	elements.gslots[2].sldVolume->connectTo((int)SimpleMixerParams::SLOT3_VOLUME, this, SLOT(onParamChange()));
	elements.gslots[3].sldVolume->connectTo((int)SimpleMixerParams::SLOT4_VOLUME, this, SLOT(onParamChange()));
	elements.gslots[4].sldVolume->connectTo((int)SimpleMixerParams::SLOT5_VOLUME, this, SLOT(onParamChange()));
	elements.gslots[5].sldVolume->connectTo((int)SimpleMixerParams::SLOT6_VOLUME, this, SLOT(onParamChange()));
	elements.gslots[6].sldVolume->connectTo((int)SimpleMixerParams::SLOT7_VOLUME, this, SLOT(onParamChange()));
	elements.gslots[7].sldVolume->connectTo((int)SimpleMixerParams::SLOT8_VOLUME, this, SLOT(onParamChange()));
	elements.gslots[8].sldVolume->connectTo((int)SimpleMixerParams::SLOT9_VOLUME, this, SLOT(onParamChange()));

	elements.gslots[0].kHighPass->connectTo((int)SimpleMixerParams::SLOT1_HIGH_PASS, this, SLOT(onParamChange()));
	elements.gslots[1].kHighPass->connectTo((int)SimpleMixerParams::SLOT2_HIGH_PASS, this, SLOT(onParamChange()));
	elements.gslots[2].kHighPass->connectTo((int)SimpleMixerParams::SLOT3_HIGH_PASS, this, SLOT(onParamChange()));
	elements.gslots[3].kHighPass->connectTo((int)SimpleMixerParams::SLOT4_HIGH_PASS, this, SLOT(onParamChange()));
	elements.gslots[4].kHighPass->connectTo((int)SimpleMixerParams::SLOT5_HIGH_PASS, this, SLOT(onParamChange()));
	elements.gslots[5].kHighPass->connectTo((int)SimpleMixerParams::SLOT6_HIGH_PASS, this, SLOT(onParamChange()));
	elements.gslots[6].kHighPass->connectTo((int)SimpleMixerParams::SLOT7_HIGH_PASS, this, SLOT(onParamChange()));
	elements.gslots[7].kHighPass->connectTo((int)SimpleMixerParams::SLOT8_HIGH_PASS, this, SLOT(onParamChange()));
	elements.gslots[8].kHighPass->connectTo((int)SimpleMixerParams::SLOT9_HIGH_PASS, this, SLOT(onParamChange()));

	elements.gslots[0].kLowPass->connectTo((int)SimpleMixerParams::SLOT1_LOW_PASS, this, SLOT(onParamChange()));
	elements.gslots[1].kLowPass->connectTo((int)SimpleMixerParams::SLOT2_LOW_PASS, this, SLOT(onParamChange()));
	elements.gslots[2].kLowPass->connectTo((int)SimpleMixerParams::SLOT3_LOW_PASS, this, SLOT(onParamChange()));
	elements.gslots[3].kLowPass->connectTo((int)SimpleMixerParams::SLOT4_LOW_PASS, this, SLOT(onParamChange()));
	elements.gslots[4].kLowPass->connectTo((int)SimpleMixerParams::SLOT5_LOW_PASS, this, SLOT(onParamChange()));
	elements.gslots[5].kLowPass->connectTo((int)SimpleMixerParams::SLOT6_LOW_PASS, this, SLOT(onParamChange()));
	elements.gslots[6].kLowPass->connectTo((int)SimpleMixerParams::SLOT7_LOW_PASS, this, SLOT(onParamChange()));
	elements.gslots[7].kLowPass->connectTo((int)SimpleMixerParams::SLOT8_LOW_PASS, this, SLOT(onParamChange()));
	elements.gslots[8].kLowPass->connectTo((int)SimpleMixerParams::SLOT9_LOW_PASS, this, SLOT(onParamChange()));

	elements.gslots[0].kPan->connectTo((int)SimpleMixerParams::SLOT1_PAN, this, SLOT(onParamChange()));
	elements.gslots[1].kPan->connectTo((int)SimpleMixerParams::SLOT2_PAN, this, SLOT(onParamChange()));
	elements.gslots[2].kPan->connectTo((int)SimpleMixerParams::SLOT3_PAN, this, SLOT(onParamChange()));
	elements.gslots[3].kPan->connectTo((int)SimpleMixerParams::SLOT4_PAN, this, SLOT(onParamChange()));
	elements.gslots[4].kPan->connectTo((int)SimpleMixerParams::SLOT5_PAN, this, SLOT(onParamChange()));
	elements.gslots[5].kPan->connectTo((int)SimpleMixerParams::SLOT6_PAN, this, SLOT(onParamChange()));
	elements.gslots[6].kPan->connectTo((int)SimpleMixerParams::SLOT7_PAN, this, SLOT(onParamChange()));
	elements.gslots[7].kPan->connectTo((int)SimpleMixerParams::SLOT8_PAN, this, SLOT(onParamChange()));
	elements.gslots[8].kPan->connectTo((int)SimpleMixerParams::SLOT9_PAN, this, SLOT(onParamChange()));


}