Skip to content

Commit

Permalink
Merge pull request #336 from steinbergmedia/develop
Browse files Browse the repository at this point in the history
Prepare 4.14.1 Release
  • Loading branch information
scheffle authored Jan 29, 2025
2 parents 0a5a00d + 436e0b3 commit 1adb2f6
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
os: [macos-12, macos-14]
os: [macos-13, macos-14, macos-15]

steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# VSTGUI

![macOS Build](https://github.com/steinbergmedia/vstgui/workflows/macOS%20Build/badge.svg?branch=develop)
![Windows build](https://github.com/steinbergmedia/vstgui/workflows/Windows%20build/badge.svg?branch=develop)
![Linux build](https://github.com/steinbergmedia/vstgui/workflows/Linux%20build/badge.svg?branch=develop)
![macOS Build](https://github.com/steinbergmedia/vstgui/actions/workflows/cmake_macos.yml/badge.svg?branch=develop)
![Windows build](https://github.com/steinbergmedia/vstgui/actions/workflows/cmake_windows.yml/badge.svg?branch=develop)
![Linux build](https://github.com/steinbergmedia/vstgui/actions/workflows/cmake_linux.yml/badge.svg?branch=develop)

**VSTGUI** is a user interface toolkit mainly for audio plug-ins (VST, AAX, AudioUnit, etc...) and it is designed for working well with **VST 3** plug-ins and its wrappers like **AU**, **AAX**, ...

Expand Down
92 changes: 44 additions & 48 deletions vstgui/lib/crowcolumnview.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is part of VSTGUI. It is subject to the license terms
// This file is part of VSTGUI. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this
// distribution and at http://github.com/steinbergmedia/vstgui/LICENSE

Expand Down Expand Up @@ -135,38 +135,38 @@ CPoint computeRectOffset (const CPoint& parent, const CPoint& rect, const Alignm
CRect computeGroupRect (const CRect& parent, const CRects& children, const Alignment alignment,
const Style style, double spacing)
{
CPoint maxSize;
if (style == Style::kRow)
{
for (const auto& rect : children)
{
if (maxSize.x < rect.getWidth ())
maxSize.x = rect.getWidth ();

maxSize.y = maxSize.y + rect.getHeight () + spacing;
}
// Remove the last spacing again
if (!children.empty())
maxSize.y -= spacing;
}
else
{
for (const auto& rect : children)
{
if (maxSize.y < rect.getHeight ())
maxSize.y = rect.getHeight ();

maxSize.x = maxSize.x + rect.getWidth () + spacing;
}
// Remove the last spacing again
if (!children.empty())
maxSize.x -= spacing;
}

const auto offset = computeRectOffset (parent.getSize (), maxSize, alignment);
return CRect().setSize(maxSize).offset(offset);
CPoint maxSize;
if (style == Style::kRow)
{
for (const auto& rect : children)
{
if (maxSize.x < rect.getWidth ())
maxSize.x = rect.getWidth ();

maxSize.y = maxSize.y + rect.getHeight () + spacing;
}

// Remove the last spacing again
if (!children.empty ())
maxSize.y -= spacing;
}
else
{
for (const auto& rect : children)
{
if (maxSize.y < rect.getHeight ())
maxSize.y = rect.getHeight ();

maxSize.x = maxSize.x + rect.getWidth () + spacing;
}

// Remove the last spacing again
if (!children.empty ())
maxSize.x -= spacing;
}

const auto offset = computeRectOffset (parent.getSize (), maxSize, alignment);
return CRect ().setSize (maxSize).offset (offset);
}

//--------------------------------------------------------------------------------
Expand Down Expand Up @@ -230,7 +230,8 @@ class AutoLayout
}

//--------------------------------------------------------------------------------
CRowColumnView::CRowColumnView (const CRect& size, Style style, LayoutStyle layoutStyle, CCoord spacing, const CRect& margin)
CRowColumnView::CRowColumnView (const CRect& size, Style style, LayoutStyle layoutStyle,
CCoord spacing, const CRect& margin)
: CAutoLayoutContainerView (size)
, style (style)
, layoutStyle (layoutStyle)
Expand Down Expand Up @@ -287,10 +288,7 @@ void CRowColumnView::setLayoutStyle (LayoutStyle inLayoutStyle)
}

//--------------------------------------------------------------------------------
bool CRowColumnView::isAnimateViewResizing () const
{
return hasBit (flags, kAnimateViewResizing);
}
bool CRowColumnView::isAnimateViewResizing () const { return hasBit (flags, kAnimateViewResizing); }

//--------------------------------------------------------------------------------
void CRowColumnView::setAnimateViewResizing (bool state)
Expand All @@ -299,10 +297,7 @@ void CRowColumnView::setAnimateViewResizing (bool state)
}

//--------------------------------------------------------------------------------
bool CRowColumnView::hideClippedSubviews () const
{
return hasBit (flags, kHideClippedSubViews);
}
bool CRowColumnView::hideClippedSubviews () const { return hasBit (flags, kHideClippedSubViews); }

//--------------------------------------------------------------------------------
void CRowColumnView::setHideClippedSubviews (bool state)
Expand All @@ -317,7 +312,9 @@ void CRowColumnView::resizeSubView (CView* view, const CRect& newSize)
{
if (isAttached () && isAnimateViewResizing () && viewResizeAnimationTime > 0)
{
view->addAnimation ("CRowColumnResizing", new Animation::ViewSizeAnimation (newSize, false), new Animation::LinearTimingFunction (viewResizeAnimationTime));
view->addAnimation ("CRowColumnResizing",
new Animation::ViewSizeAnimation (newSize, false),
new Animation::LinearTimingFunction (viewResizeAnimationTime));
}
else
{
Expand Down Expand Up @@ -459,8 +456,11 @@ bool CRowColumnView::sizeToFit ()
if (viewSize != getViewSize ())
{
invalid ();
auto autosizeState = getAutosizingEnabled ();
setAutosizingEnabled (false);
CViewContainer::setViewSize (viewSize);
CViewContainer::setMouseableArea (viewSize);
setAutosizingEnabled (autosizeState);
invalid ();
}
return true;
Expand All @@ -482,10 +482,7 @@ CMessageResult CRowColumnView::notify (CBaseObject* sender, IdStringPtr message)
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
CAutoLayoutContainerView::CAutoLayoutContainerView (const CRect& size)
: CViewContainer (size)
{
}
CAutoLayoutContainerView::CAutoLayoutContainerView (const CRect& size) : CViewContainer (size) {}

//--------------------------------------------------------------------------------
bool CAutoLayoutContainerView::attached (CView* parent)
Expand Down Expand Up @@ -543,4 +540,3 @@ bool CAutoLayoutContainerView::changeViewZOrder (CView* view, uint32_t newIndex)
}

} // VSTGUI

29 changes: 14 additions & 15 deletions vstgui/lib/platform/win32/direct2d/d2dfont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,13 @@ struct CustomFonts
return false;
}

CustomFonts ()
CustomFonts (const UTF8String& resourceBasePath)
{
auto winFactory = getPlatformFactory ().asWin32Factory ();
if (!winFactory)
if (resourceBasePath.empty ())
return;
auto basePath = winFactory->getResourceBasePath ();
if (!basePath)
return;
*basePath += "Fonts\\*";
auto files = getDirectoryContents (*basePath);
auto basePath = resourceBasePath;
basePath += "Fonts\\*";
auto files = getDirectoryContents (basePath);
if (files.empty ())
return;
auto factory = getDWriteFactory ();
Expand Down Expand Up @@ -106,6 +103,7 @@ struct CustomFonts
return result;
}
#else
CustomFonts (const UTF8String& resourceBasePath) {}
IDWriteFontCollection* getFontCollection () { return nullptr; }
bool contains (const WCHAR*, DWRITE_FONT_WEIGHT, DWRITE_FONT_STRETCH, DWRITE_FONT_STYLE)
{
Expand All @@ -116,14 +114,9 @@ struct CustomFonts

//-----------------------------------------------------------------------------
static std::unique_ptr<CustomFonts> customFonts;
static std::once_flag customFontsOnceFlag;

//-----------------------------------------------------------------------------
static CustomFonts* getCustomFonts ()
{
std::call_once (customFontsOnceFlag, [] () { customFonts = std::make_unique<CustomFonts> (); });
return customFonts.get ();
}
static CustomFonts* getCustomFonts () { return customFonts.get (); }

//-----------------------------------------------------------------------------
static void gatherFonts (const FontFamilyCallback& callback, IDWriteFontCollection* collection)
Expand Down Expand Up @@ -198,8 +191,14 @@ bool D2DFont::getAllFontFamilies (const FontFamilyCallback& callback)
return true;
}

//------------------------------------------------------------------------
void D2DFont::initialize (const UTF8String& resourceBasePath)
{
D2DFontPrivate::customFonts = std::make_unique<D2DFontPrivate::CustomFonts> (resourceBasePath);
}

//-----------------------------------------------------------------------------
void D2DFont::terminate () { D2DFontPrivate::customFonts = nullptr; }
void D2DFont::terminate () { D2DFontPrivate::customFonts.reset (); }

//-----------------------------------------------------------------------------
D2DFont::D2DFont (const UTF8String& name, const CCoord& size, const int32_t& style)
Expand Down
1 change: 1 addition & 0 deletions vstgui/lib/platform/win32/direct2d/d2dfont.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class D2DFont final : public IPlatformFont, public IFontPainter

static bool getAllFontFamilies (const FontFamilyCallback& callback);

static void initialize (const UTF8String& resourceBasePath);
static void terminate ();

protected:
Expand Down
1 change: 1 addition & 0 deletions vstgui/lib/platform/win32/win32factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ HINSTANCE Win32Factory::getInstance () const noexcept
void Win32Factory::setResourceBasePath (const UTF8String& path) const noexcept
{
impl->setBasePath (path);
D2DFont::initialize (path);
}

//-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion vstgui/lib/vstguibase.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//-----------------------------------------------------------------------------
#define VSTGUI_VERSION_MAJOR 4
#define VSTGUI_VERSION_MINOR 14
#define VSTGUI_VERSION_PATCHLEVEL 0
#define VSTGUI_VERSION_PATCHLEVEL 1

//-----------------------------------------------------------------------------
// Platform definitions
Expand Down
17 changes: 11 additions & 6 deletions vstgui/plugin-bindings/vst3editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,6 +1872,7 @@ bool VST3Editor::enableEditing (bool state)
openUIEditorController = nullptr;
if (state)
{
editingEnabled = true;
// update uiDesc file path to absolute if possible
if (UIAttributes* attributes = description->getCustomAttributes ("VST3Editor", true))
{
Expand All @@ -1895,7 +1896,6 @@ bool VST3Editor::enableEditing (bool state)
CView* view = editController->createEditView ();
if (view)
{
editingEnabled = true;
CCoord width = view->getWidth ();
CCoord height = view->getHeight ();

Expand Down Expand Up @@ -1945,15 +1945,19 @@ bool VST3Editor::enableEditing (bool state)
CCoord width = view->getWidth () * scaleFactor;
CCoord height = view->getHeight () * scaleFactor;

if (canResize () == Steinberg::kResultTrue)
if (canResize () == Steinberg::kResultTrue && nonEditRect.isEmpty ())
{
Steinberg::ViewRect tmp;
if (getRect ().getWidth () != width)
tmp.right = getRect ().getWidth ();
if (getRect ().getHeight () != height)
tmp.bottom = getRect ().getHeight ();
if (tmp.getWidth () && tmp.getHeight ())
if (tmp.getWidth () || tmp.getHeight ())
{
if (tmp.getWidth () == 0)
tmp.right = width;
if (tmp.getHeight () == 0)
tmp.bottom = width;
checkSizeConstraint (&tmp);
nonEditRect.setWidth (tmp.getWidth ());
nonEditRect.setHeight (tmp.getHeight ());
Expand All @@ -1966,9 +1970,10 @@ bool VST3Editor::enableEditing (bool state)
getFrame ()->invalid ();
if (nonEditRect.isEmpty () == false)
{
rect.right = rect.left + (Steinberg::int32)nonEditRect.getWidth ();
rect.bottom = rect.top + (Steinberg::int32)nonEditRect.getHeight ();
plugFrame->resizeView (this, &rect);
Steinberg::ViewRect tmpRect = rect;
tmpRect.right = tmpRect.left + (Steinberg::int32)nonEditRect.getWidth ();
tmpRect.bottom = tmpRect.top + (Steinberg::int32)nonEditRect.getHeight ();
plugFrame->resizeView (this, &tmpRect);
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion vstgui/plugin-bindings/vst3editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ class VST3Editor : public Steinberg::Vst::VSTGUIEditor,
IVST3EditorDelegate* getDelegate () const;
UIDescription* getUIDescription () const;

bool inEditMode () const;

//-----------------------------------------------------------------------------
DELEGATE_REFCOUNT(Steinberg::Vst::VSTGUIEditor)
Steinberg::tresult PLUGIN_API queryInterface (const ::Steinberg::TUID iid, void** obj) override;
Expand All @@ -153,7 +155,6 @@ class VST3Editor : public Steinberg::Vst::VSTGUIEditor,
bool enableShowEditButton () const;
void enableShowEditButton (bool state);
void showEditButton (bool state);
bool inEditMode () const;

bool PLUGIN_API open (void* parent, const PlatformType& type) override;
void PLUGIN_API close () override;
Expand Down

0 comments on commit 1adb2f6

Please sign in to comment.