Skip to content

Releases: bgporter/animator

Release 2.1.1 FRIZ_VBLANK_ENABLED

12 Feb 14:03
Compare
Choose a tag to compare

The juce::VBlankAttachment class isn't available before JUCE 7.0.0, so that code is now protected by a macro that tests the current JUCE version.

Release 2.1.0: Chain & makeAnimation

11 Feb 22:24
Compare
Choose a tag to compare
Chain animation type

Add a new Chain animation type that lets you bundle together a series of individual animations that will be triggered sequentially. Animations added to a Chain each retain their own update and completion callback functions, and do not need to have the same number of Values.

The existing Sequence animation type has been updated so that it's a specialization of the Chain type, where all the contained animations must contain the same number of Values, and a single UpdateFn callback is used for the entire series of effects.

Comceptually, a Chain lets you say "I want this to happen, and when that's done, I want this other thing to happen." A Sequence is used when you want to build a single complex animation out of several simpler effects that happen in order.

In the demo app, we use a Sequence for the 'pop out' of the sidebar—we first click the sidebar to the right, then run another animation to pop it out and make it visible. A single callback updates the position of the sidebar component.

We use a Chain when handling the demo boxes; the first animation moves a box from its creation point to some other (x,y) position on screen, and when that's done we start a second animation that performs a linear (1-dimensional) fade of the box's fill color.

makeAnimation Factory Function

Add a new free function makeAnimation to make the creation of many effects much simpler. In practice, most of the effects that I use are either 1-dimensional, or multi-dimensional, but all of the values being generated are using the same curve type and parameters.

Code that before might have been written like:

auto fade = std::make_unique<friz::Animation<1>> (
    friz::Animation<1>::SourceList {
        std::make_unique<friz::Linear> (startValue, endValue, duration) },
                effectId);

can be cleaned up into:

auto fade = friz::makeAnimation<friz::Linear>(effectId, startValue, endValue, duration);

The benefits become apparent when making multi-dimensional effects, as you can pass all the keyframe values at once:

auto moveEffect { friz::makeAnimation<friz::Parametric, 2> (
    effectId, {0.f, 0.f}, {100.f, 100.f}, 200, friz::Parametric::kCubic)};

-- creating an animation object that contains two AnimatedValue obiects, ready to run by passing to an Animator object.

Release 2.0.0: VBlank Sync

05 Feb 16:48
Compare
Choose a tag to compare

2.0.0 February 5, 2023

Breaking Changes

This is a major version bump, and as such, there are breaking changes that will require updates in existing code:

  • All functions/method names have been converted from StudlyCaps to mixedCase to follow JUCE conventions.
  • All durations are now specified in milliseconds instead of frames. It should always have been this way, but without doing this, synching to vertical blanking would have been problematic.
  • new argument added to the completion callback; a boolean wasCanceled will be passed to indicate whether the animation is ending normally, or because it was cancelled.
  • New DisplaySyncController class uses the juce::VBlankAttachment class to synchronize animation updates with the display.
  • The Easing family of AnimatedValue (EaseIn, EaseOut, Spring) objects will need much attention with regards to their control values (slew, acceleration, etc.) To support variable frame rates sensibly, all of these curves are now updated internally at a rate of 1000 frames per second, so they should have the same behavior regardless of the actual frame update rate that's in use.

Non-breaking Changes

  • Doxygen comments corrected, cleaned up, added as needed
  • General cleanup throughout
  • MIT license text added at top of all source files.

Release 1.6.0

21 Jan 23:40
Compare
Choose a tag to compare

Last in the 1.x line.

Much cleanup and streamlining of the code, getting ready for the 2.x line.

Adds a new control mechanism; in addition to the original timer-based frame control, there's a new AsyncController class that can be used to advance animations at a rate other than realtime. This will be extended in the future to allow animations to be controlled by a monitor's vertical blanking interval now that JUCE supports that.