Audacity 3.2.0
WaveTrackAffordanceHandle.cpp
Go to the documentation of this file.
1/*!********************************************************************
2*
3 Audacity: A Digital Audio Editor
4
5 @file WaveTrackAffordanceHandle.cpp
6
7 Vitaly Sverchinsky
8
9 **********************************************************************/
10
13#include "WaveTrackView.h"
14#include "ViewInfo.h"
15
16#include "../../../../WaveClip.h"
17#include "../../../../RefreshCode.h"
18#include "../../../../TrackPanelMouseEvent.h"
19#include "ProjectHistory.h"
20
21#include <wx/event.h>
22
23WaveTrackAffordanceHandle::WaveTrackAffordanceHandle(const std::shared_ptr<Track>& track, const std::shared_ptr<WaveClip>& target)
24 : AffordanceHandle(track), mTarget(target)
25{ }
26
28{
31 {
32 auto affordanceControl = std::dynamic_pointer_cast<WaveTrackAffordanceControls>(event.pCell);
33
34 if (affordanceControl)
35 {
36 result |= affordanceControl->OnAffordanceClick(event, project);
37 if (!event.event.GetSkipped())//event is "consumed"
38 return result | RefreshCode::Cancelled;
39 event.event.Skip(false);
40 }
41 }
42 return result | AffordanceHandle::Click(event, project);
43}
44
46{
47 auto& viewInfo = ViewInfo::Get(*project);
48 viewInfo.selectedRegion.setTimes(mTarget->GetPlayStartTime(), mTarget->GetPlayEndTime());
49
50 ProjectHistory::Get(*project).ModifyState(false);
51
53}
Result Click(const TrackPanelMouseEvent &evt, AudacityProject *pProject) override
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
void ModifyState(bool bWantsAutoSave)
static ProjectHistory & Get(AudacityProject &project)
unsigned Result
Definition: UIHandle.h:38
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235
std::shared_ptr< WaveClip > mTarget
WaveTrackAffordanceHandle(const std::shared_ptr< Track > &track, const std::shared_ptr< WaveClip > &target)
Result Click(const TrackPanelMouseEvent &event, AudacityProject *project) override
UIHandle::Result SelectAt(const TrackPanelMouseEvent &event, AudacityProject *project) override
static bool ClipDetailsVisible(const WaveClip &clip, const ZoomInfo &zoomInfo, const wxRect &viewRect)
std::shared_ptr< TrackPanelCell > pCell