1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-03 09:09:47 +02:00

191 Commits

Author SHA1 Message Date
Paul Licameli
db16150366 Break cycle: TrackPanelResizerCell, TrackPanelResizeHandle, TrackView 2019-07-09 14:55:31 -04:00
Paul Licameli
2a06b10884 Make objects attached to AudacityProject non-copyable...
... except for Tags; also some uses of final and explicit

This caught a mistake in Scrubbing.cpp
2019-07-02 19:51:24 -04:00
Paul Licameli
c50acea328 Bug2127: Record, Pause, Record, Pause, Close button: shouldn't crash 2019-06-28 10:51:41 -04:00
Paul Licameli
2257fa642a Remove TrackPanel::EnsureVisible; TrackList sends an event instead 2019-06-25 10:54:55 -04:00
Paul Licameli
9e731390f6 Don't define any Track members outside of Track.cpp 2019-06-22 21:46:33 -04:00
Paul Licameli
8793d6b475 Demote Copy to CommonTrackCell; Track points only to that base class 2019-06-22 21:46:33 -04:00
Paul Licameli
278509a505 TrackView, not TrackList, updates Y coordinates of views, using events 2019-06-22 21:46:33 -04:00
Paul Licameli
4339c0df68 Move height calculation utilities to class TrackView 2019-06-22 21:46:32 -04:00
Paul Licameli
3e0d48cc14 Redefine the factories for track views and controls...
... non-intrusively in the Track suclasses, registering functions instead.

For each abstract factory function (of two), build a table of concrete factory
functions, paralleling the hierarchy of Track subclesses.  Dispatch using
runt time type information in the Track objects.
2019-06-21 09:16:49 -04:00
Paul Licameli
604fbd0a2c Addition, deletion, sort of Labels communicated by events...
... and LabelTrack listens to its own events, to update certain state.

This is roundabout for now, but that state is view-related and will move into
another class.
2019-06-20 10:47:25 -04:00
Paul Licameli
0750f62e88 Track::SetSelected is not virtual...
... which will simplify later rewrites that associate selection state with
the track group, not the track.

Since LabelTrack isn't notified immediately of selection changes, instead it
always tests whether it is selected, before using the stored selected label
index.
2019-06-20 10:47:25 -04:00
Paul Licameli
66e32ca35d Move Y position, height, and minimized state into TrackView...
... and eliminate some unnecessary calls to SubstitutePendingChangedTrack,
because the track and the substitute store Y and height in their shared
TrackView object.

Also make GetMinimizedHeight() virtual to avoid inclusion of TrackPanel.h in
TrackView.cpp.
2019-06-18 16:01:06 -04:00
Paul Licameli
3797a5227a Minimized state moved into TrackView 2019-06-18 16:01:06 -04:00
Paul Licameli
7a91cc8e8d Applying pending changed tracks causes adoption of cell objects...
... This will simplify the updating of pending tracks when state is moved into
the view cell object.  No copies of those fields will then be needed.
2019-06-18 16:01:06 -04:00
Paul Licameli
d335276931 Define Track::AdjustPositions() 2019-06-18 16:01:06 -04:00
Paul Licameli
e581fa60d9 Move responsibilities from Track to TrackView classes...
... And Track no longer inherits TrackPanelCell, so be careful to rewrite
some dynamic_casts too to check instead for TrackView.  Those casts won't fail
to recompile if not rewritten.
2019-06-18 16:01:06 -04:00
Paul Licameli
79191d985d Separate Track::Clone (protected virtual) from Track::Duplicate 2019-06-18 16:01:06 -04:00
Paul Licameli
b4c7a8ef2a TrackPanelResizerCell, also in 1-to-1 with TrackView, now owned by it 2019-06-18 16:01:06 -04:00
Paul Licameli
18b4c01c51 TrackVRulerControl is directly owned by TrackView not Track...
... in anticipation of making views to tracks many-to-one, but then the rulers
should be one-to-one with the views.  So go through the view to get the ruler.
The ruler is really a left-hand extension for each view.
2019-06-18 16:01:06 -04:00
Paul Licameli
059d7eaa42 Associate View object with Track, analogous with controls 2019-06-18 16:01:06 -04:00
Paul Licameli
18ba27a641 Define static accessor functions for VRulerControls and TrackControls...
... and use std::enable_shared_from_this

Temporarily putting TrackControls.cpp back into the big s.c.c, now 59 files

Future rewriting might even eliminate all mention of those classes in
the definition of the Track classes.
2019-06-18 16:01:06 -04:00
Paul Licameli
98f322d685 Move writing and reading of common Track fields into functions...
... also now writing selected state of TimeTrack as for other tracks, fixing
an omission, with no harm to forward compatibility
2019-06-18 11:36:50 -04:00
Paul Licameli
291bd7258f Track.cpp does not depend directly on its subclasses 2019-06-12 11:14:19 -04:00
Paul Licameli
98960c4fc3 Track.cpp does not depend directly on AudioIO 2019-06-12 11:14:19 -04:00
Paul Licameli
e969315c90 Free TrackControls and TrackSelectHandle from cycles, to high levels 2019-06-10 21:56:46 -04:00
Paul Licameli
116ff70756 static TrackFactory::Get()...
... not member functions of AudacityProject
2019-05-23 13:55:14 -04:00
Paul Licameli
14ab93a01f static TrackList::Get()...
... not member function of AudacityProject
2019-05-23 12:58:47 -04:00
Paul Licameli
191cd23b54 XMLTagHandler.cpp has fewer dependencies...
... freeing three files from dependency cycles
2019-05-18 20:29:25 -04:00
Paul Licameli
548192fcf3 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:58:34 -04:00
Paul Licameli
56f51d8176 Revert "Remove redundant #include-s from .h files..."
This reverts commit b7fe62d17067b4441530dd36b25052cea3ad44b5.
2019-05-16 14:33:55 -04:00
Paul Licameli
b7fe62d170 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:15:05 -04:00
Paul Licameli
580e1a8a63 move a comment 2019-04-23 13:40:17 -04:00
Paul Licameli
4d29686116 Remove wx/gdicmn.h from headers 2019-03-30 11:52:48 -04:00
Paul Licameli
c3aad2e026 Remove wx/event.h from headers 2019-03-27 04:36:51 -04:00
Paul Licameli
1d0247607a Remove wx/string.h from headers 2019-03-26 11:33:55 -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
Paul Licameli
d261ea2558 Define and use utility template ValueIterator...
... generalizing the fix of commit 7591891 to other cases, making the iterators
safe for adaptation with std::reverse_iterator should the need ever arise
2019-03-18 08:44:40 -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
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
166e73fdeb Make inherited TrackList::push_back private 2019-03-16 14:29:34 -04:00
Paul Licameli
47fa651d79 TrackList inherits std::enable_shared_from_this 2019-03-16 13:11:33 -04:00
Paul Licameli
41175e94cd Simplify by removing many std::move of shared_ptr to tracks...
... Don't need them, as we did with std::unique_ptr
2019-03-16 13:11:33 -04:00
Paul Licameli
a0aa69a248 All tracks allocated with make_shared, no more make_unique...
... so that we can use Track::SharedPointer without undefined behavior even on
tracks that don't yet belong to any TrackList.

Also fix the return type of function template TrackList::Add and remove some
casts.
2019-03-16 13:11:33 -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
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
James Crook
7030c9fc4f More doxygen 2018-11-03 13:18:26 +00:00
Paul Licameli
26abe0255d Precautions also in TrackIterRange::StaringWith() as in EndingAfter() 2018-10-30 11:37:08 -04:00
Paul Licameli
74a360f682 Bug2020: Fix sync-lock groupings 2018-10-30 10:54:37 -04:00
Paul Licameli
793949aa29 more comments about TrackIterRange operators 2018-10-30 09:32:29 -04:00