Commit b12a1e7b authored by Benjamin Heisch's avatar Benjamin Heisch
Browse files

again moved vestige dep and also fixed some cppcheck bugs

parent f3ebdb88
......@@ -14,7 +14,7 @@ std::vector<TTLPluginInfo>(*getPluginInfosPtr)(std::string) = nullptr;
void writeOutBundle(std::vector<TTLPluginInfo> infoArray,std::string fileOutDir ="./") {
void writeOutBundle(std::vector<TTLPluginInfo> infoArray, const std::string& fileOutDir ="./") {
for (auto info : infoArray) {
auto plugTTL= getTTLFromPluginPtr(info.plugPtr);
std::ofstream outfile(fileOutDir + info.ttlFileName);
......
......@@ -10,10 +10,6 @@
#include <vector>
#include <unordered_map>
using namespace XPlug;
struct custom_test_data {
int (*get_port_count)(size_t plugIndex);
int (*get_port_job)(size_t plugIndex,size_t portIndex);
};
struct MidiHandle {
......
......@@ -3,13 +3,13 @@ option(XPLUG_VST2_SUPPORT "Support vor VST2" ON)
if(XPLUG_VST2_SUPPORT)
include(symbol_export)
find_package(VST2)
add_library(vst2 "vestige.h" "vestige.cpp" "vst_def.hpp")
add_library(vst2 "vestige.cpp" "vst_def.hpp")
target_compile_features(vst2 PUBLIC cxx_std_11)
if(VST2_FOUND)
target_include_directories(vst2 PRIVATE ${VST2_INCLUDE_DIRS})
target_compile_definitions(vst2 PRIVATE USE_VST2_SDK)
endif(VST2_FOUND)
target_include_directories(vst2 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../../src)
target_include_directories(vst2 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../../src ${PROJECT_SOURCE_DIR}/deps/)
set_target_properties(vst2 PROPERTIES POSITION_INDEPENDENT_CODE True)
target_link_libraries(vst2 XPlug)
EXPORT_SYMBOLS(vst2 FUNCTION_NAMES VSTPluginMain)
......
......@@ -3,6 +3,7 @@
#include "tools/LibLoading.hpp"
#include "vst_def.hpp"
typedef AEffect* (*VSTPluginMain)(audioMasterCallback);
class VST2Module {
private:
size_t samplesize = 0;
......@@ -12,9 +13,7 @@ private:
audioMasterCallback aMasterCallback = nullptr;
public:
XPlug::library_t pluginLib = nullptr;
AEffect* effect;
AEffect* effect=nullptr;
inline VST2Module(std::string pluginPath, audioMasterCallback cb =nullptr) {
if (cb == nullptr) {
......@@ -34,6 +33,7 @@ public:
VSTPluginMain_fnc = XPlug::LoadFunc<VSTPluginMain>(pluginLib, "VSTPluginMain");
}
inline ~VST2Module() {
XPlug::UnloadLib(this->pluginLib);
}
inline bool intialise() {
......
......@@ -109,8 +109,8 @@ static intptr_t vst_dispatcher(AEffect* effect, int32_t opcode, int32_t , intptr
case effSetSpeakerArrangement: ///< [value]: input #VstSpeakerArrangement* [ptr]: output #VstSpeakerArrangement* @see AudioEffectX::setSpeakerArrangement
if (getNumberOfPorts<IAudioPort>(data->plug, PortDirection::Input) == 0 || getNumberOfPorts<IAudioPort>(data->plug, PortDirection::Output) == 0)
return 0;
return ((VstSpeakerArrangement*)value)->numChannels == (int32_t)getPortAt<IAudioPort>(data->plug, 0, PortDirection::Input )->size() &&
((VstSpeakerArrangement*)ptr )->numChannels == (int32_t)getPortAt<IAudioPort>(data->plug, 0, PortDirection::Output)->size();
return reinterpret_cast<VstSpeakerArrangement*>(value)->numChannels == (int32_t)getPortAt<IAudioPort>(data->plug, 0, PortDirection::Input )->size() &&
reinterpret_cast<VstSpeakerArrangement*>(ptr)->numChannels == (int32_t)getPortAt<IAudioPort>(data->plug, 0, PortDirection::Output)->size();
break;
case effSetBypass: ///< [value]: 1 = bypass, 0 = no bypass @see AudioEffectX::setBypass
break;
......
......@@ -7,13 +7,12 @@
#include <tools/PortHandling.hpp>
// TODO: Maybe quick implementation of the Component stuff.
//------------------------------------------------------------------------
Component::Component()
Component::Component() : __funknownRefCount(1)
/* : audioInputs(kAudio, kInput)
, audioOutputs(kAudio, kOutput)
, eventInputs(kEvent, kInput)
, eventOutputs(kEvent, kOutput)*/
{
__funknownRefCount = 1;
}
......
#include "VST3EditControllerImpl.hpp"
VST3EditControllerImpl::VST3EditControllerImpl()
{
__funknownRefCount = 1;
VST3EditControllerImpl::VST3EditControllerImpl() : __funknownRefCount(1){
}
tresult PLUGIN_API VST3EditControllerImpl::queryInterface(const TUID _iid, void** obj)
......
......@@ -22,19 +22,19 @@ protected:
}
public:
inline void log(std::string msg, LoggerValue ) {
inline void log(const std::string& msg, LoggerValue ) {
std::cout << msg;
}
inline void logN(std::string msg, LoggerValue ) {
inline void logN(const std::string& msg, LoggerValue ) {
std::cout << msg << std::endl;
}
inline void logIf(bool cond, std::string msg, LoggerValue val) {
inline void logIf(bool cond, const std::string& msg, LoggerValue val) {
if (cond)
logN(msg, val);
}
inline void rawPrint(std::string msg) {
inline void rawPrint(const std::string& msg) {
std::cout << msg;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment