1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

49 Commits

Author SHA1 Message Date
James Crook
56e78922ae Bug 2455 - Audacity window height may be corrupted when using scripting, when minimised. 2020-05-30 14:59:38 +01:00
Leland Lucius
999872c21d Bug 2411 - Mac: Crash on docking/undocking Audacity with un-docked toolbar(s) 2020-05-02 21:03:23 -05:00
Yuri Chornoivan
d1ada5f08c Fix minor typos 2020-04-11 10:06:24 +01:00
Paul Licameli
72ece7d9bf Bug2314: Zoom in should work during playback...
...bug began at 52ff705b0dff568512b6c6016936b78311c56a69

Fixing this in a way that does not make a dependency cycle between ProjectWindow
and TrackPanel
2020-02-25 09:36:26 -05:00
Paul Licameli
04a9ce8ba6 Remove some GetActiveProject calls in CommandManager.cpp ...
... The remaining ones, for use in a global event handler, are appropriate
2020-01-08 13:20:00 -05:00
Paul Licameli
973f15c5ac Move ProjectWindowBase to new files...
... So that you can use GetProject without other linkage dependencies
2020-01-03 17:58:21 -05:00
Paul Licameli
be24e6b5a1 Separate class ProjectWindowBase...
... which adds a project association to wxFrame, and nothing else
2020-01-03 17:54:44 -05:00
Paul Licameli
49cab86fc1 TranslatableString for tooltips and status bar messages 2019-12-20 21:54:49 -05:00
James Crook
23f05c618c Fix signed/unsigned comparison warnings. 2019-12-06 11:33:22 +00:00
David Bailes
14b53e6736 Bug 2251 - Windows: NVDA sometimes reads the name of the track twice
Problem:
Currently calling Track::EnsureVisible() also sets the track as focus.
In Audacity 2.3.3 the timing of the code to set the focus was changed. Rather than a direct call, an event is queued, and then the focus is set. This has changed the timing of the focus event which is sent with respect to other focus and name change events. In particular in the case of toggling the selectness of the focused track, this moved the focus event to be after the name change event.
These changes only had an effect on NVDA - Jaws and Narrator were unaffected.

The introduction of this bug has highlighted an existing problem.
1. There are a small number of existing cases where a track needs to be visible, but where it is already the focus, and so setting the focus is unnecessary. For example, pressing Enter to toggle whether a track is selected.
2. Some of the Audacity code which calls EnsureVisible() is written with the assumption that EnsureVisible() doesn't set the focus, and so there are unnecessary focus events. Whilst other code which calls EnsureVisible() assumes that it also sets the focus. Confusion.

The Fix:
Remove the setting of focus from within Track::EnsureVisible(), and so remove the unnecessary focus events.
Calls to set the focus were added before calls to EnsureVisible where the code was relying on EnsureVisible to set the focus. In TrackPanel::ProcessUIHandleResult, and TrackPanel::OnMouseEvent, I wasn't sure if the focus needed to be set, so called it anyway to ensure that the behaviour did not change.

So I would like to remove the setting of focus from within Track::EnsureVisible(), and add explicit calls to set the focus where necessary.
I think this would make the code clearer, remove unnecessary calls to set the focus, and make it easier to keep NVDA happy.
2019-11-26 14:43:25 +00:00
Philipp Claßen
af79017f3a Prevent heap-use-after-free crash 2019-11-24 21:09:39 +00:00
Paul Licameli
280f724d09 Bug2179: time ruler should update while dragging horizontal thumb...
... The fix is not needed on Mac, which already does dispatch idle events
between scroll events
2019-08-01 07:06:00 -04:00
Paul Licameli
eb4eba6325 AdornedRulerPanel updates its play region in idle time...
... Eliminating TP_DisplaySelection and making ProjectWindow independent of
AdornedRulerPanel
2019-07-03 23:38:33 -04:00
Paul Licameli
1c1aca521d AdornedRulerPanel updates itself in response to theme change event 2019-07-03 23:11:10 -04:00
Paul Licameli
1e4812f470 GetProjectPanel analogous to GetProjectFrame breaks dependencies...
... in places that need the TrackPanel but only to invoke common wxWindow
methods on it.

This eliminates direct use of TrackPanel by Scrubbing and ProjectWindow
2019-07-03 13:53:07 -04:00
Paul Licameli
7597080418 Move the project window initialization into ProjectManager 2019-07-03 13:50:57 -04:00
Paul Licameli
d0c4677ab1 Move most of ProjectWindow initialization into nonmember function 2019-07-03 13:34:44 -04:00
Paul Licameli
52ff705b0d ScrollIntoView out of TrackPanel, into ProjectWindow 2019-07-03 13:32:32 -04:00
Paul Licameli
312911645e Update status bar field widths in case of language change 2019-07-02 21:02:13 -04:00
Paul Licameli
68999934e0 ProjectAudioManager doesn't use ProjectWindow, which doesn't use...
ControlToolBar, after we make a system to register functions that calculate
necessary minimum widths for status bar fields.

Also let Scrubbing.cpp register its own strings.

Also be sure to size the status field sufficiently for "Playing at Speed".
2019-07-02 21:01:54 -04:00
Paul Licameli
e2362bc25a Move project status string management to new attached object class 2019-07-02 21:01:34 -04:00
Paul Licameli
1ce9d59590 Fix another possible case of crashing on exit 2019-07-02 21:01:33 -04:00
Paul Licameli
a5364119eb Eliminate many calls to RedrawProject & TrackPanel::Refresh()...
... Let the window respond to an undo manager event instead, whenever there
is a push or modify

Maybe this makes a few unnecessary redraws that did not happen before.  If
that is important, then we should figure out how to put the logic for eliding
the redraw into ProjectWindow, and the extra information needed for the
decision into the events, but not make intrusions in other code all over the
place.
2019-07-02 08:17:01 -04:00
Paul Licameli
63c7b3740e RedrawProject has a CallAfter delay now, so remove other delays...
... and rewrite that CallAfter more safely with a weak pointer
2019-07-02 08:14:30 -04:00
Paul Licameli
7d504ba015 ControlToolBar uses idle events to update status message for itself 2019-07-01 19:48:51 -04:00
Paul Licameli
868481b686 GetSceenEndTime out of TrackPanel 2019-06-26 21:25:15 -04:00
Paul Licameli
d29d10d712 GetTracksUsableArea() out of TrackPanel 2019-06-26 21:25:15 -04:00
Paul Licameli
f87dfd43c1 GetVRulerWidth, GetLabelWidth, GetLeftOffset out of TrackPanel.h...
... And some things demoted from ViewInfo to ZoomInfo, related to x coordinates
only
2019-06-26 21:25:15 -04:00
Paul Licameli
ef7068f46a Fix some failures to update the vertical scrollbar...
... Problem involves sequence in which event handlers are done, and started at
commit 278509a which updated track Y coordinates in a handler.

Solution is to delay the updating of scrollbars further, using CallAfter.

Also remove one unnecessary call to ProjectWindow::FixScrollbars() because
ProjectWindow::HandleResize follows it and includes scrollbar update already.
2019-06-25 17:41:29 -04:00
Paul Licameli
2257fa642a Remove TrackPanel::EnsureVisible; TrackList sends an event instead 2019-06-25 10:54:55 -04:00
Paul Licameli
c6478f43af Lower ViewActions as member functions of ProjectWindow 2019-06-25 00:14:53 -04:00
Paul Licameli
4339c0df68 Move height calculation utilities to class TrackView 2019-06-22 21:46:32 -04:00
Paul Licameli
a6e2ca0aa8 Move some enums into new files WaveTrackViewConstants.* ...
... freeing TracksPrefs from the second largest s.c.c. which is now only 20
2019-06-22 21:46:32 -04:00
Paul Licameli
6a03e7c84a Global slider instances for control panels out of TrackPanel.cpp...
... and updating of them is accomplished privately in implementation files,
reducing intrusions into TrackPanel and ProjectWindow

This removes #include-s from TrackInfo.cpp, leaving dependency cycles better
than previously
2019-06-19 18:34:47 -04:00
Paul Licameli
e1908ab8e2 ToolManager does not depend on ProjectWindow 2019-06-16 01:24:29 -04:00
Paul Licameli
ca5259712c HandleCommandEntry's 3rd parameter was two-valued, make it bool...
... false when it was NoFlagsSpecified, true when it was AlwaysEnabledFlag
2019-06-14 10:12:45 -04:00
Paul Licameli
f0ae4c3858 ProjectWindow does not depend on selection toolbars...
... Freeing SelectionBar and SpectralSelectionBar from cycles.

Also fixing a minor problem:  if two projects are open, and one is playing or
recording, and you switch windows -- then the audio time in the selection bar
of the other project could be updated.
2019-06-12 21:02:11 -04:00
Paul Licameli
0a29afb933 Remove some unnecessary #include directives 2019-06-12 15:13:58 -04:00
Paul Licameli
5eaf0a649b ProjectWindow listens for undo events, intrudes less in other code 2019-06-12 11:08:50 -04:00
Paul Licameli
ef8c100cee MenuManager holds a back-reference to project; simplifies calls 2019-06-12 11:08:50 -04:00
Paul Licameli
b7386c2db1 Use idle events to update TrackPanel cursor...
... As when recording starts or stops, or the Tools button has changed, or
scrolling has changed the results of hit-test.

This reduces TrackPanel's intrusions into other code, including ProjectHistory.

Also for AdornedRulerPanel, which shares the base class CellularPanel
2019-06-12 11:05:55 -04:00
Paul Licameli
d4b44d16f1 Move details of mouse wheel handling into ProjectWindow.cpp ...
... to break some dependency cycles.  Install a callback at initialization time.

This frees CommonTrackPanelCell from cycles, which is important because it is
a base class of Track
2019-06-10 21:56:46 -04:00
Paul Licameli
42a4f55ffe Prepare to split AudioIOBase from AudioIO...
... New files, but (almost) empty; don't use the global variable gAudioIO,
but use one of two accessor function names (which are the same function for
now).

AudioIOBase will have fewer dependencies than AudioIO -- in particular, no
dependency on tracks.

It won't include StartStream.  It will contain functions to query the
present state of streams, and device capabilities.
2019-06-10 20:48:38 -04:00
Paul Licameli
090374381c Supply #include "Experimental.h" in recent new files 2019-06-09 08:56:38 -04:00
Paul Licameli
577fdb200f Fix error in playing from cursor, introduced at 4abc71c 2019-06-08 13:59:20 -04:00
David Bailes
a55cba3241 Fix tab order of top panel
Problem:
When the keyboard first moves to the top panel using ctrl+f6, the click to pin button in the ruler is the focus. It should be the first control in the top tooldock.
This problem was introduced by commit: 4abc71c. Prior to this commit the top tooldock was created before the ruler, and afterwards the order was reversed. The default tab order is the order of creation.

Fix:
Explicitly set the tab order of the top tooldock and the ruler, so that the creation order doesn't matter.
2019-06-08 12:42:56 +01:00
Paul Licameli
236b188d6b ProjectWindow does not depend on ProjectFileIO 2019-06-05 07:24:01 -04:00
Paul Licameli
63b93fd2d1 Play region and its lock are stored together in ViewInfo 2019-06-03 01:43:27 -04:00
Paul Licameli
4f940c855d New files for ProjectWindow 2019-06-03 01:43:26 -04:00