Feature request for the IntroJucer : user defined templates


#1

Hello Jules !

It would be possible to add in the IntroJucer a functionnality, allowing users to specify a template they have created, for the generation of new projects ? For example, all the class names may be “DemoJuceProject::” in the cpp file, and then the IntroJucer may replace this exact name with the name of the new project…

I think it would be great for audio plug-ins for example. The default audio plug-in generated by the IntroJucer is very light, compared to the audio plug-in of the “extras” folder for example. But more, it would be a killer feature for developers if they can include in one click all their work on presets, automation, DAW dependent behaviour etc. on each new plug-in they create… Moreover, people here would be able to share their templates.

Thanks in advance !


#2

To add some kind of template editor would be a huge amount of work - I certainly think the effort involved would be vastly disproportionate to its usefulness. And I’m not even sure how you’d generalise templates - the current wizards are all hand-coded because they need to do clever tricks that you really need to write as c++.


#3

I hate the VS-like template editors :lol:

I was just thinking about something to automate what I do when I create a new plug-in with the IntroJucer. Instead of doing lots of boring copy-and-paste from an old project into a new one, I may create myself one basic audio plug-in, like the one in the extras folder of JUCE, with some other basic functionnalities. Then, I may rename the main classes, for example into “TemplatePlugin::” and “TemplatePluginEditor::”. And, I may open the two cpp and the two h files in the IntroJucer, as a basis for all the new plug-in projects, instead of the default “hello world” one. The IntroJucer will have to rename all the instances of “TemplatePlugin” with the name of the new project.

Doing everything manually is not that hard, but such a functionnality may launch a template sharing movement from JUCE forum users :mrgreen:

And I like the idea of working on templates to automate a maximum of things in future works. It’s just an idea…


#4

Well, I can’t really imagine a way to provide that kind of functionality… If you have any concrete ideas for exactly how it’d work, fire away!


#5

OK, let’s be concrete.

When I create a new plug-in project, the IntroJucer may have a ComboBox “Files to Auto-Generate” with the following choices for example :

  • Hello World plug-in / Empty (default)
  • User defined template plug-in

Then, when the last item is selected, a FileChooser control may appear, to select a folder which must contain 4 files : PluginEditor.cpp, PluginEditor.h, PluginProcessor.cpp, and PluginProcessor.h. These files must also implement the associated classes, called PluginEditor and PluginProcessor. If all these conditions are satisfied, then the IntroJucer creates a new plug-in project, with a copy of these files, and all the classes names renamed depending on the new project name.

Another way to do that would be to select a whole IntroJucer project as a template…


#6

The real question is : anyone other than me is interested by that ? :mrgreen: