Reverted
Reverted errors. Tonex is not working becasue proprietary x86 plug‑ins such as **IK Multimedia ToneX**.
This commit is contained in:
@@ -59,7 +59,7 @@ namespace pipedal
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t GetSampleRate() const { return sampleRate_; }
|
uint64_t GetSampleRate() const { return sampleRate_; }
|
||||||
void SetSampleRate(uint64_t sampleRate) { sampleRate_ = sampleRate; }
|
|
||||||
uint32_t GetBufferSize() const { return bufferSize_; }
|
uint32_t GetBufferSize() const { return bufferSize_; }
|
||||||
uint32_t GetNumberOfBuffers() const { return numberOfBuffers_; }
|
uint32_t GetNumberOfBuffers() const { return numberOfBuffers_; }
|
||||||
const std::string &GetAlsaInputDevice() const { return alsaInputDevice_; }
|
const std::string &GetAlsaInputDevice() const { return alsaInputDevice_; }
|
||||||
|
|||||||
+50
-64
@@ -41,7 +41,6 @@
|
|||||||
#include "SysExec.hpp"
|
#include "SysExec.hpp"
|
||||||
#include "Updater.hpp"
|
#include "Updater.hpp"
|
||||||
#include "util.hpp"
|
#include "util.hpp"
|
||||||
#include <algorithm>
|
|
||||||
#include "DBusLog.hpp"
|
#include "DBusLog.hpp"
|
||||||
#include "AvahiService.hpp"
|
#include "AvahiService.hpp"
|
||||||
#include "DummyAudioDriver.hpp"
|
#include "DummyAudioDriver.hpp"
|
||||||
@@ -75,10 +74,6 @@ static std::string BytesToHex(const std::vector<uint8_t> &bytes)
|
|||||||
return s.str();
|
return s.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t SelectBestSampleRate(const AlsaDeviceInfo &inDev,
|
|
||||||
const AlsaDeviceInfo &outDev,
|
|
||||||
uint32_t desiredRate);
|
|
||||||
|
|
||||||
PiPedalModel::PiPedalModel()
|
PiPedalModel::PiPedalModel()
|
||||||
: pluginHost(),
|
: pluginHost(),
|
||||||
atomConverter(pluginHost.GetMapFeature())
|
atomConverter(pluginHost.GetMapFeature())
|
||||||
@@ -1381,31 +1376,31 @@ void PiPedalModel::RestartAudio(bool useDummyAudioDriver)
|
|||||||
{
|
{
|
||||||
jackServerSettings.UseDummyAudioDevice();
|
jackServerSettings.UseDummyAudioDevice();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
auto devices = GetAlsaDevices();
|
|
||||||
AlsaDeviceInfo inDev, outDev;
|
|
||||||
bool inFound = false, outFound = false;
|
|
||||||
for (auto &d : devices)
|
|
||||||
{
|
|
||||||
if (d.id_ == jackServerSettings.GetAlsaInputDevice())
|
|
||||||
{
|
|
||||||
inDev = d;
|
|
||||||
inFound = true;
|
|
||||||
}
|
|
||||||
if (d.id_ == jackServerSettings.GetAlsaOutputDevice())
|
|
||||||
{
|
|
||||||
outDev = d;
|
|
||||||
outFound = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (inFound && outFound)
|
|
||||||
{
|
|
||||||
uint32_t best = SelectBestSampleRate(inDev, outDev, (uint32_t)jackServerSettings.GetSampleRate());
|
|
||||||
jackServerSettings.SetSampleRate(best);
|
|
||||||
this->jackServerSettings.SetSampleRate(best);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
auto jackConfiguration = this->jackConfiguration;
|
auto jackConfiguration = this->jackConfiguration;
|
||||||
jackConfiguration.AlsaInitialize(jackServerSettings);
|
jackConfiguration.AlsaInitialize(jackServerSettings);
|
||||||
@@ -2777,38 +2772,30 @@ static bool HasAlsaDevice(const std::vector<AlsaDeviceInfo> devices, const std::
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t SelectBestSampleRate(const AlsaDeviceInfo &inDev, const AlsaDeviceInfo &outDev, uint32_t desiredRate)
|
|
||||||
{
|
|
||||||
std::vector<uint32_t> intersection;
|
|
||||||
for (auto sr : inDev.sampleRates_)
|
|
||||||
{
|
|
||||||
if (std::find(outDev.sampleRates_.begin(), outDev.sampleRates_.end(), sr) != outDev.sampleRates_.end())
|
|
||||||
{
|
|
||||||
intersection.push_back(sr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (intersection.empty())
|
|
||||||
{
|
|
||||||
return desiredRate == 0 ? 48000 : desiredRate;
|
|
||||||
}
|
|
||||||
if (desiredRate != 0 &&
|
|
||||||
std::find(intersection.begin(), intersection.end(), desiredRate) != intersection.end())
|
|
||||||
{
|
|
||||||
return desiredRate;
|
|
||||||
}
|
|
||||||
std::sort(intersection.begin(), intersection.end());
|
|
||||||
uint32_t best = 0;
|
|
||||||
for (auto sr : intersection)
|
|
||||||
{
|
|
||||||
if (sr == 48000)
|
|
||||||
return 48000;
|
|
||||||
if (sr <= 48000 && sr > best)
|
|
||||||
best = sr;
|
|
||||||
}
|
|
||||||
if (best == 0)
|
|
||||||
best = intersection.back();
|
|
||||||
return best;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PiPedalModel::StartHotspotMonitoring()
|
void PiPedalModel::StartHotspotMonitoring()
|
||||||
{
|
{
|
||||||
@@ -3156,7 +3143,7 @@ void PiPedalModel::SetTone3000Auth(const std::string &apiKey)
|
|||||||
{
|
{
|
||||||
std::lock_guard<std::recursive_mutex> lock(mutex);
|
std::lock_guard<std::recursive_mutex> lock(mutex);
|
||||||
storage.SetTone3000Auth(apiKey);
|
storage.SetTone3000Auth(apiKey);
|
||||||
|
|
||||||
std::vector<IPiPedalModelSubscriber::ptr> t{subscribers.begin(), subscribers.end()};
|
std::vector<IPiPedalModelSubscriber::ptr> t{subscribers.begin(), subscribers.end()};
|
||||||
bool hasAuth = apiKey != "";
|
bool hasAuth = apiKey != "";
|
||||||
for (auto &subscriber : t)
|
for (auto &subscriber : t)
|
||||||
@@ -3171,4 +3158,3 @@ bool PiPedalModel::HasTone3000Auth() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user