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.

25 lines
478B

  1. #include "CVEvent.hpp"
  2. namespace SynthDevKit {
  3. CVEvent::CVEvent (float value, int16_t count) : CV(value) {
  4. this->count = count;
  5. }
  6. void CVEvent::update (float value) {
  7. if (triggerTotal() == count) {
  8. triggerCount = 0;
  9. }
  10. CV::update(value);
  11. if (triggered == true && lastTriggered == false) {
  12. emit(has_emitted ? triggerTotal() : 1, currentValue());
  13. }
  14. }
  15. void CVEvent::reset ( ) {
  16. CV::reset();
  17. emit(EVENT_RESET, 0.0f);
  18. }
  19. }