SSI2164-Mixer1.cpp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #include "plugin.hpp"
  2. #include <componentlibrary.hpp>
  3. struct SSI2164_Mixer1 : Module {
  4. enum ParamId {
  5. CH1_AUX1_PARAM,
  6. CH1_AUX2_PARAM,
  7. CH1_PAN_PARAM,
  8. CH1_MUTE_PARAM,
  9. CH1_FAD_PARAM,
  10. PARAMS_LEN
  11. };
  12. enum InputId {
  13. CH1_IN_INPUT,
  14. CH1_PAN_INPUT,
  15. AUX2_RETURN_R_INPUT,
  16. AUX2_RETURN_L_INPUT,
  17. AUX1_RETURN_INPUT,
  18. INPUTS_LEN
  19. };
  20. enum OutputId {
  21. AUX2_SEND_L_OUTPUT,
  22. AUX1_SEND_OUTPUT,
  23. AUX2_SEND_R_OUTPUT,
  24. MASTER_OUT_L_OUTPUT,
  25. MASTER_OUT_R_OUTPUT,
  26. OUTPUTS_LEN
  27. };
  28. enum LightId {
  29. CH1_LEVEL_LIGHT,
  30. MASTER_LED_L_LIGHT,
  31. MASTER_LED_R_LIGHT,
  32. LIGHTS_LEN
  33. };
  34. SSI2164_Mixer1() {
  35. config(PARAMS_LEN, INPUTS_LEN, OUTPUTS_LEN, LIGHTS_LEN);
  36. configParam(CH1_AUX1_PARAM, 0.f, 1.f, 0.f, "Aux 1");
  37. configParam(CH1_AUX2_PARAM, 0.f, 1.f, 0.f, "Aux 2");
  38. configParam(CH1_PAN_PARAM, 0.f, 1.f, 0.5f, "Pan", "R/L", 2.f);
  39. configParam(CH1_MUTE_PARAM, 0.f, 1.f, 0.f, "Mute");
  40. configParam(CH1_FAD_PARAM, 0.f, 1.f, 0.f, "Fader");
  41. configInput(CH1_IN_INPUT, "Ch1");
  42. configInput(CH1_PAN_INPUT, "Ch1 Pan CV");
  43. configOutput(AUX1_SEND_OUTPUT, "Aux 1 Send");
  44. configInput(AUX1_RETURN_INPUT, "Aux 1 Return");
  45. configOutput(AUX2_SEND_L_OUTPUT, "Aux 2 Send L");
  46. configOutput(AUX2_SEND_R_OUTPUT, "Aux 2 Send R");
  47. configInput(AUX2_RETURN_L_INPUT, "Aux 2 Return L");
  48. configInput(AUX2_RETURN_R_INPUT, "Aux 2 Return R");
  49. configOutput(MASTER_OUT_L_OUTPUT, "Master L");
  50. configOutput(MASTER_OUT_R_OUTPUT, "Master R");
  51. }
  52. void process(const ProcessArgs& args) override {
  53. }
  54. };
  55. struct SSI2164_Mixer1Widget : ModuleWidget {
  56. SSI2164_Mixer1Widget(SSI2164_Mixer1* module) {
  57. setModule(module);
  58. setPanel(createPanel(asset::plugin(pluginInstance, "res/SSI2164-Mixer1.svg")));
  59. addChild(createWidget<ScrewSilver>(Vec(RACK_GRID_WIDTH, 0)));
  60. addChild(createWidget<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
  61. addChild(createWidget<ScrewSilver>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
  62. addChild(createWidget<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
  63. addInput(createInputCentered<PJ301MPort>(mm2px(Vec(12, 17)), module, SSI2164_Mixer1::CH1_IN_INPUT));
  64. addInput(createInputCentered<PJ301MPort>(mm2px(Vec(12, 28)), module, SSI2164_Mixer1::CH1_PAN_INPUT));
  65. addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(12, 38)), module, SSI2164_Mixer1::CH1_AUX1_PARAM));
  66. addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(12, 49)), module, SSI2164_Mixer1::CH1_AUX2_PARAM));
  67. addParam(createParamCentered<RoundBlackKnob>(mm2px(Vec(12, 59)), module, SSI2164_Mixer1::CH1_PAN_PARAM));
  68. addParam(createParamCentered<VCVLatch>(mm2px(Vec(12, 68)), module, SSI2164_Mixer1::CH1_MUTE_PARAM));
  69. addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(12, 77)), module, SSI2164_Mixer1::CH1_LEVEL_LIGHT));
  70. addParam(createParamCentered<VCVSlider>(mm2px(Vec(12, 101)), module, SSI2164_Mixer1::CH1_FAD_PARAM));
  71. addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(141, 13)), module, SSI2164_Mixer1::AUX1_SEND_OUTPUT));
  72. addInput(createInputCentered<PJ301MPort>(mm2px(Vec(141, 27)), module, SSI2164_Mixer1::AUX1_RETURN_INPUT));
  73. addInput(createInputCentered<PJ301MPort>(mm2px(Vec(160, 27)), module, SSI2164_Mixer1::AUX2_RETURN_L_INPUT));
  74. addInput(createInputCentered<PJ301MPort>(mm2px(Vec(172, 27)), module, SSI2164_Mixer1::AUX2_RETURN_R_INPUT));
  75. addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(160, 13)), module, SSI2164_Mixer1::AUX2_SEND_L_OUTPUT));
  76. addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(172, 13)), module, SSI2164_Mixer1::AUX2_SEND_R_OUTPUT));
  77. addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(160, 113)), module, SSI2164_Mixer1::MASTER_OUT_L_OUTPUT));
  78. addOutput(createOutputCentered<PJ301MPort>(mm2px(Vec(172, 113)), module, SSI2164_Mixer1::MASTER_OUT_R_OUTPUT));
  79. addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(160, 77)), module, SSI2164_Mixer1::MASTER_LED_L_LIGHT));
  80. addChild(createLightCentered<MediumLight<RedLight>>(mm2px(Vec(172, 77)), module, SSI2164_Mixer1::MASTER_LED_R_LIGHT));
  81. }
  82. };
  83. Model* modelSSI2164_Mixer1 = createModel<SSI2164_Mixer1, SSI2164_Mixer1Widget>("SSI2164-Mixer1");