Hello,
i have a plugin. I use it in Ardour7.5.
I would like a FileSelector. I write:
button->onClick = [this] { p->Process_message(); }; // callback
...
...
void P::Process_message()
{
chooser.launchAsync(FileBrowserComponent::openMode | FileBrowserComponent::canSelectFiles, [this](const FileChooser& chooser)
{ // this function is called from the main thread, when user has selected a file or closed the file window
File selectedFile = chooser.getResult(); // get selected file
if (selectedFile.existsAsFile()) // check if the file exists
{
//... part 1
}
else
{
//... part 2
cout << "No File selected." << std::endl;
}
});
}
When i use the plugin as a standalone application, it works well: a window to choose a file appears and when i close it, the program goes to part1 in the code above.
However when i use the plugin inside Ardour, no window appears and the program goes directly to part2 above. So it does not work.
Do you have any suggestion please? Thanks,
Frédéric.
