Hello
I have the following code in my controller .h file
namespace SBN
{
class SatuController : public Steinberg::Vst::EditControllerEx1, public VSTGUI::VST3EditorDelegate, public VSTGUI::ViewListenerAdapter
{
public:
using UTF8StringPtr = VSTGUI::UTF8StringPtr;
using IUIDescription = VSTGUI::IUIDescription;
using IController = VSTGUI::IController;
using VST3Editor = VSTGUI::VST3Editor;
using CView = VSTGUI::CView;
using UIAttributes = VSTGUI::UIAttributes;
//------------------------------------------------------------------------
SatuController () = default;
~SatuController () SMTG_OVERRIDE = default;
// Create function
static Steinberg::FUnknown* createInstance (void* /*context*/)
{
return (Steinberg::Vst::IEditController*)new SatuController;
}
// IPluginBase
Steinberg::tresult PLUGIN_API initialize (Steinberg::FUnknown* context) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API terminate () SMTG_OVERRIDE;
// EditController
Steinberg::tresult PLUGIN_API setComponentState (Steinberg::IBStream* state) SMTG_OVERRIDE;
Steinberg::IPlugView* PLUGIN_API createView (Steinberg::FIDString name) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API setState (Steinberg::IBStream* state) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API getState (Steinberg::IBStream* state) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API setParamNormalized (Steinberg::Vst::ParamID tag,
Steinberg::Vst::ParamValue value) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API getParamStringByValue (Steinberg::Vst::ParamID tag,
Steinberg::Vst::ParamValue valueNormalized,
Steinberg::Vst::String128 string) SMTG_OVERRIDE;
Steinberg::tresult PLUGIN_API getParamValueByString (Steinberg::Vst::ParamID tag,
Steinberg::Vst::TChar* string,
Steinberg::Vst::ParamValue& valueNormalized) SMTG_OVERRIDE;
VSTGUI::CView* verifyView(CView* view, const UIAttributes& attributes,
const IUIDescription* description, VST3Editor* editor) override;
//--- from IViewListenerAdapter ----------------------
//--- is called when a view will be deleted: the editor is closed -----
void viewWillDelete(VSTGUI::CView* view) override;
//---from VST3EditorDelegate-----------
IController* createSubController(UTF8StringPtr name, const IUIDescription* description,
VST3Editor* editor) SMTG_OVERRIDE;
//---Interface---------
DEFINE_INTERFACES
END_DEFINE_INTERFACES (EditController)
DELEGATE_REFCOUNT (EditController)
//------------------------------------------------------------------------
protected:
SBN::GUIEditor* mGUIEditor = NULL;
};
//------------------------------------------------------------------------
} // namespace SBN
And in my Controller’s .cpp file I have
//------------------------------------------------------------------------
IPlugView* PLUGIN_API SatuController::createView(FIDString name)
{
// Here the Host wants to open your editor (if you have one)
if (FIDStringsEqual(name, Vst::ViewType::kEditor))
{
// create your editor here and return a IPlugView ptr of it
auto* view = new SBN::GUIEditor(this, "view", "editor.uidesc");
this->mGUIEditor = view;
return view;
}
return nullptr;
}
Where the GUIEditor is my custom VSTGUI::VST3Editor that looks like this in the .h file
class GUIEditor : public VSTGUI::VST3Editor
{
public:
using UTF8StringPtr = VSTGUI::UTF8StringPtr;
using EditController = Steinberg::Vst::EditController;
GUIEditor(EditController* controller, UTF8StringPtr templateName, UTF8StringPtr xmlFile) : VSTGUI::VST3Editor(controller, templateName, xmlFile)
{
}
Steinberg::tresult PLUGIN_API canResize() override;
Steinberg::tresult PLUGIN_API checkSizeConstraint(Steinberg::ViewRect* rect) override;
Steinberg::tresult PLUGIN_API onSize(Steinberg::ViewRect* newSize) override;
PluginGUI* mPluginGUI = NULL;
};
}
And like this in the GUIEditor .cpp file
namespace SBN
{
Steinberg::tresult PLUGIN_API GUIEditor::canResize()
{
return Steinberg::kResultTrue;
}
Steinberg::tresult PLUGIN_API GUIEditor::checkSizeConstraint(Steinberg::ViewRect* rect)
{
return VSTGUIEditor::checkSizeConstraint(rect);
}
Steinberg::tresult PLUGIN_API GUIEditor::onSize(Steinberg::ViewRect* newSize)
{
return VSTGUIEditor::onSize(newSize);
}
}
The problem here is if I set the canResize to true and change the size of the plugin window the whole window will not redraw and leave artifacts as lines from the border of the plugin window.
But if I set it to return false, everything looks like it should if I resize the plugin window, because Reaper allows the plugin window to be resized no matter if I set it to return false or true.
Why are there artifacts, ugly lines?
Thanks in advance