修复在macos的链接问题

This commit is contained in:
Nana 2024-05-21 12:36:30 +08:00
parent 28b53dc273
commit 54a6bed4ed
11 changed files with 71 additions and 18 deletions

View File

@ -4,9 +4,9 @@
#include "misc/singleton/singleton_manager.h"
#include "spdlog/spdlog.h"
#include "spdlog/sinks/daily_file_sink.h"
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/sinks/ansicolor_sink.h"
#include "spdlog/sinks/stdout_sinks.h"
#include "thread_message/thread_message_hubs.h"
#include "window/window_manager.h"
application::application() {
}
@ -42,3 +42,10 @@ void application::shutdown() {
spdlog::drop_all();
spdlog::shutdown();
}
bool application::update_window_manager()
{
g_main_thread_hub.process_messages();
g_window_manager.update();
return true;
}

View File

@ -24,6 +24,12 @@ public:
virtual void shutdown();
virtual void tick(float delta_time) {}
bool update_window_manager();
virtual void tick(float delta_time)
{
}
protected:
};

View File

@ -7,6 +7,8 @@
#include "spdlog/spdlog.h"
#include "thread_message/thread_message_hubs.h"
IMPL_SINGLETON_INSTANCE(audio_device_manager)
int rt_audio_callback(void* output_buffer, void *input_buffer,
unsigned int frames_nums,
double stream_time,

View File

@ -11,6 +11,8 @@
#include "misc/query_timer.h"
#include "thread_message/thread_message_hubs.h"
IMPL_SINGLETON_INSTANCE(mixer)
void build_effect_channel_interface(mixer_track* track, const channel_interface* in_interface, std::map<mixer_track*, int32_t>& processed_tracks) {
ZoneScoped;
int32_t& track_current_layer = processed_tracks[track];

View File

@ -4,6 +4,8 @@
#include "vst2/vst2_plugin_host.h"
IMPL_SINGLETON_INSTANCE(midi_sequencer)
void midi_sequencer::init(singleton_initliazer& initliazer) {
singleton_t<midi_sequencer>::init(initliazer);

View File

@ -13,6 +13,8 @@
#include "window/window_manager.h"
#include "tracy/tracy.hpp"
IMPL_SINGLETON_INSTANCE(plugin_host_manager)
void plugin_host_manager::init(singleton_initliazer& initliazer) {
ZoneScoped;
singleton_t<plugin_host_manager>::init(initliazer);

View File

@ -112,8 +112,8 @@ VstIntPtr vst_master_callback(AEffect* effect, VstInt32 opcode, VstInt32 index,
case audioMasterProcessEvents:
// TODO
{
VstEvents* Events = (VstEvents*)ptr;
Events->events[0]->type;
// VstEvents* Events = (VstEvents*)ptr;
// Events->events[0]->type;
// FVST2PluginHost* Host = static_cast<FVST2PluginHost*>(Effect->user);
}

View File

@ -1,11 +1,17 @@
#pragma once
#ifdef WIN32
#ifdef core_EXPORTS
#define CORE_API __declspec(dllexport)
#if PLATFORM_WINDOWS
#ifdef core_EXPORTS
#define CORE_API __declspec(dllexport)
#else
#define CORE_API __declspec(dllimport)
#endif
#elif PLATFORM_MACOS || PLATFORM_LINUX
#ifdef core_EXPORTS
#define CORE_API __attribute__((visibility("default")))
#else
#define CORE_API
#endif
#else
#define CORE_API __declspec(dllimport)
#error Unsupported platform
#endif
#else
#define CORE_API
#endif

View File

@ -43,10 +43,13 @@ public:
};
#if defined(core_EXPORTS)
#define DEFINE_SINGLETON_INSTANCE(T) \
inline T g_##T; \
extern "C" CORE_API inline T* get_##T() { return &g_##T; }
#else
#define DEFINE_SINGLETON_INSTANCE(T) \
extern "C" CORE_API T* get_##T();
#define DEFINE_SINGLETON_INSTANCE(T) \
inline T g_##T; \
extern "C" CORE_API T* get_##T();
#else
#define DEFINE_SINGLETON_INSTANCE(T) \
extern "C" CORE_API T* get_##T();
#endif
#define IMPL_SINGLETON_INSTANCE(T) \
T* get_##T() { return &g_##T; }

View File

@ -5,6 +5,8 @@
#include "GLFW/glfw3.h"
#include "GLFW/glfw3native.h"
IMPL_SINGLETON_INSTANCE(window_manager)
void window_manager::init(singleton_initliazer& initliazer) {
singleton_t<window_manager>::init(initliazer);
auto plugin_host = initliazer.require<plugin_host_manager>();

21
update.sh Executable file
View File

@ -0,0 +1,21 @@
cd third_party
cd rtaudio
git checkout master
git pull
cd ..
cd spdlog
git checkout v2.x
git pull
cd ..
cd taskflow
git checkout master
git pull
cd ..
cd glfw
git checkout master
git pull
cd ..