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

77 Commits

Author SHA1 Message Date
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
3869a8f460 Remove allegro.h from other headers 2020-06-14 10:32:16 -04:00
Paul Licameli
a7408a7f80 Remove TimeWarper.h from other headers 2020-06-13 11:22:41 -04:00
Yuri Chornoivan
d1ada5f08c Fix minor typos 2020-04-11 10:06:24 +01: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
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
Pokechu22
99f4c35e18 Add support for zooming to show all notes, separate from max zoom
This is now the behavior of Zoom Reset, with Max Zoom being given the previous behavior.  Shift+Right-Click alternates between the two -- it zooms to all notes, unless it currently is zoomed to all notes in which case it performs a max zoom.

This fixes Bug 2093.  It also fixes Bug 1815, by performing the all-notes zoom when importing a track.
2019-04-15 16:52:26 +01:00
Pokechu22
53823270e0 Rework note tracks to store top and bottom notes instead of pitch height
This simplifies a bunch of other work -- in particular zooming so that specific notes are visible, and keeping the same notes on screen when resizing the track.

Also included is a fix to YToIPitch to make it use mPitchHeight directly -- this solves some roundoff errors, which previously caused inaccurate results on some zoom levels.
2019-04-15 16:52:24 +01:00
Pokechu22
8e8d838a08 Refactor note track rendering/position height code into own class
This will make later refactoring easier, and also fixes some const-correctness issues
2019-04-15 16:52:23 +01:00
Paul Licameli
1d0247607a Remove wx/string.h from headers 2019-03-26 11:33:55 -04:00
Paul Licameli
f45300f032 This is only comments, in files where USE_ macros are tested...
... following the comment convention used in the preceding commit.
2019-03-22 12:38:30 -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
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
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
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
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
b36c3efec1 Track::GetKind is private 2018-10-01 13:42:34 -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
3f05063681 Split "Do" functions out of the "Set" functions for some Track settings 2018-02-21 19:20:55 -05:00
Paul Licameli
4ef8da8f16 Revert "Preliminaries to support better interaction of undo and recording"
This reverts commit 6e75ae58ac56d9c94af5a4ce97951f627808473a, reversing
changes made to 714d53e00f803643131bb775858ac930b39dd5b8.
2018-01-14 21:36:33 -05:00
Paul Licameli
8b60e7f02d Split "Do" functions out of the "Set" functions for some Track settings 2018-01-14 19:03:52 -05:00
James Crook
d2fe7b1757 Clean up most remaining MSVC warnings. 2018-01-06 13:03:48 +00:00
Paul Licameli
f725e937a4 Still better redrawing of resized Note tracks, still not perfect...
... The uses of GetPitchHeight(1) should be reexamined
2017-07-19 15:20:47 -04:00
Paul Licameli
8279adc797 Changing NoteTrack height, keep # of piano keys (roughly) constant...
This fix is imperfect, but quick and easy
2017-07-19 14:46:23 -04:00
Paul Licameli
207db5e547 Improved Note Track vertical ruler zooming...
... Make consistent zoom in and out limits for mouse picks and for scrollwheel

Make scrollwheel do in or out by a constant multiplier, analogously with wave
track

The Note track remembers a continuously varying key height, but rounds it off
whenever it draws
2017-07-19 14:28:17 -04:00
Paul Licameli
bba9b9986d NoteTrack, extreme vertical zoom-in: limit top & bottom margin height 2017-07-19 11:42:29 -04:00
Paul Licameli
d256bfedd2 NoteTrack, extreme vertical zoom-in: limit top & bottom margin height 2017-07-19 11:33:18 -04:00
Pokechu22
896d5d682b Fix drawing MIDI channels with IDs greater than 16
PRL mentioned a while ago that it was possible to get channels greater
than 16 via allegro files.  This makes those channels correctly work with
the CHANNEL_BIT macro (which was supposed to handle them this way before).
2017-07-16 11:07:28 -04:00
Pokechu22
62ebb2f95d Remove unused and unneeded MIDI methods and variables
The fields in AudioIO are simply unneeded (commented out, declared but never implemented, or otherwise unused).

mLastMidiPosition (in NoteTrack) looks like the vestiges of a far older attempt at MIDI playback; the field itself is completely unused though so it is safe to remove it.
2017-07-16 11:07:28 -04:00
Paul Licameli
44d6d5f427 Highlight MIDI channel buttons 2017-07-09 12:34:46 -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
Pokechu22
b46abbec62 Keep the current note centered when holding control to zoom 2017-07-04 06:45:21 -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
Paul Licameli
329aa8393e Table includes draw function for Midi controls 2017-06-13 14:02:10 -04:00
Paul Licameli
5395f253bf Reviewed use of Track::GetY; don't use in NoteTrack; fix off-by-1's 2017-06-04 00:15:29 -04:00
Paul Licameli
a8ac80eda9 Bug1651: NoteTrack sync-lock and crash fixes...
Simplify the logic of duplication of NoteTrack.  Duplicates are always in
serialized state.  Un-serialization can happen on demand in any of the
NoteTrack operations that require a defined sequence.

Changing the duration of the sequence after paste is needed,
as it was also needed, when I fixed Stretch at commit
90eb4ec142f7d575d0870dd9c755589bff520cbe.  I don't know if this should be
considered a bug in Allegro that we are compensating.
2017-05-25 08:08:31 -04:00
Paul Licameli
90eb4ec142 Make MIDI track stretch path-independent 2017-05-22 23:15:26 -04:00
Pokechu22
a76ad22c91 Fix midi channel toggling
This reintroduces the buttons to toggle display of individual midi
channels, and cleans up the code behind that feature.

This functionality has actually been present in production versions of
audacity for a while, at least for clicking.  However, the buttons
themselves were not drawn, making it exteremly painful (but possible) to
use.

As requested by PRL, this is always enabled if USE_MIDI is defined.
2017-05-02 00:37:31 -04:00
Pokechu22
59d740ad77 Use a dedicated velocity slider for note tracks
This gets rid of the offset rectangle hack that was needed to re-use gain
sliders for note track velocities.  It also removes the need for changing
the style of a single slider.  Perhaps most importantly, it fixes link
errors regarding GainSlider(int).

See https://sourceforge.net/p/audacity/mailman/message/35752524/ for
details on why this change is needed and what caused it.
2017-04-01 12:48:43 -04: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