fn detect_fx_changes_on_track_internal(
        &self,
        track: &Track,
        old_fx_guids: &mut HashSet<Guid>,
        is_input_fx: bool,
        notify_listeners_about_changes: bool,
        handle_change: &mut impl FnMut(ChangeEvent),
    ) -> bool {
        let old_fx_count = old_fx_guids.len() as u32;
        let fx_chain = if is_input_fx {
            track.input_fx_chain()
        } else {
            track.normal_fx_chain()
        };
        let new_fx_count = fx_chain.fx_count();
        use std::cmp::Ordering::*;
        match new_fx_count.cmp(&old_fx_count) {
            Less => {
                self.remove_invalid_fx(
                    track,
                    old_fx_guids,
                    is_input_fx,
                    notify_listeners_about_changes,
                    handle_change,
                );
                true
            }
            Equal => {
                // Reordering (or nothing)
                false
            }
            Greater => {
                self.add_missing_fx(
                    track,
                    old_fx_guids,
                    is_input_fx,
                    notify_listeners_about_changes,
                    handle_change,
                );
                true
            }
        }
    }
// Returns true if FX was added or removed
Returns true if FX was added or removed
Returns true if FX was added or removed
fn detect_fx_changes_on_track_internal(
        &self,
        track: &Track,
        old_fx_guids: &mut HashSet<Guid>,
        is_input_fx: bool,
        notify_listeners_about_changes: bool,
        handle_change: &mut impl FnMut(ChangeEvent),
    ) -> bool {
        let old_fx_count = old_fx_guids.len() as u32;
        let fx_chain = if is_input_fx {
            track.input_fx_chain()
        } else {
            track.normal_fx_chain()
        };
        let new_fx_count = fx_chain.fx_count();
        use std::cmp::Ordering::*;
        match new_fx_count.cmp(&old_fx_count) {
            Less => {
                self.remove_invalid_fx(
                    track,
                    old_fx_guids,
                    is_input_fx,
                    notify_listeners_about_changes,
                    handle_change,
                );
                true
            }
            Equal => {
                // Reordering (or nothing)
                false
            }
            Greater => {
                self.add_missing_fx(
                    track,
                    old_fx_guids,
                    is_input_fx,
                    notify_listeners_about_changes,
                    handle_change,
                );
                true
            }
        }
    }
fn detect_fx_changes_on_track_internal ( & self , track : & Track , old_fx_guids : & mut HashSet < Guid > , is_input_fx : bool , notify_listeners_about_changes : bool , handle_change : & mut impl FnMut ( ChangeEvent ) , ) -> bool { let old_fx_count = old_fx_guids . len ( ) as u32 ; let fx_chain = if is_input_fx { track . input_fx_chain ( ) } else { track . normal_fx_chain ( ) } ; let new_fx_count = fx_chain . fx_count ( ) ; use std :: cmp :: Ordering :: * ; match new_fx_count . cmp ( & old_fx_count ) { Less => { self . remove_invalid_fx ( track , old_fx_guids , is_input_fx , notify_listeners_about_changes , handle_change , ) ; true } Equal => { // Reordering (or nothing) false } Greater => { self . add_missing_fx ( track , old_fx_guids , is_input_fx , notify_listeners_about_changes , handle_change , ) ; true } } }
Returns true if FX was added or removed
Returns true if FX was added or removed
&self
track
&Track
old_fx_guids
&mut HashSet<Guid>
is_input_fx
bool
notify_listeners_about_changes
bool
handle_change
&mut impl FnMut(ChangeEvent)
&self
track
&Track
old_fx_guids
&mut HashSet<Guid>
is_input_fx
bool
notify_listeners_about_changes
bool
handle_change
&mut impl FnMut(ChangeEvent)