How to read the api?

this might seem silly but it’s actually important. i feel like i’d have to come to the forum much less if i were able to handle the api and other juce resources better. when i ask myself a question first thing i usually do is making an object that might help in visual studio and then ctrl+left click on it to see what kinda functions it has. i repeat this with similiar objects until i run out of ideas. then i’m looking for juce forum entries where similiar topics have been discussed but most things i find aren’t close enough to my question. then i go through the tutorial projects or watch some theaudioprogrammer-videos, but that’s tricky because juce has changed while his older videos have not ofc.
so i think… ok that might be reason enough to ask in the forum but i really wanna learn how to learn better myself. for example right before this post i was trying to figure out how to handle fonts more stylistically. i mean not just changing between bold and normal and stuff, but also things like outlining them in a different colour, or give them a shadow, or change the width between letters, or multiplicate the colour values of the font with whatever is behind of it. stuff like that. i looked at font and at typeface in the api and both of them don’t seem to have these functions. i know i could probably use my new skill to print a font into an image object and make some of these functions myself by iterating through all pixels, but i feel like these are things that are totally already available in juce somewhere and i just can’t see it. so back to the original question: basically…

how to see where things are in juce?

Have you checked: https://docs.juce.com/master/index.html
You can even create the documentation with doxygen yourself, so you have offline access to it.

1 Like

so your advice would be to search for solutions by looking at the whole list of all classes. that makes sense, since everything is supposed to be somewhere in it and theAudioProgrammer also always stresses that he uses this way to find out about stuff. i just noticed that things are indeed sorted by category in this list. i guess questions regarding gui are just hard because there are so many different gui classes to learn. it’s the biggest category from all of them. the way the things are sorted alphabetically in this list is also a bit strange. since the words in each line are so far away from each other i tried to read it like from top to bottom then next row, but i just noticed that according to the way it’s sorted it’s meant to be written from left to right then next line. also i wouldn’t know what to look out for to find the things i’m searching for. sometimes it might be easy, because things are called exactly like you’d expect them to be, but other times you might search for an abstract solution to something and aren’t really sure how you’d even call that yourself. does the api still help then in some way?
and i’d also add a feature where we can filter the list by specific topics. for example a little checkbox that hides all classes that aren’t used by juce anymore, like lookAndFeel_v1. i bet that would tidy up that list a lot. or we could just type “font” into a search bar and it would only show all classes that interact with the font-class

Hey… I’m sort of in the same situation, but, I came up with a solution, no pun intended.

What I did was save out all the demo’s built into Projucer. (File -> Open Example ) Then launch that demo into VS and build it. It will ask you for a directory to save to… Do the build in VS, then quit out, and rinse and repeat…

I picked all the demos that would benefit me for a “hypothetical project”. Just to get to know the SDK…

This project needs a menu system, file read and write, properties, midi, etc. I picked all the demos that touched on something relevant for my project. I ended up with 13…

Once I did the above, I started a new GUI project, could be anything really, but, I just started with a stand alone. Once in VS, I just added each project file from each demo to this project.

So, now, I can look at each piece of code that is relevant and work out what I need. If you need to run the demo example, just set it as the startup project…

There is a font demo in there as well, I think you mentioned wanting this…

Anyways, this approach made it really easy, for me anyways.

Just note, if you upgrade Juce, it’ll kill the compile because of versions…

1 Like

good idea as well. that way we might get away with not reading the api correctly a bit longer. maybe it even gives us some other knowledge that makes the api easier to navigate at some point.

Just a hint for one of the things you mentioned. Colours are not set in Font or TypeFace objects. Colours are set to Graphics contexts before drawing whatever, including text. You make your colour operations on Colour objects, then you setColour them to the Graphics context in paint() (or methods called by paint(), like the ones in LookAndFeel classes).

I think it is difficult to navigate the API trying to get “big pictures”. The docs are exhaustive but there’s little in the way of overviews. Tutorials help with this but they’re often too basic. I’ve had to dive into the sources going from call to call to get how many things worked.

1 Like

Since this kind of became a kind of general advice thread on how to get/read documentation:
what helped me a lot was to search for publicly available projects which use JUCE, and look at how they solve problems similar to the ones you come up with.

Without limiting it to this one, here’s for example a project that showed me a lot of useful stuff, which I could dig into more in the Juce API afterwards:
https://github.com/ffAudio/Frequalizer

3 Likes