Audio plugin host https://kx.studio/carla
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.

34 lines
722B

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. CallbackRepeater.h - Timed Callback Container
  4. Copyright (C) 2016 Mark McCurry
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. */
  10. #pragma once
  11. #include <functional>
  12. #include <ctime>
  13. namespace zyncarla {
  14. struct CallbackRepeater
  15. {
  16. typedef std::function<void(void)> cb_t ;
  17. //Call interval in seconds and callback
  18. CallbackRepeater(int interval, cb_t cb_);
  19. //Time Check
  20. void tick(void);
  21. std::time_t last;
  22. std::time_t dt;
  23. cb_t cb;
  24. };
  25. }