Skip to content

Commit 2d10431

Browse files
committed
0.16.1
1 parent 4624157 commit 2d10431

File tree

8 files changed

+35
-16
lines changed

8 files changed

+35
-16
lines changed

buildspec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
"uuids": {
4444
"windowsApp": "ad885c58-5ca9-44de-8f4f-1c12676626a9"
4545
},
46-
"version": "0.15.3",
46+
"version": "0.16.1",
4747
"website": "https://www.atkaudio.com"
4848
}

lib/atkaudio/src/atkaudio/PluginHost/JuceHostPlugin.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22
#include "../LookAndFeel.h"
33

4+
#include <atkaudio/atkaudio.h>
45
#include <juce_audio_utils/juce_audio_utils.h>
56

67
using namespace juce;
@@ -638,6 +639,9 @@ class HostAudioProcessorEditor final : public AudioProcessorEditor
638639
)
639640
, scopedCallback(owner.pluginChanged, [this] { pluginChanged(); })
640641
{
642+
currentScaleFactor =
643+
juce::Desktop::getInstance().getDisplays().getDisplayForRect(getLocalBounds())->dpi / atk::DPI_NORMAL;
644+
641645
setSize(500, 500);
642646
setResizable(false, false);
643647
addAndMakeVisible(closeButton);
@@ -648,6 +652,10 @@ class HostAudioProcessorEditor final : public AudioProcessorEditor
648652
closeButton.onClick = [this] { clearPlugin(); };
649653
}
650654

655+
void parentSizeChanged() override
656+
{
657+
}
658+
651659
void paint(Graphics& g) override
652660
{
653661
g.fillAll(getLookAndFeel().findColour(ResizableWindow::backgroundColourId).darker());

lib/atkaudio/src/atkaudio/PluginHost/PluginHost.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct atk::PluginHost::Impl : public juce::Timer
2727
startTimerHz(30);
2828
}
2929

30-
~Impl()
30+
~Impl() override
3131
{
3232
stopTimer();
3333
auto* window = this->mainWindow.release();
@@ -64,8 +64,8 @@ struct atk::PluginHost::Impl : public juce::Timer
6464

6565
void process(float** buffer, int newNumChannels, int newNumSamples, double newSampleRate)
6666
{
67-
if (!buffer || this->numChannels != newNumChannels || this->numSamples < newNumSamples ||
68-
this->sampleRate != newSampleRate || isFirstRun.load(std::memory_order_acquire))
67+
if (!buffer || this->numChannels != newNumChannels || this->numSamples < newNumSamples
68+
|| this->sampleRate != newSampleRate || isFirstRun.load(std::memory_order_acquire))
6969
{
7070
isFirstRun.store(false, std::memory_order_release);
7171
this->numChannels = newNumChannels;

lib/atkaudio/src/atkaudio/PluginHost/StandaloneFilterWindow.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ class StandalonePluginHolder2
6060
handleCreatePlugin();
6161

6262
auto inChannels =
63-
(channelConfiguration.size() > 0 ? channelConfiguration[0].numIns : processor->getMainBusNumInputChannels()
64-
);
63+
(channelConfiguration.size() > 0 ? channelConfiguration[0].numIns
64+
: processor->getMainBusNumInputChannels());
6565

6666
if (preferredSetupOptions != nullptr)
6767
options.reset(new AudioDeviceManager::AudioDeviceSetup(*preferredSetupOptions));
6868

6969
auto audioInputRequired = (inChannels > 0);
7070

71-
if (audioInputRequired && RuntimePermissions::isRequired(RuntimePermissions::recordAudio) &&
72-
!RuntimePermissions::isGranted(RuntimePermissions::recordAudio))
71+
if (audioInputRequired && RuntimePermissions::isRequired(RuntimePermissions::recordAudio)
72+
&& !RuntimePermissions::isGranted(RuntimePermissions::recordAudio))
7373
RuntimePermissions::request(
7474
RuntimePermissions::recordAudio,
7575
[this, preferredDefaultDeviceName](bool granted) { init(granted, preferredDefaultDeviceName); }
@@ -185,8 +185,8 @@ class StandalonePluginHolder2
185185
{
186186
stateFileChooser =
187187
std::make_unique<FileChooser>(TRANS("Save current state"), getLastFile(), getFilePatterns(fileSuffix));
188-
auto flags = FileBrowserComponent::saveMode | FileBrowserComponent::canSelectFiles |
189-
FileBrowserComponent::warnAboutOverwriting;
188+
auto flags = FileBrowserComponent::saveMode | FileBrowserComponent::canSelectFiles
189+
| FileBrowserComponent::warnAboutOverwriting;
190190

191191
stateFileChooser->launchAsync(
192192
flags,
@@ -737,11 +737,7 @@ class StandaloneFilterWindow
737737
auto* content = new MainContentComponent(*this);
738738
decoratorConstrainer.setMainContentComponent(content);
739739

740-
#if JUCE_IOS || JUCE_ANDROID
741-
constexpr auto resizeAutomatically = false;
742-
#else
743740
constexpr auto resizeAutomatically = true;
744-
#endif
745741

746742
setContentOwned(content, resizeAutomatically);
747743
}

lib/atkaudio/src/atkaudio/PluginHost2/UI/PluginWindow.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ using namespace juce;
66
#include "../Plugins/ARAPlugin.h"
77
#include "../Plugins/IOConfigurationWindow.h"
88

9+
#include <atkaudio/atkaudio.h>
10+
911
inline String getFormatSuffix(const AudioProcessor* plugin)
1012
{
1113
const auto format = [plugin]()
@@ -162,6 +164,9 @@ class PluginWindow final : public DocumentWindow
162164
{
163165
setContentOwned(ui, true);
164166
setResizable(ui->isResizable(), false);
167+
// ui->setScaleFactor(
168+
// juce::Desktop::getInstance().getDisplays().getDisplayForRect(getLocalBounds())->dpi / atk::DPI_NORMAL
169+
// );
165170
}
166171

167172
setConstrainer(&constrainer);
@@ -198,6 +203,11 @@ class PluginWindow final : public DocumentWindow
198203
{
199204
node->properties.set(getLastXProp(type), getX());
200205
node->properties.set(getLastYProp(type), getY());
206+
207+
if (auto* content = dynamic_cast<AudioProcessorEditor*>(getContentComponent()))
208+
content->setScaleFactor(
209+
juce::Desktop::getInstance().getDisplays().getDisplayForRect(getLocalBounds())->dpi / atk::DPI_NORMAL
210+
);
201211
}
202212

203213
void closeButtonPressed() override
@@ -272,7 +282,8 @@ class PluginWindow final : public DocumentWindow
272282

273283
float getDesktopScaleFactor() const override
274284
{
275-
return 1.0f;
285+
auto bounds = getLocalBounds();
286+
return juce::Desktop::getInstance().getDisplays().getDisplayForRect(bounds)->dpi / atk::DPI_NORMAL;
276287
}
277288

278289
static AudioProcessorEditor* createProcessorEditor(AudioProcessor& processor, PluginWindow::Type type)

lib/atkaudio/src/atkaudio/atkaudio.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ void atk::create()
1010
juce::initialiseJuce_GUI();
1111
juce::MessageManager::getInstance()->setCurrentThreadAsMessageThread();
1212
updateCheck = new UpdateCheck(); // deleted at shutdown
13+
auto scaleFactor = juce::Desktop::getInstance().getDisplays().getPrimaryDisplay()->dpi / atk::DPI_NORMAL;
14+
juce::Desktop::getInstance().setGlobalScaleFactor(scaleFactor);
1315
}
1416

1517
void atk::pump()

lib/atkaudio/src/atkaudio/atkaudio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
namespace atk
66
{
77

8+
constexpr auto DPI_NORMAL = 96.0f;
9+
810
extern "C" void create();
911
extern "C" void destroy();
1012
extern "C" void pump();

src/MessagePump.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include <atkaudio/atkaudio.h>
33

4-
#if defined(JUCE_DEBUG) && defined(JUCE_WINDOWS)
4+
#if defined(JUCE_MAC) || defined(JUCE_WINDOWS)
55
#define NO_MESSAGE_PUMP
66
#endif
77
#ifndef NO_MESSAGE_PUMP

0 commit comments

Comments
 (0)