OnRefresh flags
On refresh flags are passed to the OnRefresh callback in order to indicate
what parts of the controller may need to be refreshed.
By checking these flags, controllers can avoid needlessly updating unchanged parts of their UIs, thus improving performance.
import midi
def OnRefresh(flags: int):
    if flags & midi.HW_Dirty_Mixer_Sel:
        update_mixer_selection_cache()
    if flags & midi.HW_Dirty_LEDs:
        update_led_cache()
    # etc
            HW_Dirty_Mixer_Sel
  
      module-attribute
  
    Selected tracks on the mixer have changed.
            HW_Dirty_Mixer_Controls
  
      module-attribute
  
    Controls on the mixer have changed.
            HW_Dirty_RemoteLinks
  
      module-attribute
  
    Remote (linked) controls have been added, removed or modified. Note that
changes to values associated with a remote control will instead give a
midi.HW_Dirty_RemoteLinkValues event.
            HW_Dirty_Performance
  
      module-attribute
  
    Performance mode layout (not playing state) has changed.
            HW_Dirty_LEDs
  
      module-attribute
  
    Indicates various possible changes in FL Studio which require update of controller LEDs (play/stop/record/active window/.....).
            HW_Dirty_RemoteLinkValues
  
      module-attribute
  
    Value of remote (linked) control has changed. Note that
creation, deletion or modification of remote control mappings will instead give
a midi.HW_Dirty_RemoteLinks event.
            HW_Dirty_Patterns
  
      module-attribute
  
    Changes to patterns or pattern selection.
            HW_Dirty_ControlValues
  
      module-attribute
  
    Changes to plugin control values.
            HW_Dirty_ChannelRackGroup
  
      module-attribute
  
    Channel rack groups have changed.