Skip to content

Commit

Permalink
adding bool to referTo if you want to notify listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinFAW committed Feb 14, 2024
1 parent 26d0730 commit 984fc94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/juce_data_structures/values/juce_Value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Value& Value::operator= (const var& newValue)
return *this;
}

void Value::referTo (const Value& valueToReferTo)
void Value::referTo (const Value& valueToReferTo, bool notifyListeners)
{
if (valueToReferTo.value != value)
{
Expand All @@ -185,7 +185,7 @@ void Value::referTo (const Value& valueToReferTo)
}

value = valueToReferTo.value;
callListeners();
if(notifyListeners) callListeners();
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/juce_data_structures/values/juce_Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class JUCE_API Value final
Existing listeners will still be registered after you call this method, and
they'll continue to receive messages when the new value changes.
*/
void referTo (const Value& valueToReferTo);
void referTo (const Value& valueToReferTo, bool notifyListeners = true);

/** Returns true if this object and the other one use the same underlying
ValueSource object.
Expand Down

0 comments on commit 984fc94

Please sign in to comment.