iidx: option to disable recording function (#445)

## Link to GitHub Issue, if one exists
#442 

## Description of change
Adds a new option that intentionally fails the recording functionality.

## Testing
Tested on iidx32.
This commit is contained in:
bicarus-dev
2025-12-11 22:03:51 -08:00
committed by GitHub
parent 6856a0950c
commit c3428236f8
5 changed files with 26 additions and 1 deletions
@@ -27,6 +27,8 @@ static BOOL new_preset_guids = false;
namespace nvenc_hook { namespace nvenc_hook {
bool FORCE_DISABLE;
std::optional<std::string> VIDEO_CQP_STRING_OVERRIDE; std::optional<std::string> VIDEO_CQP_STRING_OVERRIDE;
std::optional<NV_ENC_QP> VIDEO_CQP_OVERRIDE; std::optional<NV_ENC_QP> VIDEO_CQP_OVERRIDE;
@@ -189,6 +191,11 @@ namespace nvenc_hook {
} }
NVENCSTATUS NVENCAPI NvEncodeAPICreateInstance_hook(NV_ENCODE_API_FUNCTION_LIST *pFunctionList) { NVENCSTATUS NVENCAPI NvEncodeAPICreateInstance_hook(NV_ENCODE_API_FUNCTION_LIST *pFunctionList) {
if (FORCE_DISABLE) {
return NV_ENC_ERR_NO_ENCODE_DEVICE;
}
// log_misc("nvenc_hook", "NvEncodeAPICreateInstance hook hit"); // log_misc("nvenc_hook", "NvEncodeAPICreateInstance hook hit");
auto status = NvEncodeAPICreateInstance_orig(pFunctionList); auto status = NvEncodeAPICreateInstance_orig(pFunctionList);
+5
View File
@@ -1,7 +1,12 @@
#pragma once #pragma once
#ifdef SPICE64
namespace nvenc_hook { namespace nvenc_hook {
extern bool FORCE_DISABLE;
extern std::optional<std::string> VIDEO_CQP_STRING_OVERRIDE; extern std::optional<std::string> VIDEO_CQP_STRING_OVERRIDE;
void initialize(); void initialize();
} }
#endif
+3
View File
@@ -539,6 +539,9 @@ int main_implementation(int argc, char *argv[]) {
if (options[launcher::Options::IIDXRecQuality].is_active()) { if (options[launcher::Options::IIDXRecQuality].is_active()) {
nvenc_hook::VIDEO_CQP_STRING_OVERRIDE = options[launcher::Options::IIDXRecQuality].value_text(); nvenc_hook::VIDEO_CQP_STRING_OVERRIDE = options[launcher::Options::IIDXRecQuality].value_text();
} }
if (options[launcher::Options::IIDXRecDisable].value_bool()) {
nvenc_hook::FORCE_DISABLE = true;
}
#endif #endif
if (options[launcher::Options::LoadJubeatModule].value_bool()) { if (options[launcher::Options::LoadJubeatModule].value_bool()) {
attach_jb = true; attach_jb = true;
+10 -1
View File
@@ -2235,7 +2235,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
}, },
{ {
// IIDXRecQuality // IIDXRecQuality
.title = "IIDX NVENC Quality", .title = "IIDX Recording Quality",
.name = "iidxreccqp", .name = "iidxreccqp",
.desc = "WARNING: double check if your network allows this & your hardware supports it.\n\n" .desc = "WARNING: double check if your network allows this & your hardware supports it.\n\n"
"For TDJ Play Record feature, specify ConstQP quality settings for NVENC. Lower is higher quality but bigger file.\n\n" "For TDJ Play Record feature, specify ConstQP quality settings for NVENC. Lower is higher quality but bigger file.\n\n"
@@ -2244,6 +2244,15 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
.game_name = "Beatmania IIDX", .game_name = "Beatmania IIDX",
.category = "Game Options (Advanced)", .category = "Game Options (Advanced)",
}, },
{
// IIDXRecDisable
.title = "IIDX Recording Force Disable",
.name = "iidxnorec",
.desc = "When enabled, this prevents the play record feature from being used",
.type = OptionType::Bool,
.game_name = "Beatmania IIDX",
.category = "Game Options (Advanced)",
},
{ {
// MidiAlgoVer // MidiAlgoVer
.title = "MIDI Note Input Algorithm", .title = "MIDI Note Input Algorithm",
+1
View File
@@ -238,6 +238,7 @@ namespace launcher {
spice2x_EnableSMXStage, spice2x_EnableSMXStage,
spice2x_EnableSMXDedicab, spice2x_EnableSMXDedicab,
IIDXRecQuality, IIDXRecQuality,
IIDXRecDisable,
MidiAlgoVer, MidiAlgoVer,
MidiNoteSustain, MidiNoteSustain,
InputRequiresFocus, InputRequiresFocus,