[Audacity-devel] UndoManager::ModifyState and why it does that
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Leland <le...@au...> - 2013-10-07 21:16:57
|
So, while looking into a critter report, I was tracing through the ModifyState() function and I got to wondering... Why does it copy the entire tracklist for EVERY little state change? And if I'm looking at this correctly, it is copying the exact same list every time. Shouldn't that be relegated to the PushState() function when the track data actually changes (like when applying an effect)? I look at ModifyState() as a function that should update the currently active undo stack object with items like current selection, track selection state...well, basically anything that doesn't monkey with the track data itself...like this stuff: mSelected = orig.mSelected; mLinked = orig.mLinked; mMute = orig.mMute; mSolo = orig.mSolo; mHeight = orig.mHeight; mMinimized = orig.mMinimized; mChannel = orig.mChannel; mFormat = orig.mFormat; mRate = orig.mRate; mGain = orig.mGain; mPan = orig.mPan; SetDefaultName(orig.GetDefaultName()); SetName(orig.GetName()); mDisplay = orig.mDisplay; mDisplayMin = orig.mDisplayMin; mDisplayMax = orig.mDisplayMax; mDisplayNumLocations = 0; mDisplayLocations = NULL; mDisplayNumLocationsAllocated = 0; Anyway, just thought I'd start the discussion as it seems like a simple way to (possibly) improve responsiveness. |