karaoke-dev / karaoke

Will be the best karaoke system.
http://blog.karaoke.dev
GNU General Public License v3.0
204 stars 16 forks source link

Refactor the singer stage structure. #2286

Open andy840119 opened 2 months ago

andy840119 commented 2 months ago

Currently Singer and SingerState inherit the ISinger, but SingerState is not a part of singer. SingerState is designed to describe the state of the singer (e.g. happy, yell, soft, sad...), but not very sure SingerState is needed because:

  1. Singer should be enough now.
  2. It might make the editor too complex if add the singer state.

But before deciding to remove the SingerState, maybe some refactoring job can be done first.

in Lyric:

  1. BindableList<ElementId> SingerIdsBindable should be BindableDictioary<ElementId, ElementId[]> SingerIdsBindable

in SingerInfo:

  1. Record the Singer and SingerState can be two different list.
  2. Add/remove singer/singer info logic should be moved into the change handler. singer info should only focus on store the singer's info.
  3. Add checks for the singer's info.

in SingerState:

  1. Remove the ISinger interface.

in ISinger:

  1. Remove this interface.