Add a partial YaHostApplication implementation

This commit is contained in:
Robbert van der Helm
2020-12-13 14:46:17 +01:00
parent e21ee31ee8
commit 0c64aabeea
5 changed files with 92 additions and 3 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ This branch is still very far removed from being in a usable state. Below is an
imcomplete list of things that still have to be done before this can be used:
- Left to implement:
- `IHostApplication` implementations for both `IPluginBase::initialize()` as
well as for `IPluginFactory3::setHostContext()`.
- `YaHostApplicationHostImpl::createComponent`.
- `IPluginFactory3::setHostContext()` using the same host application context proxy method.
- The rest of `IComponent`'s functions after implementing `intialize()`
- `IPluginFactory3::setHostContext()`
- All other mandatory interfaces
+1
View File
@@ -116,6 +116,7 @@ if with_vst3
'src/common/serialization/vst3/component.cpp',
'src/common/serialization/vst3/host-application.cpp',
'src/common/serialization/vst3/plugin-factory.cpp',
'src/wine-host/bridges/vst3-impls/host-application.cpp',
'src/wine-host/bridges/vst3.cpp',
]
endif
@@ -94,7 +94,7 @@ class YaHostApplication : public Steinberg::Vst::IHostApplication {
* and we also track a `YaHostApplicationHostImpl` for the component with
* instance id `x`, then that should also be dropped.
*/
~YaHostApplication();
virtual ~YaHostApplication();
DECLARE_FUNKNOWN_METHODS
@@ -0,0 +1,47 @@
// yabridge: a Wine VST bridge
// Copyright (C) 2020 Robbert van der Helm
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "host-application.h"
#include <iostream>
YaHostApplicationHostImpl::YaHostApplicationHostImpl(
Vst3Bridge& bridge,
YaHostApplication::ConstructArgs&& args)
: YaHostApplication(std::move(args)), bridge(bridge) {
// The lifecycle is thos object is managed together with that of the
// `IComponent` instance this belongs to
}
tresult PLUGIN_API
YaHostApplicationHostImpl::queryInterface(const Steinberg::TUID _iid,
void** obj) {
const tresult result = YaHostApplication::queryInterface(_iid, obj);
if (result != Steinberg::kResultOk) {
std::cerr << "TODO: Implement unknown interface logging on Wine side"
<< std::endl;
}
return result;
}
tresult PLUGIN_API
YaHostApplicationHostImpl::createInstance(Steinberg::TUID cid,
Steinberg::TUID _iid,
void** obj) {
// TODO: Implement
return Steinberg::kNotImplemented;
}
@@ -0,0 +1,41 @@
// yabridge: a Wine VST bridge
// Copyright (C) 2020 Robbert van der Helm
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <pluginterfaces/vst/ivsthostapplication.h>
#include "../vst3.h"
class YaHostApplicationHostImpl : public YaHostApplication {
public:
YaHostApplicationHostImpl(Vst3Bridge& bridge,
YaHostApplication::ConstructArgs&& args);
/**
* We'll override the query interface to log queries for interfaces we do
* not (yet) support.
*/
tresult PLUGIN_API queryInterface(const Steinberg::TUID _iid,
void** obj) override;
tresult PLUGIN_API createInstance(Steinberg::TUID cid,
Steinberg::TUID _iid,
void** obj) override;
private:
Vst3Bridge& bridge;
};