|
@@ -189,7 +189,8 @@ public: |
|
|
nullptr, // TODO file request |
|
|
nullptr, // TODO file request |
|
|
nullptr, |
|
|
nullptr, |
|
|
plugin->getInstancePointer(), |
|
|
plugin->getInstancePointer(), |
|
|
scaleFactor) |
|
|
|
|
|
|
|
|
scaleFactor), |
|
|
|
|
|
fHasScaleFactor(d_isNotZero(scaleFactor)) |
|
|
# if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI |
|
|
# if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI |
|
|
, fKeyboardModifiers(0) |
|
|
, fKeyboardModifiers(0) |
|
|
# endif |
|
|
# endif |
|
@@ -228,11 +229,21 @@ public: |
|
|
return fUI.getHeight(); |
|
|
return fUI.getHeight(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
double getScaleFactor() const |
|
|
|
|
|
{ |
|
|
|
|
|
return fUI.getScaleFactor(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void setSampleRate(const double newSampleRate) |
|
|
void setSampleRate(const double newSampleRate) |
|
|
{ |
|
|
{ |
|
|
fUI.setSampleRate(newSampleRate, true); |
|
|
fUI.setSampleRate(newSampleRate, true); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void notifyScaleFactorChanged(const double scaleFactor) |
|
|
|
|
|
{ |
|
|
|
|
|
fUI.notifyScaleFactorChanged(scaleFactor); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------- |
|
|
// ------------------------------------------------------------------- |
|
|
// functions called from the plugin side, may block |
|
|
// functions called from the plugin side, may block |
|
|
|
|
|
|
|
@@ -387,9 +398,15 @@ protected: |
|
|
hostCallback(audioMasterAutomate, index, 0, nullptr, perValue); |
|
|
hostCallback(audioMasterAutomate, index, 0, nullptr, perValue); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void setSize(const uint width, const uint height) |
|
|
|
|
|
|
|
|
void setSize(uint width, uint height) |
|
|
{ |
|
|
{ |
|
|
// fUI.setWindowSize(width, height); |
|
|
|
|
|
|
|
|
// figure out scale factor ourselves if the host doesn't support it |
|
|
|
|
|
if (! fHasScaleFactor) |
|
|
|
|
|
{ |
|
|
|
|
|
const double scaleFactor = fUI.getScaleFactor(); |
|
|
|
|
|
width /= scaleFactor; |
|
|
|
|
|
height /= scaleFactor; |
|
|
|
|
|
} |
|
|
hostCallback(audioMasterSizeWindow, width, height); |
|
|
hostCallback(audioMasterSizeWindow, width, height); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -421,6 +438,7 @@ private: |
|
|
|
|
|
|
|
|
// Plugin UI |
|
|
// Plugin UI |
|
|
UIExporter fUI; |
|
|
UIExporter fUI; |
|
|
|
|
|
const bool fHasScaleFactor; |
|
|
# if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI |
|
|
# if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI |
|
|
uint16_t fKeyboardModifiers; |
|
|
uint16_t fKeyboardModifiers; |
|
|
# endif |
|
|
# endif |
|
@@ -499,7 +517,7 @@ public: |
|
|
fVstRect.left = 0; |
|
|
fVstRect.left = 0; |
|
|
fVstRect.bottom = 0; |
|
|
fVstRect.bottom = 0; |
|
|
fVstRect.right = 0; |
|
|
fVstRect.right = 0; |
|
|
fLastScaleFactor = 1.0f; |
|
|
|
|
|
|
|
|
fLastScaleFactor = 0.0f; |
|
|
|
|
|
|
|
|
if (parameterCount != 0) |
|
|
if (parameterCount != 0) |
|
|
{ |
|
|
{ |
|
@@ -670,6 +688,13 @@ public: |
|
|
{ |
|
|
{ |
|
|
fVstRect.right = fVstUI->getWidth(); |
|
|
fVstRect.right = fVstUI->getWidth(); |
|
|
fVstRect.bottom = fVstUI->getHeight(); |
|
|
fVstRect.bottom = fVstUI->getHeight(); |
|
|
|
|
|
// figure out scale factor ourselves if the host doesn't support it |
|
|
|
|
|
if (fLastScaleFactor == 0.0f) |
|
|
|
|
|
{ |
|
|
|
|
|
const double scaleFactor = fVstUI->getScaleFactor(); |
|
|
|
|
|
fVstRect.right /= scaleFactor; |
|
|
|
|
|
fVstRect.bottom /= scaleFactor; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@@ -678,6 +703,13 @@ public: |
|
|
fPlugin.getInstancePointer(), fLastScaleFactor); |
|
|
fPlugin.getInstancePointer(), fLastScaleFactor); |
|
|
fVstRect.right = tmpUI.getWidth(); |
|
|
fVstRect.right = tmpUI.getWidth(); |
|
|
fVstRect.bottom = tmpUI.getHeight(); |
|
|
fVstRect.bottom = tmpUI.getHeight(); |
|
|
|
|
|
// figure out scale factor ourselves if the host doesn't support it |
|
|
|
|
|
if (fLastScaleFactor == 0.0f) |
|
|
|
|
|
{ |
|
|
|
|
|
const double scaleFactor = tmpUI.getScaleFactor(); |
|
|
|
|
|
fVstRect.right /= scaleFactor; |
|
|
|
|
|
fVstRect.bottom /= scaleFactor; |
|
|
|
|
|
} |
|
|
tmpUI.quit(); |
|
|
tmpUI.quit(); |
|
|
} |
|
|
} |
|
|
*(ERect**)ptr = &fVstRect; |
|
|
*(ERect**)ptr = &fVstRect; |
|
@@ -998,7 +1030,15 @@ public: |
|
|
case effVendorSpecific: |
|
|
case effVendorSpecific: |
|
|
#if DISTRHO_PLUGIN_HAS_UI |
|
|
#if DISTRHO_PLUGIN_HAS_UI |
|
|
if (index == CCONST('P', 'r', 'e', 'S') && value == CCONST('A', 'e', 'C', 's')) |
|
|
if (index == CCONST('P', 'r', 'e', 'S') && value == CCONST('A', 'e', 'C', 's')) |
|
|
|
|
|
{ |
|
|
|
|
|
if (d_isEqual(fLastScaleFactor, opt)) |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
fLastScaleFactor = opt; |
|
|
fLastScaleFactor = opt; |
|
|
|
|
|
|
|
|
|
|
|
if (fVstUI != nullptr) |
|
|
|
|
|
fVstUI->notifyScaleFactorChanged(opt); |
|
|
|
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|