MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / LoadSave

Method LoadSave

pcsx2/Host/AudioStream.cpp:779–821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779void AudioStreamParameters::LoadSave(SettingsWrapper& wrap, const char* section)
780{
781 wrap.EnumEntry(section, "ExpansionMode", expansion_mode, &AudioStream::ParseExpansionMode, &AudioStream::GetExpansionModeName, DEFAULT_EXPANSION_MODE);
782 minimal_output_latency = wrap.EntryBitBool(section, "OutputLatencyMinimal", DEFAULT_OUTPUT_LATENCY_MINIMAL);
783 buffer_ms = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "BufferMS", buffer_ms, DEFAULT_BUFFER_MS), 0, std::numeric_limits<u16>::max()));
784 output_latency_ms = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "OutputLatencyMS", output_latency_ms, DEFAULT_OUTPUT_LATENCY_MS), 0, std::numeric_limits<u16>::max()));
785
786 stretch_sequence_length_ms = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "StretchSequenceLengthMS", DEFAULT_STRETCH_SEQUENCE_LENGTH), 0, std::numeric_limits<u16>::max()));
787 stretch_seekwindow_ms = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "StretchSeekWindowMS", DEFAULT_STRETCH_SEEKWINDOW), 0, std::numeric_limits<u16>::max()));
788 stretch_overlap_ms = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "StretchOverlapMS", DEFAULT_STRETCH_OVERLAP), 0, std::numeric_limits<u16>::max()));
789 stretch_use_quickseek = wrap.EntryBitBool(section, "StretchUseQuickSeek", DEFAULT_STRETCH_USE_QUICKSEEK);
790 stretch_use_aa_filter = wrap.EntryBitBool(section, "StretchUseAAFilter", DEFAULT_STRETCH_USE_AA_FILTER);
791
792 expand_block_size = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "ExpandBlockSize", DEFAULT_EXPAND_BLOCK_SIZE), 0, std::numeric_limits<u16>::max()));
793 wrap.Entry(section, "ExpandCircularWrap", expand_circular_wrap, DEFAULT_EXPAND_CIRCULAR_WRAP);
794 wrap.Entry(section, "ExpandShift", expand_shift, DEFAULT_EXPAND_SHIFT);
795 wrap.Entry(section, "ExpandDepth", expand_depth, DEFAULT_EXPAND_DEPTH);
796 wrap.Entry(section, "ExpandFocus", expand_focus, DEFAULT_EXPAND_FOCUS);
797 wrap.Entry(section, "ExpandCenterImage", expand_center_image, DEFAULT_EXPAND_CENTER_IMAGE);
798 wrap.Entry(section, "ExpandFrontSeparation", expand_front_separation, DEFAULT_EXPAND_FRONT_SEPARATION);
799 wrap.Entry(section, "ExpandRearSeparation", expand_rear_separation, DEFAULT_EXPAND_REAR_SEPARATION);
800 expand_low_cutoff = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "ExpandLowCutoff", DEFAULT_EXPAND_LOW_CUTOFF), 0, std::numeric_limits<u8>::max()));
801 expand_high_cutoff = static_cast<u16>(std::clamp<int>(wrap.EntryBitfield(section, "ExpandHighCutoff", DEFAULT_EXPAND_HIGH_CUTOFF), 0, std::numeric_limits<u8>::max()));
802
803 // Clamping of values.
804 if (wrap.IsLoading())
805 {
806 stretch_sequence_length_ms = std::clamp<u16>(stretch_sequence_length_ms, 20, 100);
807 stretch_seekwindow_ms = std::clamp<u16>(stretch_seekwindow_ms, 10, 30);
808 stretch_overlap_ms = std::clamp<u16>(stretch_overlap_ms, 5, 15);
809
810 expand_block_size = std::clamp<u16>(std::has_single_bit(expand_block_size) ? expand_block_size : std::bit_ceil(expand_block_size), 128, 8192);
811 expand_circular_wrap = std::clamp(expand_circular_wrap, 0.0f, 360.0f);
812 expand_shift = std::clamp(expand_shift, -1.0f, 1.0f);
813 expand_depth = std::clamp(expand_depth, 0.0f, 5.0f);
814 expand_focus = std::clamp(expand_focus, -1.0f, 1.0f);
815 expand_center_image = std::clamp(expand_center_image, 0.0f, 1.0f);
816 expand_front_separation = std::clamp(expand_front_separation, 0.0f, 10.0f);
817 expand_rear_separation = std::clamp(expand_rear_separation, 0.0f, 10.0f);
818 expand_low_cutoff = std::min<u8>(expand_low_cutoff, 100);
819 expand_high_cutoff = std::min<u8>(expand_high_cutoff, 100);
820 }
821}

Callers

nothing calls this directly

Calls 7

EnumEntryMethod · 0.80
EntryBitBoolMethod · 0.80
EntryBitfieldMethod · 0.80
maxFunction · 0.50
clampFunction · 0.50
EntryMethod · 0.45
IsLoadingMethod · 0.45

Tested by

no test coverage detected