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

157 Commits

Author SHA1 Message Date
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
dc9e436dde Change the track view copy function...
... It is const, renamed CopyTo, and invokes the create-on-demand factory in
the destination track; this means Track.cpp doesn't need to do that, and so
does not need TrackView.h
2019-06-22 21:46:33 -04:00
Paul Licameli
3f1fd8ced0 TrackView handles its own special XML attributes via virtual functions 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
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
c8b62f5d8a Define TrackView::Copy, cause all track duplications to invoke it...
... but it does nothing yet.

This will be important to preserve undo/redo behavior of view changes, when
view state is moved out of the proper Track objects.
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
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
05efeeb5bd New files for ProjectSettings 2019-06-03 01:13:13 -04:00
Paul Licameli
dd10e00a2d New attached structure ProjectSettings stores rate, snap-to, et al. 2019-06-02 14:42:00 -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
629678525c Bug2082: collapse, append-record, expand should restore track height 2019-03-25 19:18:11 -04:00
Paul Licameli
adcb93512c Include Audacity.h in all files that test config USE_ macros...
... except Experimental.h, but see preceding commit.

This is especially important in the header files.

Be sure there are no quiet changes of meaning when a header file is included
in a different context, not having seen Audacity.h.  Rather include Audacity.h
even if redundantly.

Also, in some header files, move more inside the include-guard #ifdef-#endif
pair.
2019-03-22 12:36:54 -04:00
Paul Licameli
12952019b2 Bug2078: crash append-recording to minimized track...
... bug was introduced at commit 1a59ba6
2019-03-18 10:33:01 -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
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
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
Paul Licameli
52642e49a5 Define and use utilities transform_range, transform_container 2019-03-10 14:43:47 -04:00
Paul Licameli
3be57fce49 Bug2015: crash repeatedly append-recording with sync-lock on 2018-10-29 20:35:45 -04:00
Paul Licameli
2741d58880 TrackList emits more events for certain changes of state of tracks...
... Also rewrote some of the existing event handling so all events from
TrackList are of the same, custom event class, and distinguishing addition
from resizing events, though this distinction is not yet used
2018-10-27 11:31:42 -04:00
Paul Licameli
e6e4f44c81 Bug1997: Split Stereo Track and Split Stereo to Mono were doing nothing 2018-10-05 22:09:10 -04:00
Paul Licameli
92cceaf599 Fix usage of InconsistencyException 2018-10-04 11:44:46 -04:00
Paul Licameli
526179b63e Remove a use of c_str 2018-10-01 19:48:10 -04:00
Paul Licameli
7e6a543473 Define TrackList::GroupChannels() 2018-10-01 13:42:35 -04:00
Paul Licameli
2ee87082cb Track::GetLink and GetLinked are private, but SetLinked isn't yet 2018-10-01 13:42:34 -04:00
Paul Licameli
b5f52e7c1c Remove old style track iterator classes 2018-10-01 13:42:34 -04:00
Paul Licameli
b94e8fec96 Remove VisibleTrackIterator 2018-10-01 11:20:52 -04:00
Paul Licameli
1a59ba6331 Simplify some internals of TrackList, don't assume at most 2 channels 2018-10-01 10:54:14 -04:00
Paul Licameli
7ec734b087 Rewrite TrackList::SwapNodes without GetLink(ed) 2018-10-01 10:54:04 -04:00
Paul Licameli
05ddfaf82b Remove TrackList::Select 2018-10-01 10:47:51 -04:00
Paul Licameli
a0e15cfbbd Remove TrackListIterator::RemoveCurrent 2018-10-01 10:42:02 -04:00
Paul Licameli
89748cbe3c Remove "skiplinked" argument of old track iterators 2018-10-01 10:35:46 -04:00
Paul Licameli
a3cdb08ee0 Classes and functions for type-safe iteration over tracks 2018-09-29 22:17:55 -04:00
Paul Licameli
6930b63192 Redo track kind as an enum class defined at global scope 2018-09-29 21:41:47 -04:00
Paul Licameli
34cc1ff577 Rename, rewrite, and simplify use of FindPendingChangedTrack 2018-09-13 13:56:47 -04:00