VstSyncData.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * VstSyncData.h - type declarations needed for VST to lmms host sync
  3. *
  4. * Copyright (c) 2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
  5. * Copyright (c) 2013 Mike Choi <rdavidian71/at/gmail/dot/com>
  6. *
  7. * This file is part of LMMS - https://lmms.io
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2 of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public
  20. * License along with this program (see COPYING); if not, write to the
  21. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  22. * Boston, MA 02110-1301 USA.
  23. *
  24. */
  25. #ifndef VST_SYNC_DATA_H
  26. #define VST_SYNC_DATA_H
  27. // VST sync frequency (in ms), how often will be VST plugin synced
  28. // keep it power of two if possible (not used by now)
  29. //#define VST_SNC_TIMER 1
  30. // When defined, latency should be subtracted from song PPQ position
  31. //#define VST_SNC_LATENCY
  32. // define file for ftok as shared memory shmget key
  33. constexpr const char* VST_SNC_SHM_KEY_FILE = "/dev/null";
  34. //constexpr int64_t VST_SNC_SHM_RND_KEY = 3561653564469;
  35. struct VstSyncData
  36. {
  37. double ppqPos;
  38. int timeSigNumer;
  39. int timeSigDenom;
  40. bool isPlaying;
  41. bool isCycle;
  42. bool hasSHM;
  43. float cycleStart;
  44. float cycleEnd;
  45. bool m_playbackJumped;
  46. int m_bufferSize;
  47. int m_sampleRate;
  48. int m_bpm;
  49. #ifdef VST_SNC_LATENCY
  50. float m_latency;
  51. #endif
  52. } ;
  53. #endif