diff --git a/core/application/application.cpp b/core/application/application.cpp index 55a8edc..5c3c59e 100644 --- a/core/application/application.cpp +++ b/core/application/application.cpp @@ -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; +} diff --git a/core/application/application.h b/core/application/application.h index 0a7c864..6da885a 100644 --- a/core/application/application.h +++ b/core/application/application.h @@ -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: }; diff --git a/core/audio/device/audio_device_manager.cpp b/core/audio/device/audio_device_manager.cpp index debc14a..3f38819 100644 --- a/core/audio/device/audio_device_manager.cpp +++ b/core/audio/device/audio_device_manager.cpp @@ -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, diff --git a/core/audio/mixer/mixer.cpp b/core/audio/mixer/mixer.cpp index c37e8cb..dcc51b2 100644 --- a/core/audio/mixer/mixer.cpp +++ b/core/audio/mixer/mixer.cpp @@ -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& processed_tracks) { ZoneScoped; int32_t& track_current_layer = processed_tracks[track]; diff --git a/core/audio/plugin_host/midi_sequencer.cpp b/core/audio/plugin_host/midi_sequencer.cpp index a288d4f..7a99ab2 100644 --- a/core/audio/plugin_host/midi_sequencer.cpp +++ b/core/audio/plugin_host/midi_sequencer.cpp @@ -4,6 +4,8 @@ #include "vst2/vst2_plugin_host.h" +IMPL_SINGLETON_INSTANCE(midi_sequencer) + void midi_sequencer::init(singleton_initliazer& initliazer) { singleton_t::init(initliazer); diff --git a/core/audio/plugin_host/plugin_host_manager.cpp b/core/audio/plugin_host/plugin_host_manager.cpp index f851163..87aed1d 100644 --- a/core/audio/plugin_host/plugin_host_manager.cpp +++ b/core/audio/plugin_host/plugin_host_manager.cpp @@ -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::init(initliazer); diff --git a/core/audio/plugin_host/vst2/vst2_plugin_host.cpp b/core/audio/plugin_host/vst2/vst2_plugin_host.cpp index dd8cd39..e354bc3 100644 --- a/core/audio/plugin_host/vst2/vst2_plugin_host.cpp +++ b/core/audio/plugin_host/vst2/vst2_plugin_host.cpp @@ -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(Effect->user); } diff --git a/core/extern.h b/core/extern.h index d1ca202..93d09f5 100644 --- a/core/extern.h +++ b/core/extern.h @@ -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 \ No newline at end of file diff --git a/core/misc/singleton/singleton.h b/core/misc/singleton/singleton.h index 6693f30..c7ca432 100644 --- a/core/misc/singleton/singleton.h +++ b/core/misc/singleton/singleton.h @@ -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; } diff --git a/core/window/window_manager.cpp b/core/window/window_manager.cpp index 6d0d5ad..c2d203a 100644 --- a/core/window/window_manager.cpp +++ b/core/window/window_manager.cpp @@ -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::init(initliazer); auto plugin_host = initliazer.require(); diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..8e219d0 --- /dev/null +++ b/update.sh @@ -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 ..