Skip to content

Instantly share code, notes, and snippets.

@kyab
Created October 6, 2020 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyab/8719ab4fdb218c3f454b6a9a6138b26a to your computer and use it in GitHub Desktop.
Save kyab/8719ab4fdb218c3f454b6a9a6138b26a to your computer and use it in GitHub Desktop.
//
// CEditorHost.hpp
// Late5 Studio
//
// Created by kyab on 2020/10/05.
// Copyright © 2020 kyab. All rights reserved.
//
#ifndef CEditorHost_hpp
#define CEditorHost_hpp
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
#include <stdio.h>
#include "pluginterfaces/base/funknown.h"
#include "pluginterfaces/gui/iplugview.h"
#include "pluginterfaces/gui/iplugviewcontentscalesupport.h"
#include "pluginterfaces/vst/ivstaudioprocessor.h"
#include "pluginterfaces/vst/ivsteditcontroller.h"
#include "pluginterfaces/vst/vsttypes.h"
#include "pluginterfaces/vst/ivsthostapplication.h"
#define _DEBUG
#include "public.sdk/source/vst/hosting/pluginterfacesupport.h"
#include <cstdio>
#include <iostream>
using namespace Steinberg;
class MyHostApplication : public Vst::IHostApplication
{
public:
MyHostApplication (){
}
~MyHostApplication () {
}
//--- IHostApplication ---------------
tresult PLUGIN_API getName (Vst::String128 name) SMTG_OVERRIDE{
NSLog(@"MyHostApplication::getName called");
return kResultOk;
};
tresult PLUGIN_API createInstance (TUID cid, TUID _iid, void** obj) SMTG_OVERRIDE{
NSLog(@"MyHostApplication::createInstance called");
return kResultOk;
}
// DECLARE_FUNKNOWN_METHODS
Vst::PlugInterfaceSupport* getPlugInterfaceSupport () const {
NSLog(@"MyHostApplication::getPlugInterfaceSupport called");
return mPlugInterfaceSupport;
}
public:
tresult PLUGIN_API queryInterface (const TUID _iid, void** obj) override
{
NSLog(@"MyHostApplication::queryInterface called for %s", _iid);
*obj = (Vst::IHostApplication *)this;
return kResultOk;
}
uint32 PLUGIN_API addRef () override { return 1000; }
uint32 PLUGIN_API release () override { return 1000; }
protected:
IPtr<Vst::PlugInterfaceSupport> mPlugInterfaceSupport;
};
#endif /* CEditorHost_hpp */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment