Skip to content

Commit 1a2ab7d

Browse files
committed
convenience change
1 parent c553e33 commit 1a2ab7d

22 files changed

Lines changed: 307 additions & 56 deletions

.github/workflows/cpp-ci-serial-programs-base.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ jobs:
9393
shell: bash
9494
run: |
9595
echo https://github.com/${{github.repository}}/commit/${{github.sha}} > ${{env.UPLOAD_FOLDER}}/version.txt
96+
cp Arduino-Source/controls.txt ${{env.UPLOAD_FOLDER}}
97+
cp Arduino-Source/devices.txt ${{env.UPLOAD_FOLDER}}
98+
cp Arduino-Source/SWITCH1.JSON ${{env.UPLOAD_FOLDER}}
99+
cp Arduino-Source/SWITCH2.JSON ${{env.UPLOAD_FOLDER}}
100+
cp Arduino-Source/SWITCH3.JSON ${{env.UPLOAD_FOLDER}}
101+
96102
97103
- name: Upload Build
98104
uses: actions/upload-artifact@v7
@@ -105,13 +111,14 @@ jobs:
105111
uses: actions/checkout@v6
106112
if: inputs.run-tests
107113
with:
108-
repository: 'PokemonAutomation/CommandLineTests'
114+
repository: 'pifopi/CommandLineTests'
109115
path: 'CommandLineTests'
110116

111117
- name: Run tests (Windows)
112118
if: startsWith(inputs.os, 'windows') && inputs.run-tests
113119
run: |
114120
cd Arduino-Source/SerialPrograms/bin
121+
$env:DISCORD_BOT_TOKEN = "Value"
115122
$process = Start-Process -FilePath "./RelWithDebInfo/SerialPrograms.exe" `
116123
-ArgumentList "--command-line-test-mode --command-line-test-folder ../../../CommandLineTests" `
117124
-NoNewWindow -Wait -PassThru
@@ -124,6 +131,7 @@ jobs:
124131
if: startsWith(inputs.os, 'mac') && inputs.run-tests
125132
run: |
126133
cd Arduino-Source/SerialPrograms/bin
134+
export DISCORD_BOT_TOKEN="Value"
127135
./SerialPrograms.app/Contents/MacOS/SerialPrograms --command-line-test-mode --command-line-test-folder ../../../CommandLineTests
128136
129137
- name: Run clang query

Common/Cpp/Options/KeyboardLayoutOption.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ KeyboardLayoutOption::~KeyboardLayoutOption() = default;
1616
KeyboardLayoutOption::KeyboardLayoutOption(
1717
std::string label,
1818
LockMode lock_while_running,
19-
KeyboardLayout default_value
19+
[[maybe_unused]] KeyboardLayout default_value
2020
)
2121
: EnumDropdownOption<KeyboardLayout>(
2222
std::move(label),
@@ -25,7 +25,7 @@ KeyboardLayoutOption::KeyboardLayoutOption(
2525
{KeyboardLayout::AZERTY, "azerty", "AZERTY"},
2626
},
2727
lock_while_running,
28-
default_value
28+
KeyboardLayout::AZERTY
2929
)
3030
{}
3131

SWITCH1.JSON

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"Audio": {
3+
"AudioVisualization": "FREQ_BARS",
4+
"InputDevice": "{0.0.1.00000000}.{de5d9e50-1404-4567-a0e7-74bb15c4e946}",
5+
"InputFile": "",
6+
"InputFormat": "1 x 96,000 Hz (Interleaved Stereo L/R)",
7+
"OutputDevice": "",
8+
"Volume": 1.0
9+
},
10+
"ConsoleType": "switch1",
11+
"Controller": {
12+
"Interface": "Serial: PABotBase",
13+
"Serial: PABotBase": "COM5"
14+
},
15+
"Overlay": {
16+
"Boxes": true,
17+
"Images": false,
18+
"Log": false,
19+
"Stats": true,
20+
"Text": true
21+
},
22+
"Video": {
23+
"Camera": "\\\\?\\usb#vid_298f&pid_1996&mi_00#7&2bc279a3&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global",
24+
"Resolution": [
25+
1920,
26+
1080
27+
],
28+
"SourceType": "Camera"
29+
}
30+
}

SWITCH2.JSON

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"Audio": {
3+
"AudioVisualization": "FREQ_BARS",
4+
"InputDevice": "{0.0.1.00000000}.{fd7f7974-73d5-483c-af2d-3b3c49a2079e}",
5+
"InputFile": "",
6+
"InputFormat": "1 x 96,000 Hz (Interleaved Stereo L/R)",
7+
"OutputDevice": "",
8+
"Volume": 1.0
9+
},
10+
"ConsoleType": "switch1",
11+
"Controller": {
12+
"Interface": "Serial: PABotBase",
13+
"Serial: PABotBase": "COM8"
14+
},
15+
"Overlay": {
16+
"Boxes": true,
17+
"Images": false,
18+
"Log": false,
19+
"Stats": true,
20+
"Text": true
21+
},
22+
"Video": {
23+
"Camera": "\\\\?\\usb#vid_298f&pid_1996&mi_00#7&2aeecc7b&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global",
24+
"Resolution": [
25+
1920,
26+
1080
27+
],
28+
"SourceType": "Camera"
29+
}
30+
}

SWITCH3.JSON

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"Audio": {
3+
"AudioVisualization": "FREQ_BARS",
4+
"InputDevice": "{0.0.1.00000000}.{de9035fb-150c-4404-846e-e1d759f57557}",
5+
"InputFile": "",
6+
"InputFormat": "1 x 96,000 Hz (Interleaved Stereo L/R)",
7+
"OutputDevice": "",
8+
"Volume": 1.0
9+
},
10+
"ConsoleType": "switch1",
11+
"Controller": {
12+
"Interface": "Serial: PABotBase",
13+
"Serial: PABotBase": "COM7"
14+
},
15+
"Overlay": {
16+
"Boxes": true,
17+
"Images": false,
18+
"Log": false,
19+
"Stats": true,
20+
"Text": true
21+
},
22+
"Video": {
23+
"Camera": "\\\\?\\usb#vid_298f&pid_1996&mi_00#7&20db319&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global",
24+
"Resolution": [
25+
1920,
26+
1080
27+
],
28+
"SourceType": "Camera"
29+
}
30+
}

SerialPrograms/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ set(RESOURCES_DIR "${PACKAGES_DIR}/Resources")
221221
if (NOT EXISTS "${PACKAGES_DIR}")
222222
message(STATUS "Cloning Packages repo at configure time...")
223223
execute_process(
224-
COMMAND git clone --branch master https://github.com/PokemonAutomation/Packages "${PACKAGES_DIR}"
224+
COMMAND git clone --branch master https://github.com/pifopi/Packages "${PACKAGES_DIR}"
225225
WORKING_DIRECTORY "${REPO_ROOT_DIR}"
226226
)
227227
add_custom_target(clone_packages DEPENDS "${PACKAGES_DIR}")

SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ void PreloadSettings::load(const JsonValue& json){
6969
return;
7070
}
7171

72-
// Naughty mode.
73-
obj->read_boolean(NAUGHTY_MODE, "NAUGHTY_MODE");
74-
75-
// Developer mode stuff.
76-
const std::string* dev_token = obj->get_string("DEVELOPER_TOKEN");
77-
if (dev_token){
78-
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha256);
79-
#if QT_VERSION < 0x060700
80-
hash.addData(dev_token->c_str(), (int)dev_token->size());
81-
#else
82-
QByteArrayView dataView(dev_token->data(), dev_token->size());
83-
hash.addData(dataView);
84-
#endif
85-
DEVELOPER_MODE = TOKENS.find(hash.result().toHex().toStdString()) != TOKENS.end();
86-
}
87-
8872
const JsonObject* debug_obj = obj->get_object("DEBUG");
8973
if (debug_obj){
9074
debug_obj->read_boolean(DEBUG.COLOR_CHECK, "COLOR_CHECK");

SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class PreloadSettings{
9393

9494
void load(const JsonValue& json);
9595

96-
bool NAUGHTY_MODE = false;
97-
bool DEVELOPER_MODE = false;
96+
bool NAUGHTY_MODE = true;
97+
bool DEVELOPER_MODE = true;
9898

9999
DebugSettings DEBUG;
100100
};

SerialPrograms/Source/CommonFramework/Notifications/EventNotificationOption.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ EventNotificationOption::~EventNotificationOption(){}
139139
EventNotificationOption::EventNotificationOption(
140140
std::string label,
141141
bool enabled, bool ping,
142-
std::chrono::seconds rate_limit
142+
[[maybe_unused]] std::chrono::seconds rate_limit
143143
)
144144
: StaticTableRow(label)
145-
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, rate_limit)
145+
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, std::chrono::seconds(0))
146146
, m_test_button(*this)
147147
{
148148
add_option(m_data->m_enabled, "Enabled");
@@ -159,10 +159,10 @@ EventNotificationOption::EventNotificationOption(
159159
std::string label,
160160
bool enabled, bool ping,
161161
std::vector<std::string> tags,
162-
std::chrono::seconds rate_limit
162+
[[maybe_unused]] std::chrono::seconds rate_limit
163163
)
164164
: StaticTableRow(label)
165-
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, std::move(tags), rate_limit)
165+
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, std::move(tags), std::chrono::seconds(0))
166166
, m_test_button(*this)
167167
{
168168
add_option(m_data->m_enabled, "Enabled");
@@ -180,10 +180,10 @@ EventNotificationOption::EventNotificationOption(
180180
bool enabled, bool ping,
181181
ImageAttachmentMode screenshot,
182182
std::vector<std::string> tags,
183-
std::chrono::seconds rate_limit
183+
[[maybe_unused]] std::chrono::seconds rate_limit
184184
)
185185
: StaticTableRow(label)
186-
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, screenshot, std::move(tags), rate_limit)
186+
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, screenshot, std::move(tags), std::chrono::seconds(0))
187187
, m_test_button(*this)
188188
{
189189
add_option(m_data->m_enabled, "Enabled");

SerialPrograms/Source/CommonFramework/VideoPipeline/Backends/CameraWidgetQt6.5.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,18 @@ std::string CameraBackend::get_camera_name(const CameraInfo& info) const{
5454
#endif
5555
for (const auto& camera : cameras){
5656
if (camera.id().toStdString() == info.device_name()){
57-
return camera.description().toStdString();
57+
QByteArray camera1 = QByteArray("\\\\?\\usb#vid_298f&pid_1996&mi_00#7&2bc279a3&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global");
58+
QByteArray camera2 = QByteArray("\\\\?\\usb#vid_298f&pid_1996&mi_00#7&2aeecc7b&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global");
59+
QByteArray camera3 = QByteArray("\\\\?\\usb#vid_298f&pid_1996&mi_00#7&20db319&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global");
60+
if (camera.id() == camera1){
61+
return "ShadowCast Video 1";
62+
}else if (camera.id() == camera2){
63+
return "ShadowCast Video 2";
64+
}else if (camera.id() == camera3){
65+
return "ShadowCast Video 3";
66+
}else{
67+
return camera.description().toStdString();
68+
}
5869
}
5970
}
6071
std::cout << "Error: no such camera for CameraInfo: " << info.device_name() << std::endl;

0 commit comments

Comments
 (0)