mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +02:00
Take class AdornedRulerPanel out of src/widgets...
... It's not a utility widget like RulerPanel. It has a lot of application specific logic in it.
This commit is contained in:
parent
492a44894b
commit
303553ae4e
@ -25,6 +25,8 @@ lib-src/mod-script-pipe/ScripterCallback.cpp
|
||||
lib-src/mod-script-pipe/ScripterCallback.h
|
||||
src/AColor.cpp
|
||||
src/AColor.h
|
||||
src/AdornedRulerPanel.cpp
|
||||
src/AdornedRulerPanel.h
|
||||
src/AboutDialog.cpp
|
||||
src/AboutDialog.h
|
||||
src/AllThemeResources.h
|
||||
|
@ -1205,6 +1205,7 @@
|
||||
5E02BFF21D1164DF00EB7578 /* Distortion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E02BFF01D1164DF00EB7578 /* Distortion.cpp */; };
|
||||
5E07842E1DEE6B8600CA76EA /* FileException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E07842C1DEE6B8600CA76EA /* FileException.cpp */; };
|
||||
5E0784311DF1E4F400CA76EA /* UserException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E07842F1DF1E4F400CA76EA /* UserException.cpp */; };
|
||||
5E08C7392180D460004079AE /* AdornedRulerPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E08C7372180D460004079AE /* AdornedRulerPanel.cpp */; };
|
||||
5E08E010217E4467003C6C99 /* ClipMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E08E00F217E4467003C6C99 /* ClipMenus.cpp */; };
|
||||
5E08E012217E549B003C6C99 /* ToolbarMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E08E011217E549B003C6C99 /* ToolbarMenus.cpp */; };
|
||||
5E08E014217E5F66003C6C99 /* LabelMenus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E08E013217E5F66003C6C99 /* LabelMenus.cpp */; };
|
||||
@ -3068,6 +3069,8 @@
|
||||
5E07842D1DEE6B8600CA76EA /* FileException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileException.h; sourceTree = "<group>"; };
|
||||
5E07842F1DF1E4F400CA76EA /* UserException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserException.cpp; sourceTree = "<group>"; };
|
||||
5E0784301DF1E4F400CA76EA /* UserException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserException.h; sourceTree = "<group>"; };
|
||||
5E08C7372180D460004079AE /* AdornedRulerPanel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AdornedRulerPanel.cpp; sourceTree = "<group>"; };
|
||||
5E08C7382180D460004079AE /* AdornedRulerPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdornedRulerPanel.h; sourceTree = "<group>"; };
|
||||
5E08E00F217E4467003C6C99 /* ClipMenus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClipMenus.cpp; path = menus/ClipMenus.cpp; sourceTree = "<group>"; };
|
||||
5E08E011217E549B003C6C99 /* ToolbarMenus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToolbarMenus.cpp; path = menus/ToolbarMenus.cpp; sourceTree = "<group>"; };
|
||||
5E08E013217E5F66003C6C99 /* LabelMenus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LabelMenus.cpp; path = menus/LabelMenus.cpp; sourceTree = "<group>"; };
|
||||
@ -4080,6 +4083,7 @@
|
||||
children = (
|
||||
1790AFC709883BFD008A330A /* AboutDialog.cpp */,
|
||||
1790AFC909883BFD008A330A /* AColor.cpp */,
|
||||
5E08C7372180D460004079AE /* AdornedRulerPanel.cpp */,
|
||||
1790AFCE09883BFD008A330A /* AudacityApp.cpp */,
|
||||
5E78388D1DE4995E003270C0 /* AudacityException.cpp */,
|
||||
28C3946B1818356800FDDAC9 /* AudacityLogger.cpp */,
|
||||
@ -4170,6 +4174,7 @@
|
||||
28FC1AF90A47762C00A188AE /* WrappedType.cpp */,
|
||||
1790AFC809883BFD008A330A /* AboutDialog.h */,
|
||||
1790AFCA09883BFD008A330A /* AColor.h */,
|
||||
5E08C7382180D460004079AE /* AdornedRulerPanel.h */,
|
||||
28FB12230A3790DF006F0917 /* AllThemeResources.h */,
|
||||
1790AFCC09883BFD008A330A /* Audacity.h */,
|
||||
1790AFCF09883BFD008A330A /* AudacityApp.h */,
|
||||
@ -8157,6 +8162,7 @@
|
||||
28884972131B6CF600B59735 /* zh_TW.po in Sources */,
|
||||
5EF3E65C203FDACE006C6882 /* SetProjectCommand.cpp in Sources */,
|
||||
EDF3B7B01588C0D50032D35F /* Paulstretch.cpp in Sources */,
|
||||
5E08C7392180D460004079AE /* AdornedRulerPanel.cpp in Sources */,
|
||||
ED920CAF15B19F61008CA12C /* ModulePrefs.cpp in Sources */,
|
||||
EDD2431416934A6100D9DEC2 /* BassTreble.cpp in Sources */,
|
||||
ED19449A1733F92800F4F5CA /* Reverb.cpp in Sources */,
|
||||
|
2172
src/AdornedRulerPanel.cpp
Normal file
2172
src/AdornedRulerPanel.cpp
Normal file
File diff suppressed because it is too large
Load Diff
212
src/AdornedRulerPanel.h
Normal file
212
src/AdornedRulerPanel.h
Normal file
@ -0,0 +1,212 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
AdornedRulerPanel.h
|
||||
|
||||
Dominic Mazzoni
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_ADORNED_RULER_PANEL__
|
||||
#define __AUDACITY_ADORNED_RULER_PANEL__
|
||||
|
||||
#include "CellularPanel.h"
|
||||
#include "widgets/Ruler.h"
|
||||
|
||||
#include "MemoryX.h"
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/dc.h>
|
||||
#include <wx/dcmemory.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/window.h>
|
||||
#include "Experimental.h"
|
||||
|
||||
class ViewInfo;
|
||||
class AudacityProject;
|
||||
class SnapManager;
|
||||
class TrackList;
|
||||
|
||||
// This is an Audacity Specific ruler panel.
|
||||
class AUDACITY_DLL_API AdornedRulerPanel final : public CellularPanel
|
||||
{
|
||||
public:
|
||||
AdornedRulerPanel(AudacityProject *project,
|
||||
wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
ViewInfo *viewinfo = NULL);
|
||||
|
||||
~AdornedRulerPanel();
|
||||
|
||||
public:
|
||||
int GetRulerHeight() { return GetRulerHeight(mShowScrubbing); }
|
||||
static int GetRulerHeight(bool showScrubBar);
|
||||
wxRect GetInnerRect() const { return mInner; }
|
||||
|
||||
void SetLeftOffset(int offset);
|
||||
|
||||
void DrawSelection();
|
||||
|
||||
void SetPlayRegion(double playRegionStart, double playRegionEnd);
|
||||
void ClearPlayRegion();
|
||||
void GetPlayRegion(double* playRegionStart, double* playRegionEnd);
|
||||
|
||||
void GetMaxSize(wxCoord *width, wxCoord *height);
|
||||
|
||||
void InvalidateRuler();
|
||||
|
||||
void UpdatePrefs();
|
||||
void ReCreateButtons();
|
||||
|
||||
void RegenerateTooltips();
|
||||
|
||||
void UpdateQuickPlayPos(wxCoord &mousePosX, bool shiftDown);
|
||||
|
||||
bool ShowingScrubRuler() const { return mShowScrubbing; }
|
||||
void OnToggleScrubRuler(/*wxCommandEvent& */);
|
||||
void OnToggleScrubRulerFromMenu(wxCommandEvent& );
|
||||
void SetPanelSize();
|
||||
|
||||
void DrawBothOverlays();
|
||||
|
||||
|
||||
private:
|
||||
void OnRecordStartStop(wxCommandEvent & evt);
|
||||
void OnPaint(wxPaintEvent &evt);
|
||||
void OnSize(wxSizeEvent &evt);
|
||||
void UpdateRects();
|
||||
void HandleQPClick(wxMouseEvent &event, wxCoord mousePosX);
|
||||
void HandleQPDrag(wxMouseEvent &event, wxCoord mousePosX);
|
||||
void HandleQPRelease(wxMouseEvent &event);
|
||||
void StartQPPlay(bool looped, bool cutPreview);
|
||||
|
||||
void DoDrawBackground(wxDC * dc);
|
||||
void DoDrawEdge(wxDC *dc);
|
||||
void DoDrawMarks(wxDC * dc, bool /*text */ );
|
||||
void DoDrawSelection(wxDC * dc);
|
||||
|
||||
public:
|
||||
void DoDrawIndicator(wxDC * dc, wxCoord xx, bool playing, int width, bool scrub, bool seek);
|
||||
void UpdateButtonStates();
|
||||
|
||||
private:
|
||||
void DoDrawPlayRegion(wxDC * dc);
|
||||
|
||||
enum class MenuChoice { QuickPlay, Scrub };
|
||||
void ShowContextMenu( MenuChoice choice, const wxPoint *pPosition);
|
||||
|
||||
double Pos2Time(int p, bool ignoreFisheye = false);
|
||||
int Time2Pos(double t, bool ignoreFisheye = false);
|
||||
|
||||
bool IsWithinMarker(int mousePosX, double markerTime);
|
||||
|
||||
private:
|
||||
|
||||
Ruler mRuler;
|
||||
AudacityProject *const mProject;
|
||||
TrackList *mTracks;
|
||||
|
||||
wxRect mOuter;
|
||||
wxRect mScrubZone;
|
||||
wxRect mInner;
|
||||
|
||||
int mLeftOffset; // Number of pixels before we hit the 'zero position'.
|
||||
|
||||
|
||||
double mIndTime;
|
||||
double mQuickPlayPosUnsnapped;
|
||||
double mQuickPlayPos;
|
||||
|
||||
bool mIsSnapped;
|
||||
|
||||
bool mPlayRegionLock;
|
||||
double mPlayRegionStart;
|
||||
double mPlayRegionEnd;
|
||||
double mOldPlayRegionStart;
|
||||
double mOldPlayRegionEnd;
|
||||
|
||||
bool mIsRecording;
|
||||
|
||||
//
|
||||
// Pop-up menu
|
||||
//
|
||||
void ShowMenu(const wxPoint & pos);
|
||||
void ShowScrubMenu(const wxPoint & pos);
|
||||
void DragSelection();
|
||||
void HandleSnapping();
|
||||
void OnToggleQuickPlay(wxCommandEvent &evt);
|
||||
void OnSyncSelToQuickPlay(wxCommandEvent &evt);
|
||||
void OnTimelineToolTips(wxCommandEvent &evt);
|
||||
void OnAutoScroll(wxCommandEvent &evt);
|
||||
void OnLockPlayRegion(wxCommandEvent &evt);
|
||||
|
||||
void OnTogglePinnedState(wxCommandEvent & event);
|
||||
|
||||
bool mPlayRegionDragsSelection;
|
||||
bool mTimelineToolTip;
|
||||
bool mQuickPlayEnabled;
|
||||
|
||||
enum MouseEventState {
|
||||
mesNone,
|
||||
mesDraggingPlayRegionStart,
|
||||
mesDraggingPlayRegionEnd,
|
||||
mesSelectingPlayRegionClick,
|
||||
mesSelectingPlayRegionRange
|
||||
};
|
||||
|
||||
MouseEventState mMouseEventState;
|
||||
double mLeftDownClickUnsnapped; // click position in seconds, before snap
|
||||
double mLeftDownClick; // click position in seconds
|
||||
bool mIsDragging;
|
||||
|
||||
bool mShowScrubbing { false };
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
wxWindow *mButtons[3];
|
||||
bool mNeedButtonUpdate { true };
|
||||
|
||||
//
|
||||
// CellularPanel implementation
|
||||
//
|
||||
FoundCell FindCell(int mouseX, int mouseY) override;
|
||||
wxRect FindRect(const TrackPanelCell &cell) override;
|
||||
public:
|
||||
AudacityProject * GetProject() const override;
|
||||
private:
|
||||
TrackPanelCell *GetFocusedCell() override;
|
||||
void SetFocusedCell() override;
|
||||
void ProcessUIHandleResult
|
||||
(TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell,
|
||||
unsigned refreshResult) override;
|
||||
|
||||
void UpdateStatusMessage( const wxString & ) override;
|
||||
|
||||
bool TakesFocus() const override;
|
||||
|
||||
void CreateOverlays();
|
||||
|
||||
// Cooperating objects
|
||||
class QuickPlayIndicatorOverlay;
|
||||
std::unique_ptr<QuickPlayIndicatorOverlay> mOverlay;
|
||||
|
||||
class QuickPlayRulerOverlay;
|
||||
|
||||
private:
|
||||
class CommonRulerHandle;
|
||||
class QPHandle;
|
||||
class ScrubbingHandle;
|
||||
|
||||
class CommonCell;
|
||||
|
||||
class QPCell;
|
||||
std::shared_ptr<QPCell> mQPCell;
|
||||
|
||||
class ScrubbingCell;
|
||||
std::shared_ptr<ScrubbingCell> mScrubbingCell;
|
||||
};
|
||||
|
||||
#endif //define __AUDACITY_ADORNED_RULER_PANEL__
|
@ -84,6 +84,7 @@ and in the spectrogram spectral selection.
|
||||
#include "./widgets/LinkingHtmlWindow.h"
|
||||
#include "./widgets/HelpSystem.h"
|
||||
#include "widgets/ErrorDialog.h"
|
||||
#include "widgets/Ruler.h"
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
#include "widgets/WindowAccessible.h"
|
||||
|
@ -29,15 +29,17 @@
|
||||
#include <wx/statusbr.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/utils.h>
|
||||
#include "widgets/Ruler.h"
|
||||
#include "SampleFormat.h"
|
||||
#include "widgets/wxPanelWrapper.h"
|
||||
|
||||
class wxStatusBar;
|
||||
class wxButton;
|
||||
class wxChoice;
|
||||
|
||||
class AudacityProject;
|
||||
class FreqWindow;
|
||||
class FreqGauge;
|
||||
class RulerPanel;
|
||||
|
||||
DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, EVT_FREQWINDOW_RECALC, -1);
|
||||
|
||||
|
@ -100,6 +100,8 @@ audacity_SOURCES = \
|
||||
AboutDialog.h \
|
||||
AColor.cpp \
|
||||
AColor.h \
|
||||
AdornedRulerPanel.cpp \
|
||||
AdornedRulerPanel.h \
|
||||
AllThemeResources.h \
|
||||
Audacity.h \
|
||||
AudacityApp.cpp \
|
||||
|
@ -289,8 +289,9 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
|
||||
blockfile/SilentBlockFile.cpp blockfile/SilentBlockFile.h \
|
||||
blockfile/SimpleBlockFile.cpp blockfile/SimpleBlockFile.h \
|
||||
xml/XMLTagHandler.cpp xml/XMLTagHandler.h AboutDialog.cpp \
|
||||
AboutDialog.h AColor.cpp AColor.h AllThemeResources.h \
|
||||
Audacity.h AudacityApp.cpp AudacityApp.h AudacityException.cpp \
|
||||
AboutDialog.h AColor.cpp AColor.h AdornedRulerPanel.cpp \
|
||||
AdornedRulerPanel.h AllThemeResources.h Audacity.h \
|
||||
AudacityApp.cpp AudacityApp.h AudacityException.cpp \
|
||||
AudacityException.h AudacityLogger.cpp AudacityLogger.h \
|
||||
AudioIO.cpp AudioIO.h AudioIOListener.h AutoRecovery.cpp \
|
||||
AutoRecovery.h BatchCommandDialog.cpp BatchCommandDialog.h \
|
||||
@ -622,7 +623,8 @@ am__objects_1 = audacity-BlockFile.$(OBJEXT) \
|
||||
@USE_VST_TRUE@ effects/VST/audacity-VSTEffect.$(OBJEXT) \
|
||||
@USE_VST_TRUE@ effects/VST/audacity-VSTControlGTK.$(OBJEXT)
|
||||
am_audacity_OBJECTS = $(am__objects_1) audacity-AboutDialog.$(OBJEXT) \
|
||||
audacity-AColor.$(OBJEXT) audacity-AudacityApp.$(OBJEXT) \
|
||||
audacity-AColor.$(OBJEXT) audacity-AdornedRulerPanel.$(OBJEXT) \
|
||||
audacity-AudacityApp.$(OBJEXT) \
|
||||
audacity-AudacityException.$(OBJEXT) \
|
||||
audacity-AudacityLogger.$(OBJEXT) audacity-AudioIO.$(OBJEXT) \
|
||||
audacity-AutoRecovery.$(OBJEXT) \
|
||||
@ -1335,8 +1337,9 @@ audacity_LDADD = $(EXPAT_LIBS) $(FILEDIALOG_LIBS) $(PORTAUDIO_LIBS) \
|
||||
$(am__append_35) $(am__append_38) $(am__append_40) \
|
||||
$(am__append_43) $(am__append_45) $(am__append_48)
|
||||
audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \
|
||||
AboutDialog.h AColor.cpp AColor.h AllThemeResources.h \
|
||||
Audacity.h AudacityApp.cpp AudacityApp.h AudacityException.cpp \
|
||||
AboutDialog.h AColor.cpp AColor.h AdornedRulerPanel.cpp \
|
||||
AdornedRulerPanel.h AllThemeResources.h Audacity.h \
|
||||
AudacityApp.cpp AudacityApp.h AudacityException.cpp \
|
||||
AudacityException.h AudacityLogger.cpp AudacityLogger.h \
|
||||
AudioIO.cpp AudioIO.h AudioIOListener.h AutoRecovery.cpp \
|
||||
AutoRecovery.h BatchCommandDialog.cpp BatchCommandDialog.h \
|
||||
@ -2474,6 +2477,7 @@ distclean-compile:
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-AColor.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-AboutDialog.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-AdornedRulerPanel.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-AudacityApp.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-AudacityException.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audacity-AudacityLogger.Po@am__quote@
|
||||
@ -3238,6 +3242,20 @@ audacity-AColor.obj: AColor.cpp
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-AColor.obj `if test -f 'AColor.cpp'; then $(CYGPATH_W) 'AColor.cpp'; else $(CYGPATH_W) '$(srcdir)/AColor.cpp'; fi`
|
||||
|
||||
audacity-AdornedRulerPanel.o: AdornedRulerPanel.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-AdornedRulerPanel.o -MD -MP -MF $(DEPDIR)/audacity-AdornedRulerPanel.Tpo -c -o audacity-AdornedRulerPanel.o `test -f 'AdornedRulerPanel.cpp' || echo '$(srcdir)/'`AdornedRulerPanel.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-AdornedRulerPanel.Tpo $(DEPDIR)/audacity-AdornedRulerPanel.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='AdornedRulerPanel.cpp' object='audacity-AdornedRulerPanel.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-AdornedRulerPanel.o `test -f 'AdornedRulerPanel.cpp' || echo '$(srcdir)/'`AdornedRulerPanel.cpp
|
||||
|
||||
audacity-AdornedRulerPanel.obj: AdornedRulerPanel.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-AdornedRulerPanel.obj -MD -MP -MF $(DEPDIR)/audacity-AdornedRulerPanel.Tpo -c -o audacity-AdornedRulerPanel.obj `if test -f 'AdornedRulerPanel.cpp'; then $(CYGPATH_W) 'AdornedRulerPanel.cpp'; else $(CYGPATH_W) '$(srcdir)/AdornedRulerPanel.cpp'; fi`
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-AdornedRulerPanel.Tpo $(DEPDIR)/audacity-AdornedRulerPanel.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='AdornedRulerPanel.cpp' object='audacity-AdornedRulerPanel.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -c -o audacity-AdornedRulerPanel.obj `if test -f 'AdornedRulerPanel.cpp'; then $(CYGPATH_W) 'AdornedRulerPanel.cpp'; else $(CYGPATH_W) '$(srcdir)/AdornedRulerPanel.cpp'; fi`
|
||||
|
||||
audacity-AudacityApp.o: AudacityApp.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(audacity_CPPFLAGS) $(CPPFLAGS) $(audacity_CXXFLAGS) $(CXXFLAGS) -MT audacity-AudacityApp.o -MD -MP -MF $(DEPDIR)/audacity-AudacityApp.Tpo -c -o audacity-AudacityApp.o `test -f 'AudacityApp.cpp' || echo '$(srcdir)/'`AudacityApp.cpp
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/audacity-AudacityApp.Tpo $(DEPDIR)/audacity-AudacityApp.Po
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "Audacity.h"
|
||||
#include "Menus.h"
|
||||
|
||||
#include "AdornedRulerPanel.h"
|
||||
#include "AudacityApp.h"
|
||||
#include "AudioIO.h"
|
||||
#include "LabelTrack.h"
|
||||
@ -45,7 +46,6 @@
|
||||
#include "prefs/TracksPrefs.h"
|
||||
#include "toolbars/ControlToolBar.h"
|
||||
#include "toolbars/ToolManager.h"
|
||||
#include "widgets/Ruler.h"
|
||||
|
||||
PrefsListener::~PrefsListener()
|
||||
{
|
||||
|
@ -87,6 +87,7 @@ scroll information. It also has some status flags.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "AdornedRulerPanel.h"
|
||||
#include "AudacityException.h"
|
||||
#include "FreqWindow.h"
|
||||
#include "effects/Contrast.h"
|
||||
@ -124,7 +125,6 @@ scroll information. It also has some status flags.
|
||||
#include "widgets/LinkingHtmlWindow.h"
|
||||
#include "widgets/ASlider.h"
|
||||
#include "widgets/ErrorDialog.h"
|
||||
#include "widgets/Ruler.h"
|
||||
#include "widgets/Warning.h"
|
||||
#include "xml/XMLFileReader.h"
|
||||
#include "PlatformCompatibility.h"
|
||||
@ -1102,10 +1102,10 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
// Create the horizontal ruler
|
||||
//
|
||||
mRuler = safenew AdornedRulerPanel( this, mTopPanel,
|
||||
wxID_ANY,
|
||||
wxDefaultPosition,
|
||||
wxSize( -1, AdornedRulerPanel::GetRulerHeight(false) ),
|
||||
&mViewInfo );
|
||||
wxID_ANY,
|
||||
wxDefaultPosition,
|
||||
wxSize( -1, AdornedRulerPanel::GetRulerHeight(false) ),
|
||||
&mViewInfo );
|
||||
mRuler->SetLayoutDirection(wxLayout_LeftToRight);
|
||||
|
||||
//
|
||||
|
@ -71,7 +71,6 @@ can't be.
|
||||
#include "Project.h"
|
||||
#include "toolbars/ToolBar.h"
|
||||
#include "toolbars/ToolManager.h"
|
||||
#include "widgets/Ruler.h"
|
||||
#include "ImageManipulation.h"
|
||||
#include "Theme.h"
|
||||
#include "Experimental.h"
|
||||
@ -79,6 +78,7 @@ can't be.
|
||||
#include "FileNames.h"
|
||||
#include "Prefs.h"
|
||||
#include "AColor.h"
|
||||
#include "AdornedRulerPanel.h"
|
||||
#include "ImageManipulation.h"
|
||||
#include "widgets/ErrorDialog.h"
|
||||
|
||||
|
@ -147,6 +147,7 @@ is time to refresh some aspect of the screen.
|
||||
*//*****************************************************************/
|
||||
|
||||
#include "Audacity.h"
|
||||
#include "AdornedRulerPanel.h"
|
||||
#include "Experimental.h"
|
||||
#include "TrackPanel.h"
|
||||
#include "Project.h"
|
||||
@ -176,7 +177,6 @@ is time to refresh some aspect of the screen.
|
||||
#include "../images/Cursors.h"
|
||||
|
||||
#include "widgets/ASlider.h"
|
||||
#include "widgets/Ruler.h"
|
||||
#include <algorithm>
|
||||
|
||||
wxDEFINE_EVENT(EVT_TRACK_PANEL_TIMER, wxCommandEvent);
|
||||
|
@ -28,6 +28,7 @@ small calculations of rectangles.
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/valgen.h>
|
||||
|
||||
#include "../AdornedRulerPanel.h"
|
||||
#include "../Track.h"
|
||||
#include "../TrackPanel.h"
|
||||
#include "../toolbars/ToolManager.h"
|
||||
@ -40,7 +41,6 @@ small calculations of rectangles.
|
||||
#include "../toolbars/SelectionBar.h"
|
||||
#include "../toolbars/ToolsToolBar.h"
|
||||
#include "../toolbars/TranscriptionToolBar.h"
|
||||
#include "../widgets/Ruler.h"
|
||||
#include "../Prefs.h"
|
||||
#include "../ShuttleGui.h"
|
||||
#include "CommandContext.h"
|
||||
|
@ -23,12 +23,12 @@ Vaughan Johnson (Preview)
|
||||
#include <wx/string.h>
|
||||
#include <wx/window.h>
|
||||
|
||||
#include "../widgets/Ruler.h"
|
||||
#include "Biquad.h"
|
||||
|
||||
#include "Effect.h"
|
||||
|
||||
class wxTextCtrl;
|
||||
class RulerPanel;
|
||||
class ShuttleGui;
|
||||
|
||||
#define CLASSICFILTERS_PLUGIN_SYMBOL IdentInterfaceSymbol{ XO("Classic Filters") }
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "../AdornedRulerPanel.h"
|
||||
#include "../HistoryWindow.h"
|
||||
#include "../LabelTrack.h"
|
||||
#include "../Menus.h"
|
||||
@ -16,7 +17,6 @@
|
||||
#include "../prefs/PrefsDialog.h"
|
||||
#include "../prefs/SpectrogramSettings.h"
|
||||
#include "../prefs/WaveformSettings.h"
|
||||
#include "../widgets/Ruler.h"
|
||||
|
||||
// private helper classes and functions
|
||||
namespace {
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "../AdornedRulerPanel.h"
|
||||
#include "../AudioIO.h"
|
||||
#include "../Experimental.h"
|
||||
#include "../FreqWindow.h"
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "../AdornedRulerPanel.h"
|
||||
#include "../AudioIO.h"
|
||||
#include "../DeviceManager.h"
|
||||
#include "../Experimental.h"
|
||||
@ -16,7 +17,6 @@
|
||||
#include "../toolbars/ControlToolBar.h"
|
||||
#include "../toolbars/TranscriptionToolBar.h"
|
||||
#include "../tracks/ui/Scrubbing.h"
|
||||
#include "../widgets/Ruler.h"
|
||||
|
||||
#include <float.h>
|
||||
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include "MeterToolBar.h"
|
||||
|
||||
#include "../AColor.h"
|
||||
#include "../AdornedRulerPanel.h"
|
||||
#include "../AllThemeResources.h"
|
||||
#include "../AudioIO.h"
|
||||
#include "../ImageManipulation.h"
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <wx/tooltip.h>
|
||||
#endif
|
||||
|
||||
#include "../AdornedRulerPanel.h"
|
||||
#include "../AllThemeResources.h"
|
||||
#include "../AudioIO.h"
|
||||
#include "../ImageManipulation.h"
|
||||
@ -36,7 +37,6 @@
|
||||
#include "../Track.h"
|
||||
#include "../UndoManager.h"
|
||||
#include "../widgets/AButton.h"
|
||||
#include "../widgets/Ruler.h"
|
||||
#include "../tracks/ui/Scrubbing.h"
|
||||
#include "../commands/CommandContext.h"
|
||||
|
||||
|
@ -13,7 +13,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../Experimental.h"
|
||||
|
||||
#include "../../AColor.h"
|
||||
#include "../../widgets/Ruler.h"
|
||||
#include "../../AdornedRulerPanel.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../TrackPanelCell.h"
|
||||
#include "../../TrackPanelCellIterator.h"
|
||||
|
@ -12,12 +12,12 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "PlayIndicatorOverlay.h"
|
||||
|
||||
#include "../../AColor.h"
|
||||
#include "../../AdornedRulerPanel.h"
|
||||
#include "../../AudioIO.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../TrackPanel.h"
|
||||
#include "../../TrackPanelCell.h"
|
||||
#include "../../TrackPanelCellIterator.h"
|
||||
#include "../../widgets/Ruler.h"
|
||||
#include "Scrubbing.h"
|
||||
|
||||
#include <wx/dc.h>
|
||||
|
@ -13,6 +13,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../Experimental.h"
|
||||
#include <functional>
|
||||
|
||||
#include "../../AdornedRulerPanel.h"
|
||||
#include "../../AudioIO.h"
|
||||
#include "../../Menus.h"
|
||||
#include "../../Project.h"
|
||||
@ -30,7 +31,6 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../toolbars/TranscriptionToolBar.h"
|
||||
#endif
|
||||
|
||||
#include "../../widgets/Ruler.h"
|
||||
#include "../../commands/CommandFunctors.h"
|
||||
#include "../../commands/CommandContext.h"
|
||||
#include "../../commands/CommandManager.h"
|
||||
|
@ -16,7 +16,10 @@
|
||||
#ifndef __AUDACITY_METER__
|
||||
#define __AUDACITY_METER__
|
||||
|
||||
#include <wx/brush.h>
|
||||
#include <wx/defs.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/timer.h>
|
||||
|
||||
#include "../SampleFormat.h"
|
||||
@ -26,6 +29,8 @@
|
||||
#include "WindowAccessible.h"
|
||||
#endif
|
||||
|
||||
class AudacityProject;
|
||||
|
||||
// Event used to notify all meters of preference changes
|
||||
wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API,
|
||||
EVT_METER_PREFERENCES_CHANGED, wxCommandEvent);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -11,22 +11,20 @@
|
||||
#ifndef __AUDACITY_RULER__
|
||||
#define __AUDACITY_RULER__
|
||||
|
||||
#include "../CellularPanel.h"
|
||||
#include "../MemoryX.h"
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/dc.h>
|
||||
#include <wx/dcmemory.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/window.h>
|
||||
#include "wxPanelWrapper.h"
|
||||
#include "../Experimental.h"
|
||||
|
||||
class ViewInfo;
|
||||
class AudacityProject;
|
||||
class TimeTrack;
|
||||
class SnapManager;
|
||||
#include <wx/colour.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/pen.h>
|
||||
#include <wx/types.h>
|
||||
|
||||
class wxArrayString;
|
||||
class wxDC;
|
||||
class wxFont;
|
||||
|
||||
class NumberScale;
|
||||
class TrackList;
|
||||
class TimeTrack;
|
||||
class ZoomInfo;
|
||||
|
||||
class AUDACITY_DLL_API Ruler {
|
||||
@ -309,185 +307,4 @@ private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
// This is an Audacity Specific ruler panel.
|
||||
class AUDACITY_DLL_API AdornedRulerPanel final : public CellularPanel
|
||||
{
|
||||
public:
|
||||
AdornedRulerPanel(AudacityProject *project,
|
||||
wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
ViewInfo *viewinfo = NULL);
|
||||
|
||||
~AdornedRulerPanel();
|
||||
|
||||
public:
|
||||
int GetRulerHeight() { return GetRulerHeight(mShowScrubbing); }
|
||||
static int GetRulerHeight(bool showScrubBar);
|
||||
wxRect GetInnerRect() const { return mInner; }
|
||||
|
||||
void SetLeftOffset(int offset);
|
||||
|
||||
void DrawSelection();
|
||||
|
||||
void SetPlayRegion(double playRegionStart, double playRegionEnd);
|
||||
void ClearPlayRegion();
|
||||
void GetPlayRegion(double* playRegionStart, double* playRegionEnd);
|
||||
|
||||
void GetMaxSize(wxCoord *width, wxCoord *height);
|
||||
|
||||
void InvalidateRuler();
|
||||
|
||||
void UpdatePrefs();
|
||||
void ReCreateButtons();
|
||||
|
||||
void RegenerateTooltips();
|
||||
|
||||
void UpdateQuickPlayPos(wxCoord &mousePosX, bool shiftDown);
|
||||
|
||||
bool ShowingScrubRuler() const { return mShowScrubbing; }
|
||||
void OnToggleScrubRuler(/*wxCommandEvent& */);
|
||||
void OnToggleScrubRulerFromMenu(wxCommandEvent& );
|
||||
void SetPanelSize();
|
||||
|
||||
void DrawBothOverlays();
|
||||
|
||||
|
||||
private:
|
||||
void OnRecordStartStop(wxCommandEvent & evt);
|
||||
void OnPaint(wxPaintEvent &evt);
|
||||
void OnSize(wxSizeEvent &evt);
|
||||
void UpdateRects();
|
||||
void HandleQPClick(wxMouseEvent &event, wxCoord mousePosX);
|
||||
void HandleQPDrag(wxMouseEvent &event, wxCoord mousePosX);
|
||||
void HandleQPRelease(wxMouseEvent &event);
|
||||
void StartQPPlay(bool looped, bool cutPreview);
|
||||
|
||||
void DoDrawBackground(wxDC * dc);
|
||||
void DoDrawEdge(wxDC *dc);
|
||||
void DoDrawMarks(wxDC * dc, bool /*text */ );
|
||||
void DoDrawSelection(wxDC * dc);
|
||||
|
||||
public:
|
||||
void DoDrawIndicator(wxDC * dc, wxCoord xx, bool playing, int width, bool scrub, bool seek);
|
||||
void UpdateButtonStates();
|
||||
|
||||
private:
|
||||
void DoDrawPlayRegion(wxDC * dc);
|
||||
|
||||
enum class MenuChoice { QuickPlay, Scrub };
|
||||
void ShowContextMenu( MenuChoice choice, const wxPoint *pPosition);
|
||||
|
||||
double Pos2Time(int p, bool ignoreFisheye = false);
|
||||
int Time2Pos(double t, bool ignoreFisheye = false);
|
||||
|
||||
bool IsWithinMarker(int mousePosX, double markerTime);
|
||||
|
||||
private:
|
||||
|
||||
Ruler mRuler;
|
||||
AudacityProject *const mProject;
|
||||
TrackList *mTracks;
|
||||
|
||||
wxRect mOuter;
|
||||
wxRect mScrubZone;
|
||||
wxRect mInner;
|
||||
|
||||
int mLeftOffset; // Number of pixels before we hit the 'zero position'.
|
||||
|
||||
|
||||
double mIndTime;
|
||||
double mQuickPlayPosUnsnapped;
|
||||
double mQuickPlayPos;
|
||||
|
||||
bool mIsSnapped;
|
||||
|
||||
bool mPlayRegionLock;
|
||||
double mPlayRegionStart;
|
||||
double mPlayRegionEnd;
|
||||
double mOldPlayRegionStart;
|
||||
double mOldPlayRegionEnd;
|
||||
|
||||
bool mIsRecording;
|
||||
|
||||
//
|
||||
// Pop-up menu
|
||||
//
|
||||
void ShowMenu(const wxPoint & pos);
|
||||
void ShowScrubMenu(const wxPoint & pos);
|
||||
void DragSelection();
|
||||
void HandleSnapping();
|
||||
void OnToggleQuickPlay(wxCommandEvent &evt);
|
||||
void OnSyncSelToQuickPlay(wxCommandEvent &evt);
|
||||
void OnTimelineToolTips(wxCommandEvent &evt);
|
||||
void OnAutoScroll(wxCommandEvent &evt);
|
||||
void OnLockPlayRegion(wxCommandEvent &evt);
|
||||
|
||||
void OnTogglePinnedState(wxCommandEvent & event);
|
||||
|
||||
bool mPlayRegionDragsSelection;
|
||||
bool mTimelineToolTip;
|
||||
bool mQuickPlayEnabled;
|
||||
|
||||
enum MouseEventState {
|
||||
mesNone,
|
||||
mesDraggingPlayRegionStart,
|
||||
mesDraggingPlayRegionEnd,
|
||||
mesSelectingPlayRegionClick,
|
||||
mesSelectingPlayRegionRange
|
||||
};
|
||||
|
||||
MouseEventState mMouseEventState;
|
||||
double mLeftDownClickUnsnapped; // click position in seconds, before snap
|
||||
double mLeftDownClick; // click position in seconds
|
||||
bool mIsDragging;
|
||||
|
||||
bool mShowScrubbing { false };
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
wxWindow *mButtons[3];
|
||||
bool mNeedButtonUpdate { true };
|
||||
|
||||
//
|
||||
// CellularPanel implementation
|
||||
//
|
||||
FoundCell FindCell(int mouseX, int mouseY) override;
|
||||
wxRect FindRect(const TrackPanelCell &cell) override;
|
||||
public:
|
||||
AudacityProject * GetProject() const override;
|
||||
private:
|
||||
TrackPanelCell *GetFocusedCell() override;
|
||||
void SetFocusedCell() override;
|
||||
void ProcessUIHandleResult
|
||||
(TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell,
|
||||
unsigned refreshResult) override;
|
||||
|
||||
void UpdateStatusMessage( const wxString & ) override;
|
||||
|
||||
bool TakesFocus() const override;
|
||||
|
||||
void CreateOverlays();
|
||||
|
||||
// Cooperating objects
|
||||
class QuickPlayIndicatorOverlay;
|
||||
std::unique_ptr<QuickPlayIndicatorOverlay> mOverlay;
|
||||
|
||||
class QuickPlayRulerOverlay;
|
||||
|
||||
private:
|
||||
class CommonRulerHandle;
|
||||
class QPHandle;
|
||||
class ScrubbingHandle;
|
||||
|
||||
class CommonCell;
|
||||
|
||||
class QPCell;
|
||||
std::shared_ptr<QPCell> mQPCell;
|
||||
|
||||
class ScrubbingCell;
|
||||
std::shared_ptr<ScrubbingCell> mScrubbingCell;
|
||||
};
|
||||
|
||||
#endif //define __AUDACITY_RULER__
|
||||
|
@ -123,6 +123,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\src\AboutDialog.cpp" />
|
||||
<ClCompile Include="..\..\..\src\AColor.cpp" />
|
||||
<ClCompile Include="..\..\..\src\AdornedRulerPanel.cpp" />
|
||||
<ClCompile Include="..\..\..\src\AudacityApp.cpp" />
|
||||
<ClCompile Include="..\..\..\src\AudacityException.cpp" />
|
||||
<ClCompile Include="..\..\..\src\AudacityHeaders.cpp">
|
||||
@ -481,6 +482,7 @@
|
||||
<ClInclude Include="..\..\..\include\audacity\Types.h" />
|
||||
<ClInclude Include="..\..\..\src\AboutDialog.h" />
|
||||
<ClInclude Include="..\..\..\src\AColor.h" />
|
||||
<ClInclude Include="..\..\..\src\AdornedRulerPanel.h" />
|
||||
<ClInclude Include="..\..\..\src\AllThemeResources.h" />
|
||||
<ClInclude Include="..\..\..\src\Audacity.h" />
|
||||
<ClInclude Include="..\..\..\src\AudacityApp.h" />
|
||||
|
@ -1130,6 +1130,9 @@
|
||||
<ClCompile Include="..\..\..\src\menus\ClipMenus.cpp">
|
||||
<Filter>src\menus</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\AdornedRulerPanel.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\src\AboutDialog.h">
|
||||
@ -2209,6 +2212,9 @@
|
||||
<ClInclude Include="..\..\..\src\CellularPanel.h">
|
||||
<Filter>src</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\AdornedRulerPanel.h">
|
||||
<Filter>src</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\..\audacity.ico">
|
||||
|
Loading…
x
Reference in New Issue
Block a user