Commit Graph

78 Commits

Author SHA1 Message Date
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
Paul Licameli e653b4aaf8 Eliminate Experimental.h, configure compile options instead...
... This makes it impossible to forget to include the EXPERIMENTAL definitions
(such as when cutting and pasting code) and so get unintended quiet changes of
behavior.

The EXPERIMENTAL flags are now specified instead in new file Experimental.cmake
2021-04-27 12:40:07 -04:00
Paul Licameli 92e36332f3 Reimplement importation of .aup3 file more simply...
... Breaking dependency of ProjectFileIO on on TimeTrack, and reusing the same
functions that implement cross-document copy and paste of tracks.

Also changing behavior, so that if a TimeTrack exists but another is imported,
then the import quietly replaces the existing completely.
2021-02-02 15:22:44 -05:00
Paul Licameli 15313a27f7 Define virtual Track::PasteInto to simplfy Paste...
... Also making EditMenus not dependent on TimeTrack
2021-02-02 15:01:51 -05:00
Paul Licameli badb1643fa New Track virtual eliminates a track_cast in CommonCommandFlags...
... Also a better name for one of the command flags

This allows removal of special mention of TimeTrack
2021-02-02 14:42:21 -05:00
Paul Licameli 4ca3e7096f
Track factory cleanup (#646)
* Don't need TrackFactory to make LabelTrack

* Don't need TrackFactory to make NoteTrack

* Don't need TrackFactory to make TimeTrack, or ZoomInfo in the factory

* Remove some forward declarations

* Rename TrackFactory as WaveTrackFactory, move it out of Track.cpp
2020-08-22 18:44:49 -05:00
Paul Licameli 1fcb77ebce
Unitary fixes (#598)
* Eliminate unneeded back-pointer to project from non-wave Tracks...

... now that DirManager is gone

* Remove unused declarations

* SampleData::mProject was not used

* Correct ProjectFileIO::GetLibraryError

* Remove unnecessary #include directives
2020-07-02 11:42:25 -05:00
Leland Lucius d39590cf41 AUP3: First round of updates
!!! THERE WILL NO DOUBT BE BUGS !!!

This is a big one and there's still several things to
complete. Just want to get this in the wild to start
receiving feedback.

One big thing right now is that it will NOT load pre-aup3
files.  An importer is on the way for that.
2020-07-01 02:30:18 -05:00
Paul Licameli cbe4a46af2 Bug2265: Should save and restore track heights...
... Regression happened at 3f1fd8ced0

The heights were written to file, but not read back again.

This fix was done carefully to avoid making dependency cycles.  We don't want
Track to depend on TrackView or TrackControls.

It's not great that LabelTrack, NoteTrack, TimeTrack, and WaveTrack now have
those dependencies, but at least they don't make cycles.

It would be better to figure out how to attach the view and controls to the
track with ClientData, then just invoke BuildAll to repopulate the view and
controls, so that they are non-null when you reach
Track::HandleCommonXMLAttribute.
2020-01-14 20:04:32 -05:00
Paul Licameli df14253a50 Remove unnecessary #include-s in TimeTrack 2019-06-20 16:44:47 -04:00
Paul Licameli 7466556e21 Move drawing code for TimeTrack...
... Freeing 3 files from cycles:
EnvelopeHandle
Mix
TimeTrack
2019-06-19 11:35:48 -04:00
Paul Licameli 63350d8573 TimeTrack drawing not dependent on EnvelopeEditor...
... after a static function is moved from EnvelopeEditor to Envelope
2019-06-19 11:35:47 -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 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 46bf5a82fc Don't pass whole TimeTrack to Ruler or Mixer...
... they need only the information in a (Bounded)Envelope.
2019-06-10 20:48:38 -04:00
Paul Licameli 5ae606cf53 Move TimeTrack's upper and lower range into new BoundedEnvelope...
... confusingly, Envelope already carried its own limiting values, but those
in the TimeTrack were not guaranteed to be the same.

I'm just preserving behavior as I break file dependencies and won't try to fix
that confusion now.
2019-06-10 20:48:38 -04:00
Paul Licameli 7ed99c6e8f Split EnvelopeEditor.cpp from Envelope.cpp...
... Envelope drops down out of the big strongly connected component, the new
piece stays behind
2019-06-10 20:48:38 -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 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 390af96796 Dispatch read of top-level project XML tags with a table of functions...
... which makes Project.cpp a bit less dependent on some details of other
classes

This puts Tags.cpp back into the big strongly connected component of the
dependency graph.  That will be remedied later when Project.cpp becomes a
low-level file
2019-05-20 21:38:07 -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 08c16b6eb7 Remove wx/{html/htmlwin,fileconf,dragimag,debug,dcclient}.h from *.h 2019-03-30 10:53:22 -04:00
Paul Licameli 3760db9dff Remove wx/wxchar.h from headers 2019-03-29 15:56:54 -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 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 99106e3ed3 Carry more information in TrackPanelDrawingContext; fewer arguments 2018-11-05 09:12:45 -05:00
James Crook 657159d542 Fix C4189 and C4100 Warnings
C4189 is 'Local variable initialised but not used'
C4100 is 'Unreferenced parameter'

Fixed some other warnings, e.g. about empty if, too.
2018-10-10 19:46:24 +01:00
Paul Licameli 51842fc78b Use TypeSwitch and track_cast 2018-10-01 10:58:47 -04:00
James Crook 0022e0c06c Bug 1844 - Nyquist effects move subsequent envelope points by selection's length
Also renamed Envelop::Paste to Envelope::PasteEnvelope, since it was hard to find
just its usages, given the many usages of WaveTrack::Paste.
2018-08-07 10:39:18 +01:00
Paul Licameli 4d978bcefb Use wxPrintf not printf 2017-12-16 11:54:32 -05:00
James Crook f463eda36c Clean up some dead code and MSVC warnings.
- Dead code from experiments in SelectionBar removed.
- Many warnings about unused parameters fixed with WXUNUSED()
- Many warnings about signed / unsigned comparisons cleaned up.
- Several 'local variable declared but not used' warnings fixed.
2017-12-08 15:20:39 +00:00
Paul Licameli 7fb107e143 Highlighting of envelopes 2017-07-11 13:56:41 -04:00
Paul Licameli ada4b6307d Pass more context information into drawing routines 2017-07-09 12:34:27 -04:00
Paul Licameli 58e7a94264 Envelope::Paste takes a time tolerance argument 2017-05-29 13:53:25 -04:00
Paul Licameli 5886bd8eb2 Don't push time track points right of paste point off to infinity 2017-05-28 00:50:34 -04:00
Paul Licameli e428425c7d Change the drawing of wave track envelope at high zoom...
... The function defined by the envelope is evaluated exactly at the times of
samples, but not between samples -- instead there is a simple interpolation.

Therefore the curve might not go through the control points when they are not at
sample times.

The exact value of the function defined by the envelope has no influence on
rendering of the sound in between samples.  So this can make it clear that
the middle point has no influence at all in case three points are very close.

Drawing of other envelopes (Time track, Equalization curves) is not changed.
2017-05-26 14:51:50 -04:00
Paul Licameli aba52bc79e Update envelope properly for TimeTrack and WaveTrack editing...
... Formerly this was done correctly only for cut and delete from WaveTrack,
paste into WaveTrack, and sync-lock adjustment of WaveTrack (either lengthening
or shortening).

Now also properly done for TimeTrack cut and paste, and also for:

Split cut
Split delete
Trim
2017-05-09 09:22:06 -04:00
Paul Licameli 9c683a4f19 Rename some member functions of Envelope 2017-05-07 11:00:55 -04:00
Paul Licameli 4be19128c0 Better constructors for Envelope 2017-05-07 11:00:55 -04:00
James Crook ff3ed65d83 Draw TimeTrack Background in unselected colour.
Using blank colour is incorrect here.
I also removed an unused pen and brush.
2017-04-27 21:40:16 +01:00
James Crook 60a53d560b Ensure colours of rulers and TimeTrack background update after a theme change. 2017-04-27 12:08:25 +01:00
James Crook d9e25bfc12 Add themed background for time track 2017-04-26 22:34:14 +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 f1b354b141 More pure virtuals in Track, supply Note and Time overrides 2017-03-31 18:03:37 -04:00
Paul Licameli b81cdee7e3 Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
Paul Licameli 18be1bdad6 Remove naked new[] in: tracks 2017-03-17 17:52:47 -04:00