Skip to content

Instantly share code, notes, and snippets.

View ffAudio's full-sized avatar

Daniel Walz ffAudio

View GitHub Profile
@ffAudio
ffAudio / PluginEditor.cpp
Created June 20, 2017 10:47
A simple JUCE plugin that saves text in float parameters
/*
==============================================================================
PluginEditor.cpp
==============================================================================
*/
#include "PluginProcessor.h"
#include "PluginEditor.h"
@ffAudio
ffAudio / RelativeTimeToString.cpp
Last active February 6, 2018 22:53
Addition for juce::RelativeTime to write a technical string
String RelativeTime::toString (bool includeDays) const
{
String result;
result.preallocateBytes (32);
if (numSeconds < 0)
result << '-';
bool empty = true;
@ffAudio
ffAudio / ElapsedTime.h
Last active March 28, 2019 16:19
JUCE ElapsedTime
/**
Stop watch to measure time intervals
\code{.cpp}
ElapsedTime timer;
// do stuff
DBG ("Doing stuff took: " << String (timer.elapsed()) << " milliseconds");
timer.pause();
// that doesn't count
timer.resume();
@ffAudio
ffAudio / ChoiceParameterRadioGroup.cpp
Last active June 10, 2019 12:31
A Component to synchronise a RadioButtonGroup with an AudioParameterChoice
class ChoiceParameterRadioGroup : public Component,
private Button::Listener,
private AudioProcessorValueTreeState::Listener
{
public:
enum Orientation
{
horizontal,
vertical
};
/*
==============================================================================
MouseOverChecker.h
Created: 13 Aug 2019 1:26:42pm
Author: Daniel Walz
==============================================================================
*/
#!/usr/bin/python
import sys, json
if len (sys.argv) < 4:
print "Usage: " + sys.argv[0] + " <font.otf> <font_metadata.json> fontname"
exit (-1)
fontname = sys.argv[3]
@ffAudio
ffAudio / AutoReleasePool.cpp
Last active July 15, 2020 11:43
A juce AutoReleasePool
#include <JuceHeader.h>
class AutoReleasePool : private juce::Timer
{
public:
using Ptr = juce::ReferenceCountedObjectPtr<juce::ReferenceCountedObject>;
AutoReleasePool()
{
startTimerHz (1);
}
#include "MainComponent.h"
//==============================================================================
MainComponent::MainComponent()
{
text.append ("Lorem ipsum dolor sit amet, consectetur adipiscing elit,\n", juce::Font (14.0f), juce::Colours::white);
text.append ("sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n", juce::Font (20.0f), juce::Colours::white);
text.append ("Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi\n", juce::Font (8.0f), juce::Colours::white);
text.append ("ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit\n", juce::Font (18.0f), juce::Colours::red);
text.append ("in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n", juce::Colours::blue);
@ffAudio
ffAudio / LomseComponent.h
Created January 2, 2021 23:31
JUCE Component to display a score using lenmus/lomse
/**
\file LomseComponent.h
\author Daniel Walz - Foleys Finest Audio (ffAudio)
This uses JUCE www.juce.com
and lenmus https://github.com/lenmus/lomse
*/
@ffAudio
ffAudio / MFSafePointer
Created April 18, 2021 14:02
A scoped pointer for MediaFoundation classes
template<typename T>
class MFSafePointer
{
public:
MFSafePointer() = default;
~MFSafePointer()
{
reset();
}