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.

30 lines
697B

  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. struct CallbackRepeater
  14. {
  15. typedef std::function<void(void)> cb_t ;
  16. //Call interval in seconds and callback
  17. CallbackRepeater(int interval, cb_t cb_);
  18. //Time Check
  19. void tick(void);
  20. std::time_t last;
  21. std::time_t dt;
  22. cb_t cb;
  23. };