1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 07:40:23 +02:00

816 Commits

Author SHA1 Message Date
Paul Licameli
82663892dc Accessors to get the project window...
... as a preparation for splitting up class AudacityProject.

Use ProjectWindow as an alias for AudacityProject, and fetch it from the
project with a static member function, where certain of its services are used;
pretending they are not the same class.

Use global accessor functions to get wxFrame from the project where only
wxFrame's member functions are needed, so there will be less dependency on
ProjectWindow when it becomes a distinct class.
2019-05-28 23:18:13 -04:00
Paul Licameli
02afcbca8c Redo TP_UpdateStatusMessage...
... Rename it as SetStatus; make it part of AudacityProject not
TrackPanelListener; and use a roundabout event signalling to cause the timer
restart.

Because SetStatus will be one of very few things left in AudacityProject, but
the timer handling will be part of another class decoupled from it.

And TrackPanelListener won't really be needed: TrackPanel will not need to
pretend it doesn't know what an AudacityProject is.
2019-05-28 19:36:47 -04:00
Paul Licameli
441763cabd Fix 9c75ebe, which caused TrackPanel not to get the message 2019-05-28 18:53:54 -04:00
Paul Licameli
3416b5bad6 Toolbars accessed by static Get() functions, not through AudacityProject 2019-05-24 16:08:29 -04:00
Paul Licameli
7bb71257ed static AdornedRulerPanel::Get()...
... not member functions of AudacityProject
2019-05-24 15:48:16 -04:00
Paul Licameli
d1ad8f55e0 static TrackPanel::Get()...
... not member functions of AudacityProject
2019-05-24 15:46:30 -04:00
Paul Licameli
b5a57682b6 static ViewInfo::Get() and ZoomInfo::Get()...
... not member functions of AudacityProject
2019-05-23 12:58:47 -04:00
Paul Licameli
14ab93a01f static TrackList::Get()...
... not member function of AudacityProject
2019-05-23 12:58:47 -04:00
Paul Licameli
62899a32f4 All things with an UpdatePrefs() message listen for an event...
... Still to do, improve the handling of updates of only subsets of the prefs
2019-05-20 21:38:13 -04:00
Paul Licameli
9c75ebe7f7 TrackPanel subscribes directly to ODManager for events...
... cutting middleman AudacityProject out
2019-05-20 21:38:10 -04:00
Paul Licameli
735860c856 Remove the TrackPanelFactory...
... It was part of an attempt at decoupling that will be superseded by other
techniques
2019-05-20 21:38:08 -04:00
Paul Licameli
db8c4c5e5a Global keyboard capture handling into new files, better comments...
... and break its compile dependency on CommandManager.h by letting it install
callbacks.

This also removes Objective-C mixed code from CommmandManager.

This also eliminates four inclusions of Project.h!

Capture handler state is also global, not per project, though the
CommandManager's callbacks still do depend on the active project.
2019-05-18 15:14:18 -04:00
Paul Licameli
8f55d55869 Remove two call-through functions to TrackPanel from AudacityProject 2019-04-26 14:05:57 -04:00
Paul Licameli
440fc17cd4 A long comment clarifying the subdivision of TrackPanel area 2019-04-21 00:15:41 -04:00
James Crook
0923a5d744 Tweaks to names on tracks
This makes them opaque when the track height is low.
It also improves on painting with low stereo tracks, where the name previously was clipped.
2019-04-08 18:10:53 +01:00
Paul Licameli
08c16b6eb7 Remove wx/{html/htmlwin,fileconf,dragimag,debug,dcclient}.h from *.h 2019-03-30 10:53:22 -04:00
Paul Licameli
71adb89342 Remove non-UI functions in TrackPanelListener 2019-03-27 04:06:15 -04:00
Paul Licameli
a915a510bd include <wx/setup.h> in all files where wxUSE* macros are used...
... even if it's redundant; improving on what was done at b47e2f9
2019-03-23 14:56:02 -04:00
Paul Licameli
bb634614e6 static overloads of Track::SharedPointer when null check is needed...
... Some optimizing compilers don't let us get away with null check on this
in a nonstatic member function.
2019-03-23 13:23:46 -04:00
Paul Licameli
f45300f032 This is only comments, in files where USE_ macros are tested...
... following the comment convention used in the preceding commit.
2019-03-22 12:38:30 -04:00
James Crook
4ff7d7875a Add 'Select Track' Button.
This is a first take at this new feature.  I'm expecting we'll want to refine it.
https://wiki.audacityteam.org/wiki/Proposal_Select_Track_button_in_TCP has the feature proposal.
2019-03-21 19:43:36 +00:00
Paul Licameli
02db402b54 Bug2064: ESC key should abort drags in time ruler on Linux...
... Reimplement the ESC key handling in TrackPanel and time ruler on all
operating systems so that it does not rely on the focused window, but instead
uses the application-wide event filter.

This includes reversion of 9491605cfc8a7d60117365884fd494996b5ebbaf
2019-03-18 12:43:14 -04:00
Paul Licameli
5e7d41ec07 Each .cpp/.mm file includes corresponding header before any other...
... except Audacity.h

This forces us to make each header contain all forward declarations or nested
headers that it requires, rather than depend on context.
2019-03-17 22:54:52 -04:00
Paul Licameli
906e55f047 Experimental.h in all .h or .cpp files that directly use EXPERIMENTALs...
... except Audacity.h; and in no others.

Do so even if Experimental.h gets multiply included, as in both the .h and
.cpp files.

This makes it easier to do a text scan to be sure there are no unintended quiet
changes of meaning because of omission of Experimental.h when the flag is
an enabled one.

Also move inclusions of Experimental.h earlier.

Also don't require Experimental.h to be preceded by Audacity.h to define
EXPERIMENTAL_MIDI_OUT correctly.
2019-03-17 22:54:00 -04:00
Paul Licameli
173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli
6c931dc885 Reimplement TrackPanel::FindTrackRect...
... addressing unfinished business mentioned in comment of commit b7e1cc0.

This eliminates a duplicate definition of track panel area subdivision, which
might grow inconsistent.

Now that subdivision is defined only by the tree of TrackPanelNodes built by
TrackPanel::Root() -- EXCEPT in the drawing code, which is still quite a lot
of other code needing its own difficult refactoring.
2019-03-17 15:59:41 -04:00
Paul Licameli
15777834e0 Remove calls to TrackPanel::FindTrackRect for finding control area 2019-03-17 15:23:51 -04:00
Paul Licameli
6f31a9f7dc Specific types, const versions: getting track & vruler controls...
... See changes to classes CommonTrackPanelCell and Track; the rest follows
2019-03-17 15:20:52 -04:00
Paul Licameli
6f89c48873 Reimplement Track::Pointer using std::enable_shared_from_this...
... now the Track need not be owned yet by a TrackList
2019-03-16 13:11:32 -04:00
Paul Licameli
c68e336247 More use of std:: style members of wxString...
... replacing:

Length => length
Len => length
2019-03-10 14:44:54 -04:00
David Bailes
012d707a8a Bug 2060: Windows: no access to microphone causes crash
Problem:
1. Set no access to microphone in Privacy category of Settings app.
2. Try to record in a new track. (not append to an existing track.)
3. Audacity crashes.

Cause of crash:
TrackPanel::OnTrackListResizing is called with a track after a call to
TrackList::ClearPendingTracks, which has removed its owner.
TrackPanel::OnTrackListResizing ends up calling TrackPanel::UpdateTrackVRuler,
and this function calls TrackList::Channels(t)), which assumes the track has an owner.
Crash.

Fix: in TrackPanel::OnTrackListResizing, check that the track has an owner.
2019-02-05 14:29:22 +00:00
Paul Licameli
03e67b9bcd Bug2026: drawing channel separator on Windows...
... This shouldn't make a difference, but it does.  I suspect MSVC 2017
compiler bugs still remain in implementing braced initialization.
2018-11-06 20:17:14 -05:00
Paul Licameli
50cf2e9a1f Give TrackArtist a back-pointer to TrackPanel 2018-11-05 10:54:58 -05:00
Paul Licameli
4ebfbd9c50 Split class TrackArtist from namespace TrackArt...
... The first is just extended drawing context info, and the second has
functions that retrieve TrackArtist from TrackPanelDrawingContext as needed.
2018-11-05 09:16:50 -05:00
Paul Licameli
99106e3ed3 Carry more information in TrackPanelDrawingContext; fewer arguments 2018-11-05 09:12:45 -05:00
Paul Licameli
c4994ae9c2 kTrackInfoWidth was misleadingly named...
... keep the name, but change the value to be what it really says:
the proper width of the track control panel, agreeing with the hit-test
area, NOT including the left margin

And change places where the constant was used, adding the margin back again.
2018-11-04 18:23:29 -05:00
Paul Licameli
38005054f4 Make TrackInfo a namespace, not a class...
... Its functions take a pointer to TrackPanel when necessary, just to do the
reparenting of the global slider instances
2018-11-04 10:51:00 -05:00
James Crook
b5d4a828d1 More doxygen 2018-11-04 14:21:00 +00:00
Paul Licameli
55774fbb29 When drawing, treat track plus separator BELOW as the natural grouping...
... and treat the top margin of the first track specially.
2018-11-02 23:16:05 -04:00
Paul Licameli
3589aacd7c Rewrite iteration over tracks in DrawEverythingElse 2018-11-02 23:00:28 -04:00
Paul Licameli
10bc061b00 Pass rectangles to drawing routines excluding left & right margins...
... not insets.

This makes them agree with the horizontal extents of the hit-test areas of
event handling code.

Some routines may draw outside of the box passed in to them, as when drawing
the border around a track.

In some of the routines, fewer pixels are painted than before, but these are
always either cleared already when painting left and right margins, or are
overpainted later, as with the right endpoints of sash borders overpainted by
the border around the track.
2018-11-02 22:45:22 -04:00
Paul Licameli
a2e392433a Paint left and right margins of the whole TrackPanel first 2018-11-02 22:38:11 -04:00
Paul Licameli
d0d88118cc Rectangle passed VRuler draw function agrees with hit test rectangle...
... that is, it is one wider than before.  But the drawing routine compensates
to make the picture no different.
2018-11-02 22:36:47 -04:00
Paul Licameli
e70b240338 The ruler and sash draw functions treat their own backgrounds 2018-11-02 21:10:30 -04:00
Paul Licameli
951e7d27da The vruler and sash draw functions treat their own left boundaries 2018-11-02 21:07:48 -04:00
Paul Licameli
0f17b309bc Fuse the two sash-drawing functions, pass a rectangle not a track...
... and be consistent about substituting the track before finding Y and height
2018-11-02 21:07:45 -04:00
Paul Licameli
8d02134d6a Simplify the track rectangle calculations in TrackArtist 2018-11-02 16:51:08 -04:00
Paul Licameli
49dd6002d3 Simplify HighlightFocusedTrack 2018-11-02 16:51:08 -04:00
Paul Licameli
e31669f555 comment out unused function 2018-11-02 16:51:07 -04:00
Paul Licameli
c1b729822c Remove unused arguments of some drawing functions 2018-11-02 16:51:07 -04:00