You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.5KB

  1. #include "BaconPlugs.hpp"
  2. #include "Glissinator.hpp"
  3. namespace rack_plugin_BaconMusic {
  4. struct GlissinatorWidget : ModuleWidget {
  5. typedef Glissinator< Module > G;
  6. GlissinatorWidget( Glissinator<Module> *model );
  7. };
  8. GlissinatorWidget::GlissinatorWidget( Glissinator<Module> *model ) : ModuleWidget( model )
  9. {
  10. box.size = Vec( SCREW_WIDTH * 5, RACK_HEIGHT );
  11. BaconBackground *bg = new BaconBackground( box.size, "Glissinator" );
  12. addChild( bg->wrappedInFramebuffer() );
  13. // FIXME - spacing
  14. // addChild( new BaconHelpButton( "README.md#glissinator" ) );
  15. ParamWidget *slider = ParamWidget::create< GraduatedFader< 230 > >( Vec( bg->cx( 29 ), 23 ),
  16. module,
  17. G::GLISS_TIME,
  18. 0,
  19. 1,
  20. 0.1 );
  21. addParam( slider );
  22. Vec inP = Vec( 7, RACK_HEIGHT - 15 - 43 );
  23. Vec outP = Vec( box.size.x - 24 - 7, RACK_HEIGHT - 15 - 43 );
  24. bg->addPlugLabel( inP, BaconBackground::SIG_IN, "in" );
  25. addInput( Port::create< PJ301MPort >( inP, Port::INPUT,
  26. module,
  27. G::SOURCE_INPUT ) );
  28. bg->addPlugLabel( outP, BaconBackground::SIG_OUT, "out" );
  29. addOutput( Port::create< PJ301MPort >( outP, Port::OUTPUT,
  30. module,
  31. G::SLID_OUTPUT ) );
  32. bg->addRoundedBorder( Vec( 5, RACK_HEIGHT - 120 ), Vec( box.size.x - 10, 38 ), BaconBackground::highlight );
  33. bg->addLabel( Vec( 10, RACK_HEIGHT - 102 ), "gliss", 11, NVG_ALIGN_LEFT | NVG_ALIGN_BOTTOM, COLOR_WHITE );
  34. bg->addLabel( Vec( 10, RACK_HEIGHT - 90 ), "gate", 11, NVG_ALIGN_LEFT | NVG_ALIGN_BOTTOM, COLOR_WHITE );
  35. addChild( ModuleLightWidget::create< SmallLight< BlueLight > >( Vec( bg->cx() - 4 , RACK_HEIGHT - 120 + 38 / 2 - 3 ),
  36. module, G::SLIDING_LIGHT ) );
  37. addOutput( Port::create< PJ301MPort >( Vec( bg->cx() + 5, RACK_HEIGHT - 114 ), Port::OUTPUT, module, G::GLISSING_GATE ) );
  38. }
  39. } // namespace rack_plugin_BaconMusic
  40. using namespace rack_plugin_BaconMusic;
  41. RACK_PLUGIN_MODEL_INIT(BaconMusic, Glissinator) {
  42. Model *modelGlissinator = Model::create<Glissinator<Module>,GlissinatorWidget>("Bacon Music", "Glissinator", "Glissinator", EFFECT_TAG);
  43. return modelGlissinator;
  44. }