mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-15 04:50:43 +02:00
Answer event queries within the Wine VST host
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
// Libraries like Boost and msgpack think we're compiling on Windows or using a
|
||||
// MSVC toolchain. This will cause them to make assumptions about the way
|
||||
// certain types are defined, which headers are available and which features to
|
||||
// disable (i.e. POSIX specific features). The only way around this I could
|
||||
// think of was to just temporarily undefine the macros these libraries use to
|
||||
// detect it's running under a WIN32 environment. If anyone knows a better way
|
||||
// to do this, please let me know!
|
||||
|
||||
#pragma push_macro("WIN32")
|
||||
#pragma push_macro("_WIN32")
|
||||
#pragma push_macro("__WIN32__")
|
||||
#pragma push_macro("_WIN64")
|
||||
|
||||
#undef WIN32
|
||||
#undef _WIN32
|
||||
#undef __WIN32__
|
||||
#undef _WIN64
|
||||
|
||||
#include <msgpack.hpp>
|
||||
|
||||
#pragma pop_macro("WIN32")
|
||||
#pragma pop_macro("_WIN32")
|
||||
#pragma pop_macro("__WIN32__")
|
||||
#pragma pop_macro("_WIN64")
|
||||
@@ -1,7 +1,28 @@
|
||||
// TODO: Do something useful here!
|
||||
#include <vestige/aeffect.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "native-includes.h"
|
||||
|
||||
// `native-includes.h` has to be included before any other files as otherwise we
|
||||
// might get the wrong version of certain libraries
|
||||
#include "../common/communication.h"
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello, world!" << std::endl;
|
||||
// TODO: The program should terminate automatically when stdin gets closed
|
||||
|
||||
// TODO: Remove debug
|
||||
while (true) {
|
||||
auto event = read_object<Event>(std::cin);
|
||||
|
||||
EventResult response;
|
||||
if (event.opcode == effGetEffectName) {
|
||||
response.return_value = 1;
|
||||
response.result = "Hello, world!";
|
||||
} else {
|
||||
response.return_value = 0;
|
||||
}
|
||||
|
||||
write_object(std::cout, response);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user