Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/host-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
g++ libjansson-dev libcurl4-openssl-dev libsrtp2-dev libusrsctp-dev \
libavcodec-dev libavutil-dev libmbedtls-dev python3 openssl cmake
libavcodec-dev libavutil-dev libmbedtls-dev python3 openssl cmake pkg-config

- name: Run host regression tests
run: bash scripts/test-host.sh
4 changes: 2 additions & 2 deletions app/src/StreamView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ void StreamView::draw(NVGcontext* vg, float x, float y, float width, float heigh
}

if (touch_down) {
const int stream_width = std::max(1, session_->stream_width());
const int stream_height = std::max(1, session_->stream_height());
const int stream_width = std::max(1, session_->negotiated_stream_width());
const int stream_height = std::max(1, session_->negotiated_stream_height());
const auto target = opennow::input::MapTouchToStream(
touch_position.x, touch_position.y, x, y, width, height,
stream_width, stream_height);
Expand Down
20 changes: 20 additions & 0 deletions app/src/keyboard_input_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ enum class KeyboardShortcut
WindowsExplorer,
WindowsRun,
WindowsTaskView,
Backspace,
Delete,
ArrowLeft,
ArrowRight,
};

struct KeyboardShortcutControl
Expand All @@ -44,6 +48,18 @@ inline constexpr std::array<KeyboardShortcutControl, 8> kKeyboardShortcutControl
{KeyboardShortcut::WindowsTaskView, "Win + Tab", "MINUS + DOWN"},
}};

inline constexpr auto kKeyboardTouchControls = [] {
std::array<KeyboardShortcutControl, kKeyboardShortcutControls.size() + 4> controls {};
std::size_t index = 0;
for (const auto& control : kKeyboardShortcutControls)
controls[index++] = control;
controls[index++] = {KeyboardShortcut::Backspace, "Bksp", "TAP"};
controls[index++] = {KeyboardShortcut::Delete, "Del", "TAP"};
controls[index++] = {KeyboardShortcut::ArrowLeft, "Left", "TAP"};
controls[index] = {KeyboardShortcut::ArrowRight, "Right", "TAP"};
return controls;
}();

inline int PollKeyboardShortcut(std::uint16_t buttons, bool& latched)
{
const bool was_latched = latched;
Expand Down Expand Up @@ -71,6 +87,10 @@ inline KeyboardStroke MapKeyboardShortcut(KeyboardShortcut shortcut)
case KeyboardShortcut::WindowsExplorer: return {'E', 0x12, kMeta};
case KeyboardShortcut::WindowsRun: return {'R', 0x13, kMeta};
case KeyboardShortcut::WindowsTaskView: return {0x09, 0x0f, kMeta};
case KeyboardShortcut::Backspace: return {0x08, 0x0e, 0};
case KeyboardShortcut::Delete: return {0x2e, 0x53, 0};
case KeyboardShortcut::ArrowLeft: return {0x25, 0x4b, 0};
case KeyboardShortcut::ArrowRight: return {0x27, 0x4d, 0};
}

return {};
Expand Down
1 change: 1 addition & 0 deletions app/src/settings_tab.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class SettingsTab : public brls::Box
bool ToggleControllerLayout(brls::View* view);
bool ToggleAudio(brls::View* view);
bool CycleAudioVolume(brls::View* view);
bool CycleQueueNotifyThreshold(brls::View* view);
bool ChooseInterfaceLanguage(brls::View* view);
bool ShowHomeScreenHelp(brls::View* view);

Expand Down
13 changes: 13 additions & 0 deletions app/src/settings_tab_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,4 +578,17 @@ bool SettingsTab::CycleAudioVolume(brls::View* view)
return true;
}

bool SettingsTab::CycleQueueNotifyThreshold(brls::View* view)
{
(void)view;
constexpr int thresholds[] = {5, 10, 20, 50};
int next = thresholds[0];
for (int v : thresholds) {
if (v > draft_settings_.queue_notify_threshold) { next = v; break; }
}
draft_settings_.queue_notify_threshold = next;
MarkDirty();
return true;
}

} // namespace opennow
5 changes: 5 additions & 0 deletions app/src/settings_tab_pages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ void SettingsTab::BuildAppPage()
: std::string("Disabled");
},
[this](brls::View* view) { return ToggleStatsOverlay(view); }));
interface->addView(MakeOptionRow(
"Queue notify at",
"When minimized, pop a reminder when queue drops to this position. Choose 5, 10, 20 or 50.",
[this] { return std::to_string(draft_settings_.queue_notify_threshold); },
[this](brls::View* view) { return CycleQueueNotifyThreshold(view); }));
content_container_->addView(interface);

auto* shortcuts = MakeSection(
Expand Down
Loading
Loading