Browse Source

More linuxsampler work; Minor UI tweaks

tags/1.9.6
falkTX 10 years ago
parent
commit
17cf68a399
3 changed files with 34 additions and 33 deletions
  1. +9
    -2
      resources/ui/carla_host.ui
  2. +23
    -29
      source/backend/plugin/CarlaPluginLinuxSampler.cpp
  3. +2
    -2
      source/carla_skin.py

+ 9
- 2
resources/ui/carla_host.ui View File

@@ -66,7 +66,14 @@
</widget>
</item>
<item>
<widget class="RackListWidget" name="listWidget"/>
<widget class="RackListWidget" name="listWidget">
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="pad_right">
@@ -137,7 +144,7 @@
<x>0</x>
<y>0</y>
<width>870</width>
<height>17</height>
<height>19</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">


+ 23
- 29
source/backend/plugin/CarlaPluginLinuxSampler.cpp View File

@@ -46,7 +46,9 @@ using CarlaBackend::CarlaPlugin;
// -----------------------------------------------------------------------
// LinuxSampler static values

static const float kVolumeMax = 3.16227766f; // +10 dB
static const float kVolumeMax = 3.16227766f; // +10 dB
static const uint kMaxStreams = 90*2; // default is not *2
static const uint kMaxVoices = 64*2;

// -----------------------------------------------------------------------
// LinuxSampler AudioOutputDevice Plugin
@@ -213,8 +215,9 @@ public:
{
carla_debug("CarlaPluginLinuxSampler::CarlaPluginLinuxSampler(%p, %i, %s, %s)", engine, id, bool2str(isGIG), bool2str(use16Outs));

sSampler->SetGlobalMaxStreams(300);
sSampler->SetGlobalMaxVoices(300);
// TODO - option for this
sSampler->SetGlobalMaxStreams(LinuxSampler::kMaxStreams);
sSampler->SetGlobalMaxVoices(LinuxSampler::kMaxVoices);

carla_zeroStruct(fCurProgs, MAX_MIDI_CHANNELS);
carla_zeroStruct(fSamplerChannels, MAX_MIDI_CHANNELS);
@@ -374,8 +377,8 @@ public:

switch (parameterId)
{
case LinuxSamplerStreamCount:
std::strncpy(strBuf, "Stream Count", STR_MAX);
case LinuxSamplerDiskStreamCount:
std::strncpy(strBuf, "Disk Stream Count", STR_MAX);
return;
case LinuxSamplerVoiceCount:
std::strncpy(strBuf, "Voice Count", STR_MAX);
@@ -471,6 +474,9 @@ public:
CARLA_SAFE_ASSERT_RETURN(index < pData->prog.count,);
CARLA_SAFE_ASSERT_RETURN(channel >= 0 && channel < MAX_MIDI_CHANNELS,);

if (fCurProgs[channel] == index)
return;

LinuxSampler::EngineChannel* const engineChannel(fEngineChannels[kIsGIG ? channel : 0]);
CARLA_SAFE_ASSERT_RETURN(engineChannel != nullptr,);

@@ -627,13 +633,13 @@ public:
int j;

// ----------------------
j = LinuxSamplerStreamCount;
j = LinuxSamplerDiskStreamCount;
pData->param.data[j].type = PARAMETER_OUTPUT;
pData->param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_AUTOMABLE | PARAMETER_IS_INTEGER;
pData->param.data[j].index = j;
pData->param.data[j].rindex = j;
pData->param.ranges[j].min = 0.0f;
pData->param.ranges[j].max = 65355.0f;
pData->param.ranges[j].max = LinuxSampler::kMaxStreams;
pData->param.ranges[j].def = 0.0f;
pData->param.ranges[j].step = 1.0f;
pData->param.ranges[j].stepSmall = 1.0f;
@@ -646,7 +652,7 @@ public:
pData->param.data[j].index = j;
pData->param.data[j].rindex = j;
pData->param.ranges[j].min = 0.0f;
pData->param.ranges[j].max = 65355.0f;
pData->param.ranges[j].max = LinuxSampler::kMaxVoices;
pData->param.ranges[j].def = 0.0f;
pData->param.ranges[j].step = 1.0f;
pData->param.ranges[j].stepSmall = 1.0f;
@@ -771,8 +777,8 @@ public:
for (uint32_t i=0; i < pData->audioOut.count; ++i)
FloatVectorOperations::clear(audioOut[i], static_cast<int>(frames));

fParamBuffers[LinuxSamplerStreamCount] = 0.0f;
fParamBuffers[LinuxSamplerVoiceCount] = 0.0f;
fParamBuffers[LinuxSamplerDiskStreamCount] = 0.0f;
fParamBuffers[LinuxSamplerVoiceCount] = 0.0f;
return;
}

@@ -1036,20 +1042,8 @@ public:
// --------------------------------------------------------------------------------------------------------
// Parameter outputs

uint streamCount = 0;
uint voiceCount = 0;

for (uint i=0; i<kMaxChannels; ++i)
{
if (LinuxSampler::EngineChannel* const engineChannel = fEngineChannels[i])
{
streamCount += engineChannel->GetDiskStreamCount();
voiceCount += engineChannel->GetVoiceCount();
}
}

fParamBuffers[LinuxSamplerStreamCount] = streamCount;
fParamBuffers[LinuxSamplerVoiceCount] = voiceCount;
fParamBuffers[LinuxSamplerDiskStreamCount] = fEngineChannels[0]->GetDiskStreamCount();
fParamBuffers[LinuxSamplerVoiceCount] = fEngineChannels[0]->GetVoiceCount();
}

bool processSingle(float** const outBuffer, const uint32_t frames, const uint32_t timeOffset)
@@ -1339,9 +1333,9 @@ public:

private:
enum LinuxSamplerParameters {
LinuxSamplerStreamCount = 0,
LinuxSamplerVoiceCount = 1,
LinuxSamplerParametersMax = 2
LinuxSamplerDiskStreamCount = 0,
LinuxSamplerVoiceCount = 1,
LinuxSamplerParametersMax = 2
};

const bool kIsGIG; // SFZ if false
@@ -1352,8 +1346,8 @@ private:
const char* fMaker;
const char* fRealName;

int32_t fCurProgs[MAX_MIDI_CHANNELS];
float fParamBuffers[LinuxSamplerParametersMax];
uint32_t fCurProgs[MAX_MIDI_CHANNELS];
float fParamBuffers[LinuxSamplerParametersMax];

SharedResourcePointer<LinuxSampler::Sampler> sSampler;



+ 2
- 2
source/carla_skin.py View File

@@ -284,14 +284,14 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta):
self.peak_in.setColor(DigitalPeakMeter.GREEN)
self.peak_in.setChannels(self.fPeaksInputCount)
self.peak_in.setOrientation(DigitalPeakMeter.HORIZONTAL)
if self.fPeaksInputCount == 0:
if self.fPeaksInputCount == 0 and not isinstance(self, PluginSlot_Default):
self.peak_in.hide()

if self.peak_out is not None:
self.peak_out.setColor(DigitalPeakMeter.BLUE)
self.peak_out.setChannels(self.fPeaksOutputCount)
self.peak_out.setOrientation(DigitalPeakMeter.HORIZONTAL)
if self.fPeaksOutputCount == 0:
if self.fPeaksOutputCount == 0 and not isinstance(self, PluginSlot_Default):
self.peak_out.hide()

for paramIndex, paramWidget in self.fParameterList:


Loading…
Cancel
Save