O'Reilly logo

Getting Started With JUCE by Martin Robinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Storing application properties

In this final example we will implement a simple application that stores its state in a properties file (that is, settings or preferences) in a standard location on the runtime platform. First create a new Introjucer project named Chapter05_04 with a basic window. Change the MainComponent.h file to contain the following code:

#ifndef __MAINCOMPONENT_H__
#define __MAINCOMPONENT_H__

#include "../JuceLibraryCode/JuceHeader.h"

class MainContentComponent   : public Component
{
public:
  MainContentComponent();
  ~MainContentComponent();
  
  void resized();
  
private:
  Label label;
  Slider slider;
  ApplicationProperties appProperties;
};

#endif  // __MAINCOMPONENT_H__

Here we have a label and a slider; these will represent our simple application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required