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

55 Commits

Author SHA1 Message Date
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
Paul Licameli
c391a8f884 Define AudioTrack and PlayableTrack as common bases for Wave and Note 2017-03-29 13:27:22 -04:00
Paul Licameli
80984c9f1d From Pokechu22: Rename gain to velocity on note tracks
"Velocity" is the technical term, and it's the term that's used everywhere.
"Gain" was probably only used because "gain" is used on wave tracks; since
note tracks aren't wave tracks (and shouldn't be treated as them) the
corresponding variables should be named velocity.
2017-03-29 13:27:22 -04:00
Pokechu22
0ce9598274 Fix midi-related compile problems in AudioIO and NoteTrack
The compilation was broken in 67cec5a but fixed in ed8c7fd.  However, the warnings weren't fixed.  The same general sign-related changes from 67cec5a were applied, fixing several warnings.

This also changes the arguments for NoteTrack's label click handler, to match the ones found in TrackPanel.  That's needed to handle some other const-related changes.

Additionally, EXPERIMENTAL_MIDI_PLAYBACK was changed to EXPERIMENTAL_MIDI_OUT in the documentation, as that is the correct name.
2017-03-27 01:12:16 -04:00
Paul Licameli
25619fb46e Don't create placeholder clips in Duplicate command ...
... when there is no clip at the right edge of the selection.
2017-03-17 17:52:39 -04:00
Paul Licameli
509f974dfb Consistently use delete[] not free for NoteTrack serialization...
... Because allocation is with new[], if you search for where it happens in
lib-src.
2017-03-17 17:52:33 -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
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
48a5f55179 More const qualifiers, for copying of tracks, and replacing in lists of tracks
... (the tracks may be const, not the list, when replacing)
2016-02-27 17:30:30 -05:00
Paul Licameli
d097c7fad4 More const qualifications. The source of a paste is const. 2016-02-27 12:54:57 -05: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
9bf098c7d9 Sweep unnecessary wxString copies: rest 2016-02-23 02:15:56 -05: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
martynshaw99
4ce2643d5f Remove the
// Indentation settings for Vim and Emacs
etc. lines from all files, as Campbell's patch (except for other changes to Languages.cpp)
2013-09-24 00:14:37 +00:00
v.audacity
1ceb0ef660 Apply modified version Roger Dannenberg's patch to remedy some problems from commit r10680 and fix some bugs. 2011-10-19 23:06:53 +00:00
rbdannenberg
92950e22fd Previous version did not compile on OS X due to confusion between USE_MIDI and EXPERIMENTAL_MIDI_OUT and some missing includes that didn't bother Visual C++. This revision fixes OS X builds. 2010-10-28 21:22:14 +00:00