1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-10 00:23:32 +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:
Paul Licameli
2017-07-05 16:45:55 -04:00
parent d2fbca83b2
commit 2c1a16f593
75 changed files with 891 additions and 678 deletions

View File

@@ -23,6 +23,8 @@ class Envelope;
class Ruler;
class ZoomInfo;
class EnvelopeHandle;
class TimeTrack final : public Track {
public:
@@ -141,6 +143,8 @@ class TimeTrack final : public Track {
bool mDisplayLog;
bool mRescaleXMLValues; // needed for backward-compatibility with older project files
std::weak_ptr<EnvelopeHandle> mEnvelopeHandle;
/** @brief Copy the metadata from another track but not the points
*
* Copies the Name, DefaultName, Range and Display data from the source track