Style cleanup. 80 character line limit.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected]. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected].
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ 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;
|
||||||
@@ -64,7 +65,7 @@ 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];
|
||||||
@@ -79,16 +80,16 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected]. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected].
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected]. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected].
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -33,12 +34,12 @@ EqualizerAddOn::CountFlavors()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t EqualizerAddOn::GetFlavorAt(int32 idx, const flavor_info **info)
|
status_t EqualizerAddOn::GetFlavorAt(int32 idx, const flavor_info** info)
|
||||||
{
|
{
|
||||||
if(idx < 0 || idx >= CountFlavors())
|
if (idx < 0 || idx >= CountFlavors())
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
flavor_info *f_info = new flavor_info;
|
flavor_info* f_info = new flavor_info;
|
||||||
f_info->internal_id = idx;
|
f_info->internal_id = idx;
|
||||||
f_info->kinds = B_BUFFER_CONSUMER | B_BUFFER_PRODUCER | B_CONTROLLABLE;
|
f_info->kinds = B_BUFFER_CONSUMER | B_BUFFER_PRODUCER | B_CONTROLLABLE;
|
||||||
f_info->possible_count = 0;
|
f_info->possible_count = 0;
|
||||||
@@ -46,7 +47,7 @@ status_t EqualizerAddOn::GetFlavorAt(int32 idx, const flavor_info **info)
|
|||||||
f_info->info = (char *)"10 Band Equalizer.\nby 3dEyes**";
|
f_info->info = (char *)"10 Band Equalizer.\nby 3dEyes**";
|
||||||
f_info->name = (char *)"Equalizer (10 Band)";
|
f_info->name = (char *)"Equalizer (10 Band)";
|
||||||
|
|
||||||
media_format *format = new media_format;
|
media_format* format = new media_format;
|
||||||
format->type = B_MEDIA_RAW_AUDIO;
|
format->type = B_MEDIA_RAW_AUDIO;
|
||||||
format->u.raw_audio = media_raw_audio_format::wildcard;
|
format->u.raw_audio = media_raw_audio_format::wildcard;
|
||||||
format->u.raw_audio.format = media_raw_audio_format::B_AUDIO_FLOAT;
|
format->u.raw_audio.format = media_raw_audio_format::B_AUDIO_FLOAT;
|
||||||
@@ -68,15 +69,15 @@ status_t EqualizerAddOn::GetFlavorAt(int32 idx, const flavor_info **info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BMediaNode*
|
BMediaNode*
|
||||||
EqualizerAddOn::InstantiateNodeFor(const flavor_info *info, BMessage *config,
|
EqualizerAddOn::InstantiateNodeFor(const flavor_info* info, BMessage* config,
|
||||||
status_t *err)
|
status_t* err)
|
||||||
{
|
{
|
||||||
EqualizerNode *node = new EqualizerNode(this);
|
EqualizerNode* node = new EqualizerNode(this);
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EqualizerAddOn::GetConfigurationFor(BMediaNode *node, BMessage *message)
|
EqualizerAddOn::GetConfigurationFor(BMediaNode* node, BMessage* message)
|
||||||
{
|
{
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -88,8 +89,7 @@ EqualizerAddOn::WantsAutoStart()
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
EqualizerAddOn::AutoStart(int count, BMediaNode **node, int32 *id, bool *more)
|
EqualizerAddOn::AutoStart(int count, BMediaNode** node, int32* id, bool* more)
|
||||||
{
|
{
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected]. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected].
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -13,14 +14,14 @@ class EqualizerAddOn : public BMediaAddOn
|
|||||||
public:
|
public:
|
||||||
virtual ~EqualizerAddOn();
|
virtual ~EqualizerAddOn();
|
||||||
explicit EqualizerAddOn(image_id image);
|
explicit EqualizerAddOn(image_id image);
|
||||||
virtual status_t InitCheck(const char **text);
|
virtual status_t InitCheck(const char** text);
|
||||||
virtual int32 CountFlavors();
|
virtual int32 CountFlavors();
|
||||||
virtual status_t GetFlavorAt(int32 idx, const flavor_info **info);
|
virtual status_t GetFlavorAt(int32 idx, const flavor_info** info);
|
||||||
virtual BMediaNode* InstantiateNodeFor(const flavor_info *info, BMessage *config,
|
virtual BMediaNode* InstantiateNodeFor(const flavor_info* info, BMessage* config,
|
||||||
status_t *err);
|
status_t *err);
|
||||||
virtual status_t GetConfigurationFor(BMediaNode *node, BMessage *message);
|
virtual status_t GetConfigurationFor(BMediaNode* node, BMessage* message);
|
||||||
virtual bool WantsAutoStart();
|
virtual bool WantsAutoStart();
|
||||||
virtual status_t AutoStart(int count, BMediaNode **node, int32 *id, bool *more);
|
virtual status_t AutoStart(int count, BMediaNode** node, int32* id, bool* more);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__EQUALIZER_ADDON_H__
|
#endif //__EQUALIZER_ADDON_H__
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected]. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected].
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -35,85 +36,85 @@ class EqualizerNode : public BBufferConsumer,
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~EqualizerNode();
|
virtual ~EqualizerNode();
|
||||||
EqualizerNode(BMediaAddOn *pAddOn=NULL);
|
EqualizerNode(BMediaAddOn* pAddOn = NULL);
|
||||||
//BMediaNode
|
//BMediaNode
|
||||||
public:
|
public:
|
||||||
virtual BMediaAddOn *AddOn(int32 *id) const;
|
virtual BMediaAddOn *AddOn(int32* id) const;
|
||||||
virtual status_t HandleMessage(int32 code, const void *data, size_t size);
|
virtual status_t HandleMessage(int32 code, const void* data, size_t size);
|
||||||
protected:
|
protected:
|
||||||
virtual void NodeRegistered();
|
virtual void NodeRegistered();
|
||||||
//BControllable
|
//BControllable
|
||||||
public:
|
public:
|
||||||
virtual status_t GetParameterValue(int32 id, bigtime_t *lastChangeTime,
|
virtual status_t GetParameterValue(int32 id, bigtime_t* lastChangeTime,
|
||||||
void *value, size_t *size);
|
void* value, size_t* size);
|
||||||
virtual void SetParameterValue(int32 id, bigtime_t changeTime,
|
virtual void SetParameterValue(int32 id, bigtime_t changeTime,
|
||||||
const void *value, size_t size);
|
const void* value, size_t size);
|
||||||
//BBufferConsumer
|
//BBufferConsumer
|
||||||
public:
|
public:
|
||||||
virtual void BufferReceived(BBuffer *buffer);
|
virtual void BufferReceived(BBuffer* buffer);
|
||||||
virtual status_t AcceptFormat(const media_destination &dst,
|
virtual status_t AcceptFormat(const media_destination &dst,
|
||||||
media_format *format);
|
media_format* format);
|
||||||
virtual status_t GetNextInput(int32 *cookie, media_input *input);
|
virtual status_t GetNextInput(int32* cookie, media_input* input);
|
||||||
virtual void DisposeInputCookie(int32 cookie);
|
virtual void DisposeInputCookie(int32 cookie);
|
||||||
virtual status_t FormatChanged(const media_source &src,
|
virtual status_t FormatChanged(const media_source &src,
|
||||||
const media_destination &dst,
|
const media_destination &dst,
|
||||||
int32 change_tag, const media_format &format);
|
int32 change_tag, const media_format &format);
|
||||||
virtual void ProducerDataStatus(const media_destination &dst,
|
virtual void ProducerDataStatus(const media_destination &dst,
|
||||||
int32 status,
|
int32 status,
|
||||||
bigtime_t when);
|
bigtime_t when);
|
||||||
virtual status_t GetLatencyFor(const media_destination &dst,
|
virtual status_t GetLatencyFor(const media_destination &dst,
|
||||||
bigtime_t *latency,
|
bigtime_t* latency,
|
||||||
media_node_id *time_src);
|
media_node_id* time_src);
|
||||||
virtual status_t Connected(const media_source &src,
|
virtual status_t Connected(const media_source &src,
|
||||||
const media_destination &dst,
|
const media_destination &dst,
|
||||||
const media_format &format,
|
const media_format &format,
|
||||||
media_input *input);
|
media_input* input);
|
||||||
virtual void Disconnected(const media_source &src,
|
virtual void Disconnected(const media_source &src,
|
||||||
const media_destination &dst);
|
const media_destination &dst);
|
||||||
//BBufferProducer
|
//BBufferProducer
|
||||||
public:
|
public:
|
||||||
virtual status_t FormatSuggestionRequested(media_type type,
|
virtual status_t FormatSuggestionRequested(media_type type,
|
||||||
int32 quality, media_format *format);
|
int32 quality, media_format* format);
|
||||||
virtual status_t FormatProposal(const media_source &src,
|
virtual status_t FormatProposal(const media_source &src,
|
||||||
media_format *format);
|
media_format* format);
|
||||||
virtual status_t FormatChangeRequested(const media_source &src,
|
virtual status_t FormatChangeRequested(const media_source &src,
|
||||||
const media_destination &dst,
|
const media_destination &dst,
|
||||||
media_format *format,
|
media_format* format,
|
||||||
int32* _deprecated_);
|
int32* _deprecated_);
|
||||||
virtual void LateNoticeReceived(const media_source &src,
|
virtual void LateNoticeReceived(const media_source &src,
|
||||||
bigtime_t late, bigtime_t when);
|
bigtime_t late, bigtime_t when);
|
||||||
virtual status_t GetNextOutput(int32 *cookie, media_output *output);
|
virtual status_t GetNextOutput(int32 *cookie, media_output* output);
|
||||||
virtual status_t DisposeOutputCookie(int32 cookie);
|
virtual status_t DisposeOutputCookie(int32 cookie);
|
||||||
virtual status_t SetBufferGroup(const media_source &src,
|
virtual status_t SetBufferGroup(const media_source &src,
|
||||||
BBufferGroup *group);
|
BBufferGroup* group);
|
||||||
virtual status_t PrepareToConnect(const media_source &src,
|
virtual status_t PrepareToConnect(const media_source &src,
|
||||||
const media_destination &dst,
|
const media_destination &dst,
|
||||||
media_format *format, media_source *source,
|
media_format* format, media_source* source,
|
||||||
char *name);
|
char* name);
|
||||||
virtual void Connect(status_t status,
|
virtual void Connect(status_t status,
|
||||||
const media_source &src,
|
const media_source &src,
|
||||||
const media_destination &dst,
|
const media_destination &dst,
|
||||||
const media_format &format,
|
const media_format &format,
|
||||||
char* name);
|
char* name);
|
||||||
virtual void Disconnect(const media_source &src,
|
virtual void Disconnect(const media_source &src,
|
||||||
const media_destination &dst);
|
const media_destination &dst);
|
||||||
virtual void EnableOutput(const media_source &src,
|
virtual void EnableOutput(const media_source &src,
|
||||||
bool enabled, int32* _deprecated_);
|
bool enabled, int32* _deprecated_);
|
||||||
virtual status_t GetLatency(bigtime_t *outLatency);
|
virtual status_t GetLatency(bigtime_t* outLatency);
|
||||||
virtual void LatencyChanged( const media_source &src,
|
virtual void LatencyChanged( const media_source &src,
|
||||||
const media_destination &dst,
|
const media_destination &dst,
|
||||||
bigtime_t latency, uint32 flags);
|
bigtime_t latency, uint32 flags);
|
||||||
//BMediaEventLooper
|
//BMediaEventLooper
|
||||||
protected:
|
protected:
|
||||||
virtual bigtime_t OfflineTime();
|
virtual bigtime_t OfflineTime();
|
||||||
//EqualizerNode
|
//EqualizerNode
|
||||||
protected:
|
protected:
|
||||||
virtual void HandleEvent(const media_timed_event *event,
|
virtual void HandleEvent(const media_timed_event* event,
|
||||||
bigtime_t late,
|
bigtime_t late,
|
||||||
bool realTimeEvent=false);
|
bool realTimeEvent = false);
|
||||||
void ParameterEventProcessing(const media_timed_event *event);
|
void ParameterEventProcessing(const media_timed_event* event);
|
||||||
status_t ValidateFormat(const media_format &preferredFormat,
|
status_t ValidateFormat(const media_format &preferredFormat,
|
||||||
media_format &format);
|
media_format &format);
|
||||||
void SetOutputFormat(media_format &format);
|
void SetOutputFormat(media_format &format);
|
||||||
virtual void InitParameterValues(void);
|
virtual void InitParameterValues(void);
|
||||||
virtual void InitParameterWeb(void);
|
virtual void InitParameterWeb(void);
|
||||||
@@ -122,8 +123,8 @@ protected:
|
|||||||
virtual void FilterBuffer(BBuffer* pBuffer);
|
virtual void FilterBuffer(BBuffer* pBuffer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BMediaAddOn *fAddOn;
|
BMediaAddOn* fAddOn;
|
||||||
BParameterWeb *fWeb;
|
BParameterWeb* fWeb;
|
||||||
|
|
||||||
Equalizer fEqualizer;
|
Equalizer fEqualizer;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected]. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected].
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
@@ -41,7 +42,7 @@ VSTAddOn::~VSTAddOn()
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTAddOn::InitCheck(const char **text)
|
VSTAddOn::InitCheck(const char** text)
|
||||||
{
|
{
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -52,9 +53,10 @@ VSTAddOn::CountFlavors()
|
|||||||
return fPluginsList.CountItems();
|
return fPluginsList.CountItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t VSTAddOn::GetFlavorAt( int32 idx, const flavor_info **info)
|
status_t
|
||||||
|
VSTAddOn::GetFlavorAt(int32 idx, const flavor_info** info)
|
||||||
{
|
{
|
||||||
if(idx < 0 || idx >= fPluginsList.CountItems())
|
if (idx < 0 || idx >= fPluginsList.CountItems())
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
VSTPlugin *plugin = (VSTPlugin*)fPluginsList.ItemAt(idx);
|
VSTPlugin *plugin = (VSTPlugin*)fPluginsList.ItemAt(idx);
|
||||||
@@ -89,33 +91,33 @@ status_t VSTAddOn::GetFlavorAt( int32 idx, const flavor_info **info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BMediaNode*
|
BMediaNode*
|
||||||
VSTAddOn::InstantiateNodeFor(const flavor_info *info, BMessage *config,
|
VSTAddOn::InstantiateNodeFor(const flavor_info* info, BMessage* config,
|
||||||
status_t *err)
|
status_t* err)
|
||||||
{
|
{
|
||||||
VSTPlugin *plugin = (VSTPlugin*)fPluginsList.ItemAt(info->internal_id);
|
VSTPlugin* plugin = (VSTPlugin*)fPluginsList.ItemAt(info->internal_id);
|
||||||
VSTNode *node = new VSTNode(this, plugin->ModuleName(), plugin->Path());
|
VSTNode* node = new VSTNode(this, plugin->ModuleName(), plugin->Path());
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
VSTAddOn::ScanPluginsFolders(const char *path, bool make_dir)
|
VSTAddOn::ScanPluginsFolders(const char* path, bool make_dir)
|
||||||
{
|
{
|
||||||
BEntry ent;
|
BEntry ent;
|
||||||
|
|
||||||
BDirectory dir(path);
|
BDirectory dir(path);
|
||||||
if(dir.InitCheck() != B_OK) {
|
if (dir.InitCheck() != B_OK) {
|
||||||
create_directory(path, 0755);
|
create_directory(path, 0755);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(dir.GetNextEntry(&ent) == B_OK) {
|
while(dir.GetNextEntry(&ent) == B_OK) {
|
||||||
BPath p(&ent);
|
BPath p(&ent);
|
||||||
if(ent.IsDirectory()) {
|
if (ent.IsDirectory()) {
|
||||||
ScanPluginsFolders(p.Path());
|
ScanPluginsFolders(p.Path());
|
||||||
} else {
|
} else {
|
||||||
VSTPlugin *plugin = new VSTPlugin();
|
VSTPlugin* plugin = new VSTPlugin();
|
||||||
int ret = plugin->LoadModule(p.Path());
|
int ret = plugin->LoadModule(p.Path());
|
||||||
if(ret == B_OK) {
|
if (ret == B_OK) {
|
||||||
plugin->UnLoadModule();
|
plugin->UnLoadModule();
|
||||||
fPluginsList.AddItem(plugin);
|
fPluginsList.AddItem(plugin);
|
||||||
} else {
|
} else {
|
||||||
@@ -127,7 +129,7 @@ VSTAddOn::ScanPluginsFolders(const char *path, bool make_dir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTAddOn::GetConfigurationFor(BMediaNode *node, BMessage *message)
|
VSTAddOn::GetConfigurationFor(BMediaNode* node, BMessage* message)
|
||||||
{
|
{
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -139,7 +141,7 @@ VSTAddOn::WantsAutoStart()
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTAddOn::AutoStart(int count, BMediaNode **node, int32 *id, bool *more)
|
VSTAddOn::AutoStart(int count, BMediaNode** node, int32* id, bool* more)
|
||||||
{
|
{
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected]. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected].
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __VST_ADDON_H__
|
#ifndef __VST_ADDON_H__
|
||||||
#define __VST_ADDON_H__
|
#define __VST_ADDON_H__
|
||||||
@@ -14,16 +15,16 @@ class VSTAddOn : public BMediaAddOn
|
|||||||
public:
|
public:
|
||||||
virtual ~VSTAddOn();
|
virtual ~VSTAddOn();
|
||||||
explicit VSTAddOn(image_id image);
|
explicit VSTAddOn(image_id image);
|
||||||
virtual status_t InitCheck(const char **text);
|
virtual status_t InitCheck(const char** text);
|
||||||
virtual int32 CountFlavors();
|
virtual int32 CountFlavors();
|
||||||
virtual status_t GetFlavorAt(int32 idx, const flavor_info **info);
|
virtual status_t GetFlavorAt(int32 idx, const flavor_info** info);
|
||||||
virtual BMediaNode* InstantiateNodeFor(const flavor_info *info, BMessage *config,
|
virtual BMediaNode* InstantiateNodeFor(const flavor_info* info, BMessage* config,
|
||||||
status_t *err);
|
status_t* err);
|
||||||
virtual status_t GetConfigurationFor(BMediaNode *node, BMessage *message);
|
virtual status_t GetConfigurationFor(BMediaNode* node, BMessage* message);
|
||||||
virtual bool WantsAutoStart();
|
virtual bool WantsAutoStart();
|
||||||
virtual status_t AutoStart(int count, BMediaNode **node, int32 *id, bool *more);
|
virtual status_t AutoStart(int count, BMediaNode** node, int32* id, bool* more);
|
||||||
private:
|
private:
|
||||||
int ScanPluginsFolders(const char *path, bool make_dir=false);
|
int ScanPluginsFolders(const char* path, bool make_dir = false);
|
||||||
BList fPluginsList;
|
BList fPluginsList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected]. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected].
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -12,12 +13,12 @@
|
|||||||
#include "VSTHost.h"
|
#include "VSTHost.h"
|
||||||
|
|
||||||
static int32 VHostCallback(VSTEffect* effect, int32 opcode, int32 index,
|
static int32 VHostCallback(VSTEffect* effect, int32 opcode, int32 index,
|
||||||
int32 value, void* ptr, float opt);
|
int32 value, void* ptr, float opt);
|
||||||
|
|
||||||
//Trim string
|
//Trim string
|
||||||
static void
|
static void
|
||||||
TrimString(BString *string) {
|
TrimString(BString *string) {
|
||||||
char *str = string->LockBuffer(256);
|
char* str = string->LockBuffer(256);
|
||||||
uint32 k = 0;
|
uint32 k = 0;
|
||||||
uint32 i = 0;
|
uint32 i = 0;
|
||||||
for(i=0; str[i]!='\0';) {
|
for(i=0; str[i]!='\0';) {
|
||||||
@@ -36,7 +37,7 @@ TrimString(BString *string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//VST Parameter class
|
//VST Parameter class
|
||||||
VSTParameter::VSTParameter(VSTPlugin *plugin, int index)
|
VSTParameter::VSTParameter(VSTPlugin* plugin, int index)
|
||||||
{
|
{
|
||||||
fIndex = index;
|
fIndex = index;
|
||||||
fEffect = plugin->Effect();
|
fEffect = plugin->Effect();
|
||||||
@@ -74,21 +75,22 @@ VSTParameter::VSTParameter(VSTPlugin *plugin, int index)
|
|||||||
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++) {
|
||||||
if(fabs(test_values[i] - new_value) < delta) {
|
if (fabs(test_values[i] - new_value) < delta) {
|
||||||
valtest = true;
|
valtest = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(valtest == false) {
|
if (valtest == false) {
|
||||||
test_values[test_cnt] = new_value;
|
test_values[test_cnt] = new_value;
|
||||||
fEffect->dispatcher(fEffect, VST_GET_PARAM_STR, index, 0, test_disp[test_cnt], 0);
|
fEffect->dispatcher(fEffect, VST_GET_PARAM_STR, index,
|
||||||
|
0, test_disp[test_cnt], 0);
|
||||||
test_cnt++;
|
test_cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,25 +99,25 @@ VSTParameter::VSTParameter(VSTPlugin *plugin, int index)
|
|||||||
fEffect->setParameter(fEffect, index, val);
|
fEffect->setParameter(fEffect, index, val);
|
||||||
|
|
||||||
//detect param type
|
//detect param type
|
||||||
if(test_cnt == 2) {
|
if (test_cnt == 2) {
|
||||||
fType = VST_PARAM_CHECKBOX;
|
fType = VST_PARAM_CHECKBOX;
|
||||||
|
|
||||||
DropListValue *min_item = new DropListValue();
|
DropListValue* min_item = new DropListValue();
|
||||||
min_item->Value = 0.0;
|
min_item->Value = 0.0;
|
||||||
min_item->Index = 0;
|
min_item->Index = 0;
|
||||||
min_item->Name = fMinValue;
|
min_item->Name = fMinValue;
|
||||||
fDropList.AddItem(min_item);
|
fDropList.AddItem(min_item);
|
||||||
|
|
||||||
DropListValue *max_item = new DropListValue();
|
DropListValue* max_item = new DropListValue();
|
||||||
max_item->Value = 1.0;
|
max_item->Value = 1.0;
|
||||||
max_item->Index = 1;
|
max_item->Index = 1;
|
||||||
max_item->Name = fMaxValue;
|
max_item->Name = fMaxValue;
|
||||||
fDropList.AddItem(max_item);
|
fDropList.AddItem(max_item);
|
||||||
} else if(test_cnt > 2 && test_cnt < VST_PARAM_TEST_COUNT / 2) {
|
} else if (test_cnt > 2 && test_cnt < VST_PARAM_TEST_COUNT / 2) {
|
||||||
fType = VST_PARAM_DROPLIST;
|
fType = VST_PARAM_DROPLIST;
|
||||||
|
|
||||||
for(int i = 0; i < test_cnt; i++) {
|
for(int i = 0; i < test_cnt; i++) {
|
||||||
DropListValue *item = new DropListValue();
|
DropListValue* item = new DropListValue();
|
||||||
item->Value = test_values[i];
|
item->Value = test_values[i];
|
||||||
item->Index = i;
|
item->Index = i;
|
||||||
item->Name = test_disp[i];
|
item->Name = test_disp[i];
|
||||||
@@ -132,29 +134,29 @@ 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;
|
||||||
|
|
||||||
const char *ptr = string->String();
|
const char *ptr = string->String();
|
||||||
for(;*ptr!=0;ptr++) {
|
for(; *ptr!=0; ptr++) {
|
||||||
char ch = *ptr;
|
char ch = *ptr;
|
||||||
if(!((ch >= '0' && ch <= '9') || ch == '.' || ch == '-')) {
|
if (!((ch >= '0' && ch <= '9') || ch == '.' || ch == '-')) {
|
||||||
isNum = false;
|
isNum = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isNum) {
|
if (isNum) {
|
||||||
float val = atof(string->String());
|
float val = atof(string->String());
|
||||||
|
|
||||||
if(val <= -pow(2, 31)) {
|
if (val <= -pow(2, 31)) {
|
||||||
string->SetTo("-∞");
|
string->SetTo("-∞");
|
||||||
} else if(val >= pow(2, 31)) {
|
} else if (val >= pow(2, 31)) {
|
||||||
string->SetTo("∞");
|
string->SetTo("∞");
|
||||||
} else {
|
} else {
|
||||||
char temp[256];
|
char temp[256];
|
||||||
@@ -163,9 +165,9 @@ VSTParameter::ValidateValues(BString *string)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TrimString(string);
|
TrimString(string);
|
||||||
if(*string == "oo" || *string == "inf")
|
if (*string == "oo" || *string == "inf")
|
||||||
string->SetTo("∞");
|
string->SetTo("∞");
|
||||||
if(*string == "-oo" || *string == "-inf")
|
if (*string == "-oo" || *string == "-inf")
|
||||||
string->SetTo("-∞");
|
string->SetTo("-∞");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -181,8 +183,8 @@ VSTParameter::ListCount(void)
|
|||||||
DropListValue*
|
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;
|
||||||
@@ -193,14 +195,14 @@ float
|
|||||||
VSTParameter::Value()
|
VSTParameter::Value()
|
||||||
{
|
{
|
||||||
float value = fEffect->getParameter(fEffect, fIndex);
|
float value = fEffect->getParameter(fEffect, fIndex);
|
||||||
if(fType == VST_PARAM_DROPLIST) {
|
if (fType == VST_PARAM_DROPLIST) {
|
||||||
//scan for near value
|
//scan for near value
|
||||||
int min_index = 0;
|
int min_index = 0;
|
||||||
float min_delta = 1.0;
|
float min_delta = 1.0;
|
||||||
for(int i = 0; i < fDropList.CountItems(); i++) {
|
for(int i = 0; i < fDropList.CountItems(); i++) {
|
||||||
DropListValue *item = (DropListValue*)fDropList.ItemAt(i);
|
DropListValue* item = (DropListValue*)fDropList.ItemAt(i);
|
||||||
float delta = fabs(item->Value - value);
|
float delta = fabs(item->Value - value);
|
||||||
if(delta <= min_delta) {
|
if (delta <= min_delta) {
|
||||||
min_delta = delta;
|
min_delta = delta;
|
||||||
min_index = i;
|
min_index = i;
|
||||||
}
|
}
|
||||||
@@ -214,14 +216,14 @@ 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
|
||||||
int index = (int)round(value);
|
int index = (int)round(value);
|
||||||
if(index >= 0 && index < fDropList.CountItems()) {
|
if (index >= 0 && index < fDropList.CountItems()) {
|
||||||
DropListValue *item = (DropListValue*)fDropList.ItemAt(index);
|
DropListValue *item = (DropListValue*)fDropList.ItemAt(index);
|
||||||
value = item->Value;
|
value = item->Value;
|
||||||
fLastValue = index;
|
fLastValue = index;
|
||||||
@@ -305,24 +307,25 @@ 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, (void**)&VSTMainProc) != B_OK) {
|
if (get_image_symbol(fModule, "main_plugin", B_SYMBOL_TYPE_TEXT,
|
||||||
|
(void**)&VSTMainProc) != B_OK) {
|
||||||
unload_add_on(fModule);
|
unload_add_on(fModule);
|
||||||
return VST_ERR_NO_MAINPROC;
|
return VST_ERR_NO_MAINPROC;
|
||||||
}
|
}
|
||||||
|
|
||||||
fEffect = VSTMainProc(VHostCallback);
|
fEffect = VSTMainProc(VHostCallback);
|
||||||
if(fEffect==NULL) {
|
if (fEffect==NULL) {
|
||||||
unload_add_on(fModule);
|
unload_add_on(fModule);
|
||||||
return VST_ERR_NOT_LOADED;
|
return VST_ERR_NOT_LOADED;
|
||||||
}
|
}
|
||||||
@@ -363,7 +366,7 @@ 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);
|
||||||
@@ -419,27 +422,27 @@ VSTPlugin::Path(void)
|
|||||||
int
|
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) {
|
||||||
inputs = new float*[fInputChannels];
|
inputs = new float*[fInputChannels];
|
||||||
for(int32 i = 0; i < fInputChannels; i++) {
|
for(int32 i = 0; i < fInputChannels; i++) {
|
||||||
inputs[i] = new float[fBlockSize];
|
inputs[i] = new float[fBlockSize];
|
||||||
memset (inputs[i], 0, fBlockSize * sizeof(float));
|
memset(inputs[i], 0, fBlockSize * sizeof(float));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fOutputChannels > 0) {
|
if (fOutputChannels > 0) {
|
||||||
outputs = new float*[fOutputChannels];
|
outputs = new float*[fOutputChannels];
|
||||||
for(int32_t i = 0; i < fOutputChannels; i++) {
|
for(int32_t i = 0; i < fOutputChannels; i++) {
|
||||||
outputs[i] = new float[fBlockSize];
|
outputs[i] = new float[fBlockSize];
|
||||||
@@ -464,9 +467,9 @@ VSTPlugin::ParametersCount(void)
|
|||||||
VSTParameter*
|
VSTParameter*
|
||||||
VSTPlugin::Parameter(int index)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,15 +511,15 @@ void
|
|||||||
VSTPlugin::Process(float *buffer, int samples, int channels)
|
VSTPlugin::Process(float *buffer, int samples, int channels)
|
||||||
{
|
{
|
||||||
//todo: full channels remapping needed
|
//todo: full channels remapping needed
|
||||||
float *src = buffer;
|
float* src = buffer;
|
||||||
|
|
||||||
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;
|
||||||
@@ -526,15 +529,15 @@ VSTPlugin::Process(float *buffer, int samples, int channels)
|
|||||||
|
|
||||||
fEffect->processReplacing(fEffect, inputs, outputs, fBlockSize);
|
fEffect->processReplacing(fEffect, inputs, outputs, fBlockSize);
|
||||||
|
|
||||||
float *dst = buffer;
|
float* dst = buffer;
|
||||||
|
|
||||||
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++) {
|
||||||
@@ -546,14 +549,15 @@ VSTPlugin::Process(float *buffer, int samples, int channels)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int32
|
static int32
|
||||||
VHostCallback(VSTEffect* effect, int32 opcode, int32 index, int32 value, void* ptr, float opt)
|
VHostCallback(VSTEffect* effect, int32 opcode, int32 index, int32 value,
|
||||||
|
void* ptr, float opt)
|
||||||
{
|
{
|
||||||
intptr_t result = 0;
|
intptr_t result = 0;
|
||||||
|
|
||||||
switch(opcode)
|
switch(opcode)
|
||||||
{
|
{
|
||||||
case VST_MASTER_PRODUCT:
|
case VST_MASTER_PRODUCT:
|
||||||
if(ptr) {
|
if (ptr) {
|
||||||
strcpy((char*)ptr, "VSTHost Media AddOn");
|
strcpy((char*)ptr, "VSTHost Media AddOn");
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected]. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected].
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __VST_HOST_H__
|
#ifndef __VST_HOST_H__
|
||||||
#define __VST_HOST_H__
|
#define __VST_HOST_H__
|
||||||
@@ -60,8 +61,10 @@
|
|||||||
struct VSTEffect
|
struct VSTEffect
|
||||||
{
|
{
|
||||||
int cookie;
|
int cookie;
|
||||||
int32 (*dispatcher)(struct VSTEffect*, int32, int32, int32, void*, float);
|
int32 (*dispatcher)(struct VSTEffect*, int32,
|
||||||
void (*process)(struct VSTEffect*, float**, float**, int32);
|
int32, int32, void*, float);
|
||||||
|
void (*process)(struct VSTEffect*, float**,
|
||||||
|
float**, int32);
|
||||||
void (*setParameter)(struct VSTEffect*, int32, float);
|
void (*setParameter)(struct VSTEffect*, int32, float);
|
||||||
float (*getParameter)(struct VSTEffect*, int32);
|
float (*getParameter)(struct VSTEffect*, int32);
|
||||||
int32 numPrograms;
|
int32 numPrograms;
|
||||||
@@ -77,7 +80,8 @@ struct VSTEffect
|
|||||||
void* _notused_pointer4;
|
void* _notused_pointer4;
|
||||||
int32 ID;
|
int32 ID;
|
||||||
char _notused_block2[4];
|
char _notused_block2[4];
|
||||||
void (*processReplacing)(struct VSTEffect*, float**, float**, int);
|
void (*processReplacing)(struct VSTEffect*,
|
||||||
|
float**, float**, int);
|
||||||
};
|
};
|
||||||
|
|
||||||
//typedefs
|
//typedefs
|
||||||
@@ -162,8 +166,8 @@ private:
|
|||||||
BString fVendorString;
|
BString fVendorString;
|
||||||
BString fProductString;
|
BString fProductString;
|
||||||
BList fParameters;
|
BList fParameters;
|
||||||
float **inputs;
|
float** inputs;
|
||||||
float **outputs;
|
float** outputs;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__VST_HOST_H__
|
#endif //__VST_HOST_H__
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected]. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), [email protected].
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -16,11 +17,13 @@
|
|||||||
#include "VSTNode.h"
|
#include "VSTNode.h"
|
||||||
|
|
||||||
//VSTNode
|
//VSTNode
|
||||||
VSTNode::~VSTNode() {
|
VSTNode::~VSTNode()
|
||||||
|
{
|
||||||
Quit();
|
Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
VSTNode::VSTNode(BMediaAddOn* addon, const char *name, const char* path) : BMediaNode(name),
|
VSTNode::VSTNode(BMediaAddOn* addon, const char* name, const char* path)
|
||||||
|
: BMediaNode(name),
|
||||||
BBufferConsumer(B_MEDIA_RAW_AUDIO),
|
BBufferConsumer(B_MEDIA_RAW_AUDIO),
|
||||||
BBufferProducer(B_MEDIA_RAW_AUDIO),
|
BBufferProducer(B_MEDIA_RAW_AUDIO),
|
||||||
BControllable(),
|
BControllable(),
|
||||||
@@ -35,7 +38,8 @@ VSTNode::VSTNode(BMediaAddOn* addon, const char *name, const char* path) : BMedi
|
|||||||
}
|
}
|
||||||
|
|
||||||
//BMediaNode
|
//BMediaNode
|
||||||
BMediaAddOn* VSTNode::AddOn(int32 *id) const
|
BMediaAddOn*
|
||||||
|
VSTNode::AddOn(int32* id) const
|
||||||
{
|
{
|
||||||
if(fAddOn) {
|
if(fAddOn) {
|
||||||
*id = 0;
|
*id = 0;
|
||||||
@@ -44,18 +48,17 @@ BMediaAddOn* VSTNode::AddOn(int32 *id) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTNode::HandleMessage(int32 message, const void *data, size_t size)
|
VSTNode::HandleMessage(int32 message, const void* data, size_t size)
|
||||||
{
|
{
|
||||||
if((BControllable::HandleMessage(message, data, size)!=B_OK) &&
|
if((BControllable::HandleMessage(message, data, size) != B_OK) &&
|
||||||
(BBufferConsumer::HandleMessage(message, data, size) != B_OK) &&
|
(BBufferConsumer::HandleMessage(message, data, size) != B_OK) &&
|
||||||
(BBufferProducer::HandleMessage(message, data, size) != B_OK) &&
|
(BBufferProducer::HandleMessage(message, data, size) != B_OK) &&
|
||||||
(BControllable::HandleMessage(message, data, size) != B_OK) ) {
|
(BControllable::HandleMessage(message, data, size) != B_OK) ) {
|
||||||
BMediaNode::HandleMessage(message, data, size);
|
BMediaNode::HandleMessage(message, data, size);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
} else {
|
}
|
||||||
BMediaNode::HandleBadMessage(message, data, size);
|
BMediaNode::HandleBadMessage(message, data, size);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -67,7 +70,8 @@ VSTNode::NodeRegistered()
|
|||||||
fPreferredFormat.type = B_MEDIA_RAW_AUDIO;
|
fPreferredFormat.type = B_MEDIA_RAW_AUDIO;
|
||||||
fPreferredFormat.u.raw_audio.buffer_size = BUFF_SIZE;
|
fPreferredFormat.u.raw_audio.buffer_size = BUFF_SIZE;
|
||||||
fPreferredFormat.u.raw_audio = media_raw_audio_format::wildcard;
|
fPreferredFormat.u.raw_audio = media_raw_audio_format::wildcard;
|
||||||
fPreferredFormat.u.raw_audio.channel_count = media_raw_audio_format::wildcard.channel_count;
|
fPreferredFormat.u.raw_audio.channel_count =
|
||||||
|
media_raw_audio_format::wildcard.channel_count;
|
||||||
fPreferredFormat.u.raw_audio.format = media_raw_audio_format::B_AUDIO_FLOAT;
|
fPreferredFormat.u.raw_audio.format = media_raw_audio_format::B_AUDIO_FLOAT;
|
||||||
|
|
||||||
fFormat.type = B_MEDIA_RAW_AUDIO;
|
fFormat.type = B_MEDIA_RAW_AUDIO;
|
||||||
@@ -93,10 +97,11 @@ VSTNode::NodeRegistered()
|
|||||||
|
|
||||||
//BControllable
|
//BControllable
|
||||||
status_t
|
status_t
|
||||||
VSTNode::GetParameterValue(int32 id, bigtime_t *lastChangeTime, void *value, size_t *size)
|
VSTNode::GetParameterValue(int32 id, bigtime_t* lastChangeTime, void* value,
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,22 +118,22 @@ VSTNode::GetParameterValue(int32 id, bigtime_t *lastChangeTime, void *value, siz
|
|||||||
|
|
||||||
*size = sizeof(float);
|
*size = sizeof(float);
|
||||||
|
|
||||||
if(id == P_MUTE) {
|
if (id == P_MUTE) {
|
||||||
*(int32*)value = fMute;
|
*(int32*)value = fMute;
|
||||||
*lastChangeTime = fMuteLastChanged;
|
*lastChangeTime = fMuteLastChanged;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
} else if(id == P_BYPASS) {
|
} else if (id == P_BYPASS) {
|
||||||
*(int32*)value = fByPass;
|
*(int32*)value = fByPass;
|
||||||
*lastChangeTime = fByPassLastChanged;
|
*lastChangeTime = fByPassLastChanged;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
} else {
|
} else {
|
||||||
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();
|
||||||
@@ -139,51 +144,58 @@ VSTNode::GetParameterValue(int32 id, bigtime_t *lastChangeTime, void *value, siz
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VSTNode::SetParameterValue(int32 id, bigtime_t time, const void *value, size_t size)
|
VSTNode::SetParameterValue(int32 id, bigtime_t time, const void* value,
|
||||||
|
size_t size)
|
||||||
{
|
{
|
||||||
int32 idx = id - P_PARAM;
|
int32 idx = id - P_PARAM;
|
||||||
if((idx >= 0 && idx < fPlugin->ParametersCount()) || id == P_MUTE || id == P_BYPASS) {
|
if ((idx >= 0 && idx < fPlugin->ParametersCount()) || id == P_MUTE ||
|
||||||
|
id == P_BYPASS) {
|
||||||
media_timed_event ev(time, BTimedEventQueue::B_PARAMETER, (void*)value,
|
media_timed_event ev(time, BTimedEventQueue::B_PARAMETER, (void*)value,
|
||||||
BTimedEventQueue::B_NO_CLEANUP, size, id, "VSTParam");
|
BTimedEventQueue::B_NO_CLEANUP, size, id, "VSTParam");
|
||||||
ParameterEventProcessing(&ev); //dirty hack for parameter processing (mediakit bug????)
|
//dirty hack for parameter processing (mediakit bug????)
|
||||||
|
ParameterEventProcessing(&ev);
|
||||||
EventQueue()->AddEvent(ev);
|
EventQueue()->AddEvent(ev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//BBufferConsumer
|
//BBufferConsumer
|
||||||
void
|
void
|
||||||
VSTNode::BufferReceived(BBuffer *buffer)
|
VSTNode::BufferReceived(BBuffer* buffer)
|
||||||
{
|
{
|
||||||
if(buffer->Header()->destination != fInputMedia.destination.id) {
|
if (buffer->Header()->destination != fInputMedia.destination.id) {
|
||||||
buffer->Recycle();
|
buffer->Recycle();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fOutputMedia.destination == media_destination::null || !fOutputMediaEnabled) {
|
if (fOutputMedia.destination == media_destination::null ||
|
||||||
|
!fOutputMediaEnabled) {
|
||||||
buffer->Recycle();
|
buffer->Recycle();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FilterBuffer(buffer);
|
FilterBuffer(buffer);
|
||||||
|
|
||||||
status_t err = SendBuffer(buffer, fOutputMedia.source, fOutputMedia.destination);
|
status_t err = SendBuffer(buffer, fOutputMedia.source,
|
||||||
|
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((fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
ValidateFormat(
|
||||||
fFormat : fPreferredFormat, *format);
|
(fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
||||||
|
fFormat : fPreferredFormat, *format);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -191,7 +203,7 @@ 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;
|
||||||
@@ -212,19 +224,19 @@ VSTNode::FormatChanged(const media_source &src, const media_destination &dst,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VSTNode::ProducerDataStatus(const media_destination &dst, int32 status, bigtime_t when)
|
VSTNode::ProducerDataStatus(const media_destination &dst, int32 status,
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,18 +248,18 @@ VSTNode::GetLatencyFor( const media_destination &dst, bigtime_t *latency,
|
|||||||
status_t
|
status_t
|
||||||
VSTNode::Connected(const media_source& source,
|
VSTNode::Connected(const media_source& source,
|
||||||
const media_destination& destination, const media_format& format,
|
const media_destination& destination, const media_format& format,
|
||||||
media_input* poInput)
|
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;
|
||||||
*poInput = fInputMedia;
|
*input = fInputMedia;
|
||||||
fFormat = format;
|
fFormat = format;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -268,13 +280,14 @@ VSTNode::Disconnected(const media_source &src, const media_destination &dst)
|
|||||||
|
|
||||||
//BBufferProducer
|
//BBufferProducer
|
||||||
status_t
|
status_t
|
||||||
VSTNode::FormatSuggestionRequested(media_type type, int32 quality, media_format *format)
|
VSTNode::FormatSuggestionRequested(media_type type, int32 quality,
|
||||||
|
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;
|
||||||
@@ -285,40 +298,42 @@ VSTNode::FormatSuggestionRequested(media_type type, int32 quality, media_format
|
|||||||
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((fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
ValidateFormat(
|
||||||
fFormat : fPreferredFormat, *format);
|
(fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
||||||
|
fFormat : fPreferredFormat, *format);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTNode::FormatChangeRequested(const media_source &src, const media_destination &dst,
|
VSTNode::FormatChangeRequested(const media_source &src,
|
||||||
media_format* format, int32* _deprecated_)
|
const media_destination &dst, media_format* format, int32* _deprecated_)
|
||||||
{
|
{
|
||||||
return B_MEDIA_BAD_FORMAT;
|
return B_MEDIA_BAD_FORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VSTNode::LateNoticeReceived(const media_source &src, bigtime_t late, bigtime_t when)
|
VSTNode::LateNoticeReceived(const media_source &src,
|
||||||
|
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;
|
||||||
@@ -333,41 +348,47 @@ VSTNode::DisposeOutputCookie(int32 cookie)
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTNode::SetBufferGroup(const media_source &src, BBufferGroup *group)
|
VSTNode::SetBufferGroup(const media_source &src, BBufferGroup* group)
|
||||||
{
|
{
|
||||||
|
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,
|
||||||
return SetOutputBuffersFor(fInputMedia.source, fInputMedia.destination, group, 0, &changeTag);
|
group, 0, &changeTag);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTNode::PrepareToConnect( const media_source &src, const media_destination &dst,
|
VSTNode::PrepareToConnect( const media_source &src, const media_destination &dst,
|
||||||
media_format *format, media_source *out_source, char *name)
|
media_format* format, media_source* out_source, char* name)
|
||||||
{
|
{
|
||||||
if(src != fOutputMedia.source) {
|
status_t ret = B_OK;
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t err = ValidateFormat((fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
ret = ValidateFormat(
|
||||||
|
(fFormat.u.raw_audio.format != media_raw_audio_format::wildcard.format) ?
|
||||||
fFormat : fPreferredFormat, *format);
|
fFormat : fPreferredFormat, *format);
|
||||||
|
|
||||||
if(err < B_OK) {
|
if (ret < B_OK) {
|
||||||
return err;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetOutputFormat(*format);
|
SetOutputFormat(*format);
|
||||||
@@ -382,11 +403,10 @@ VSTNode::PrepareToConnect( const media_source &src, const media_destination &dst
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VSTNode::Connect(status_t status, const media_source &src, const media_destination &dst,
|
VSTNode::Connect(status_t status, const media_source &src,
|
||||||
const media_format &format, char *name)
|
const media_destination &dst, const media_format &format, char* name)
|
||||||
{
|
{
|
||||||
status_t err;
|
if (status < B_OK) {
|
||||||
if(status < B_OK) {
|
|
||||||
fOutputMedia.destination = media_destination::null;
|
fOutputMedia.destination = media_destination::null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -396,14 +416,14 @@ VSTNode::Connect(status_t status, const media_source &src, const media_destinati
|
|||||||
fFormat = format;
|
fFormat = format;
|
||||||
|
|
||||||
media_node_id timeSource;
|
media_node_id timeSource;
|
||||||
err = FindLatencyFor(fOutputMedia.destination, &fDownstreamLatency, &timeSource);
|
FindLatencyFor(fOutputMedia.destination, &fDownstreamLatency, &timeSource);
|
||||||
|
|
||||||
InitFilter();
|
InitFilter();
|
||||||
|
|
||||||
fProcessLatency = GetFilterLatency();
|
fProcessLatency = GetFilterLatency();
|
||||||
SetEventLatency(fDownstreamLatency + fProcessLatency);
|
SetEventLatency(fDownstreamLatency + fProcessLatency);
|
||||||
|
|
||||||
if(fInputMedia.source != media_source::null) {
|
if (fInputMedia.source != media_source::null) {
|
||||||
SendLatencyChange(fInputMedia.source, fInputMedia.destination,
|
SendLatencyChange(fInputMedia.source, fInputMedia.destination,
|
||||||
EventLatency()+SchedulingLatency());
|
EventLatency()+SchedulingLatency());
|
||||||
}
|
}
|
||||||
@@ -412,11 +432,11 @@ VSTNode::Connect(status_t status, const media_source &src, const media_destinati
|
|||||||
|
|
||||||
int sample_size = (fFormat.u.raw_audio.format & 0xf)*
|
int sample_size = (fFormat.u.raw_audio.format & 0xf)*
|
||||||
fFormat.u.raw_audio.channel_count;
|
fFormat.u.raw_audio.channel_count;
|
||||||
if(fFormat.u.raw_audio.buffer_size > 0 &&
|
if (fFormat.u.raw_audio.buffer_size > 0 &&
|
||||||
fFormat.u.raw_audio.frame_rate > 0 &&
|
fFormat.u.raw_audio.frame_rate > 0 &&
|
||||||
sample_size > 0) {
|
sample_size > 0) {
|
||||||
duration = (bigtime_t)(((fFormat.u.raw_audio.buffer_size / sample_size) /
|
duration = (bigtime_t)(((fFormat.u.raw_audio.buffer_size / sample_size) /
|
||||||
fFormat.u.raw_audio.frame_rate) * 1000000.0);
|
fFormat.u.raw_audio.frame_rate) * 1000000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetBufferDuration(duration);
|
SetBufferDuration(duration);
|
||||||
@@ -425,17 +445,17 @@ VSTNode::Connect(status_t status, const media_source &src, const media_destinati
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,14 +465,14 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
VSTNode::GetLatency(bigtime_t *latency)
|
VSTNode::GetLatency(bigtime_t* latency)
|
||||||
{
|
{
|
||||||
*latency = EventLatency() + SchedulingLatency();
|
*latency = EventLatency() + SchedulingLatency();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -460,16 +480,16 @@ VSTNode::GetLatency(bigtime_t *latency)
|
|||||||
|
|
||||||
void
|
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);
|
||||||
|
|
||||||
if(fInputMedia.source != media_source::null) {
|
if (fInputMedia.source != media_source::null) {
|
||||||
SendLatencyChange(fInputMedia.source,
|
SendLatencyChange(fInputMedia.source,
|
||||||
fInputMedia.destination,EventLatency() + SchedulingLatency());
|
fInputMedia.destination,EventLatency() + SchedulingLatency());
|
||||||
}
|
}
|
||||||
@@ -484,7 +504,8 @@ VSTNode::OfflineTime()
|
|||||||
|
|
||||||
//VSTNode
|
//VSTNode
|
||||||
void
|
void
|
||||||
VSTNode::HandleEvent(const media_timed_event *event, bigtime_t late, bool realTime)
|
VSTNode::HandleEvent(const media_timed_event *event, bigtime_t late,
|
||||||
|
bool realTime)
|
||||||
{
|
{
|
||||||
if(event->type == BTimedEventQueue::B_PARAMETER) {
|
if(event->type == BTimedEventQueue::B_PARAMETER) {
|
||||||
ParameterEventProcessing(event);
|
ParameterEventProcessing(event);
|
||||||
@@ -503,33 +524,33 @@ VSTNode::ParameterEventProcessing(const media_timed_event* event)
|
|||||||
|
|
||||||
type_code v_type = B_FLOAT_TYPE;
|
type_code v_type = B_FLOAT_TYPE;
|
||||||
|
|
||||||
BParameter *web_param;
|
BParameter* web_param;
|
||||||
for(int i = 0; i < fWeb->CountParameters(); i++) {
|
for(int i = 0; i < fWeb->CountParameters(); i++) {
|
||||||
web_param = fWeb->ParameterAt(i);
|
web_param = fWeb->ParameterAt(i);
|
||||||
if(web_param->ID()==id) {
|
if(web_param->ID() == id) {
|
||||||
v_type=web_param->ValueType();
|
v_type = web_param->ValueType();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(id == P_MUTE) {
|
if (id == P_MUTE) {
|
||||||
fMute = value32;
|
fMute = value32;
|
||||||
fMuteLastChanged = now;
|
fMuteLastChanged = now;
|
||||||
BroadcastNewParameterValue(now, id, event->pointer, size);
|
BroadcastNewParameterValue(now, id, event->pointer, size);
|
||||||
} else if(id == P_BYPASS) {
|
} else if (id == P_BYPASS) {
|
||||||
fByPass = value32;
|
fByPass = value32;
|
||||||
fByPassLastChanged = now;
|
fByPassLastChanged = now;
|
||||||
BroadcastNewParameterValue(now, id, event->pointer, size);
|
BroadcastNewParameterValue(now, id, event->pointer, size);
|
||||||
} else {
|
} else {
|
||||||
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);
|
||||||
param->SetValue(value);
|
param->SetValue(value);
|
||||||
BroadcastNewParameterValue(now, id, &value, size);
|
BroadcastNewParameterValue(now, id, &value, size);
|
||||||
@@ -543,7 +564,7 @@ VSTNode::ValidateFormat(const media_format &preferredFormat,
|
|||||||
{
|
{
|
||||||
status_t ret = B_OK;
|
status_t ret = B_OK;
|
||||||
|
|
||||||
if(proposedFormat.type != B_MEDIA_RAW_AUDIO) {
|
if (proposedFormat.type != B_MEDIA_RAW_AUDIO) {
|
||||||
proposedFormat = preferredFormat;
|
proposedFormat = preferredFormat;
|
||||||
return B_MEDIA_BAD_FORMAT;
|
return B_MEDIA_BAD_FORMAT;
|
||||||
}
|
}
|
||||||
@@ -559,7 +580,8 @@ VSTNode::ValidateFormat(const media_format &preferredFormat,
|
|||||||
f.frame_rate = pref.frame_rate;
|
f.frame_rate = pref.frame_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pref.channel_count != wild.channel_count && f.channel_count != pref.channel_count) {
|
if(pref.channel_count != wild.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;
|
||||||
}
|
}
|
||||||
@@ -573,14 +595,16 @@ VSTNode::ValidateFormat(const media_format &preferredFormat,
|
|||||||
f.format = pref.format;
|
f.format = pref.format;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pref.byte_order != wild.byte_order && f.byte_order != pref.byte_order) {
|
if(pref.byte_order != wild.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 && f.buffer_size != pref.buffer_size) {
|
if(pref.buffer_size != wild.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;
|
||||||
}
|
}
|
||||||
@@ -597,23 +621,24 @@ 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)?B_MEDIA_BIG_ENDIAN:B_MEDIA_LITTLE_ENDIAN;
|
f.byte_order = (B_HOST_IS_BENDIAN) ?
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -634,28 +659,33 @@ VSTNode::InitParameterWeb()
|
|||||||
|
|
||||||
bool switch_group_needed = false;
|
bool switch_group_needed = false;
|
||||||
for(int i = 0; i < fPlugin->ParametersCount(); i++) {
|
for(int i = 0; i < fPlugin->ParametersCount(); i++) {
|
||||||
VSTParameter *param = fPlugin->Parameter(i);
|
VSTParameter* param = fPlugin->Parameter(i);
|
||||||
if(param->Type() == VST_PARAM_CHECKBOX ||
|
if (param->Type() == VST_PARAM_CHECKBOX ||
|
||||||
param->Type() == VST_PARAM_DROPLIST) {
|
param->Type() == VST_PARAM_DROPLIST) {
|
||||||
switch_group_needed = true;
|
switch_group_needed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BParameterGroup *fParamGroup = fWeb->MakeGroup("Parameters");
|
BParameterGroup* fParamGroup = fWeb->MakeGroup("Parameters");
|
||||||
BParameterGroup *fSwitchesGroup = switch_group_needed?fWeb->MakeGroup("Switches"):NULL;
|
BParameterGroup* fSwitchesGroup = switch_group_needed ?
|
||||||
BParameterGroup *fAboutGroup = fWeb->MakeGroup("About");
|
fWeb->MakeGroup("Switches") : NULL;
|
||||||
|
BParameterGroup* fAboutGroup = fWeb->MakeGroup("About");
|
||||||
|
|
||||||
BParameter *value;
|
BParameter* value;
|
||||||
BNullParameter *label;
|
BNullParameter* label;
|
||||||
BParameterGroup *group;
|
BParameterGroup* group;
|
||||||
|
|
||||||
BParameterGroup *fFControlGroup = fParamGroup->MakeGroup("FilterControl");
|
BParameterGroup* fFControlGroup = fParamGroup->MakeGroup("FilterControl");
|
||||||
BParameterGroup *fCheckBoxGroup = switch_group_needed?fSwitchesGroup->MakeGroup("CheckBoxes") : NULL;
|
BParameterGroup* fCheckBoxGroup = switch_group_needed ?
|
||||||
BParameterGroup *fSelectorsGroup = switch_group_needed?fSwitchesGroup->MakeGroup("Selectors") : NULL;
|
fSwitchesGroup->MakeGroup("CheckBoxes") : NULL;
|
||||||
|
BParameterGroup* fSelectorsGroup = switch_group_needed ?
|
||||||
|
fSwitchesGroup->MakeGroup("Selectors") : NULL;
|
||||||
|
|
||||||
fFControlGroup->MakeDiscreteParameter(P_MUTE, B_MEDIA_NO_TYPE,"Mute", B_ENABLE);
|
fFControlGroup->MakeDiscreteParameter(P_MUTE,
|
||||||
fFControlGroup->MakeDiscreteParameter(P_BYPASS, B_MEDIA_NO_TYPE,"ByPass", B_ENABLE);
|
B_MEDIA_NO_TYPE,"Mute", B_ENABLE);
|
||||||
|
fFControlGroup->MakeDiscreteParameter(P_BYPASS,
|
||||||
|
B_MEDIA_NO_TYPE,"ByPass", B_ENABLE);
|
||||||
|
|
||||||
for(int i = 0; i < fPlugin->ParametersCount(); i++) {
|
for(int i = 0; i < fPlugin->ParametersCount(); i++) {
|
||||||
VSTParameter *param = fPlugin->Parameter(i);
|
VSTParameter *param = fPlugin->Parameter(i);
|
||||||
@@ -663,17 +693,21 @@ VSTNode::InitParameterWeb()
|
|||||||
case VST_PARAM_CHECKBOX:
|
case VST_PARAM_CHECKBOX:
|
||||||
{
|
{
|
||||||
BString str;
|
BString str;
|
||||||
str << param->Name() << " (" << param->MinimumValue() << "/" << param->MaximumValue() << ")";
|
str << param->Name() << " (" << param->MinimumValue()
|
||||||
value = fCheckBoxGroup->MakeDiscreteParameter(P_PARAM + param->Index(),
|
<< "/" << param->MaximumValue() << ")";
|
||||||
B_MEDIA_NO_TYPE, str.String(), B_ENABLE);
|
value = fCheckBoxGroup->MakeDiscreteParameter(
|
||||||
|
P_PARAM + param->Index(), B_MEDIA_NO_TYPE,
|
||||||
|
str.String(), B_ENABLE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VST_PARAM_DROPLIST:
|
case VST_PARAM_DROPLIST:
|
||||||
{
|
{
|
||||||
BDiscreteParameter *dvalue = fSelectorsGroup->MakeDiscreteParameter(P_PARAM + param->Index(),
|
BDiscreteParameter *dvalue =
|
||||||
B_MEDIA_NO_TYPE, param->Name(), B_OUTPUT_MUX);
|
fSelectorsGroup->MakeDiscreteParameter(P_PARAM + param->Index(),
|
||||||
|
B_MEDIA_NO_TYPE, param->Name(), B_OUTPUT_MUX);
|
||||||
for(int j = 0; j < param->ListCount(); j++) {
|
for(int j = 0; j < param->ListCount(); j++) {
|
||||||
dvalue->AddItem( param->ListItemAt(j)->Index, param->ListItemAt(j)->Name.String());
|
dvalue->AddItem( param->ListItemAt(j)->Index,
|
||||||
|
param->ListItemAt(j)->Name.String());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -710,7 +744,7 @@ 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");
|
||||||
@@ -719,7 +753,7 @@ VSTNode::InitParameterWeb()
|
|||||||
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");
|
||||||
@@ -728,7 +762,7 @@ VSTNode::InitParameterWeb()
|
|||||||
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");
|
||||||
@@ -762,13 +796,15 @@ 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 = new BBufferGroup(fOutputMedia.format.u.raw_audio.buffer_size, 1);
|
BBufferGroup* temp_group =
|
||||||
|
new BBufferGroup(fOutputMedia.format.u.raw_audio.buffer_size, 1);
|
||||||
|
|
||||||
BBuffer *buffer = temp_group->RequestBuffer(fOutputMedia.format.u.raw_audio.buffer_size);
|
BBuffer *buffer =
|
||||||
|
temp_group->RequestBuffer(fOutputMedia.format.u.raw_audio.buffer_size);
|
||||||
buffer->Header()->type = B_MEDIA_RAW_AUDIO;
|
buffer->Header()->type = B_MEDIA_RAW_AUDIO;
|
||||||
buffer->Header()->size_used = fOutputMedia.format.u.raw_audio.buffer_size;
|
buffer->Header()->size_used = fOutputMedia.format.u.raw_audio.buffer_size;
|
||||||
|
|
||||||
@@ -792,10 +828,10 @@ VSTNode::FilterBuffer(BBuffer* buffer)
|
|||||||
uint32 samples = buffer->Header()->size_used / m_frameSize;
|
uint32 samples = buffer->Header()->size_used / m_frameSize;
|
||||||
uint32 channels = fFormat.u.raw_audio.channel_count;
|
uint32 channels = fFormat.u.raw_audio.channel_count;
|
||||||
|
|
||||||
if(fMute != 0) {
|
if (fMute != 0) {
|
||||||
memset(buffer->Data(), 0, buffer->Header()->size_used);
|
memset(buffer->Data(), 0, buffer->Header()->size_used);
|
||||||
} else {
|
} else {
|
||||||
if(fByPass == 0) {
|
if (fByPass == 0) {
|
||||||
fPlugin->Process((float*)buffer->Data(), samples, channels);
|
fPlugin->Process((float*)buffer->Data(), samples, channels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012, Gerasim Troeglazov (3dEyes**), 3dEyes@gmail.com. All rights reserved.
|
* Copyright 2012, Gerasim Troeglazov (3dEyes**), 3dEyes@gmail.com.
|
||||||
|
* All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __VST_NODE_H__
|
#ifndef __VST_NODE_H__
|
||||||
#define __VST_NODE_H__
|
#define __VST_NODE_H__
|
||||||
@@ -40,7 +41,8 @@ class VSTNode : public BBufferConsumer,
|
|||||||
public BMediaEventLooper {
|
public BMediaEventLooper {
|
||||||
public:
|
public:
|
||||||
virtual ~VSTNode();
|
virtual ~VSTNode();
|
||||||
VSTNode(BMediaAddOn *addon, const char *name, const char* path);
|
VSTNode(BMediaAddOn *addon, const char *name,
|
||||||
|
const char* path);
|
||||||
//BMediaNode
|
//BMediaNode
|
||||||
public:
|
public:
|
||||||
virtual BMediaAddOn *AddOn(int32 *id) const;
|
virtual BMediaAddOn *AddOn(int32 *id) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user