1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-19 17:40:15 +02:00

891 Commits

Author SHA1 Message Date
Paul Licameli
a8de4d9e50 Construct MenuItem with untranslated label, so it can be static...
... and other storage of TranslatableString instead of naked wxString, for
management of menu items, in CommandManager
2019-12-12 15:49:00 -05:00
Paul Licameli
70ec69fa3d Pass untranslated command labels to CommandManager...
... and deduce whether to exclude from macros inside NewIdentifier, simplifying
argument lists further

Also fix the localization of "..." added to names by PluginMenus.cpp
2019-12-12 15:15:59 -05:00
Paul Licameli
5cbafc6086 Clarifying name change in CommandManager & simplify PluginMenus...
... The purpose of the boolean field in command entries was to exclude certain
menu commands from being steps in macros, because they require user interaction.

Effects are never meant to be excluded, even though they normally have dialogs,
but in the context of macro execution, the parameters are supplied by other
means.
2019-12-12 15:15:59 -05:00
James Crook
7f3c40eb43 Fix class/struct warnings. 2019-12-06 11:32:17 +00:00
Paul Licameli
72df562c4a Conversion of TranslatableString to wxString is private 2019-12-01 18:17:57 -05:00
David Bailes
9e51dba3db Bug 2215 - Cut does not work when in Pause mode
In bool MenuManager::TryToMakeActionAllowed(), there's the condition:
(MissingFlags & enabler.possibleFlags()) == MissingFlags

that is, the missing flags has to be a subset of the possible flags.
For cut in pause mode, this condition is not met for the enabler stopIfPaused, because MissingFlags also includes the CutCopyAvailableFlag, which is not one of the enabler's possible flags.
It is not sensible for the missing flags to have to be a subset of the possible flags, because for this to work, for each enabler the possible flags would have to include other flags that could need fixing by other enablers.

Fix:
1. Change the condition to the intersection of the missing flags and possible flags is non-empty.
2. In CutCopyAvailableFlag, remove the condition !AudioIOBusyPred(). If this is present, then due to the first change, paused audio could cause all audio to be selected even when there was a selection. The commands for which this flag is used are cut and copy, and they already have AudioIONotBusy flags, so this change should not affect previous behaviour.
2019-10-02 10:39:15 +01:00
David Bailes
b06af2330b Revert "Bug 2215 - Cut does not work when in Pause mode"
This reverts commit 458d92157a4fccb2524971f607e28a6c73b1901f.

The fix caused another bug: when paused, with select all enabled, all audio was selected.
2019-10-01 15:19:11 +01:00
David Bailes
458d92157a Bug 2215 - Cut does not work when in Pause mode
In bool MenuManager::TryToMakeActionAllowed(), there's the condition:
(MissingFlags & enabler.possibleFlags()) == Missing

that is, the missing flags has to be a subset of the possible flags.
For cut in pause mode, this condition is not met for the enabler stopIfPaused, because MissingFlags also includes the CutCopyAvailableFlag, which is not one of the enabler's possible flags.
It is not sensible for the missing flags to have to be a subset of the possible flags, because for this to work, for each enabler the possible flags would have to include other flags that could need fixing by other enablers.

Fix: change the condition to the intersection of the missing flags and possible flags is non-empty.
2019-10-01 13:56:33 +01:00
David Bailes
6b2785b625 Revert "Bug 2215: Cut does not work when in pause mode"
This reverts commit 6a37cbae35da95b45f88d310a65b23064f3ed117.

This was reverted because it caused bug 2221.
2019-09-30 12:57:31 +01:00
David Bailes
6a37cbae35 Bug 2215: Cut does not work when in pause mode
Minor fix to logic required.
2019-09-23 12:31:05 +01:00
Paul Licameli
51f2578e0a Bug2184: should not grey Effect menu when selection is point 2019-08-03 12:03:46 -04:00
Paul Licameli
22f21b3245 Enh2049 residual: do it without making a new dependency cycle...
... Do not include CommonCommandFlags in Menus.cpp, but PluginMenus is
high-level enough to do the special case changing of flags.

see commit 0bd1beae9a92c9753b04c160c0dd649ddd13939d
2019-07-29 15:30:06 -04:00
James Crook
0bd1beae9a Bug 2049 - ENH: Noise Reduction error message for no selection is unhelpful 2019-07-29 08:29:48 +01:00
Paul Licameli
a31636aa1a Make a member function const 2019-07-16 10:48:39 -04:00
Paul Licameli
c506536912 Menus.cpp does not depend directly on ProjectWindow 2019-06-16 01:24:29 -04:00
Paul Licameli
c0adb35839 Command flag functions out of Menus.cpp, reducing its dependencies...
... Mostly into CommonCommandFlags.cpp, but some elsewhere, to avoid giving
that new file problematic dependencies on LabelTrack, ControlToolBar, and
EffectManager.

Note that CutCopyAvailableFlag is critically ordered, for message purposes,
only with AudioIONotAvailableFlag, the only flag with a message that it combines
with in menu item definitions.

The dependency on LabelTrack.cpp might not be a bad one later, if the track and
its view can be separated, and that would allow CutCopyAvailableFlag to be
put with the others.  But much other work on LabelTrack must happen first.
2019-06-16 01:21:05 -04:00
Paul Licameli
1b329b0e36 Error messages for disallowed commands are table-driven too 2019-06-16 01:21:05 -04:00
Paul Licameli
b09a1af564 Separate the flags mentioned in TellUserWhyDisallowed 2019-06-16 01:21:04 -04:00
Paul Licameli
f9b0281b47 Move TellUserWhyDisallowed into MenuManager...
... so we don't have MenuManager calling CommandManager which calls it back.
2019-06-16 01:21:04 -04:00
Paul Licameli
76996bf0cd TryToMakeActionAllowed is also table driven...
... and also the logic for relaxing the conditions for enabling the menu items
2019-06-16 01:21:02 -04:00
Paul Licameli
6c6d0b869e So we prove that MissingFlags was always reassigned zero...
... so remove this piece of confused logic that did nothing
2019-06-14 10:12:45 -04:00
Paul Licameli
94d9593df8 3rd arg of TryToMakeActionAllows always == 2nd; eliminate it 2019-06-14 10:12:45 -04:00
Paul Licameli
e5a786c420 4th arg of ReportIfActionNotAllowed always == 3rd; eliminate it 2019-06-14 10:12:45 -04:00
Paul Licameli
0f2278d394 Eliminate the confusing mask from CommandManager entries...
... In fact it was only ever different from flags when flags had the special
NoAutoSelect and mask did not.  Now put that bit in the mask too, and make
the special NoAutoSelect always true in MenuManager::GetUpdateFlags().  This
still preserves the intended effects of NoAutoSelect.
2019-06-14 10:12:45 -04:00
Paul Licameli
64650b9a55 Third argument of EnableUsingFlags was always all-ones; eliminate it 2019-06-14 10:12:45 -04:00
Paul Licameli
a34f1cbba5 Reimplement the rejection of select-all-on-none for certain commands...
... Specify it in the menu descriptions.  Don't put special ad hoc logic
in Menus.cpp.
2019-06-14 10:12:44 -04:00
Paul Licameli
3847b66638 MenuManager::GetUpdateFlags is now table-driven 2019-06-14 10:12:00 -04:00
Paul Licameli
82ea023843 Distinguish the quick-to-compute command flags 2019-06-14 10:11:58 -04:00
Paul Licameli
705b4b28e7 Register a predicate with each CommandFlag bit 2019-06-14 00:31:15 -04:00
Paul Licameli
36e3a03c7f Redo CommandFlags as std::bitset, allow registration of values 2019-06-14 00:31:15 -04:00
Paul Licameli
1f763984c9 Remove unused command flags 2019-06-14 00:31:15 -04:00
Paul Licameli
e2c6720436 MenuManager 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
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
f03684db4f New class ProjectHistory split from ProjectManager for undo, etc...
... And yet fewer inclusions of Projectmanager.h, though it's still not yet
free of cycles
2019-06-09 12:10:48 -04:00
Paul Licameli
b020e8fbd0 Remove unnecesary inclusions of TrackPanel.h 2019-06-08 16:18:39 -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
Paul Licameli
3fc961f74a New files for ProjectFileIO 2019-06-03 01:24:01 -04:00
Paul Licameli
7b8bfd1d02 New attached structure ProjectFileIO handles load and save 2019-06-03 01:21:15 -04:00
Paul Licameli
fee5582826 New files for ProjectManager 2019-06-03 01:21:12 -04:00
Paul Licameli
4274d44ab7 New attached structure ProjectManager handles project lifetime...
... that is, a factory function, open, close, import, undo/redo/rollback.

Also the callbacks from AudioIO, which need to invoke undo history push when
recording stops.

It is meant as a high-level class using several of the other things attached
to the project, while AudacityProject will be a low level class acting mostly
as just the container of the attached structures.
2019-06-03 01:18:12 -04:00
Paul Licameli
e5cf2165d1 New files for ProjectAudioIO 2019-06-03 01:18:08 -04:00
Paul Licameli
1f4202c878 New attached structure ProjectAudioIO handles tokens and meters 2019-06-03 01:15:47 -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
b25d3ad344 Limit access to global array of open projects & simplify iterations 2019-05-30 01:55:25 -04:00
Paul Licameli
82663892dc Accessors to get the project window...
... as a preparation for splitting up class AudacityProject.

Use ProjectWindow as an alias for AudacityProject, and fetch it from the
project with a static member function, where certain of its services are used;
pretending they are not the same class.

Use global accessor functions to get wxFrame from the project where only
wxFrame's member functions are needed, so there will be less dependency on
ProjectWindow when it becomes a distinct class.
2019-05-28 23:18:13 -04:00
Paul Licameli
3416b5bad6 Toolbars accessed by static Get() functions, not through AudacityProject 2019-05-24 16:08:29 -04:00
Paul Licameli
7bb71257ed static AdornedRulerPanel::Get()...
... not member functions of AudacityProject
2019-05-24 15:48:16 -04:00