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.

52 lines
720B

  1. #pragma once
  2. #include "bogaudio.hpp"
  3. #include "dsp/signal.hpp"
  4. using namespace bogaudio::dsp;
  5. extern Model* modelXFade;
  6. namespace bogaudio {
  7. struct XFade : Module {
  8. enum ParamsIds {
  9. MIX_PARAM,
  10. CURVE_PARAM,
  11. LINEAR_PARAM,
  12. NUM_PARAMS
  13. };
  14. enum InputsIds {
  15. MIX_INPUT,
  16. A_INPUT,
  17. B_INPUT,
  18. NUM_INPUTS
  19. };
  20. enum OutputsIds {
  21. OUT_OUTPUT,
  22. NUM_OUTPUTS
  23. };
  24. enum LightsIds {
  25. LINEAR_LIGHT,
  26. NUM_LIGHTS
  27. };
  28. bool _linear = false;
  29. float _mix = 0.0f;
  30. float _curveIn = -1.0f;
  31. SlewLimiter _mixSL;
  32. CrossFader _mixer;
  33. XFade() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {
  34. onSampleRateChange();
  35. }
  36. void onSampleRateChange() override;
  37. void step() override;
  38. };
  39. } // namespace bogaudio