2015-07-07 03:12:16 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
NoteTrackControls.h
|
|
|
|
|
|
|
|
Paul Licameli split from TrackPanel.cpp
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#ifndef __AUDACITY_NOTE_TRACK_CONTROLS__
|
|
|
|
#define __AUDACITY_NOTE_TRACK_CONTROLS__
|
|
|
|
|
|
|
|
#include "../../../ui/TrackControls.h"
|
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.
2017-07-05 20:45:55 +00:00
|
|
|
class MuteButtonHandle;
|
|
|
|
class SoloButtonHandle;
|
|
|
|
class NoteTrackButtonHandle;
|
|
|
|
class VelocitySliderHandle;
|
2015-07-07 03:12:16 +00: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.
2017-07-05 20:45:55 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2015-07-07 03:12:16 +00:00
|
|
|
class NoteTrackControls : public TrackControls
|
|
|
|
{
|
|
|
|
NoteTrackControls(const NoteTrackControls&) = delete;
|
|
|
|
NoteTrackControls &operator=(const NoteTrackControls&) = delete;
|
|
|
|
|
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.
2017-07-05 20:45:55 +00:00
|
|
|
std::weak_ptr<MuteButtonHandle> mMuteHandle;
|
|
|
|
std::weak_ptr<SoloButtonHandle> mSoloHandle;
|
|
|
|
std::weak_ptr<NoteTrackButtonHandle> mClickHandle;
|
|
|
|
std::weak_ptr<VelocitySliderHandle> mVelocityHandle;
|
|
|
|
|
2015-07-07 03:12:16 +00:00
|
|
|
public:
|
2017-06-23 21:33:45 +00:00
|
|
|
explicit
|
|
|
|
NoteTrackControls( std::shared_ptr<Track> pTrack )
|
|
|
|
: TrackControls( pTrack ) {}
|
2015-07-07 03:12:16 +00:00
|
|
|
~NoteTrackControls();
|
|
|
|
|
2017-06-29 14:34:57 +00:00
|
|
|
std::vector<UIHandlePtr> HitTest
|
2017-06-29 03:21:20 +00:00
|
|
|
(const TrackPanelMouseState &state,
|
2015-07-07 03:12:16 +00:00
|
|
|
const AudacityProject *pProject) override;
|
2015-07-30 18:57:13 +00:00
|
|
|
|
|
|
|
PopupMenuTable *GetMenuExtension(Track *pTrack) override;
|
2015-07-07 03:12:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|