Beginner roadblock: default code


#1

I got started with the GUI window tutorial, but had a huge issue with the library defaulting to a “hello world made with JUCE” window, and no where in the code does it say to that it should do this. I modified the code according to the tutorial but still was only able to resize the window without changing the window to a blank slate like I wanted to. Is there a way to just use the code to generate gui window without using the default generated code? Should I just use JUCE to handle the audio and use Qt fir GUI? I want to make my own libraries using juce code, to abstract away all the clunkiness of the generated code. Also why dies the scoped pointer macro determine whether a window even prints in the first place?


#2

The library itself doesn’t default to much, but the default GUI application project and code generated by the Projucer application sets you up with a simple window with a content component that paints the hello world text. That painting code is found in the MainComponent.cpp file in the method

void MainComponent::paint (Graphics& g)

The “Made with Juce” splash logo is a licensing related thing. Removing that requires you to either get a commercial paid for Juce license or release all your code from your JUCE using project as open source under the GPL license.


#3

And for the scoped pointer macro? It doesn’t seem to have much relevance in the drawing of the graphics.


#4

I don’t know what you mean by that. What scoped pointer “macro” and where? ScopedPointer is a JUCE provided smart pointer class. If you don’t like it, you can use something else like std::unique_ptr or if for some obscure reason you want to, raw pointers.


#5

At the bottom of the auto generated code in order to even draw the graphics it requires me to change unique ptr to scoped pointer.


#6

You are not required to do anything like that. Actually the GUI application projects generated by the latest Projucer use std::unique_ptr anyway for the MainWindow object. If you are looking at some tutorial texts, those may be outdated in that regard.


#7

Okay yeah so the tutorial texts are a little confusing. Is there any way I can just scrap the example code and implement the GUI classes in a main() just like I might use the STD library? This is my first third party library. Do you recommend Qt+ a photo editor for designing GUIs?


#8

There should be no reason for you to implement your own main() function, there probably is nothing useful you could do there anyway, that’s why JUCE has the START_JUCE_APPLICATION macro that creates the JUCEApplication subclass instance, where you should be doing your initialization stuff.

Combining JUCE and Qt would be a nightmare, even for an experienced programmer, so I absolutely would not recommend attempting that.


#9

I’m just trying to to get over the first hump of using shared code. I know that audio development is one of the last things to do without a good library, I’m just asking if I should use something else for GUI specifically.


#10

Since modern displays can display very variable pixel sizes, the more modern approach is to use vector graphics, either designing SVG files and use them in Drawables or writing drawing code in the Graphics class.
Using Bitmaps results in scaling artefacts and blurry views.

About mixing QT and JUCE, i second @Xenakios. If you are new to both, try to stick to one of them…


#11

Are there any good resources I should look into outside of JUCE for GUI building alone? I want to compartmentalize my work.


#12

There may be a chance that I could focus on audio and use an ugly command line interface just to get something running?


#13

It’s possible, you can generate a command line program project with the Projucer. But you won’t be able to easily add any 3rd party GUI stuff on top of that.


#14

Okay. So I’m a beginner guy who just wants to build something to put on my resume/portfolio before graduating University. How should I spend my time, worrying about graphics or getting comfortable with the DAC?


#15

I have a virtually free evening and want to really get comfortable. How should I approach the tutorials etc.? Because I’m simply overwhelmed.


#16

So the JUCe app class take the place of main()? Also why are the classes nested in the GUI window tutorial code?


#17

I am not sure what tutorial you are looking at, but at least in the default GUI application project generated by the Projucer, there isn’t much for the MainWindow class to do, so there’s no reason to have that as a full separate class. All the “real” stuff happens in the MainComponent class. But if you for some reason want to, you can write the MainWindow subclass outside the JUCEApplication subclass.


#18

Okay so I guess I was just thrown off by the graphics that were painted on the screen. I’ll go back to the coding this evening and give it all another shot.