Style cleanup: removed unnecessary braces.
This commit is contained in:
@@ -55,9 +55,9 @@ Equalizer::PreAmp(void)
|
|||||||
void
|
void
|
||||||
Equalizer::SetBand(int band, double value)
|
Equalizer::SetBand(int band, double value)
|
||||||
{
|
{
|
||||||
if (band < 0 || band >= BandCount()) {
|
if (band < 0 || band >= BandCount())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
fBands[band] = value;
|
fBands[band] = value;
|
||||||
RecalcGains();
|
RecalcGains();
|
||||||
}
|
}
|
||||||
@@ -65,9 +65,9 @@ Equalizer::SetBand(int band, double value)
|
|||||||
double
|
double
|
||||||
Equalizer::Band(int band)
|
Equalizer::Band(int band)
|
||||||
{
|
{
|
||||||
if (band < 0 || band >= BandCount()) {
|
if (band < 0 || band >= BandCount())
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
|
||||||
return fBands[band];
|
return fBands[band];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,18 +80,17 @@ Equalizer::BandCount(void)
|
|||||||
float
|
float
|
||||||
Equalizer::BandFrequency(int band)
|
Equalizer::BandFrequency(int band)
|
||||||
{
|
{
|
||||||
if (band < 0 || band >= BandCount()) {
|
if (band < 0 || band >= BandCount())
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
|
||||||
return fFrequency[band];
|
return fFrequency[band];
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Equalizer::ProcessBuffer(float* buffer, int samples)
|
Equalizer::ProcessBuffer(float* buffer, int samples)
|
||||||
{
|
{
|
||||||
if (!fActivated || samples <= 0) {
|
if (!fActivated || samples <= 0)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
for(int i = 0; i < fChannels; i++) {
|
for(int i = 0; i < fChannels; i++) {
|
||||||
float *g = fGainVector[i];
|
float *g = fGainVector[i];
|
||||||
@@ -130,15 +129,14 @@ void
|
|||||||
Equalizer::RecalcGains(void)
|
Equalizer::RecalcGains(void)
|
||||||
{
|
{
|
||||||
float adjust[EQ_BANDS];
|
float adjust[EQ_BANDS];
|
||||||
for(int i = 0; i < BandCount(); i++) {
|
|
||||||
|
for(int i = 0; i < BandCount(); i++)
|
||||||
adjust[i] = fPreAmp + fBands[i];
|
adjust[i] = fPreAmp + fBands[i];
|
||||||
}
|
|
||||||
|
|
||||||
for(int c = 0; c < MAX_CHANNELS; c++) {
|
for(int c = 0; c < MAX_CHANNELS; c++)
|
||||||
for(int i = 0; i<BandCount(); i++) {
|
for(int i = 0; i<BandCount(); i++)
|
||||||
fGainVector[c][i] = pow(10, adjust[i] / 20) - 1;
|
fGainVector[c][i] = pow(10, adjust[i] / 20) - 1;
|
||||||
}
|
|
||||||
}
|
|
||||||
fActivated = true;
|
fActivated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,7 @@
|
|||||||
#define MAX_CHANNELS 8
|
#define MAX_CHANNELS 8
|
||||||
#define EQ_BANDS 10
|
#define EQ_BANDS 10
|
||||||
|
|
||||||
class Equalizer
|
class Equalizer {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
Equalizer();
|
Equalizer();
|
||||||
~Equalizer();
|
~Equalizer();
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ EqualizerAddOn::~EqualizerAddOn()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
EqualizerAddOn::EqualizerAddOn(image_id image) : BMediaAddOn(image)
|
EqualizerAddOn::EqualizerAddOn(image_id image)
|
||||||
|
:
|
||||||
|
BMediaAddOn(image)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,7 @@
|
|||||||
|
|
||||||
#include <MediaAddOn.h>
|
#include <MediaAddOn.h>
|
||||||
|
|
||||||
class EqualizerAddOn : public BMediaAddOn
|
class EqualizerAddOn : public BMediaAddOn {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
virtual ~EqualizerAddOn();
|
virtual ~EqualizerAddOn();
|
||||||
explicit EqualizerAddOn(image_id image);
|
explicit EqualizerAddOn(image_id image);
|
||||||
|
|||||||
@@ -574,40 +574,35 @@ EqualizerNode::ValidateFormat(const media_format &preferred_format,
|
|||||||
const media_raw_audio_format &pref = preferred_format.u.raw_audio;
|
const media_raw_audio_format &pref = preferred_format.u.raw_audio;
|
||||||
|
|
||||||
if(pref.frame_rate != wild.frame_rate && f.frame_rate != pref.frame_rate) {
|
if(pref.frame_rate != wild.frame_rate && f.frame_rate != pref.frame_rate) {
|
||||||
if(f.frame_rate != wild.frame_rate) {
|
if(f.frame_rate != wild.frame_rate)
|
||||||
ret = B_MEDIA_BAD_FORMAT;
|
ret = B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
f.frame_rate = pref.frame_rate;
|
f.frame_rate = pref.frame_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pref.channel_count != wild.channel_count &&
|
if(pref.channel_count != wild.channel_count &&
|
||||||
f.channel_count != pref.channel_count) {
|
f.channel_count != pref.channel_count) {
|
||||||
if(f.channel_count != wild.channel_count) {
|
if(f.channel_count != wild.channel_count)
|
||||||
ret = B_MEDIA_BAD_FORMAT;
|
ret = B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
f.channel_count = pref.channel_count;
|
f.channel_count = pref.channel_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pref.format != wild.format && f.format != pref.format) {
|
if(pref.format != wild.format && f.format != pref.format) {
|
||||||
if(f.format != wild.format) {
|
if(f.format != wild.format)
|
||||||
ret = B_MEDIA_BAD_FORMAT;
|
ret = B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
f.format = pref.format;
|
f.format = pref.format;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pref.byte_order != wild.byte_order &&
|
if(pref.byte_order != wild.byte_order &&
|
||||||
f.byte_order != pref.byte_order) {
|
f.byte_order != pref.byte_order) {
|
||||||
if(f.byte_order != wild.byte_order) {
|
if(f.byte_order != wild.byte_order)
|
||||||
ret = B_MEDIA_BAD_FORMAT;
|
ret = B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
f.byte_order = pref.byte_order;
|
f.byte_order = pref.byte_order;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pref.buffer_size != wild.buffer_size &&
|
if(pref.buffer_size != wild.buffer_size &&
|
||||||
f.buffer_size != pref.buffer_size) {
|
f.buffer_size != pref.buffer_size) {
|
||||||
if(f.buffer_size != wild.buffer_size) {
|
if(f.buffer_size != wild.buffer_size)
|
||||||
ret = B_MEDIA_BAD_FORMAT;
|
ret = B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
f.buffer_size = pref.buffer_size;
|
f.buffer_size = pref.buffer_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -625,22 +620,22 @@ EqualizerNode::SetOutputFormat(media_format &format)
|
|||||||
f.frame_rate = 44100.0;
|
f.frame_rate = 44100.0;
|
||||||
}
|
}
|
||||||
if (f.channel_count == w.channel_count) {
|
if (f.channel_count == w.channel_count) {
|
||||||
if(fInputMedia.source != media_source::null) {
|
if(fInputMedia.source != media_source::null)
|
||||||
f.channel_count = fInputMedia.format.u.raw_audio.channel_count;
|
f.channel_count = fInputMedia.format.u.raw_audio.channel_count;
|
||||||
} else {
|
else
|
||||||
f.channel_count = 2;
|
f.channel_count = 2;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (f.format == w.format) {
|
|
||||||
|
if (f.format == w.format)
|
||||||
f.format = media_raw_audio_format::B_AUDIO_FLOAT;
|
f.format = media_raw_audio_format::B_AUDIO_FLOAT;
|
||||||
}
|
|
||||||
if (f.byte_order == w.format) {
|
if (f.byte_order == w.format) {
|
||||||
f.byte_order = (B_HOST_IS_BENDIAN) ?
|
f.byte_order = (B_HOST_IS_BENDIAN) ?
|
||||||
B_MEDIA_BIG_ENDIAN : B_MEDIA_LITTLE_ENDIAN;
|
B_MEDIA_BIG_ENDIAN : B_MEDIA_LITTLE_ENDIAN;
|
||||||
}
|
}
|
||||||
if (f.buffer_size == w.buffer_size) {
|
|
||||||
|
if (f.buffer_size == w.buffer_size)
|
||||||
f.buffer_size = BUFF_SIZE;
|
f.buffer_size = BUFF_SIZE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,8 +32,7 @@ class BBufferGroup;
|
|||||||
class EqualizerNode : public BBufferConsumer,
|
class EqualizerNode : public BBufferConsumer,
|
||||||
public BBufferProducer,
|
public BBufferProducer,
|
||||||
public BControllable,
|
public BControllable,
|
||||||
public BMediaEventLooper
|
public BMediaEventLooper {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
virtual ~EqualizerNode();
|
virtual ~EqualizerNode();
|
||||||
EqualizerNode(BMediaAddOn* pAddOn = NULL);
|
EqualizerNode(BMediaAddOn* pAddOn = NULL);
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ extern "C" _EXPORT BMediaAddOn* make_media_addon(image_id image)
|
|||||||
return new VSTAddOn(image);
|
return new VSTAddOn(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
VSTAddOn::VSTAddOn(image_id image) : BMediaAddOn(image)
|
VSTAddOn::VSTAddOn(image_id image)
|
||||||
|
:
|
||||||
|
BMediaAddOn(image)
|
||||||
{
|
{
|
||||||
const char vst_subdir[]={"media/vstplugins"};
|
const char vst_subdir[]={"media/vstplugins"};
|
||||||
|
|
||||||
@@ -120,9 +122,8 @@ VSTAddOn::ScanPluginsFolders(const char* path, bool make_dir)
|
|||||||
if (ret == B_OK) {
|
if (ret == B_OK) {
|
||||||
plugin->UnLoadModule();
|
plugin->UnLoadModule();
|
||||||
fPluginsList.AddItem(plugin);
|
fPluginsList.AddItem(plugin);
|
||||||
} else {
|
} else
|
||||||
delete plugin;
|
delete plugin;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -10,8 +10,7 @@
|
|||||||
#include <MediaAddOn.h>
|
#include <MediaAddOn.h>
|
||||||
#include "VSTHost.h"
|
#include "VSTHost.h"
|
||||||
|
|
||||||
class VSTAddOn : public BMediaAddOn
|
class VSTAddOn : public BMediaAddOn {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
virtual ~VSTAddOn();
|
virtual ~VSTAddOn();
|
||||||
explicit VSTAddOn(image_id image);
|
explicit VSTAddOn(image_id image);
|
||||||
|
|||||||
@@ -24,14 +24,12 @@ TrimString(BString *string) {
|
|||||||
for(i=0; str[i]!='\0';) {
|
for(i=0; str[i]!='\0';) {
|
||||||
if (isspace(str[i])) {
|
if (isspace(str[i])) {
|
||||||
k = i;
|
k = i;
|
||||||
for(uint32 j = i; j < strlen(str) - 1; j++) {
|
for(uint32 j = i; j < strlen(str) - 1; j++)
|
||||||
str[j] = str[j + 1];
|
str[j] = str[j + 1];
|
||||||
}
|
|
||||||
str[strlen(str) - 1] = '\0';
|
str[strlen(str) - 1] = '\0';
|
||||||
i = k;
|
i = k;
|
||||||
} else {
|
} else
|
||||||
i++;
|
i++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
string->UnlockBuffer();
|
string->UnlockBuffer();
|
||||||
}
|
}
|
||||||
@@ -73,12 +71,14 @@ VSTParameter::VSTParameter(VSTPlugin* plugin, int index)
|
|||||||
float test_values[VST_PARAM_TEST_COUNT];
|
float test_values[VST_PARAM_TEST_COUNT];
|
||||||
float delta = 1.0 / (float)VST_PARAM_TEST_COUNT;
|
float delta = 1.0 / (float)VST_PARAM_TEST_COUNT;
|
||||||
int test_cnt = 0;
|
int test_cnt = 0;
|
||||||
for(int tst_val = 0; tst_val < VST_PARAM_TEST_COUNT; tst_val++){
|
for(int tst_val = 0; tst_val < VST_PARAM_TEST_COUNT; tst_val++) {
|
||||||
float v = (float)tst_val / (float)VST_PARAM_TEST_COUNT;
|
float v = (float)tst_val / (float)VST_PARAM_TEST_COUNT;
|
||||||
if (tst_val >= VST_PARAM_TEST_COUNT - 1) {
|
|
||||||
|
if (tst_val >= VST_PARAM_TEST_COUNT - 1)
|
||||||
v = 1.0;
|
v = 1.0;
|
||||||
}
|
|
||||||
fEffect->setParameter(fEffect, index, v);
|
fEffect->setParameter(fEffect, index, v);
|
||||||
|
|
||||||
float new_value = fEffect->getParameter(fEffect, index);
|
float new_value = fEffect->getParameter(fEffect, index);
|
||||||
bool valtest = false;
|
bool valtest = false;
|
||||||
for(int i = 0; i < test_cnt; i++) {
|
for(int i = 0; i < test_cnt; i++) {
|
||||||
@@ -136,9 +136,8 @@ VSTParameter::~VSTParameter()
|
|||||||
BString*
|
BString*
|
||||||
VSTParameter::ValidateValues(BString* string)
|
VSTParameter::ValidateValues(BString* string)
|
||||||
{
|
{
|
||||||
if (string->Length() == 0) {
|
if (string->Length() == 0)
|
||||||
return string;
|
return string;
|
||||||
}
|
|
||||||
|
|
||||||
bool isNum = true;
|
bool isNum = true;
|
||||||
|
|
||||||
@@ -184,9 +183,8 @@ DropListValue*
|
|||||||
VSTParameter::ListItemAt(int index)
|
VSTParameter::ListItemAt(int index)
|
||||||
{
|
{
|
||||||
DropListValue* item = NULL;
|
DropListValue* item = NULL;
|
||||||
if (index >= 0 && index < fDropList.CountItems()) {
|
if (index >= 0 && index < fDropList.CountItems())
|
||||||
item = (DropListValue*)fDropList.ItemAt(index);
|
item = (DropListValue*)fDropList.ItemAt(index);
|
||||||
}
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,9 +214,8 @@ VSTParameter::Value()
|
|||||||
void
|
void
|
||||||
VSTParameter::SetValue(float value)
|
VSTParameter::SetValue(float value)
|
||||||
{
|
{
|
||||||
if (value == fLastValue) {
|
if (value == fLastValue)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (fType == VST_PARAM_DROPLIST) {
|
if (fType == VST_PARAM_DROPLIST) {
|
||||||
//take value by index
|
//take value by index
|
||||||
@@ -307,16 +304,14 @@ VSTPlugin::LoadModule(const char *path)
|
|||||||
char vendorString[256] = {0};
|
char vendorString[256] = {0};
|
||||||
char productString[256] = {0};
|
char productString[256] = {0};
|
||||||
|
|
||||||
if (fActive) {
|
if (fActive)
|
||||||
return VST_ERR_ALREADY_LOADED;
|
return VST_ERR_ALREADY_LOADED;
|
||||||
}
|
|
||||||
|
|
||||||
fPath = BPath(path);
|
fPath = BPath(path);
|
||||||
|
|
||||||
fModule = load_add_on(path);
|
fModule = load_add_on(path);
|
||||||
if (fModule <= 0) {
|
if (fModule <= 0)
|
||||||
return VST_ERR_NOT_LOADED;
|
return VST_ERR_NOT_LOADED;
|
||||||
}
|
|
||||||
|
|
||||||
if (get_image_symbol(fModule, "main_plugin", B_SYMBOL_TYPE_TEXT,
|
if (get_image_symbol(fModule, "main_plugin", B_SYMBOL_TYPE_TEXT,
|
||||||
(void**)&VSTMainProc) != B_OK) {
|
(void**)&VSTMainProc) != B_OK) {
|
||||||
@@ -366,9 +361,9 @@ VSTPlugin::LoadModule(const char *path)
|
|||||||
int
|
int
|
||||||
VSTPlugin::UnLoadModule(void)
|
VSTPlugin::UnLoadModule(void)
|
||||||
{
|
{
|
||||||
if (!fActive || fModule <= 0) {
|
if (!fActive || fModule <= 0)
|
||||||
return VST_ERR_NOT_LOADED;
|
return VST_ERR_NOT_LOADED;
|
||||||
}
|
|
||||||
fEffect->dispatcher(fEffect, VST_STATE_CHANGED, 0, 0, 0, 0);
|
fEffect->dispatcher(fEffect, VST_STATE_CHANGED, 0, 0, 0, 0);
|
||||||
fEffect->dispatcher(fEffect, VST_CLOSE, 0, 0, 0, 0);
|
fEffect->dispatcher(fEffect, VST_CLOSE, 0, 0, 0, 0);
|
||||||
|
|
||||||
@@ -423,15 +418,13 @@ int
|
|||||||
VSTPlugin::ReAllocBuffers(void)
|
VSTPlugin::ReAllocBuffers(void)
|
||||||
{
|
{
|
||||||
if (inputs != NULL) {
|
if (inputs != NULL) {
|
||||||
for(int32 i = 0; i < fInputChannels; i++) {
|
for(int32 i = 0; i < fInputChannels; i++)
|
||||||
delete inputs[i];
|
delete inputs[i];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputs != NULL) {
|
if (outputs != NULL) {
|
||||||
for(int32 i = 0; i < fOutputChannels; i++) {
|
for(int32 i = 0; i < fOutputChannels; i++)
|
||||||
delete outputs[i];
|
delete outputs[i];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fInputChannels > 0) {
|
if (fInputChannels > 0) {
|
||||||
@@ -469,9 +462,8 @@ VSTPlugin::Parameter(int index)
|
|||||||
{
|
{
|
||||||
VSTParameter* param = NULL;
|
VSTParameter* param = NULL;
|
||||||
|
|
||||||
if (index >= 0 && index < fParameters.CountItems()) {
|
if (index >= 0 && index < fParameters.CountItems())
|
||||||
param = (VSTParameter*)fParameters.ItemAt(index);
|
param = (VSTParameter*)fParameters.ItemAt(index);
|
||||||
}
|
|
||||||
|
|
||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
@@ -515,15 +507,13 @@ VSTPlugin::Process(float *buffer, int samples, int channels)
|
|||||||
|
|
||||||
if (channels == fInputChannels) { //channel to channel
|
if (channels == fInputChannels) { //channel to channel
|
||||||
for(int j = 0; j < samples; j++) {
|
for(int j = 0; j < samples; j++) {
|
||||||
for(int c = 0; c < fInputChannels; c++) {
|
for(int c = 0; c < fInputChannels; c++)
|
||||||
inputs[c][j] = *src++;
|
inputs[c][j] = *src++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if ( channels == 1) { //from mone to multichannel
|
} else if ( channels == 1) { //from mone to multichannel
|
||||||
for(int j = 0; j < samples; j++, src++) {
|
for(int j = 0; j < samples; j++, src++) {
|
||||||
for(int c = 0; c < fInputChannels; c++) {
|
for(int c = 0; c < fInputChannels; c++)
|
||||||
inputs[c][j] = *src;
|
inputs[c][j] = *src;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -533,16 +523,14 @@ VSTPlugin::Process(float *buffer, int samples, int channels)
|
|||||||
|
|
||||||
if (channels == fOutputChannels) { //channel to channel
|
if (channels == fOutputChannels) { //channel to channel
|
||||||
for(int j = 0; j < samples; j++) {
|
for(int j = 0; j < samples; j++) {
|
||||||
for(int c = 0; c < fOutputChannels; c++) {
|
for(int c = 0; c < fOutputChannels; c++)
|
||||||
*dst++ = outputs[c][j];
|
*dst++ = outputs[c][j];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (channels == 1) { //from multichannel to mono
|
} else if (channels == 1) { //from multichannel to mono
|
||||||
for(int j = 0; j < samples; j++, dst++) {
|
for(int j = 0; j < samples; j++, dst++) {
|
||||||
float mix = 0;
|
float mix = 0;
|
||||||
for(int c = 0; c < fOutputChannels; c++) {
|
for(int c = 0; c < fOutputChannels; c++)
|
||||||
mix += outputs[c][j];
|
mix += outputs[c][j];
|
||||||
}
|
|
||||||
*dst = mix / (float)fOutputChannels;
|
*dst = mix / (float)fOutputChannels;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ VSTNode::~VSTNode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
VSTNode::VSTNode(BMediaAddOn* addon, const char* name, const char* path)
|
VSTNode::VSTNode(BMediaAddOn* addon, const char* name, const char* path)
|
||||||
: BMediaNode(name),
|
:
|
||||||
|
BMediaNode(name),
|
||||||
BBufferConsumer(B_MEDIA_RAW_AUDIO),
|
BBufferConsumer(B_MEDIA_RAW_AUDIO),
|
||||||
BBufferProducer(B_MEDIA_RAW_AUDIO),
|
BBufferProducer(B_MEDIA_RAW_AUDIO),
|
||||||
BControllable(),
|
BControllable(),
|
||||||
@@ -41,9 +42,8 @@ VSTNode::VSTNode(BMediaAddOn* addon, const char* name, const char* path)
|
|||||||
BMediaAddOn*
|
BMediaAddOn*
|
||||||
VSTNode::AddOn(int32* id) const
|
VSTNode::AddOn(int32* id) const
|
||||||
{
|
{
|
||||||
if(fAddOn) {
|
if(fAddOn)
|
||||||
*id = 0;
|
*id = 0;
|
||||||
}
|
|
||||||
return fAddOn;
|
return fAddOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,10 +100,8 @@ status_t
|
|||||||
VSTNode::GetParameterValue(int32 id, bigtime_t* lastChangeTime, void* value,
|
VSTNode::GetParameterValue(int32 id, bigtime_t* lastChangeTime, void* value,
|
||||||
size_t *size)
|
size_t *size)
|
||||||
{
|
{
|
||||||
if (*size < sizeof(float) ||
|
if (*size < sizeof(float) || *size < sizeof(int32))
|
||||||
*size < sizeof(int32)) {
|
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
|
||||||
|
|
||||||
type_code v_type = B_FLOAT_TYPE;
|
type_code v_type = B_FLOAT_TYPE;
|
||||||
|
|
||||||
@@ -130,12 +128,13 @@ VSTNode::GetParameterValue(int32 id, bigtime_t* lastChangeTime, void* value,
|
|||||||
int32 idx = id - P_PARAM;
|
int32 idx = id - P_PARAM;
|
||||||
if (idx >= 0 && idx < fPlugin->ParametersCount()) {
|
if (idx >= 0 && idx < fPlugin->ParametersCount()) {
|
||||||
VSTParameter *param = fPlugin->Parameter(idx);
|
VSTParameter *param = fPlugin->Parameter(idx);
|
||||||
if (v_type == B_FLOAT_TYPE) {
|
|
||||||
|
if (v_type == B_FLOAT_TYPE)
|
||||||
*(float*)value = param->Value();
|
*(float*)value = param->Value();
|
||||||
}
|
|
||||||
if (v_type == B_INT32_TYPE) {
|
if (v_type == B_INT32_TYPE)
|
||||||
*(int32*)value = (int32)ceil(param->Value());
|
*(int32*)value = (int32)ceil(param->Value());
|
||||||
}
|
|
||||||
*lastChangeTime = param->LastChangeTime();
|
*lastChangeTime = param->LastChangeTime();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -178,20 +177,18 @@ VSTNode::BufferReceived(BBuffer* buffer)
|
|||||||
status_t err = SendBuffer(buffer, fOutputMedia.source,
|
status_t err = SendBuffer(buffer, fOutputMedia.source,
|
||||||
fOutputMedia.destination);
|
fOutputMedia.destination);
|
||||||
|
|
||||||
if (err < B_OK) {
|
if (err < B_OK)
|
||||||
buffer->Recycle();
|
buffer->Recycle();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTNode::AcceptFormat(const media_destination &dst, media_format* format)
|
VSTNode::AcceptFormat(const media_destination &dst, media_format* format)
|
||||||
{
|
{
|
||||||
if (dst != fInputMedia.destination) {
|
if (dst != fInputMedia.destination)
|
||||||
return B_MEDIA_BAD_DESTINATION;
|
return B_MEDIA_BAD_DESTINATION;
|
||||||
}
|
|
||||||
if (format->type != B_MEDIA_RAW_AUDIO) {
|
if (format->type != B_MEDIA_RAW_AUDIO)
|
||||||
return B_MEDIA_BAD_FORMAT;
|
return B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
|
|
||||||
ValidateFormat(
|
ValidateFormat(
|
||||||
(fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
(fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
||||||
@@ -203,9 +200,9 @@ VSTNode::AcceptFormat(const media_destination &dst, media_format* format)
|
|||||||
status_t
|
status_t
|
||||||
VSTNode::GetNextInput(int32* cookie, media_input* input)
|
VSTNode::GetNextInput(int32* cookie, media_input* input)
|
||||||
{
|
{
|
||||||
if (*cookie) {
|
if (*cookie)
|
||||||
return B_BAD_INDEX;
|
return B_BAD_INDEX;
|
||||||
}
|
|
||||||
++*cookie;
|
++*cookie;
|
||||||
*input = fInputMedia;
|
*input = fInputMedia;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -227,18 +224,16 @@ void
|
|||||||
VSTNode::ProducerDataStatus(const media_destination &dst, int32 status,
|
VSTNode::ProducerDataStatus(const media_destination &dst, int32 status,
|
||||||
bigtime_t when)
|
bigtime_t when)
|
||||||
{
|
{
|
||||||
if (fOutputMedia.destination != media_destination::null) {
|
if (fOutputMedia.destination != media_destination::null)
|
||||||
SendDataStatus(status, fOutputMedia.destination, when);
|
SendDataStatus(status, fOutputMedia.destination, when);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTNode::GetLatencyFor( const media_destination &dst, bigtime_t* latency,
|
VSTNode::GetLatencyFor( const media_destination &dst, bigtime_t* latency,
|
||||||
media_node_id* outTimeSource)
|
media_node_id* outTimeSource)
|
||||||
{
|
{
|
||||||
if (dst != fInputMedia.destination) {
|
if (dst != fInputMedia.destination)
|
||||||
return B_MEDIA_BAD_DESTINATION;
|
return B_MEDIA_BAD_DESTINATION;
|
||||||
}
|
|
||||||
|
|
||||||
*latency = fDownstreamLatency + fProcessLatency;
|
*latency = fDownstreamLatency + fProcessLatency;
|
||||||
*outTimeSource = TimeSource()->ID();
|
*outTimeSource = TimeSource()->ID();
|
||||||
@@ -250,12 +245,11 @@ VSTNode::Connected(const media_source& source,
|
|||||||
const media_destination& destination, const media_format& format,
|
const media_destination& destination, const media_format& format,
|
||||||
media_input* input)
|
media_input* input)
|
||||||
{
|
{
|
||||||
if (destination != fInputMedia.destination) {
|
if (destination != fInputMedia.destination)
|
||||||
return B_MEDIA_BAD_DESTINATION;
|
return B_MEDIA_BAD_DESTINATION;
|
||||||
}
|
|
||||||
if (fInputMedia.source != media_source::null) {
|
if (fInputMedia.source != media_source::null)
|
||||||
return B_MEDIA_ALREADY_CONNECTED;
|
return B_MEDIA_ALREADY_CONNECTED;
|
||||||
}
|
|
||||||
|
|
||||||
fInputMedia.source = source;
|
fInputMedia.source = source;
|
||||||
fInputMedia.format = format;
|
fInputMedia.format = format;
|
||||||
@@ -268,13 +262,14 @@ VSTNode::Connected(const media_source& source,
|
|||||||
void
|
void
|
||||||
VSTNode::Disconnected(const media_source &src, const media_destination &dst)
|
VSTNode::Disconnected(const media_source &src, const media_destination &dst)
|
||||||
{
|
{
|
||||||
if(fInputMedia.source!=src || dst!=fInputMedia.destination) {
|
if(fInputMedia.source!=src || dst!=fInputMedia.destination)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
fInputMedia.source = media_source::null;
|
fInputMedia.source = media_source::null;
|
||||||
if(fOutputMedia.destination == media_destination::null) {
|
|
||||||
|
if(fOutputMedia.destination == media_destination::null)
|
||||||
fFormat.u.raw_audio = media_raw_audio_format::wildcard;
|
fFormat.u.raw_audio = media_raw_audio_format::wildcard;
|
||||||
}
|
|
||||||
fInputMedia.format = fFormat;
|
fInputMedia.format = fFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,28 +278,25 @@ status_t
|
|||||||
VSTNode::FormatSuggestionRequested(media_type type, int32 quality,
|
VSTNode::FormatSuggestionRequested(media_type type, int32 quality,
|
||||||
media_format* format)
|
media_format* format)
|
||||||
{
|
{
|
||||||
if (type != B_MEDIA_RAW_AUDIO) {
|
if (type != B_MEDIA_RAW_AUDIO)
|
||||||
return B_MEDIA_BAD_FORMAT;
|
return B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
|
|
||||||
if (fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) {
|
if (fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format)
|
||||||
*format = fFormat;
|
*format = fFormat;
|
||||||
} else {
|
else
|
||||||
*format = fPreferredFormat;
|
*format = fPreferredFormat;
|
||||||
}
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTNode::FormatProposal(const media_source &src, media_format* format)
|
VSTNode::FormatProposal(const media_source &src, media_format* format)
|
||||||
{
|
{
|
||||||
if (src != fOutputMedia.source) {
|
if (src != fOutputMedia.source)
|
||||||
return B_MEDIA_BAD_SOURCE;
|
return B_MEDIA_BAD_SOURCE;
|
||||||
}
|
|
||||||
|
|
||||||
if (format->type != B_MEDIA_RAW_AUDIO) {
|
if (format->type != B_MEDIA_RAW_AUDIO)
|
||||||
return B_MEDIA_BAD_FORMAT;
|
return B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
|
|
||||||
ValidateFormat(
|
ValidateFormat(
|
||||||
(fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
(fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
||||||
@@ -324,18 +316,18 @@ void
|
|||||||
VSTNode::LateNoticeReceived(const media_source &src,
|
VSTNode::LateNoticeReceived(const media_source &src,
|
||||||
bigtime_t late, bigtime_t when)
|
bigtime_t late, bigtime_t when)
|
||||||
{
|
{
|
||||||
if (src != fOutputMedia.source || fInputMedia.source == media_source::null) {
|
if (src != fOutputMedia.source || fInputMedia.source == media_source::null)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
NotifyLateProducer(fInputMedia.source, late, when);
|
NotifyLateProducer(fInputMedia.source, late, when);
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTNode::GetNextOutput(int32 *cookie, media_output* output)
|
VSTNode::GetNextOutput(int32 *cookie, media_output* output)
|
||||||
{
|
{
|
||||||
if (*cookie) {
|
if (*cookie)
|
||||||
return B_BAD_INDEX;
|
return B_BAD_INDEX;
|
||||||
}
|
|
||||||
++*cookie;
|
++*cookie;
|
||||||
*output = fOutputMedia;
|
*output = fOutputMedia;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -353,12 +345,12 @@ VSTNode::SetBufferGroup(const media_source &src, BBufferGroup* group)
|
|||||||
status_t ret;
|
status_t ret;
|
||||||
int32 changeTag;
|
int32 changeTag;
|
||||||
|
|
||||||
if (src != fOutputMedia.source) {
|
if (src != fOutputMedia.source)
|
||||||
return B_MEDIA_BAD_SOURCE;
|
return B_MEDIA_BAD_SOURCE;
|
||||||
}
|
|
||||||
if (fInputMedia.source == media_source::null) {
|
if (fInputMedia.source == media_source::null)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
|
||||||
ret = SetOutputBuffersFor(fInputMedia.source, fInputMedia.destination,
|
ret = SetOutputBuffersFor(fInputMedia.source, fInputMedia.destination,
|
||||||
group, 0, &changeTag);
|
group, 0, &changeTag);
|
||||||
|
|
||||||
@@ -371,25 +363,21 @@ VSTNode::PrepareToConnect( const media_source &src, const media_destination &dst
|
|||||||
{
|
{
|
||||||
status_t ret = B_OK;
|
status_t ret = B_OK;
|
||||||
|
|
||||||
if (src != fOutputMedia.source) {
|
if (src != fOutputMedia.source)
|
||||||
return B_MEDIA_BAD_SOURCE;
|
return B_MEDIA_BAD_SOURCE;
|
||||||
}
|
|
||||||
|
|
||||||
if (format->type != B_MEDIA_RAW_AUDIO) {
|
if (format->type != B_MEDIA_RAW_AUDIO)
|
||||||
return B_MEDIA_BAD_FORMAT;
|
return B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
|
|
||||||
if (fOutputMedia.destination != media_destination::null) {
|
if (fOutputMedia.destination != media_destination::null)
|
||||||
return B_MEDIA_ALREADY_CONNECTED;
|
return B_MEDIA_ALREADY_CONNECTED;
|
||||||
}
|
|
||||||
|
|
||||||
ret = ValidateFormat(
|
ret = ValidateFormat(
|
||||||
(fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
(fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
||||||
fFormat : fPreferredFormat, *format);
|
fFormat : fPreferredFormat, *format);
|
||||||
|
|
||||||
if (ret < B_OK) {
|
if (ret < B_OK)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
SetOutputFormat(*format);
|
SetOutputFormat(*format);
|
||||||
|
|
||||||
@@ -445,19 +433,16 @@ VSTNode::Connect(status_t status, const media_source &src,
|
|||||||
void
|
void
|
||||||
VSTNode::Disconnect(const media_source &src, const media_destination &dst)
|
VSTNode::Disconnect(const media_source &src, const media_destination &dst)
|
||||||
{
|
{
|
||||||
if (src != fOutputMedia.source) {
|
if (src != fOutputMedia.source)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (dst != fOutputMedia.destination) {
|
if (dst != fOutputMedia.destination)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
fOutputMedia.destination = media_destination::null;
|
fOutputMedia.destination = media_destination::null;
|
||||||
|
|
||||||
if (fInputMedia.source == media_source::null) {
|
if (fInputMedia.source == media_source::null)
|
||||||
fFormat.u.raw_audio = media_raw_audio_format::wildcard;
|
fFormat.u.raw_audio = media_raw_audio_format::wildcard;
|
||||||
}
|
|
||||||
|
|
||||||
fOutputMedia.format = fFormat;
|
fOutputMedia.format = fFormat;
|
||||||
}
|
}
|
||||||
@@ -465,9 +450,9 @@ VSTNode::Disconnect(const media_source &src, const media_destination &dst)
|
|||||||
void
|
void
|
||||||
VSTNode::EnableOutput(const media_source &src, bool enabled, int32* _deprecated_)
|
VSTNode::EnableOutput(const media_source &src, bool enabled, int32* _deprecated_)
|
||||||
{
|
{
|
||||||
if (src != fOutputMedia.source) {
|
if (src != fOutputMedia.source)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
fOutputMediaEnabled = enabled;
|
fOutputMediaEnabled = enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,9 +467,8 @@ void
|
|||||||
VSTNode::LatencyChanged(const media_source &src, const media_destination &dst,
|
VSTNode::LatencyChanged(const media_source &src, const media_destination &dst,
|
||||||
bigtime_t latency, uint32 flags)
|
bigtime_t latency, uint32 flags)
|
||||||
{
|
{
|
||||||
if (src != fOutputMedia.source || dst != fOutputMedia.destination) {
|
if (src != fOutputMedia.source || dst != fOutputMedia.destination)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
fDownstreamLatency = latency;
|
fDownstreamLatency = latency;
|
||||||
SetEventLatency(fDownstreamLatency + fProcessLatency);
|
SetEventLatency(fDownstreamLatency + fProcessLatency);
|
||||||
@@ -507,9 +491,8 @@ void
|
|||||||
VSTNode::HandleEvent(const media_timed_event *event, bigtime_t late,
|
VSTNode::HandleEvent(const media_timed_event *event, bigtime_t late,
|
||||||
bool realTime)
|
bool realTime)
|
||||||
{
|
{
|
||||||
if(event->type == BTimedEventQueue::B_PARAMETER) {
|
if(event->type == BTimedEventQueue::B_PARAMETER)
|
||||||
ParameterEventProcessing(event);
|
ParameterEventProcessing(event);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -535,7 +518,7 @@ VSTNode::ParameterEventProcessing(const media_timed_event* event)
|
|||||||
|
|
||||||
if (v_type == B_FLOAT_TYPE)
|
if (v_type == B_FLOAT_TYPE)
|
||||||
value = *((float*)event->pointer);
|
value = *((float*)event->pointer);
|
||||||
if (v_type == B_INT32_TYPE) {
|
if (v_type == B_INT32_TYPE) {
|
||||||
value32 = *((int32*)event->pointer);
|
value32 = *((int32*)event->pointer);
|
||||||
value = (float)value32;
|
value = (float)value32;
|
||||||
}
|
}
|
||||||
@@ -574,40 +557,35 @@ VSTNode::ValidateFormat(const media_format &preferredFormat,
|
|||||||
const media_raw_audio_format &pref = preferredFormat.u.raw_audio;
|
const media_raw_audio_format &pref = preferredFormat.u.raw_audio;
|
||||||
|
|
||||||
if(pref.frame_rate != wild.frame_rate && f.frame_rate != pref.frame_rate) {
|
if(pref.frame_rate != wild.frame_rate && f.frame_rate != pref.frame_rate) {
|
||||||
if(f.frame_rate != wild.frame_rate) {
|
if(f.frame_rate != wild.frame_rate)
|
||||||
ret = B_MEDIA_BAD_FORMAT;
|
ret = B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
f.frame_rate = pref.frame_rate;
|
f.frame_rate = pref.frame_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pref.channel_count != wild.channel_count &&
|
if(pref.channel_count != wild.channel_count &&
|
||||||
f.channel_count != pref.channel_count) {
|
f.channel_count != pref.channel_count) {
|
||||||
if(f.channel_count != wild.channel_count) {
|
if(f.channel_count != wild.channel_count)
|
||||||
ret = B_MEDIA_BAD_FORMAT;
|
ret = B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
f.channel_count = pref.channel_count;
|
f.channel_count = pref.channel_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pref.format != wild.format && f.format != pref.format) {
|
if(pref.format != wild.format && f.format != pref.format) {
|
||||||
if(f.format != wild.format) {
|
if(f.format != wild.format)
|
||||||
ret = B_MEDIA_BAD_FORMAT;
|
ret = B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
f.format = pref.format;
|
f.format = pref.format;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pref.byte_order != wild.byte_order &&
|
if(pref.byte_order != wild.byte_order &&
|
||||||
f.byte_order != pref.byte_order) {
|
f.byte_order != pref.byte_order) {
|
||||||
if(f.byte_order != wild.byte_order) {
|
if(f.byte_order != wild.byte_order)
|
||||||
ret = B_MEDIA_BAD_FORMAT;
|
ret = B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
f.byte_order = pref.byte_order;
|
f.byte_order = pref.byte_order;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pref.buffer_size != wild.buffer_size &&
|
if(pref.buffer_size != wild.buffer_size &&
|
||||||
f.buffer_size != pref.buffer_size) {
|
f.buffer_size != pref.buffer_size) {
|
||||||
if(f.buffer_size != wild.buffer_size) {
|
if(f.buffer_size != wild.buffer_size)
|
||||||
ret = B_MEDIA_BAD_FORMAT;
|
ret = B_MEDIA_BAD_FORMAT;
|
||||||
}
|
|
||||||
f.buffer_size = pref.buffer_size;
|
f.buffer_size = pref.buffer_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -621,26 +599,26 @@ VSTNode::SetOutputFormat(media_format &format)
|
|||||||
media_raw_audio_format &f = format.u.raw_audio;
|
media_raw_audio_format &f = format.u.raw_audio;
|
||||||
media_raw_audio_format &w = media_raw_audio_format::wildcard;
|
media_raw_audio_format &w = media_raw_audio_format::wildcard;
|
||||||
|
|
||||||
if (f.frame_rate == w.frame_rate) {
|
if (f.frame_rate == w.frame_rate)
|
||||||
f.frame_rate = 44100.0;
|
f.frame_rate = 44100.0;
|
||||||
}
|
|
||||||
if (f.channel_count == w.channel_count) {
|
if (f.channel_count == w.channel_count) {
|
||||||
if(fInputMedia.source != media_source::null) {
|
if(fInputMedia.source != media_source::null)
|
||||||
f.channel_count = fInputMedia.format.u.raw_audio.channel_count;
|
f.channel_count = fInputMedia.format.u.raw_audio.channel_count;
|
||||||
} else {
|
else
|
||||||
f.channel_count = fPlugin->Channels(VST_OUTPUT_CHANNELS);
|
f.channel_count = fPlugin->Channels(VST_OUTPUT_CHANNELS);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (f.format == w.format) {
|
|
||||||
|
if (f.format == w.format)
|
||||||
f.format = media_raw_audio_format::B_AUDIO_FLOAT;
|
f.format = media_raw_audio_format::B_AUDIO_FLOAT;
|
||||||
}
|
|
||||||
if (f.byte_order == w.format) {
|
if (f.byte_order == w.format) {
|
||||||
f.byte_order = (B_HOST_IS_BENDIAN) ?
|
f.byte_order = (B_HOST_IS_BENDIAN) ?
|
||||||
B_MEDIA_BIG_ENDIAN : B_MEDIA_LITTLE_ENDIAN;
|
B_MEDIA_BIG_ENDIAN : B_MEDIA_LITTLE_ENDIAN;
|
||||||
}
|
}
|
||||||
if (f.buffer_size == w.buffer_size) {
|
|
||||||
|
if (f.buffer_size == w.buffer_size)
|
||||||
f.buffer_size = BUFF_SIZE;
|
f.buffer_size = BUFF_SIZE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -744,29 +722,29 @@ VSTNode::InitParameterWeb()
|
|||||||
B_MEDIA_NO_TYPE, str.String(), B_GENERIC);
|
B_MEDIA_NO_TYPE, str.String(), B_GENERIC);
|
||||||
|
|
||||||
str.SetTo("Effect name: ");
|
str.SetTo("Effect name: ");
|
||||||
if (strlen(fPlugin->EffectName()) != 0) {
|
if (strlen(fPlugin->EffectName()) != 0)
|
||||||
str.Append(fPlugin->EffectName());
|
str.Append(fPlugin->EffectName());
|
||||||
} else {
|
else
|
||||||
str.Append("not specified");
|
str.Append("not specified");
|
||||||
}
|
|
||||||
label = fAboutGroup->MakeNullParameter(P_ABOUT + 1,
|
label = fAboutGroup->MakeNullParameter(P_ABOUT + 1,
|
||||||
B_MEDIA_NO_TYPE, str.String(), B_GENERIC);
|
B_MEDIA_NO_TYPE, str.String(), B_GENERIC);
|
||||||
|
|
||||||
str.SetTo("Vendor: ");
|
str.SetTo("Vendor: ");
|
||||||
if (strlen(fPlugin->Vendor()) != 0) {
|
if (strlen(fPlugin->Vendor()) != 0)
|
||||||
str.Append(fPlugin->Vendor());
|
str.Append(fPlugin->Vendor());
|
||||||
} else {
|
else
|
||||||
str.Append("not specified");
|
str.Append("not specified");
|
||||||
}
|
|
||||||
label = fAboutGroup->MakeNullParameter(P_ABOUT + 2,
|
label = fAboutGroup->MakeNullParameter(P_ABOUT + 2,
|
||||||
B_MEDIA_NO_TYPE, str.String(), B_GENERIC);
|
B_MEDIA_NO_TYPE, str.String(), B_GENERIC);
|
||||||
|
|
||||||
str.SetTo("Product: ");
|
str.SetTo("Product: ");
|
||||||
if (strlen(fPlugin->Product()) != 0) {
|
if (strlen(fPlugin->Product()) != 0)
|
||||||
str.Append(fPlugin->Product());
|
str.Append(fPlugin->Product());
|
||||||
} else {
|
else
|
||||||
str.Append("not specified");
|
str.Append("not specified");
|
||||||
}
|
|
||||||
label = fAboutGroup->MakeNullParameter(P_ABOUT + 3,
|
label = fAboutGroup->MakeNullParameter(P_ABOUT + 3,
|
||||||
B_MEDIA_NO_TYPE, str.String(), B_GENERIC);
|
B_MEDIA_NO_TYPE, str.String(), B_GENERIC);
|
||||||
|
|
||||||
@@ -796,9 +774,8 @@ VSTNode::InitFilter()
|
|||||||
bigtime_t
|
bigtime_t
|
||||||
VSTNode::GetFilterLatency()
|
VSTNode::GetFilterLatency()
|
||||||
{
|
{
|
||||||
if (fOutputMedia.destination == media_destination::null) {
|
if (fOutputMedia.destination == media_destination::null)
|
||||||
return 0LL;
|
return 0LL;
|
||||||
}
|
|
||||||
|
|
||||||
BBufferGroup* temp_group =
|
BBufferGroup* temp_group =
|
||||||
new BBufferGroup(fOutputMedia.format.u.raw_audio.buffer_size, 1);
|
new BBufferGroup(fOutputMedia.format.u.raw_audio.buffer_size, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user