Commit Graph

73 Commits

Author SHA1 Message Date
James Crook
5a3e9cd063 Fix dialog naming
For nicer Doxygen results, we need consistency in naming of classes.
Dialag classes are now called SomethingDialog.
2019-12-06 10:39:07 +00:00
Paul Licameli
705b4b28e7 Register a predicate with each CommandFlag bit 2019-06-14 00:31:15 -04:00
Paul Licameli
e17fc86c23 Distinguish another undo event type 2019-06-12 11:08:50 -04:00
Paul Licameli
06c9896498 Send Undo events through the project, not the UndoManager 2019-06-12 11:08:50 -04:00
Paul Licameli
72b7c776a8 static UndoManager::Get()...
... not member functions of AudacityProject
2019-05-23 12:58:47 -04:00
Paul Licameli
d5b2507af9 Remove unneeded inclusions of Project.h, no cycles broken 2019-05-22 10:02:24 -04:00
Paul Licameli
338d7cd164 A class encapsulating the global clipboard 2019-05-17 06:47:53 -04:00
Paul Licameli
6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
Paul Licameli
c09edbb18a Define and use const version of WaveTrack::GetAllClips 2019-05-16 12:30:27 -04:00
Paul Licameli
b4ce681867 WaveTrack.h does not include WaveClip.h 2019-03-18 01:44:42 -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
2db49dc1f0 Use standard library style members of wxArrayString (and wxString) ...
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes

for wxString,

IsEmpty => empty
Clear => clear
Alloc => reserve

for wxArrayString,

Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
2019-03-10 14:43:57 -04:00
Paul Licameli
cee0d35da2 UndoManager emits events when state changes 2018-10-27 12:51:59 -04:00
Paul Licameli
4f7d308ca3 Some inversion of control flow when popping Undo state 2018-10-27 11:31:42 -04:00
Paul Licameli
968d63d5fd Rewrite many iterations over tracks and channels in various places 2018-10-01 13:35:51 -04:00
Paul Licameli
8c486b50f6 Changes via History affect selection exactly as undo/redo...
... I don't know a good reason why they didn't before.  It was ancient (2010)
behavior.

This also means that RollbackState really will properly rollback the selection
too, even when there are redo items.

This simplifies away an odd special case.
2018-08-09 13:22:07 -04:00
James Crook
9357c90b43 Bug 1859 - Macros on files - Save Project causes overwrites. thus loses data
AudacityProject::Save() is now batch mode sensitive, and if in batch mode (and not overwriting) will save without prompting.
The loop for applying macros to multiple files now also clears down the project, using the new function ResetProjectToEmpty().
2018-08-05 21:34:24 +01:00
Paul Licameli
b8a8712ba0 make_movable -> std::make_unique 2018-05-10 00:56:36 -04:00
Paul Licameli
7a0475e39f Remove most uses of AUDACITY_OLD_STD 2018-05-10 00:56:36 -04:00
Paul Licameli
6d687136aa Bug1845: Remove the vacuous undo check, wasn't good enough anyway 2018-02-26 09:49:01 -05:00
Paul Licameli
43776f5263 Don't push vacuous undo items...
... Vacuous pushes should not happen yet, but may happen after the machinery
for pending track changes is added and used.

This will only detect the case of one new recording track being modified. It
will not detect it if that track is modified, but other tracks exist that are
not modified.
2018-02-21 19:20:57 -05:00
Paul Licameli
539e870302 Add machinery to TrackList for pending changes to tracks 2018-02-21 19:20:56 -05:00
Paul Licameli
4ef8da8f16 Revert "Preliminaries to support better interaction of undo and recording"
This reverts commit 6e75ae58ac, reversing
changes made to 714d53e00f.
2018-01-14 21:36:33 -05:00
Paul Licameli
a0c3a4b43c Add machinery to TrackList for pending changes to tracks 2018-01-14 19:03:57 -05:00
Paul Licameli
cb403954fa Use std::[tr1::]unordered_(set|map), not the wxWidgets container macros 2018-01-08 18:22:51 -05:00
Paul Licameli
8bf3791edf TrackList constructed only by factory function, to avoid more trouble 2017-07-14 21:55:32 -04:00
Paul Licameli
63ae687baf Consolidation of Undo items not limited to three 2017-05-18 09:02:27 -04:00
Paul Licameli
38236a807c More new -> NEW, delete -> DELETE in comments 2017-03-17 17:52:41 -04:00
Paul Licameli
4ec7044639 Better calculation of space usage in undo history dialog...
... Don't double-count any block files.  Count each only in the latest undo
history state containing it, because you reclaim its space only by deleting
the history at least up to that state.

Block files may still be double-counted between undo history and the clipboard.
2016-11-07 16:46:36 -05:00
Paul Licameli
93c0b5a92d Add button to History dialog to clear the clipboard & space calc 2016-11-07 11:25:27 -05:00
Paul Licameli
f993f1eadf Regularize casts as (int), so they are easier to find and review 2016-09-20 08:42:11 -04:00
Paul Licameli
4ecd93beff fix mac build! 2016-09-06 16:41:33 -04:00
Paul Licameli
35d3dd01f1 fix Windows build 2016-09-06 12:58:22 -04:00
Paul Licameli
c9bff2f0f4 BlockFile::GetSpaceUsage() returns an unsigned value 2016-09-06 12:39:57 -04:00
James Crook
af61389322 Fix memory leak in CalculateSpaceUsage
Memory leak was caused by diagnostics.
2016-08-18 21:50:34 +01:00
Paul Licameli
2ede67be96 Use type alias for pointer to BlockFile, which is still a dumb pointer 2016-08-16 12:29:59 -04:00
Paul Licameli
84a6456788 Iterate over all clips of a track, including cutlines, where needed 2016-08-13 20:17:55 -04:00
Paul Licameli
b548e641ae Simplify iterations over WaveClips outside of WaveTrack/WaveClip; ...
... also add some const qualifiers
2016-08-12 20:53:37 -04:00
Paul Licameli
a52f7f8410 new -> NEW in comments, so text search for naked new excludes them 2016-08-08 10:07:37 -04:00
Paul Licameli
8f02213e23 travis 2016-04-10 21:19:15 -04:00
Paul Licameli
f94b3b3afa Add some const qualifiers to BlockFile methods 2016-04-10 21:05:20 -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
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
de75a00c10 Define movable_ptr and make_movable, use __AUDACITY_OLD_STD__ in fewer places 2016-03-25 20:27:25 -04:00
Leland Lucius
9dc9348127 Fixes bug #1344 (mac build)
In addition, the Xcode project can now build against the 10.6
or 10.7 SDKs.  All that is needed is to change the SDK version
and the other settings will change automatically.
2016-03-07 00:29:26 -06:00
Paul Licameli
88eeebcb8b Undoing and redoing of Tags...
Use reference counting (in std::shared_ptr) to avoid replicating Tags with each
Undo state.
2016-02-24 19:25:39 -05:00
Paul Licameli
e12a060751 Define UndoState 2016-02-24 19:10:40 -05:00
Paul Licameli
a5b6c9fd8f Add some const qualifiers; define TrackListConstIterator 2016-02-24 19:10:39 -05:00
Paul Licameli
a1c7b396b3 UndoStackElem has proper constructor and destructor; use std::vector 2016-02-24 19:10:36 -05:00