Skip to content

Conversation

@netmindz
Copy link
Member

Remove pointless code duplication

@blazoncek
Copy link
Contributor

This optimisation is great, however..

Instead of modifying usermod manager with a single usermod extension it would be much better IMO to add a static function in FX.cpp to work arround the underlying issue.

I.e..

static um_data_t *getAudioData() {
  um_data_t *um_data;
  if (!usermods.getUMData(&um_data, USERMOD_ID_AUDIOREACTIVE)) {
    // add support for no audio
    um_data = simulateSound(SEGMENT.soundSim);
  }
  return um_data;
}

@netmindz
Copy link
Member Author

Updated to suggested form, I was going to add to utils.cpp at first, the top of FX.cpp makes more sense though

This version is also more performant than when I moved to the UserModManager so definitely good suggestion @blazoncek

@blazoncek blazoncek merged commit 8688777 into wled:0_15 Aug 16, 2024
@netmindz netmindz deleted the FX-cleanup branch August 16, 2024 16:30
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