1. 优化内存池
2. 延迟补偿功能完成 3. 优化内存布局
This commit is contained in:
parent
0ff79d10be
commit
ee9c18edd3
@ -2,6 +2,7 @@
|
||||
|
||||
#include "window/window_manager.h"
|
||||
#include "imgui.h"
|
||||
#include "imgui_main.h"
|
||||
#include "widget/widgets.h"
|
||||
#include "audio/plugin_host/plugin_host_manager.h"
|
||||
#include "audio/plugin_host/plugin_host.h"
|
||||
@ -17,9 +18,7 @@ void configure_imgui(ImGuiIO& io) {
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
|
||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
|
||||
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows
|
||||
io.ConfigViewportsNoAutoMerge = true;
|
||||
// io.ConfigFlags |= ImGuiConfigFlags_DpiEnableScaleFonts; // Enable DPI scaling
|
||||
// io.ConfigFlags |= ImGuiConfigFlags_DpiEnableScaleViewports; // Enable DPI scaling
|
||||
io.ConfigViewportsNoAutoMerge = false;
|
||||
|
||||
// Setup Dear ImGui style
|
||||
ImGui::StyleColorsClassic();
|
||||
@ -29,7 +28,7 @@ void configure_imgui(ImGuiIO& io) {
|
||||
// ImGui::StyleColorsDark();
|
||||
//ImGui::StyleColorsLight();
|
||||
// get dpi scale
|
||||
float dpi_scale = 1.5f;
|
||||
float dpi_scale = get_dpi_scale();
|
||||
|
||||
// Load Fonts
|
||||
// - If no fonts are loaded, dear imgui will use the default font. You can also load multiple fonts and use ImGui::PushFont()/PopFont() to select them.
|
||||
@ -46,7 +45,7 @@ void configure_imgui(ImGuiIO& io) {
|
||||
//io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f);
|
||||
//ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, nullptr, io.Fonts->GetGlyphRangesJapanese());
|
||||
//IM_ASSERT(font != nullptr);
|
||||
auto font = io.Fonts->AddFontFromFileTTF("resources/GenJyuuGothic-Normal-2.ttf", 18.f * dpi_scale);
|
||||
io.Fonts->AddFontFromFileTTF("resources/GenJyuuGothic-Normal-2.ttf", 18.f * dpi_scale);
|
||||
}
|
||||
|
||||
void draw_imgui(float delta_time) {
|
||||
|
@ -59,7 +59,7 @@ void draw_mixer_track(mixer_track* track) {
|
||||
|
||||
ImGui::BeginGroup();
|
||||
window->DC.CurrLineTextBaseOffset = 0;
|
||||
ImGui::Text(track_label.c_str());
|
||||
ImGui::Text("%s", track_label.c_str());
|
||||
|
||||
float widget_height = ImGui::GetContentRegionAvail().y;
|
||||
const ImVec2 slider_size = ImGui::CalcItemSize(ImVec2(25, widget_height), 25, widget_height);
|
||||
@ -68,7 +68,7 @@ void draw_mixer_track(mixer_track* track) {
|
||||
track->set_volume(volume);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
draw_volume_bar(track->get_uid(), widget_height, track->get_ui_buffers());
|
||||
draw_volume_bar(track->get_uid(), widget_height, track->get_ui_buffer());
|
||||
ImGui::EndGroup();
|
||||
if (ImGui::IsItemClicked(ImGuiMouseButton_Left)) {
|
||||
get_mixer()->selected_track = track;
|
||||
@ -279,7 +279,8 @@ bool vertical_volume_slider(const char* id, ImVec2 size, float* volume, float mi
|
||||
void draw_mixer_track_effect_list(mixer_track* track) {
|
||||
ImGui::Begin("TrackEffects");
|
||||
if (track) {
|
||||
for (auto effect: track->effects) {
|
||||
const auto& effects = track->get_effects();
|
||||
for (auto effect : effects) {
|
||||
draw_mixer_track_effect(effect);
|
||||
ImGui::SameLine();
|
||||
draw_volume_bar(effect->get_uid(), 100, *effect->ui_buffers);
|
||||
|
@ -13,6 +13,7 @@ class plugin_host;
|
||||
inline float volume_bar_peak_duration = 1.0f;
|
||||
inline float volume_bar_peak_decay = 0.2f;
|
||||
inline constexpr float volume_bar_inf = 0.0001f;
|
||||
inline mixer_track* selected_track = nullptr;
|
||||
|
||||
inline float mapping(float value, float in_min, float in_max, float out_min, float out_max) {
|
||||
return (value - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||
|
Loading…
x
Reference in New Issue
Block a user