Skip to content

Refactor CAPU reconfiguration, make FDS lowpass filter configurable in settings#42

Merged
Gumball2415 merged 3 commits intomasterfrom
fds-adjustable-cutoff
Mar 17, 2021
Merged

Refactor CAPU reconfiguration, make FDS lowpass filter configurable in settings#42
Gumball2415 merged 3 commits intomasterfrom
fds-adjustable-cutoff

Conversation

@nyanpasu64
Copy link
Copy Markdown
Collaborator

Make FDS lowpass filter configurable in settings

The FDS lowpass filter cutoff slider is located in the Configuration dialog's new Emulation tab.

The code has to thread the FDS filter cutoff value from CSoundGen reading from its pointer to CSettings, through CAPUConfig::SetupMixer, to CMixer::SetMixing and CMixer::RecomputeMixing, finally into CFDS::UpdateFdsFilter().

Refactor CAPU reconfiguration into a transaction object

The previous CAPU configuration methods were somewhat hacky (eg. CMixer::ExternalSound() called UpdateMixing() with the same parameters as before, but with different member variables) and depended on the order of method calls, which was confusing, and error-prone in theory (but the existing API usages worked fine in practice, and adding configurable FDS filter would've worked fine).

I replaced the eager update system with CAPUConfig, a "transaction object" that queues up changes and recomputes the necessary set of derived data when destroyed. I find that this approach scales well to more complex scenarios like exotracker's GUI updates, which proved to be unworkable using eager updates.

The previous CAPU configuration methods were somewhat hacky
(eg. CMixer::ExternalSound() called UpdateMixing() with the same
parameters as before, but with different member variables)
and depended on the order of method calls, which was confusing,
and error-prone in theory (but the existing API usages worked fine
in practice, and adding configurable FDS filter would've worked fine).

I replaced the eager update system with CAPUConfig,
a "transaction object" that queues up changes and recomputes the
necessary set of derived data when destroyed.
I find that this approach scales well to more complex scenarios like
exotracker's GUI updates, which proved to be unworkable using
eager updates.
@Gumball2415 Gumball2415 merged commit 17b76f9 into master Mar 17, 2021
@Gumball2415 Gumball2415 deleted the fds-adjustable-cutoff branch March 19, 2021 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants