Skip to content

Commit c62ae24

Browse files
committed
audio only feedback type, rename program
1 parent b5c2e2d commit c62ae24

File tree

7 files changed

+33
-27
lines changed

7 files changed

+33
-27
lines changed

SerialPrograms/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,8 +1293,8 @@ file(GLOB MAIN_SOURCES
12931293
Source/PokemonLA/Resources/PokemonLA_WeatherAndTimeIcons.h
12941294
Source/PokemonRSE/Inference/Sounds/PokemonRSE_ShinySoundDetector.cpp
12951295
Source/PokemonRSE/Inference/Sounds/PokemonRSE_ShinySoundDetector.h
1296-
Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_StarterReset.cpp
1297-
Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_StarterReset.h
1296+
Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_AudioStarterReset.cpp
1297+
Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_AudioStarterReset.h
12981298
Source/PokemonRSE/Programs/TestPrograms/PokemonRSE_SoundListener.cpp
12991299
Source/PokemonRSE/Programs/TestPrograms/PokemonRSE_SoundListener.h
13001300
Source/PokemonRSE/PokemonRSE_Navigation.cpp

SerialPrograms/Source/CommonFramework/Globals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ enum class FeedbackType{
6969
NONE,
7070
OPTIONAL_, // Naming conflict with macro.
7171
REQUIRED,
72+
AUDIO,
7273
VIDEO_AUDIO,
7374
};
7475

SerialPrograms/Source/CommonFramework/Panels/UI/PanelElements.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ CollapsibleGroupBox* make_panel_header(
8181
header
8282
);
8383
break;
84+
case FeedbackType::AUDIO:
85+
text = new QLabel(
86+
"<font color=\"green\">(This program requires audio feedback. Please make sure you choose the correct audio device.)</font>",
87+
header
88+
);
89+
break;
8490
case FeedbackType::VIDEO_AUDIO:
8591
text = new QLabel(
8692
"<font color=\"green\">(This program requires video and audio feedback. Please make sure you choose the correct capture device, as well as the correct audio device.)</font>",

SerialPrograms/Source/PokemonRSE/PokemonRSE_Panels.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include "PokemonRSE_Settings.h"
1212

13-
#include "Programs/ShinyHunting/PokemonRSE_StarterReset.h"
13+
#include "Programs/ShinyHunting/PokemonRSE_AudioStarterReset.h"
1414
#include "Programs/TestPrograms/PokemonRSE_SoundListener.h"
1515

1616
namespace PokemonAutomation{
@@ -20,7 +20,7 @@ namespace PokemonRSE{
2020

2121

2222
PanelListFactory::PanelListFactory()
23-
: PanelListDescriptor("Pokemon Ruby, Sapphire, and Emerald")
23+
: PanelListDescriptor("Pokemon Ruby and Sapphire, Pokemon Emerald")
2424
{}
2525

2626
std::vector<PanelEntry> PanelListFactory::make_panels() const{
@@ -35,8 +35,8 @@ std::vector<PanelEntry> PanelListFactory::make_panels() const{
3535

3636

3737
if (PreloadSettings::instance().DEVELOPER_MODE){
38-
ret.emplace("---- WIP: Shiny Hunting (Audio only) ----");
39-
ret.emplace_back(make_single_switch_program<StarterReset_Descriptor, StarterReset>());
38+
ret.emplace_back("---- WIP: Shiny Hunting (Audio only) ----");
39+
ret.emplace_back(make_single_switch_program<AudioStarterReset_Descriptor, AudioStarterReset>());
4040

4141
ret.emplace_back("---- Developer Tools ----");
4242
ret.emplace_back(make_single_switch_program<SoundListener_Descriptor, SoundListener>());

SerialPrograms/Source/PokemonRSE/PokemonRSE_Settings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ GameSettings::GameSettings()
4545
, SHINY_SOUND_THRESHOLD(
4646
"<b>Shiny Sound Threshold:</b><br>Maximum error coefficient to trigger a shiny detection.",
4747
LockMode::LOCK_WHILE_RUNNING,
48-
0.87, 0, 1.0
48+
0.97, 0, 1.0
4949
)
5050
, SHINY_SOUND_LOW_FREQUENCY(
5151
"<b>Shiny Sound Low Frequency (Hz):</b><br>High pass filter frequency for shiny sound.",

SerialPrograms/Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_StarterReset.cpp renamed to SerialPrograms/Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_AudioStarterReset.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,25 @@
1414
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.h"
1515
#include "PokemonRSE/Inference/Sounds/PokemonRSE_ShinySoundDetector.h"
1616
#include "PokemonRSE/PokemonRSE_Navigation.h"
17-
#include "PokemonRSE_StarterReset.h"
17+
#include "PokemonRSE_AudioStarterReset.h"
1818

1919
namespace PokemonAutomation{
2020
namespace NintendoSwitch{
2121
namespace PokemonRSE{
2222

23-
StarterReset_Descriptor::StarterReset_Descriptor()
23+
AudioStarterReset_Descriptor::AudioStarterReset_Descriptor()
2424
: SingleSwitchProgramDescriptor(
25-
"PokemonRSE:StarterReset",
26-
"Pokemon RSE", "Starter Reset",
27-
"ComputerControl/blob/master/Wiki/Programs/PokemonRSE/StarterReset.md",
28-
"(Audio only) Soft reset for a shiny starter. WIP, audio recognition does not work well.",
29-
//FeedbackType::VIDEO_AUDIO,
30-
FeedbackType::NONE,
25+
"PokemonRSE:AudioStarterReset",
26+
"Pokemon RSE", "[RS] Starter Reset - Audio only",
27+
"ComputerControl/blob/master/Wiki/Programs/PokemonRSE/AudioStarterReset.md",
28+
"Soft reset for a shiny starter. Ruby and Sapphire only. WIP, audio recognition does not work well.",
29+
FeedbackType::AUDIO,
3130
AllowCommandsWhenRunning::DISABLE_COMMANDS,
3231
PABotBaseLevel::PABOTBASE_12KB
3332
)
3433
{}
3534

36-
struct StarterReset_Descriptor::Stats : public StatsTracker{
35+
struct AudioStarterReset_Descriptor::Stats : public StatsTracker{
3736
Stats()
3837
: resets(m_stats["Resets"])
3938
, poochyena(m_stats["Shiny Poochyena"])
@@ -47,11 +46,11 @@ struct StarterReset_Descriptor::Stats : public StatsTracker{
4746
std::atomic<uint64_t>& poochyena;
4847
std::atomic<uint64_t>& shinystarter;
4948
};
50-
std::unique_ptr<StatsTracker> StarterReset_Descriptor::make_stats() const{
49+
std::unique_ptr<StatsTracker> AudioStarterReset_Descriptor::make_stats() const{
5150
return std::unique_ptr<StatsTracker>(new Stats());
5251
}
5352

54-
StarterReset::StarterReset()
53+
AudioStarterReset::AudioStarterReset()
5554
: TARGET(
5655
"<b>Starter:</b><br>",
5756
{
@@ -96,9 +95,9 @@ StarterReset::StarterReset()
9695
PA_ADD_OPTION(NOTIFICATIONS);
9796
}
9897

99-
void StarterReset::program(SingleSwitchProgramEnvironment& env, BotBaseContext& context){
98+
void AudioStarterReset::program(SingleSwitchProgramEnvironment& env, BotBaseContext& context){
10099
//assert_16_9_720p_min(env.logger(), env.console);
101-
StarterReset_Descriptor::Stats& stats = env.current_stats<StarterReset_Descriptor::Stats>();
100+
AudioStarterReset_Descriptor::Stats& stats = env.current_stats<AudioStarterReset_Descriptor::Stats>();
102101

103102
/*
104103
* Settings: Text Speed fast.
@@ -133,7 +132,7 @@ void StarterReset::program(SingleSwitchProgramEnvironment& env, BotBaseContext&
133132
default:
134133
OperationFailedException::fire(
135134
env.console, ErrorReport::SEND_ERROR_REPORT,
136-
"StarterReset: Invalid target."
135+
"AudioStarterReset: Invalid target."
137136
);
138137
break;
139138
}

SerialPrograms/Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_StarterReset.h renamed to SerialPrograms/Source/PokemonRSE/Programs/ShinyHunting/PokemonRSE_AudioStarterReset.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*
55
*/
66

7-
#ifndef PokemonAutomation_PokemonRSE_StarterReset_H
8-
#define PokemonAutomation_PokemonRSE_StarterReset_H
7+
#ifndef PokemonAutomation_PokemonRSE_AudioStarterReset_H
8+
#define PokemonAutomation_PokemonRSE_AudioStarterReset_H
99

1010
#include "Common/Cpp/Options/SimpleIntegerOption.h"
1111
#include "Common/Cpp/Options/TimeExpressionOption.h"
@@ -16,16 +16,16 @@ namespace PokemonAutomation{
1616
namespace NintendoSwitch{
1717
namespace PokemonRSE{
1818

19-
class StarterReset_Descriptor : public SingleSwitchProgramDescriptor{
19+
class AudioStarterReset_Descriptor : public SingleSwitchProgramDescriptor{
2020
public:
21-
StarterReset_Descriptor();
21+
AudioStarterReset_Descriptor();
2222
struct Stats;
2323
virtual std::unique_ptr<StatsTracker> make_stats() const override;
2424
};
2525

26-
class StarterReset : public SingleSwitchProgramInstance{
26+
class AudioStarterReset : public SingleSwitchProgramInstance{
2727
public:
28-
StarterReset();
28+
AudioStarterReset();
2929
virtual void program(SingleSwitchProgramEnvironment& env, BotBaseContext& context) override;
3030

3131
private:

0 commit comments

Comments
 (0)