It all works just fine for me. In a plugin I guess the host could be doing something strange that closes the window but I use this stuff all the time, and the juce demo doesn’t go wrong. Maybe something odd about the way you’ve built it? Try the pre-built juce demo and see if that works.
The precompiled one downloaded from yoursite works fine.
I need 1.13 Juce version to build it?
bye
Using th juce_static.lib and building my project as release the File chooser appear.
Ok, thanx jules.
Very interesting your new demo.
I would ask you if an element of a ListBox could be a DragAndDropContainer.
I’m trying to explain my wish.
The ListBox will contains some wav file. I wish the user could drag the file into one cell…The cell is a DragAndDropTarget,isn’t it?
thanx
best regards
cialz
Sure, you can do that if you create your own components for the list box items - that way you can use any type of component you want in there.
Hi, I don’t know why some days ago all works fine, but now not.
The problem is that when I load the plug in the host (AudioMulch) I can’t see anything, it seems that the host could not open it.
here is the DllMain from JuceWrapper:
[code]bool JuceVSTWrapper::DllMain (HINSTANCE instance, DWORD dwReason)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
PlatformUtilities::setCurrentModuleInstanceHandle (instance);
// set logger name to this DLL name until it is changed later to plugin name
char name[1024];
name[0] = 0;
GetModuleFileName( instance, name, 1024 );
dllPath = name;
// load state from XML file with the same name as this DLL
XmlDocument settingsDocument( dllPath.withFileExtension( "xml" ) );
XmlElement* outerElement = settingsDocument.getDocumentElement();
if ( outerElement != NULL )
{
//get input and output channels
// get saved lastDir
XmlElement* lastDirElement = outerElement->getChildByName( "LastDir" );
if ( lastDirElement != NULL )
{
XmlElement* lastDirTextElement = lastDirElement->getChildElement( 0 );
if ( lastDirTextElement != NULL )
lastDir = lastDirTextElement->getText();
XmlElement* plugInputs = outerElement->getChildByName ("Inputs");
XmlElement* plugOutputs = outerElement->getChildByName ("Outputs");
if (plugInputs != NULL) mvInputs = plugInputs->getIntAttribute ("number");
if (plugOutputs != NULL) mvOutputs = plugOutputs->getIntAttribute ("number");
}
}
else
mvInputs = mvOutputs = 2;
initJuce();
}
else if (dwReason == DLL_PROCESS_DETACH)
{
// save lastdir
XmlElement* lastDirElement = new XmlElement( "LastDir" );
lastDirElement->addTextElement( lastDir.getFullPathName() );
exitJuce();
}
return TRUE;
}[/code]
Here is the contructor of the filter:
[code]
//==============================================================================
JuceFilterMain::JuceFilterMain()
: AudioFilterBase (T(“Juce VST Demo”),
T(“Raw Material Software”))
{
plugOuts = mvOutputs;
plugIns = mvInputs;
gain = 1.0f;
//init Intel Primitives Engine
InitStatic();
}[/code]
I’ve tried to set breakpoint in JuceVstWrapper contructor, close to setNumInputs (filter->getNumInputChannels()); but the Visual Studio debugger tells me that I can’t put it there.
Agh! Yeeuch! Get that code out of the DLL initialiser!
The idea with the juce plugins project is that none of the VST-specific or platform-specific code is public - so stuffing your initialisation code in the middle of the Windows DLL initialiser (before it’s even initialised Juce!) isn’t the best plan! Put it in your plugin class and keep well away from the VST-specific files.
And here’s a tip: settings files should never be stored with the executable! That directory might (and probably should) be write-protected. Use SystemStats::getUserApplicationDataDirectory() to find the place you should save your settings in.
Yes, ok,you are right, but I’ll found this peace of code in another VST plug written with Juce…
So it is better to put this stuff in my Filter Constructor?
Yes - keep everything in the filter class, and stay a safe distance from the VST code.
I can’t build my project because I can’t instantiate the class SimpleListBox
I’ve inherited SimpleListBoxModel from the EditorComponent class
class DemoEditorComponent : public Component,
public ChangeListener,
public SimpleListBoxModel,
public ActionListener
Then, in its contructor:
addAndMakeVisible (listBox = new SimpleListBox (T("IRs"), this));
listBox->setRowHeight (28);
The compiler tells me that:
c:\juce\projects\MultiVolverVST\src\MultiVolverFilter.cpp(99) : error C2259: ‘DemoEditorComponent’ : cannot instantiate abstract class due to following members:
c:\juce\projects\multivolvervst\src\multivolvereditor.h(7) : see declaration of 'DemoEditorComponent’
c:\juce\projects\MultiVolverVST\src\MultiVolverFilter.cpp(99) : warning C4259: ‘int __thiscall JUCE::SimpleListBoxModel::getNumRows(void)’ : pure virtual function was not defined
c:\juce\src\juce_appframework\gui\gui_components\widgets\juce_simplelistbox.h(51) : see declaration of 'getNumRows’
c:\juce\projects\MultiVolverVST\src\MultiVolverFilter.cpp(99) : warning C4259: ‘void __thiscall JUCE::SimpleListBoxModel::paintListBoxItem(int,class JUCE::Graphics &,int,int,bool)’ : pure virtual function was not defined
c:\juce\src\juce_appframework\gui\gui_components\widgets\juce_simplelistbox.h(55) : see declaration of 'paintListBoxItem’
c:\juce\projects\MultiVolverVST\src\MultiVolverFilter.cpp(99) : error C2259: ‘DemoEditorComponent’ : cannot instantiate abstract class due to following members:
c:\juce\projects\multivolvervst\src\multivolvereditor.h(7) : see declaration of 'DemoEditorComponent’
c:\juce\projects\MultiVolverVST\src\MultiVolverFilter.cpp(99) : warning C4259: ‘int __thiscall JUCE::SimpleListBoxModel::getNumRows(void)’ : pure virtual function was not defined
c:\juce\src\juce_appframework\gui\gui_components\widgets\juce_simplelistbox.h(51) : see declaration of 'getNumRows’
c:\juce\projects\MultiVolverVST\src\MultiVolverFilter.cpp(99) : warning C4259: ‘void __thiscall JUCE::SimpleListBoxModel::paintListBoxItem(int,class JUCE::Graphics &,int,int,bool)’ : pure virtual function was not defined
c:\juce\src\juce_appframework\gui\gui_components\widgets\juce_simplelistbox.h(55) : see declaration of ‘paintListBoxItem’
Reading the MSDN help I found that I can’t create an object with more of one pure virtual functions…I know but why JuceDemo works fine?
thanx
Sorry, I found the mistake!
I must implement getNumRows and paintListBoxItem
:lol:
that’s right always make sure you define any pure virtual functions that are in your base class. that always gets me with textEditorListener, because there are quite a few of them!
where’s the “implement pure virtual function” button anyway?
can’t be hard can it IDE makers? look at base class, look for “= 0” on declarations, ask us if we want inline, impl file or at the end, create a stub!
[quote]where’s the “implement pure virtual function” button anyway?
can’t be hard can it IDE makers? look at base class, look for “= 0” on declarations, ask us if we want inline, impl file or at the end, create a stub![/quote]
couldn’t agree more. Sometimes I wonder if the people who write IDEs actually ever write code themselves… but I guess they must do, mustn’t they?
Sorry…could I read and manage multichannel audio files vith Juce AudioFormat?
I have to reach 24 channels for my purposes.
thanx
24 channels in one file? That’s quite a lot.
The audio file readers I’ve written so far just do stereo, but there’s no reason you couldn’t do your own audiofilereader/writer that does as many channels as you need.
Any reason you’re not using 24 separate wave files? That’s probably easier to edit with.
Yes Jules, we are using multichannel audio files working with Ambisonics technology.
We record sound from a microphone array (24 omni condenser microphones)
I’ve just written a multichannel sf player and recorder.
I’m writing a MultiVolver (multichannel convolver), for convolve our impulse responses with multichannel registrations.
groovy stuff!
I’ve tried to show the number of channels of one 24 chs file with AudioFormatReader.
It shows me 24.
Do yuo know if the read and write functions works with any general number of channels?
thanx
the classes I’ve done will only read stereo, but you could mod them or write your own.