General Help


#1

I'm using the source code methods from the demo plugin in my project and following the same coding methods but after I used this in my project...

      BeatzAudioProcessor* getProcessor() const

    {
      return static_cast<BeatzAudioProcessor&> (processor);
    }

 

It returns the following error is Visual Studio...

 

IntelliSense: no suitable conversion function from "BeatzAudioProcessor" to "BeatzAudioProcessor *" 

 

Which points to some obvious difference in how I formatted or referenced something in my copying of all that, but it escapes me.   Any help would be appreciated.   I'm down to only 3 errors in my "transplant" of the coding example to my project so I'm almost there.

 

The demo example is formatted the same way...


JuceDemoPluginAudioProcessor& getProcessor() const
    {
        return static_cast<JuceDemoPluginAudioProcessor&> (processor);
    }

 

 

The only obvious difference I can see in my code and the demo code is the former is (ownerFilter) and the latter is (owner).  Not sure if that's the difference or not...

BeatzAudioProcessorEditor::BeatzAudioProcessorEditor (BeatzAudioProcessor& ownerFilter)

    : AudioProcessorEditor(ownerFilter)

 

Thanks in advance.  I can post all of the modified cpp's and header files if that will help.
 


#2

How did you declare processor ?


#3

Bear with my relative inexperience.  I've searched through the demo code trying to reconcile that, looking for a specific declaration for that and also for "ourProcessor",  another one of my three errors.

I can't yet find anything in the demo code that specifically defines "processor" as such, so it's obviously something I'm missing.

Comparing them side by side I can't see any area where the code obviously differs.

Here's the source.  If you open it in VS you'll see the 3 errors.

http://theaudiocave.com/devstuff/Beatzz.zip

 


#4

I'm not sure, but maybe you should use BeatzAudioProcessor& instead of BeatzAudioProcessor*. Looks like you're trying to return a pointer from a non-pointer. That's typically the kind of error message you'll get with that sort of thing.


#5

Thanks a lot Jordan.  I'm very appreciative for all of your responses.   

For clarity, my history is corporate, I was a corporate staffer in my previous life and I can whack up a business class app in VB or C# in no time, so I never really needed to use C++ until I wanted to port some of my stand alone musical tools to vst plugins, and as you might expect, there's a good bit of a learning curve involved there.

At any rate, the adventure continues.   When I stepped back (knowing what I don't know) it occurred to me that what I probably should have done was not code a brand new plugin, but instead just modify the AudioPluginDemo into my plugin, so I circled back and did that, and moved my graphics over there, and now I'm a few steps closer than I was, but still not through phase one yet.   I have something like Playhead position displaying now, but not running in real time, so I'm working on crackng that nut.

To all of you guys like yourself and Xeniaos who are so willing to share your knowledge with we who are less capabale....  a big virutal beer to you.   Thanks a lot, it's not unappreciated or viewed as something i"m actually entitled to.  I say the previous because I often get annoyed by people who feel like they're entitled to the knowledge of others and I never want to be one of those people.

Thanks guys.

 

 

 

 


#6

AFAIK, the “processor” variable is a public member of juce::AudioProcessorEditor.

In the code below:

BeatzAudioProcessor& getProcessor() const
{
    return static_cast < BeatzAudioProcessor& > (processor);
}
  1. The owner of getProcessor function must inherit from AudioProcessorEditor.
  2. BeatzAudioProcessor must inherit from AudioProcessor.

It seems something went wrong in your cloning process.


#7

So yeah, I opened the JuceDemoPlugin and changed 

JuceDemoPluginAudioProcessor&

to

JuceDemoPluginAudioProcessor*

and got the same error. So just use a reference (&), not a pointer (*) and you're good to go.

 


 

I'd also like to mention that you don't even have to use this getProcessor() that's in the JuceDemoPlugin. If you create a plugin with the Audio Plugin template from the IntroJucer, you'll see the private member variable with a comment above it:

// This reference is provided as a quick way for your editor to // access the processor object that created it.
ProcessorAccessAudioProcessor& processor;

This is called  ProcessorAccessAudioProcessor because I named the project ProcessorAccess (for demonstration). If you look at the constructor in PluginEditor.cpp, it initializes this processor variable with the AudioProcessor that's passed as a reference argument from the AudioProcessor.

So this means you can simply do something like 

processor.lastUIWidth = getWidth();

instead of

getProcessor().lastUIWidth = getWidth();

You might find this to be an easier way to access the AudioProcessor. To be honest, I'm not exactly sure why it's done the way it is in JuceDemoPlugin. Hopefully someone can answer that one.