March 24, 2015
I'm working my way through the synth book and was doing the first setup of LFO.cpp. I'm not sure where I went wrong in putting together the doOscillate() function but I get an error message that VS "Expected an expression"
inline double doOscillate(double* pQuadPhaseOutput = NULL) // the "inline" is where the error is being called
now if I add virtual to the call:
inline virtual double doOscillate(double* pQuadPhaseOutput = NULL)
the expected expression error is resolved, but then virtual will raise an "invalid specifier outside a class declaration" error
I'm not sure what's wrong, but I believe I did everything else right (creating the LFO class, using COscillator as a base, including the appropriate headers, etc...)
January 29, 2017
I'm not sure what you are trying to do here, but both syntaxes are wrong.
I think you have doOscillate() defined in the .h file
// in the .h file somewhere
inline double doOscillate()
Whenever you define a function implementation (with or without the inline specifier, and with or without the virtual specifier) inside the .h file, there is no implementation in the .cpp file. I would have expected a "this function already has a body" error. So, you should't be implementing the function in the .cpp file if you already have it in the .h file.
If on the other hand you are trying to call the base class, you would write:
The doOscillate(), doFilter() and other CPU intensive functions are implemented in the .h file and declared as inline to force the compiler to place the chunk of code inline without jumps, which is less efficient in terms of DLL size, but (theoretically at least) more efficient for CPU usage since the jumps are removed.
Most Users Ever Online: 36
Currently Browsing this Page:
Guest Posters: 1
Newest Members:CoraDias, Edoardo, knooierd, daniel, Merril Bradshaw, BillPlunkett, Pajczur, michaelwayneharwood, RickM, rainbow wind
Moderators: W Pirkle: 187
Administrators: Tom: 66, JD Young: 80, Will Pirkle: 0, W Pirkle: 187