Comments (3)
Here's a minimal example:
class AGainEditor : public VSTGUIEditor, public IControlListener
{
enum
{
kWidth = 400,
kHeight = 400,
kButton1 = 'btn1',
kButton2 = 'btn2'
};
public:
AGainEditor (void* controller) :
VSTGUIEditor(controller)
{
ViewRect vr(0, 0, kWidth, kHeight);
setRect(vr);
}
virtual ~AGainEditor () {}
virtual bool PLUGIN_API open (void* parent, const VSTGUI::PlatformType& platformType) SMTG_OVERRIDE
{
auto r = getRect();
CRect size(r.left, r.top, r.right, r.bottom);
auto oldFrame = frame;
frame = new CFrame(size, this);
if(oldFrame)
oldFrame->forget();
if(frame->open(parent, platformType))
{
frame->setBackgroundColor(kBlueCColor);
CRect buttonSize(0, 0, 120, 20);
buttonSize.centerInside(size);
buttonSize.offset(CPoint(-buttonSize.getWidth() / 2 - 2, 0));
auto button1 = new CTextButton(buttonSize, this, kButton1, "zoomFactor = 1", CTextButton::Style::kKickStyle);
frame->addView(button1);
buttonSize.centerInside(size);
buttonSize.offset(CPoint(+buttonSize.getWidth() / 2 + 2, 0));
auto button2 = new CTextButton(buttonSize, this, kButton2, "zoomFactor = 2");
frame->addView(button2);
return true;
}
return false;
}
virtual void PLUGIN_API close () SMTG_OVERRIDE
{
if(frame)
{
frame->close();
frame = nullptr;
}
}
virtual void valueChanged (CControl* pControl) SMTG_OVERRIDE
{
int tag = pControl->getTag();
float value = pControl->getValue();
if(value > 0.5f)
{
if(tag == kButton1)
{
frame->setZoom(1.0);
}
else if(tag == kButton2)
{
frame->setZoom(2.0);
}
}
}
bool beforeSizeChange(const CRect& newSize, const CRect& oldSize) SMTG_OVERRIDE
{
static bool resizeGuard = false;
bool result = resizeGuard;
if(plugFrame && !result)
{
resizeGuard = true;
ViewRect vr;
vr.right = int32(newSize.getWidth());
vr.bottom = int32(newSize.getHeight());
result = (plugFrame->resizeView(this, &vr) == kResultTrue);
resizeGuard = false;
}
return result;
}
};
from vst3sdk.
Will be fixed with the next SDK update.
from vst3sdk.
Okay, that's great news. Out of curiosity: Any hints on how you fixed this? Can I review the respective commit somewhere? Thanks.
from vst3sdk.
Related Issues (20)
- moduleinfotool.exe exits with code 1, no other info
- AUv2 Wrapper crashes in V3.7.7 HOT 1
- AUCocoaView is broken in cases where the same auwrapper lib is used in different plugs (SDK v3.7.7) HOT 2
- Controller CID output from validator cut on non Windows platform HOT 1
- Mac Fails to compile generated project HOT 1
- Unable to build using gcc 13 HOT 2
- where is the helloworld template? HOT 1
- Does the BaseWrapper::processMidiEvent function have a bug? HOT 3
- Linux: can you trust uname() to find out which version to load from a bundle? HOT 3
- CMake Error on Win 10 / VS 2019 building vst3 examples
- How to install though? HOT 1
- [Feature Request]: Adding APT or Flatpak Support
- Inconsistency between docs & code for module initializer / deinitializer names HOT 1
- Max Plugin Parameter ID Clarity HOT 1
- VST3
- For symbolic links on Windows 11 Home 22H2, enable Developer Mode in Settings > System HOT 1
- Cannot git clone project HOT 3
- Build Failure on Fedora 40 HOT 3
- Change docs to let users use GPLv3, GPLV3, AGPLv3, or AGPLv3+ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vst3sdk.