Commit Graph

82 Commits

Author SHA1 Message Date
James Crook
7fb5ec4b7a Revert "Provide STL idiom for iterating tracks..."
Unsafe on MSVC 2013.
2018-01-14 14:24:21 +00:00
Paul Licameli
f9dab3679c Provide STL idiom for iterating tracks...
... and require qualified name access to use the underlying std::list iterators
that return shared_ptr to Track.

Which should not be done very much outside of class TrackList, but a few
places need it.
2018-01-13 19:37:05 -05:00
Paul Licameli
5407079c62 Remove EXPERIMENTAL_OUTPUT_DISPLAY...
... Maybe a good feature idea, but the implementation pollutes the code in
too many places.

It's a special case of the more general idea of many-to-one associations
between screen rectangles and track objects.  More generalized ways to
accommodate that should be sought.
2018-01-12 12:08:09 -05:00
Paul Licameli
c975de8c5e More use of shared_ptr to Track, for safety...
... This even makes it possible to remove the prohibition of undo and redo
during transport, not that we want to though.  Playback and recording will
continue, using track objects that might not be in the current project.
2018-01-10 20:05:11 -05:00
James Crook
a49f14ad02 doxygen. Class list completed for letter 'A'. 2017-11-09 18:32:29 +00:00
Paul Licameli
5dd72acc02 Bug1770: fix crash applying chains 2017-11-04 20:59:55 -04:00
James Crook
68897d8932 Some cppcheck fixes by David Binderman 2017-11-04 17:47:39 +00:00
Paul Licameli
8bf3791edf TrackList constructed only by factory function, to avoid more trouble 2017-07-14 21:55:32 -04:00
Paul Licameli
903cebafe1 Bug1669: Close and Menu buttons should never disappear...
... As they did with Ctrl+Shift+F, with a certain minimimum number of wave
tracks that depends on screen resolution.  On my Macbook, that was 13 tracks.

This bug was a consequence of James' TCP layout changes making buttons a little
taller plus my changes to hide any top controls for which there is not
sufficient height.

The fix makes the height of tracks after Ctrl+Shift+F a bit more (44 pixels
not 40) than in 2.1.3.

This fix also replaces some more "magic numbers" with calculation from
tabled data about TCP layout.
2017-07-14 12:03:16 -04:00
Paul Licameli
54af4f1ff7 More precautions about the back-pointers of tracks to their lists 2017-07-14 10:03:11 -04:00
Paul Licameli
16645f6b95 Back-pointer from Track to TrackList is weak (fixes crashes) 2017-07-10 11:48:11 -04:00
Paul Licameli
708d84ac22 CommonTrackPanelCell::FindTrack returns shared_ptr 2017-06-27 23:09:35 -04:00
Paul Licameli
2806b509e2 Fix crashes in repainting, and update first visible track correctly 2017-06-26 15:20:35 -04:00
Paul Licameli
d635535241 Fix another error in Mac build 2017-06-25 16:00:30 -04:00
Paul Licameli
d3c9a1decb JAWS fix?: Now do the delay of event handling...
... Queue, don't immediately process, TrackList events, and if listeners want
to hold pointers to tracks, let them use weak_ptr or shared_ptr
2017-06-25 13:35:17 -04:00
Paul Licameli
bd5d2bf114 Accessor for shared pointer to track, given only a bare pointer 2017-06-25 13:35:15 -04:00
Paul Licameli
1fce8b54f2 Remove oudated comment 2017-06-25 13:35:14 -04:00
Paul Licameli
750fc34fac Clarify what the TrackList events are for...
Also fixes this bug:

Vertical rulers did not narrow as needed after deletion of the lowest track.
2017-06-25 03:00:28 -04:00
Paul Licameli
c48bf4f37d Fix old unreported minor bug with vertical rulers of Label tracks...
New project; create a label track; undo; redo.  Used to see no vertical ruler.
2017-06-25 01:46:20 -04:00
Paul Licameli
68dfdab843 Store tracks in TrackList with shared_ptr ...
... but still use unique_ptr from track factories and importers.
2017-06-23 15:05:50 -04:00
Paul Licameli
91c86fd937 TrackPanelCellIterator visits all cells, and FindCell simply uses it 2017-06-17 03:01:40 -04:00
Paul Licameli
14d45eda33 Define and use the UIHandle and TrackPanelCell protocols, but...
...no actions reimplemented to them yet.

Later commits will move special cases one at a time from TrackPanel, preserving
all click and drag capabilities at each step.  With a few exceptions, but those
lost abilities are restored in yet later commits.  (Ctrl+Click on the Label
track being one.)
2017-06-15 08:20:56 -04:00
James Crook
d8a71c40eb Tweak TCP minimize button Position
It now doesn't impinge on the bottom edge of the TCP, and it is left aligned flush with the left edge.
Minimum track height increased accordingly.
2017-06-10 10:10:38 +01:00
Paul Licameli
f0c149b890 Default MIDI track height is enough to display velocity slider...
... It is computed from the layout table, and in fact comes to 158 pixels,
versus 150 for other tracks.
2017-06-06 22:39:30 -04:00
Paul Licameli
721faf89c6 Avoid possible dangling pointer problems with EVT_TRACKLIST_UPDATED 2017-06-01 14:40:05 -04:00
James Crook
028ed19d90 Sync with DarkAudacity 2017-04-02 23:07:13 +01:00
Paul Licameli
e1473dfe76 void return, not boolean success, from some Track virtual functions...
... The return codes were mostly ignored anyway, and exceptions will be thrown
instead.

It seems there was also confusion whether the return values of Track::Paste
and Track::SyncLockAdjust were to indicate success or indicate whether there
was any change.  No matter now.
2017-03-31 18:26:52 -04:00
Paul Licameli
6b84dc1c1d Factory methods will return non-NULL or throw 2017-03-31 18:14:29 -04:00
Paul Licameli
a936aed643 Another use of type AudioTrack 2017-03-30 20:48:27 -04:00
Paul Licameli
7bda40f656 Common functions read and write mute and solo in Wave and Note 2017-03-30 16:00:27 -04:00
Paul Licameli
6c4cf46c06 Move mute and solo state into PlayableTrack 2017-03-29 13:45:08 -04:00
Paul Licameli
5fdd9fe05a Remove TrackList::GetLink 2017-03-17 17:52:29 -04:00
Paul Licameli
64d163ebcd Make EXPERIMENTAL_OUTPUT_DISPLAY compile 2017-03-17 17:52:18 -04:00
Darrell Walisser
11cfe75793 Add missing template instantiation 2017-02-07 13:11:33 -05:00
Paul Licameli
c439ceba03 Consistency among the methods of SyncLockedTracksIterator...
A sync-lock group is a maximal sub-sequence of the tracks, containing:
one or more wave tracks (and/or Note tracks, if MIDI is enabled),
and zero or more label tracks.

(These are not exhaustive of all of the types of tracks.)

So redefine Next(), Prev(), and Last() carefully to implement this intention.
2016-11-04 00:10:21 -04:00
Paul Licameli
67cec5ad83 Make many counts of tracks and channels unsigned...
... And in some places where a library uses signed types, assert that
the reported number is not negative.

What led me to this, is that there are many places where a size_t value for
an allocation is the product of a number of channels and some other number.
2016-09-07 10:11:41 -04:00
Paul Licameli
46f38708ed Dir manager uses std::shared_ptr 2016-08-13 12:23:05 -04:00
Paul Licameli
f4aee7948f Bug1429: Fix Mac crash in 2nd Audacity process enabling VST plugins 2016-06-27 23:40:50 -04:00
Paul Licameli
7e0de9a9bc Fix incidentals to Bug 1331, though not the bug itself...
... See comments #1 and #2 at
http://bugzilla.audacityteam.org/show_bug.cgi?id=1331

Don't make strange undo history if, e.g., R to record (or other keystroke
with undoable effects) interrupts a drag with undoable effects (like time
shift).  Ensure that by first simulating a mouse button up event to stop the
drag, before dispatching the keystroke.

Don't crash if certain other drags, that do not have undoable effects, such
as selection or vertical ruler drag -- are interrupted by a keystroke
command (Ctrl+C in particular could cause crash).  However, in these cases,
the drag is still allowed to continue.
2016-05-21 23:19:09 -04:00
Max Kellermann
8ef83759a7 Track: disable TrackList::Add<NoteTrack> if MIDI support is disabled
Fixes build failure when configured with --without-midi.
2016-04-28 04:40:01 -04:00
Paul Licameli
b28ec2957a Make EXPERIMENTAL_MIDI_OUT compilable, but it doesn't link 2016-04-09 15:10:05 -04:00
Paul Licameli
e327032137 Mac build 2016-03-31 17:39:04 -04:00
Paul Licameli
a6ca36cdab TrackList holds smart pointers to tracks, Add() only takes rvalue refs to such 2016-03-26 15:41:31 -04:00
Paul Licameli
c5a70126eb TrackList always deletes tracks on destruction or when cleared 2016-03-26 15:41:29 -04:00
Paul Licameli
bc5519a0e2 TrackList::Remove and TrackListIterator::RemoveCurrent always delete the track 2016-03-26 15:41:26 -04:00
Paul Licameli
81c2cc950f Rewrite the sorting of tracks 2016-03-26 15:41:24 -04:00
Paul Licameli
a6fe2b19d6 TrackList uses std::list. Eliminate TrackListNode and unused ReplaceCurrent(). 2016-03-26 15:41:21 -04:00
Paul Licameli
3015a9c8d9 Track cut and copy functions return a unique_ptr argument...
... Because they are factory functions.
2016-03-26 11:50:13 -04:00
Paul Licameli
f42a953752 Track duplication methods return unique_ptr, although some callers...
... simply release() them for now.
2016-03-26 11:50:10 -04:00
Paul Licameli
c609af3bbe Correct TrackList::Swap -- mind the back-pointers in the tracks. 2016-03-14 11:18:32 -04:00