Misc small clean ups and fixes

pull/604/head
jackun 3 years ago
parent a82e27d978
commit 355c521f12
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -365,7 +365,7 @@ bool dbus_manager::dbus_list_name_to_owner() {
return false;
}
iter.array_for_each_value<std::string>([&](std::string name) {
if (!starts_with(name.c_str(), "org.mpris.MediaPlayer2.")) return;
if (!starts_with(name, "org.mpris.MediaPlayer2.")) return;
std::string owner;
if (dbus_get_name_owner(dbus_mgr, owner, name.c_str())) {
m_name_owners[name] = owner;

@ -27,7 +27,7 @@ template <class T>
const int dbus_type_identifier = dbus_type_traits<T>().value;
template <class T>
const bool is_fixed = dbus_type_traits<T>().is_fiexd;
const bool is_fixed = dbus_type_traits<T>().is_fixed;
} // namespace detail
class DBusMessageIter_wrap {

@ -7,6 +7,9 @@
#include "string_utils.h"
#include <IconsForkAwesome.h>
#define CHAR_CELSIUS "\xe2\x84\x83"
#define CHAR_FAHRENHEIT "\xe2\x84\x89"
// Cut from https://github.com/ocornut/imgui/pull/2943
// Probably move to ImGui
float SRGBToLinear(float in)
@ -487,6 +490,9 @@ void HudElements::frame_timing(){
void HudElements::media_player(){
#ifdef HAVE_DBUS
if (!HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_media_player])
return;
ImGui::TableNextRow(); ImGui::TableNextColumn();
uint32_t f_idx = (HUDElements.sw_stats->n_frames - 1) % ARRAY_SIZE(HUDElements.sw_stats->frames_stats);
uint64_t frame_timing = HUDElements.sw_stats->frames_stats[f_idx].stats[OVERLAY_PLOTS_frame_timing];
@ -744,9 +750,9 @@ void HudElements::graphs(){
ImGui::PopStyleColor(1);
}
void HudElements::sort_elements(std::pair<std::string, std::string> option){
auto param = option.first;
auto value = option.second;
void HudElements::sort_elements(const std::pair<std::string, std::string>& option){
const auto& param = option.first;
const auto& value = option.second;
// Use this to always add to front of vector
//ordered_functions.insert(ordered_functions.begin(),std::make_pair(param,value));

@ -25,12 +25,12 @@ class HudElements{
std::vector<std::pair<std::string, std::string>> options;
std::vector<std::pair<void(*)(), std::string >> ordered_functions;
int min, max, gpu_core_max, gpu_mem_max, cpu_temp_max, gpu_temp_max;
std::vector<std::string> permitted_params = {
const std::vector<std::string> permitted_params = {
"gpu_load", "cpu_load", "gpu_core_clock", "gpu_mem_clock",
"vram", "ram", "cpu_temp", "gpu_temp"
};
std::vector<exec_list> exec_list;
void sort_elements(std::pair<std::string, std::string> option);
void sort_elements(const std::pair<std::string, std::string>& option);
void legacy_elements();
void update_exec();
static void version();

@ -215,9 +215,6 @@ static void unmap_object(uint64_t obj)
/**/
#define CHAR_CELSIUS "\xe2\x84\x83"
#define CHAR_FAHRENHEIT "\xe2\x84\x89"
static void shutdown_swapchain_font(struct swapchain_data*);
static VkLayerInstanceCreateInfo *get_instance_chain_info(const VkInstanceCreateInfo *pCreateInfo,

Loading…
Cancel
Save