Skip to content

Commit

Permalink
Impl DAW channel count UI changes in DS plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
firthm01 committed Oct 6, 2023
1 parent b43d110 commit f15d61d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ void DirectSpeakersJuceFrontendConnector::setSpeakerSetup(
routingComboBoxLocked->clearEntries();
auto layoutSizeFixed = layoutSize != 0 ? layoutSize - 1 : layoutSize;
for (int i = 1; i + layoutSizeFixed <= MAX_DAW_CHANNELS; ++i) {
routingComboBoxLocked->addTextEntry(routingLayoutDescriptionAt(i, layoutSizeFixed));
auto entry = routingComboBoxLocked->addTextEntry(routingLayoutDescriptionAt(i, layoutSizeFixed), i);
entry->setSelectable(i + layoutSizeFixed <= p_->getNumDawChannels());
}
routingComboBoxLocked->selectEntry(cachedRouting_, sendNotification);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include "direct_speakers_plugin_editor.hpp"
#include "direct_speakers_frontend_connector.hpp"

#include <daw_channel_count.h>

void registerPluginLoadSig(std::function<void(std::string const&)>);
uint32_t requestInputInstanceIdSig();

Expand Down Expand Up @@ -213,6 +211,12 @@ void DirectSpeakersAudioProcessor::setIHostApplication(Steinberg::FUnknown * unk
this->extensionSetState(xmlState);
});
}

auto getAppVersionPtr = reaperHost->getReaperApi("GetAppVersion");
numDawChannels_ = MAX_DAW_CHANNELS;
if (getAppVersionPtr) {
numDawChannels_ = GetReaperChannelCount(getAppVersionPtr);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "components/level_meter_calculator.hpp"
#include "reaper_vst3_interfaces.h"
#include "components/read_only_audio_parameter_int.hpp"
#include <daw_channel_count.h>

#include <memory>

Expand Down Expand Up @@ -72,6 +73,8 @@ class DirectSpeakersAudioProcessor : public AudioProcessor, public VST3ClientExt
void setIHostApplication(Steinberg::FUnknown *unknown) override;
void extensionSetState(std::string const& xmlState);

int getNumDawChannels() { return numDawChannels_; }

private:
IReaperHostApplication* reaperHost{ nullptr };
ear::plugin::communication::ConnectionId connectionId_;
Expand All @@ -87,6 +90,7 @@ class DirectSpeakersAudioProcessor : public AudioProcessor, public VST3ClientExt
std::unique_ptr<ear::plugin::DirectSpeakersBackend> backend_;

int samplerate_;
int numDawChannels_{MAX_DAW_CHANNELS};
std::shared_ptr<ear::plugin::LevelMeterCalculator> levelMeter_;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DirectSpeakersAudioProcessor)
Expand Down

0 comments on commit f15d61d

Please sign in to comment.