From 1f620f9a8c7d747cab3097065073b4d4af4fde07 Mon Sep 17 00:00:00 2001 From: Brett g Porter Date: Sun, 12 Feb 2023 08:59:35 -0500 Subject: [PATCH] add FRIZ_VBLANK_ENABLED macro, bump version # --- README.md | 6 ++++++ Source/friz/control/controller.cpp | 2 ++ Source/friz/control/controller.h | 12 ++++++++++-- Source/friz/friz.h | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2914ba0..b5312a8 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,12 @@ animator.addAnimation (std::move (animation)); ## Release History +### 2.1.1 Feb 12, 2023 + +#### Non-breaking Changes + +- added new `FRIZ_VBLANK_ENABLED` macro, which will be set to `1` if the version of JUCE being targeted is 7.0.0 or higher. + ### 2.1.0 Feb 11, 2023 #### Non-breaking Changes diff --git a/Source/friz/control/controller.cpp b/Source/friz/control/controller.cpp index fa53ead..9f8588e 100644 --- a/Source/friz/control/controller.cpp +++ b/Source/friz/control/controller.cpp @@ -73,6 +73,7 @@ void TimeController::timerCallback () animator->gotoTime (getCurrentTime ()); } +#if FRIZ_VBLANK_ENABLED void DisplaySyncController::start () { jassert (animator != nullptr); @@ -88,6 +89,7 @@ void DisplaySyncController::start () running = true; } } +#endif bool AsyncController::gotoTime (juce::int64 timeInMs) { diff --git a/Source/friz/control/controller.h b/Source/friz/control/controller.h index e405eb9..dea9b6c 100644 --- a/Source/friz/control/controller.h +++ b/Source/friz/control/controller.h @@ -25,6 +25,11 @@ #include #include +#if JUCE_VERSION >= (7 << 16) +#define FRIZ_VBLANK_ENABLED 1 +#else +#define FRIZ_VBLANK_ENABLED 0 +#endif namespace friz { class Animator; @@ -176,11 +181,14 @@ class TimeController : public Controller, int frameRate { 30 }; }; +#if FRIZ_VBLANK_ENABLED /** * @class DisplaySyncController - + * * @brief Synchronize animations with a display's vertical blank interval. * + * @warning This class is only available in code targeting JUCE 7.0.0 or higher + * */ class DisplaySyncController : public Controller { @@ -234,7 +242,7 @@ class DisplaySyncController : public Controller FrameRateCalculator frameRate; bool running { false }; }; - +#endif /** * @class AsyncController * @brief Controller to support clocking an animation manually, or at rates diff --git a/Source/friz/friz.h b/Source/friz/friz.h index c7f4418..ec2c98a 100644 --- a/Source/friz/friz.h +++ b/Source/friz/friz.h @@ -27,7 +27,7 @@ BEGIN_JUCE_MODULE_DECLARATION ID: friz vendor: bgporter -version: 2.1.0 +version: 2.1.1 name: 'friz' animator description: Animation control classes for JUCE. website: https://github.com/bgporter/animator