Skip to content

Instantly share code, notes, and snippets.

@Xenakios
Created August 27, 2024 17:31
Show Gist options
  • Save Xenakios/9477521eac76333050203fc3c97a2680 to your computer and use it in GitHub Desktop.
Save Xenakios/9477521eac76333050203fc3c97a2680 to your computer and use it in GitHub Desktop.
bool implementsGui() const noexcept override { return true; }
bool guiIsApiSupported(const char *api, bool isFloating) noexcept override
{
if (strcmp(api, "win32") == 0)
return true;
return false;
}
bool guiCreate(const char *api, bool isFloating) noexcept override
{
m_gui =
std::make_unique<NoisePlethoraGUI>(paramDescriptions, m_from_ui_fifo, m_to_ui_fifo,
[this](int parid) { return paramValues[parid]; });
return true;
}
void guiDestroy() noexcept override { m_gui = nullptr; }
bool guiShow() noexcept override
{
if (!m_gui)
return false;
return true;
}
bool guiHide() noexcept override
{
if (!m_gui)
return false;
return true;
}
int guiw = 700;
int guih = 580;
bool guiGetSize(uint32_t *width, uint32_t *height) noexcept override
{
if (!m_gui)
return false;
*width = guiw;
*height = guih;
return true;
}
bool guiAdjustSize(uint32_t *width, uint32_t *height) noexcept override
{
return guiGetSize(width, height);
}
bool guiSetParent(const clap_window *window) noexcept override
{
if (!m_gui)
return false;
SetParent((HWND)m_gui->m_webview->getViewHandle(), (HWND)window->win32);
ShowWindow((HWND)m_gui->m_webview->getViewHandle(), SW_SHOWNA);
SetWindowPos((HWND)m_gui->m_webview->getViewHandle(), NULL, 0, 0, guiw, guih,
SWP_SHOWWINDOW);
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment