A few usefull classes for JUCE

I collected up some code I’ve written / ported to juce over the years and put them into a module named Gin. Some I’ve posted before as individual files, but I thought it would be better to have them all in a juce module. All code ported to juce was originally BSD license or similar, credits are in the files. This adds a few useful classes such as:

  • BMPImageFormat - Load and Save Windows Bitmaps. 8, 24, 32 bit, uncompressed reading supported. Write 32 bit.
  • ColourPropertyComponent - Colour picker for PropertyComponent
  • Ellipse - Determine if point is on ellipse. Find point at angle on ellipse.
  • FilePropertyComponent - File chooser for PropertyComponent
  • FileSystemWathcer - Get notified when files in directory change
  • ImageEffects - Sepia, Vignette, Soften, Sharpen, Invert, Contrast, Hue, Saturation, etc. Works on ARGB formatted images only.
  • Integrator - Calculate integrals
  • LeastSquaresRegression - Fits a curve to data points
  • LinearRegression - Fits a line to data points
  • MapViewer - Displays a map. Shows map tiles noly, you will need to extend it to draw paths, markers, etc.
  • OpenStreetMaps - Fetch tiles from various OSM servers
  • SharedMemory - Share a memory block between processes
  • Spline - A smooth curve from a set of discrete points
  • PerlinNoise - Natural looking noise

Some screenshots from the demo app:





great stuff, thanks!

What’s new in Gin since I last posted about it:

  • DownloadManager - a class for downloading multiple files in the background simultaneously with retries, gzip support, progress, etc.

  • ElevatedFileCopy - Requests admin permission to copy files, create directories, delete files. (macOS / Windows only)

  • EquationParser - solve math equations in strings i.e. x + y / sin (t)

  • AudioEquationParser - solve audio equations in strings i.e. lp24(saw(60), 4000, _q) / 2

  • MessagePack - converts to / from MessagePack and juce::var

  • parsePlist - converts from xml plist to juce::var

  • valueTreeToJSON / valueTreeFromJSON - convert between ValueTrees and json

  • LambdaValueTreeListener / AsyncLambdaValueTreeListener - listen to ValueTrees without having to subclass

  • applyBlend - 25 blending modes for Image

  • ResamplingFifo - a fifo that you push and pop at different sample rates

  • AsyncWebsocket - websocket class, supports https

  • SecureStreamingSocket - like StreamingSocket, but https. Client only.


I’ve started adding some comments and documentation, so it isn’t just a big dump of unreadable code.



Did the json to valueTree stuff get pulled? I recently had to write one of these and it felt pretty clunky by the end. I’d be interested to see how did it. Maybe this is even possible now with the latest versions of JUCE? I’m still rocking out 5.4.7!

juce::String valueTreeToJSON ( **const** juce::ValueTree& v);

juce::ValueTree valueTreeFromJSON ( **const** juce::String& jsonText);

There are a few special named properties. Couldn’t think another way to do it.

1 Like