mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-25 15:53:52 +02:00
Changed lifetime management of UIHandle objects, no singletons...
... Rather, construct them during hit tests (also capturing more state sooner rather than at Click time, and adding some accessors for later use) This also fixes bug 1677 by other means and avoids similar problems. A cell may be implemented to re-use a previously hit handle object, not yet clicked, in a later hit test, by remembering a weak pointer, but TrackPanel holds the strong pointers that determine when the object is destroyed. And the objects will surely be destroyed after drag-release, or ESC key. For now they are also destroyed whenever not dragging, and hit-testing is re-invoked; that will be changed later, so that the re-use mentioned above becomes effective, but still they will be destroyed when the pointer moves from one cell to another.
This commit is contained in:
@@ -28,6 +28,10 @@ class SpectrogramSettings;
|
||||
class WaveformSettings;
|
||||
class TimeWarper;
|
||||
|
||||
class CutlineHandle;
|
||||
class SampleHandle;
|
||||
class EnvelopeHandle;
|
||||
|
||||
//
|
||||
// Tolerance for merging wave tracks (in seconds)
|
||||
//
|
||||
@@ -636,6 +640,10 @@ class AUDACITY_DLL_API WaveTrack final : public PlayableTrack {
|
||||
std::unique_ptr<SpectrogramSettings> mpSpectrumSettings;
|
||||
std::unique_ptr<WaveformSettings> mpWaveformSettings;
|
||||
|
||||
std::weak_ptr<CutlineHandle> mCutlineHandle;
|
||||
std::weak_ptr<SampleHandle> mSampleHandle;
|
||||
std::weak_ptr<EnvelopeHandle> mEnvelopeHandle;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<TrackControls> GetControls() override;
|
||||
std::shared_ptr<TrackVRulerControls> GetVRulerControls() override;
|
||||
|
||||
Reference in New Issue
Block a user