**SUBMODULE UPDATE - PLEASE READ!**
as of now I have added the Date library as a submodule in order to have log messages in the correct time zone please update your submodules by doing: ``` git submodule update --init --recursive ```
This commit is contained in:
parent
6b627ab885
commit
552967246d
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -22,3 +22,6 @@
|
||||||
[submodule "extern/Nuked-OPL3"]
|
[submodule "extern/Nuked-OPL3"]
|
||||||
path = extern/Nuked-OPL3
|
path = extern/Nuked-OPL3
|
||||||
url = https://github.com/nukeykt/Nuked-OPL3.git
|
url = https://github.com/nukeykt/Nuked-OPL3.git
|
||||||
|
[submodule "extern/date"]
|
||||||
|
path = extern/date
|
||||||
|
url = https://github.com/HowardHinnant/date
|
||||||
|
|
|
@ -42,6 +42,7 @@ option(SYSTEM_LIBSNDFILE "Use a system-installed version of libsndfile instead o
|
||||||
option(SYSTEM_RTMIDI "Use a system-installed version of RtMidi instead of the vendored one" OFF)
|
option(SYSTEM_RTMIDI "Use a system-installed version of RtMidi instead of the vendored one" OFF)
|
||||||
option(SYSTEM_ZLIB "Use a system-installed version of zlib instead of the vendored one" OFF)
|
option(SYSTEM_ZLIB "Use a system-installed version of zlib instead of the vendored one" OFF)
|
||||||
option(SYSTEM_SDL2 "Use a system-installed version of SDL2 instead of the vendored one" ${SYSTEM_SDL2_DEFAULT})
|
option(SYSTEM_SDL2 "Use a system-installed version of SDL2 instead of the vendored one" ${SYSTEM_SDL2_DEFAULT})
|
||||||
|
option(SYSTEM_DATE "Use a system-installed version of Date instead of the vendored one" OFF)
|
||||||
option(WARNINGS_ARE_ERRORS "Whether warnings in furnace's C++ code should be treated as errors" OFF)
|
option(WARNINGS_ARE_ERRORS "Whether warnings in furnace's C++ code should be treated as errors" OFF)
|
||||||
|
|
||||||
set(DEPENDENCIES_INCLUDE_DIRS "")
|
set(DEPENDENCIES_INCLUDE_DIRS "")
|
||||||
|
@ -126,6 +127,24 @@ if (USE_RTMIDI)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (SYSTEM_DATE)
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(HHDATE REQUIRED date)
|
||||||
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS ${HHDATE_INCLUDE_DIRS})
|
||||||
|
list(APPEND DEPENDENCIES_COMPILE_OPTIONS ${HHDATE_CFLAGS_OTHER})
|
||||||
|
list(APPEND DEPENDENCIES_LIBRARIES ${HHDATE_LIBRARIES})
|
||||||
|
list(APPEND DEPENDENCIES_LIBRARY_DIRS ${HHDATE_LIBRARY_DIRS})
|
||||||
|
list(APPEND DEPENDENCIES_LINK_OPTIONS ${HHDATE_LDFLAGS_OTHER})
|
||||||
|
list(APPEND DEPENDENCIES_LEGACY_LDFLAGS ${HHDATE_LDFLAGS})
|
||||||
|
message(STATUS "Using system-installed Date")
|
||||||
|
else()
|
||||||
|
set(BUILD_TZ_LIB ON CACHE BOOL "build/install of TZ library" FORCE)
|
||||||
|
add_subdirectory(extern/date EXCLUDE_FROM_ALL)
|
||||||
|
list(APPEND DEPENDENCIES_INCLUDE_DIRS extern/date/include)
|
||||||
|
list(APPEND DEPENDENCIES_LIBRARIES date date-tz)
|
||||||
|
message(STATUS "Using vendored Date")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (SYSTEM_ZLIB)
|
if (SYSTEM_ZLIB)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(ZLIB REQUIRED zlib)
|
pkg_check_modules(ZLIB REQUIRED zlib)
|
||||||
|
|
1
extern/date
vendored
Submodule
1
extern/date
vendored
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 9ea5654c1206e19245dc21d8a2c433e090c8c3f5
|
|
@ -3439,7 +3439,8 @@ FurnaceGUI::FurnaceGUI():
|
||||||
openSampleFilterOpt(false),
|
openSampleFilterOpt(false),
|
||||||
oscTotal(0),
|
oscTotal(0),
|
||||||
oscZoom(0.5f),
|
oscZoom(0.5f),
|
||||||
oscZoomSlider(false) {
|
oscZoomSlider(false),
|
||||||
|
followLog(true) {
|
||||||
// value keys
|
// value keys
|
||||||
valueKeys[SDLK_0]=0;
|
valueKeys[SDLK_0]=0;
|
||||||
valueKeys[SDLK_1]=1;
|
valueKeys[SDLK_1]=1;
|
||||||
|
|
|
@ -1003,6 +1003,9 @@ class FurnaceGUI {
|
||||||
// visualizer
|
// visualizer
|
||||||
float keyHit[DIV_MAX_CHANS];
|
float keyHit[DIV_MAX_CHANS];
|
||||||
int lastIns[DIV_MAX_CHANS];
|
int lastIns[DIV_MAX_CHANS];
|
||||||
|
|
||||||
|
// log window
|
||||||
|
bool followLog;
|
||||||
|
|
||||||
void drawSSGEnv(unsigned char type, const ImVec2& size);
|
void drawSSGEnv(unsigned char type, const ImVec2& size);
|
||||||
void drawWaveform(unsigned char type, bool opz, const ImVec2& size);
|
void drawWaveform(unsigned char type, bool opz, const ImVec2& size);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
#include "../ta-log.h"
|
#include "../ta-log.h"
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <imgui.h>
|
#include "date/tz.h"
|
||||||
|
|
||||||
const char* logLevels[5]={
|
const char* logLevels[5]={
|
||||||
"ERROR",
|
"ERROR",
|
||||||
|
@ -27,8 +27,11 @@ void FurnaceGUI::drawLog() {
|
||||||
}
|
}
|
||||||
if (!logOpen) return;
|
if (!logOpen) return;
|
||||||
if (ImGui::Begin("Log Viewer",&logOpen)) {
|
if (ImGui::Begin("Log Viewer",&logOpen)) {
|
||||||
|
ImGui::Checkbox("Follow",&followLog);
|
||||||
|
ImGui::SameLine();
|
||||||
ImGui::Text("Level");
|
ImGui::Text("Level");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
ImGui::Combo("##LogLevel",&logLevel,logLevels,5);
|
ImGui::Combo("##LogLevel",&logLevel,logLevels,5);
|
||||||
if (ImGui::BeginTable("LogView",3,ImGuiTableFlags_ScrollY|ImGuiTableFlags_BordersInnerV)) {
|
if (ImGui::BeginTable("LogView",3,ImGuiTableFlags_ScrollY|ImGuiTableFlags_BordersInnerV)) {
|
||||||
ImGui::PushFont(patFont);
|
ImGui::PushFont(patFont);
|
||||||
|
@ -53,17 +56,21 @@ void FurnaceGUI::drawLog() {
|
||||||
const LogEntry& logEntry=logEntries[(pos+i)&(TA_LOG_SIZE-1)];
|
const LogEntry& logEntry=logEntries[(pos+i)&(TA_LOG_SIZE-1)];
|
||||||
if (!logEntry.ready) continue;
|
if (!logEntry.ready) continue;
|
||||||
if (logLevel<logEntry.loglevel) continue;
|
if (logLevel<logEntry.loglevel) continue;
|
||||||
ssize_t t=std::chrono::time_point_cast<std::chrono::seconds>(logEntry.time).time_since_epoch().count();
|
String t=date::format("%T",date::make_zoned(date::current_zone(),date::floor<std::chrono::seconds>(logEntry.time)));
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
// this will fail on 32-bit :<
|
// this will fail on 32-bit :<
|
||||||
ImGui::Text("%02ld:%02ld:%02ld",(t/3600)%24,(t/60)%60,t%60);
|
ImGui::TextUnformatted(t.c_str());
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::TextColored(uiColors[logColors[logEntry.loglevel]],"%s",logLevels[logEntry.loglevel]);
|
ImGui::TextColored(uiColors[logColors[logEntry.loglevel]],"%s",logLevels[logEntry.loglevel]);
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::TextWrapped("%s",logEntry.text.c_str());
|
ImGui::TextWrapped("%s",logEntry.text.c_str());
|
||||||
}
|
}
|
||||||
ImGui::PopFont();
|
ImGui::PopFont();
|
||||||
|
|
||||||
|
if (followLog) {
|
||||||
|
ImGui::SetScrollY(ImGui::GetScrollMaxY());
|
||||||
|
}
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue