diff --git a/src/InputController.cpp b/src/InputController.cpp index 6f0d79e..ca2add6 100644 --- a/src/InputController.cpp +++ b/src/InputController.cpp @@ -87,6 +87,7 @@ void InputController::handle_keyboard_event(int key, int scancode, int action, i GLFW_KEYBOARD_TO_GAMEPAD(GLFW_KEY_B, GLFW_GAMEPAD_BUTTON_B); GLFW_KEYBOARD_TO_GAMEPAD(GLFW_KEY_X, GLFW_GAMEPAD_BUTTON_X); GLFW_KEYBOARD_TO_GAMEPAD(GLFW_KEY_Y, GLFW_GAMEPAD_BUTTON_Y); + GLFW_KEYBOARD_TO_GAMEPAD(GLFW_KEY_ESCAPE, GLFW_GAMEPAD_BUTTON_START); glfw_gamepad_state.axes[GLFW_GAMEPAD_AXIS_LEFT_TRIGGER] = glfw_keyboard_state[GLFW_KEY_Z] ? 1 : -1; glfw_gamepad_state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER] = glfw_keyboard_state[GLFW_KEY_C] ? 1 : -1; diff --git a/src/Settings.cpp b/src/Settings.cpp index ee26c71..0d13b22 100644 --- a/src/Settings.cpp +++ b/src/Settings.cpp @@ -54,6 +54,13 @@ void Settings::add_host(const std::string address) { } } +void Settings::remove_host(const std::string address) { + if (std::find(m_hosts.begin(), m_hosts.end(), address) != m_hosts.end()) { + m_hosts.erase(std::remove(m_hosts.begin(), m_hosts.end(), address), m_hosts.end()); + save(); + } +} + void Settings::load() { json_t* root = json_load_file((m_working_dir + "/settings.json").c_str(), 0, NULL); diff --git a/src/Settings.hpp b/src/Settings.hpp index 938f838..e8b8fd6 100644 --- a/src/Settings.hpp +++ b/src/Settings.hpp @@ -36,6 +36,7 @@ public: } void add_host(const std::string address); + void remove_host(const std::string address); int resolution() const { return m_resolution; diff --git a/src/libgamestream/http.cpp b/src/libgamestream/http.cpp index 274359b..4c90f78 100644 --- a/src/libgamestream/http.cpp +++ b/src/libgamestream/http.cpp @@ -81,7 +81,7 @@ int http_init(const char* key_directory) { } int http_request(char* url, Data* data, HTTPRequestTimeout timeout) { - Logger::info("Curl", "Request %s", url); + Logger::info("Curl", "Request:\n%s", url); HTTP_DATA* http_data = (HTTP_DATA*)malloc(sizeof(HTTP_DATA)); http_data->memory = (char*)malloc(1); diff --git a/src/streaming/audio/AudrenAudioRenderer.cpp b/src/streaming/audio/AudrenAudioRenderer.cpp index e67ed8c..a5b6233 100644 --- a/src/streaming/audio/AudrenAudioRenderer.cpp +++ b/src/streaming/audio/AudrenAudioRenderer.cpp @@ -143,7 +143,6 @@ ssize_t AudrenAudioRenderer::free_wavebuf_index() { return i; } } - Logger::error("Audren", "No free wavebuf"); return -1; } @@ -189,14 +188,14 @@ size_t AudrenAudioRenderer::append_audio(const void *buf, size_t size) { } void AudrenAudioRenderer::write_audio(const void *buf, size_t size) { - if (m_inited_driver) { + if (!m_inited_driver) { Logger::fatal("Audren", "Call write_audio without init driver!"); return; } size_t written = 0; - while(written < size) { + while (written < size) { written += append_audio(buf + written, size - written); if (written != size) { diff --git a/src/ui/Application.cpp b/src/ui/Application.cpp index c9f2a87..22af449 100644 --- a/src/ui/Application.cpp +++ b/src/ui/Application.cpp @@ -86,7 +86,7 @@ void Application::gamepad_button_callback_event(int jid, int button, int action) m_windows.back()->gamepad_button_event(jid, button, action); } - if (action && button == NANOGUI_GAMEPAD_BUTTON_START) { + if (action && button == NANOGUI_GAMEPAD_BUTTON_START && m_windows.size() == 1) { moonlight_exit = 1; } } diff --git a/src/ui/windows/LogsWindow.cpp b/src/ui/windows/LogsWindow.cpp index 3b40731..ed2e24a 100644 --- a/src/ui/windows/LogsWindow.cpp +++ b/src/ui/windows/LogsWindow.cpp @@ -27,13 +27,28 @@ void LogsWindow::reload() { if (data.is_empty()) { auto label = container()->add