Code Monkey home page Code Monkey logo

Comments (8)

scheffle avatar scheffle commented on June 2, 2024

How do you trigger a redraw?

from vstgui.

setoutsoft avatar setoutsoft commented on June 2, 2024

invalid and setDirty both. results were same.

from vstgui.

scheffle avatar scheffle commented on June 2, 2024

Can you provide a simple test app/plugin for this. I cannot reproduce the issue.

from vstgui.

setoutsoft avatar setoutsoft commented on June 2, 2024

OK, I will prepare a demo for this as soon as possible

from vstgui.

setoutsoft avatar setoutsoft commented on June 2, 2024

@scheffle
vstplugin_demo.zip
Before building the demo, add VSTSDK_HOME to environment variable that ref to path of vst sdk, or simply modify CMakelists.txt to use your vst sdk.

In this demo, mainly, 3 steps were done.
//firstly, every 3 frames, we post a message to controller.
tresult PLUGIN_API RaccoonXProcessor::process (Vst::ProcessData& data)
{
//--- First : Read inputs parameter changes-----------
bool bParamUpdated = false;
if (data.inputParameterChanges)
{
bParamUpdated = updateParameter(data);
}

if (++m_nFrames == 3) {
	//post a message to Controller
	if (auto message2 = owned(allocateMessage()))
	{
		message2->setMessageID("TimeData");
		sendMessage(message2);
	}
	m_nFrames = 0;
}
//--- Here you have to implement your processing

return kResultOk;

}

//then, at controller, we create a HWND which is used to transfer a message received from processor to UI thread.
void RaccoonXController::onNotify(Vst::IMessage* message) {
//run on ui thread
for (auto it = uiMessageControllers.begin(); it != uiMessageControllers.end(); it++) {
(*it)->notify(message);
}
}

tresult PLUGIN_API RaccoonXController::notify(Vst::IMessage* message) {
//post message to ui thread.
SOUI::CRunnable *pTask = new CVstRunnable(this, message);
assert(m_pMsg2UI);
m_pMsg2UI->postRunnable(pTask);
pTask->release();
return kResultTrue;
}

//finally, we try to invalid UI
void UIMessageController::notify(Vst::IMessage* pMsg) {
if (m_root) {
m_root->invalid();
//m_root->setDirty();
}
}

wait about 10 seconds, I believe you will observe a flicker. make sure using vstgui 4.11+. Vst3pluginTestHost was used here. Studio one looks better, but flicker can be observed still.

from vstgui.

nickdowell avatar nickdowell commented on June 2, 2024

This sounds like the same issue as https://forums.steinberg.net/t/vstgui-4-11-windows-release-build-flickering/797049 for which there are a couple of workarounds;

  • In win32directcomposition.cpp replace D3D_DRIVER_TYPE_HARDWARE with D3D_DRIVER_TYPE_WARP to bypass the hardware driver.
  • In win32factory.cpp comment out the impl->directCompositionFactory = DirectComposition::Factory::create (impl->d2dFactory.get ()); line to bypass D3D / direct composition entirely.

from vstgui.

scheffle avatar scheffle commented on June 2, 2024

Commit e5294ca should fix this issue.

from vstgui.

nickdowell avatar nickdowell commented on June 2, 2024

Commit e5294ca should fix this issue.

Amazing! That fix seems to work for me with my NVIDIA GPU.

from vstgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.