Commit Graph

54 Commits

Author SHA1 Message Date
Paul Licameli 406b23cae7 More uses of AUDACITY_DLL_API...
... in many places where the function call will later need to be between
modules (or libraries, or the executable) and the annotation will be a necessity
to keep the linkage working on Windows.

That's all that this sweeping commit does.
2021-05-10 10:46:55 -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 b881a6e918 Move drawing code for tracks, free EnvelopeEditor from cycles 2019-06-26 23:39:42 -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 7466556e21 Move drawing code for TimeTrack...
... Freeing 3 files from cycles:
EnvelopeHandle
Mix
TimeTrack
2019-06-19 11:35:48 -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 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 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 c982cf6a41 Remove wx/intl.h, wx/brush.h, wx/bitmap.h from headers 2019-03-30 11:45:20 -04:00
Paul Licameli ec2f26e48c Remove wx/pen.h, wx/thread.h from headers 2019-03-30 10:17:18 -04:00
Paul Licameli 4e9c3cfb5f Remove wx/{dc,tokenzr,tglbtn,statusbr,simplebook}.h from *.h 2019-03-29 06:29:35 -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 99106e3ed3 Carry more information in TrackPanelDrawingContext; fewer arguments 2018-11-05 09:12:45 -05: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 ada4b6307d Pass more context information into drawing routines 2017-07-09 12:34:27 -04:00
Paul Licameli 8e44827980 TrackPanelCell hit tests can return multiple results...
.. though only the first is used yet
2017-07-09 08:17:40 -04:00
Paul Licameli b3d62e2ab6 Simplify by removing class HitTestResult...
... Because all hit tests returned all fields blank, or else, returned a
UIHandle object whose Preview method gives the rest of the information; so
the other fields were redundant.
2017-07-09 07:57:34 -04:00
Paul Licameli 2c1a16f593 Changed lifetime management of UIHandle objects, no singletons...
... Rather, construct them during hit tests (also capturing more state sooner
rather than at Click time, and adding some accessors for later use)

This also fixes bug 1677 by other means and avoids similar problems.

A cell may be implemented to re-use a previously hit handle object, not yet
clicked, in a later hit test, by remembering a weak pointer, but TrackPanel
holds the strong pointers that determine when the object is destroyed.

And the objects will surely be destroyed after drag-release, or ESC key.

For now they are also destroyed whenever not dragging, and hit-testing is
re-invoked; that will be changed later, so that the re-use mentioned above
becomes effective, but still they will be destroyed when the pointer moves
from one cell to another.
2017-07-09 07:23:28 -04:00
Paul Licameli 3a8280c562 Distinguish TrackPanelMouseState from TrackPanelMouseEvent...
... Let cell hit tests, and handle preview, know states only, not transitions.

Cell hit tests are passed a mouse state that does not always match the current,
but anticipates the button click to come; usually left, but if the Control
[sic] key on Mac is down, then right.

Thus, pressing and releasing Mac Control in multi-tool switches in and out of
the magnifier cursor.
2017-07-09 06:38:55 -04:00
Paul Licameli bce3571372 Redo hit test priorities in TrackPanel...
Zoom tool takes precedence;

Otherwise do special hits appropriate to the track subclass -- and only
WaveTrack here uses Tools toolbar state, and now disallows clicks on things
when they are not drawn because the view is spectrogram;

Finally, default to right button zooming in Multi tool, or to time shift in
that tool, or to selection adjustment in Multi or in Select tool.
2017-06-27 08:26:07 -04:00
Paul Licameli 35ce499ce1 Manage TrackControls and TrackVRulerControls by shared_ptr; ...
... they are not singletons; and the back-pointers to their Tracks are weak.
2017-06-26 16:34:10 -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 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
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 81285ee0c1 More const and override 2017-03-17 17:52:20 -04:00
Paul Licameli 46f38708ed Dir manager uses std::shared_ptr 2016-08-13 12:23:05 -04:00
Paul Licameli 20bee00115 Remove some naked new amd delete in: tracks and clips 2016-08-08 07:30:44 -04:00
Paul Licameli f06dadbd68 Comment out unused function declarations 2016-04-12 00:55:41 -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 70c1d57591 More const qualifications, and mutables, for functions that draw tracks...
... The display related  members that had to become mutable are probably
ones that don't belong in the track classes, ultimately.
2016-02-27 12:35:17 -05:00
Paul Licameli 990080ae7d Replace virtual with override wherever possible; eliminate needless virtual...
... for functions in final classes.

override is like const -- it's not necessary, but it helps the compiler to
catch mistakes.

There may be some overriding functions not explicitly declared virtual and I did
not identify such cases, in which I might also add override.
2016-02-26 12:35:38 -05:00
Paul Licameli 7824e94030 Harmlessly qualify classes as final (or explicitly comment not)...
... Should have no effect on generated code, except perhaps some slight faster
virtual function calls.  Mostly useful as documentation of design intent.

Tried to mark every one of our classes that inherits from another, or is a
base for others, or has abstract virtual functions, and a few others besides.
2016-02-24 20:58:30 -05:00
Paul Licameli a5b6c9fd8f Add some const qualifiers; define TrackListConstIterator 2016-02-24 19:10:39 -05:00
Paul Licameli 7c4c45a0d5 "new"->"NEW" in comments, easier to find remaining naked operator new 2016-02-14 18:52:41 -05:00
Paul Licameli 17c9369286 Bug1239: Correct time rulers after importing files (with File>Open) ...
... The fisheye stuff was to blame.
2016-01-26 18:09:29 -05:00
Paul Licameli e0f4595485 TrackArtist, LabelTrack, TimeTrack, Envelope functions take ZoomInfo...
... and SelectedRegion, and not ViewInfo or zoom level as a double.

Also some leftOffset arguments.

Assumptions of uniform zoom level persist in TrackArtist::DrawClipSpectrum and
in TrackArtist::DrawClipWaveform but no longer in the rest.
2015-07-19 11:44:13 -04:00
Paul-Licameli bdc2839112 Preliminaries for bug 900
Create WaveTrackCache as a utility class but don't use it anywhere yet.

The possible minor performance problem with effects is fixed by changes
in WaveTrack::GetBestBlockSize().
2015-05-26 20:02:37 -04:00
benjamin.drung@gmail.com 277932dccb Remove trailing spaces. 2014-06-03 20:30:19 +00:00
RichardAsh1981@gmail.com 8d8e008b45 Patch by Maarten Baert for compatibility with project files from previous versions of Audacity, by re-scaling on load. Opening newer project files in older builds works but the time track gets messed up. This needs to be release noted. 2013-01-06 16:55:19 +00:00
richardash1981 f39454594b add documentation to these two functions as it's not that obvious exactly what they do 2013-01-05 16:36:14 +00:00
richardash1981 389beeb7fc Add some comments to the places I got confused. This would be much clearer if classes had copy-constructors\! 2012-12-31 13:13:58 +00:00