Commit Graph

946 Commits

Author SHA1 Message Date
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
Paul Licameli e653b4aaf8 Eliminate Experimental.h, configure compile options instead...
... This makes it impossible to forget to include the EXPERIMENTAL definitions
(such as when cutting and pasting code) and so get unintended quiet changes of
behavior.

The EXPERIMENTAL flags are now specified instead in new file Experimental.cmake
2021-04-27 12:40:07 -04:00
James Crook c08131b78f Bug 2689 - Ctrl+R to repeat an effect may show the dialog 2021-03-08 09:51:46 +00:00
JohnColket a3d9f41fb4
Bug 2582 - Enh: Repeat last Process, Part 2 (#734) 2021-02-03 11:02:49 +00:00
Paul Licameli 1efebb7cdc Bug2600 residual: cause update of menu item text after compact 2020-11-25 13:43:04 -05:00
James Crook 6cd4fce29b Build fix for PR 547 2020-05-28 15:49:56 +01:00
Paul Licameli 4a271ba549 Move namespace Registry into new source files 2020-05-28 05:45:11 -04:00
Paul Licameli 2c8c5799f6 Correct menu ordering after "Reset Configuration" command, see f5afb28 2020-05-25 14:24:14 -04:00
Paul Licameli 4d09705a73 Change XO to XXO in many more places, with no effects at all...
... because the two macros have the same expansion, and are both checked for
in the --keyword arguments passed to msgfmt by locale/update_po_files.sh.

This commit makes ONLY such changes, and comments in Internat.h.  It is big
but quite harmless.

The intention is to introduce a type distinction in a later release, by defining
XXO differently.  XXO is used where & characters in strings (for hotkeys of menu
items or control prompts) are permitted, XO where not.
2020-05-22 13:07:50 -04:00
Leland Lucius 1ca911ed38 Convert all __WXDEBUG__ tests to use new _DEBUG symbol
This symbol is based on the NDEBUG symbol that's automatically
defined by CMake.
2020-04-25 02:36:27 -05:00
Paul Licameli e5540c6118 Don't crash on exit when a module attaches a menu item...
... such as Nyquist Workbench.

I don't fully understand why, but destroying the menu registry items very late,
during the destruction of static objects, causes a crash in memory deallocation,
at least on Mac.

So destroy the menu registry explicitly in application shut-down.
2020-02-17 16:08:59 -05:00
Paul Licameli 4cfbf07227 Registry passed to Visit can be const 2020-02-14 22:08:35 -05:00
Paul Licameli d0a99d5ae5 Each toolbar registers its menu item 2020-02-14 14:51:11 -05:00
Paul Licameli 540f2c5e67 Restore separators after "Move Track to Bottom" in TCP menus 2020-02-06 17:52:45 -05:00
Paul Licameli 446ee8ef6e Separate subclass ToolbarMenuVisitor from MenuVisitor 2020-02-04 12:15:24 -05:00
Paul Licameli a43c9a5337 Identifier not wxString in ctors of registry items 2020-02-04 12:15:24 -05:00
Paul Licameli db224895b0 Bug2302: Don't make separators at bottoms of menus on Win & Linux...
... Fix it by demoting the logic for separators from the menu tree diagnostic
into the common MenuVisitor class, then reusing that.
2020-02-04 00:41:31 -05:00
Paul Licameli 0a10c33e66 Fix Windows debug assertion on startup 2020-02-03 13:39:13 -05:00
Paul Licameli 586d0df449 Fix Linux & Win crash at start 2020-02-03 11:05:04 -05:00
Paul Licameli c293a8fc18 Remove unnecessary #include from Menus.cpp 2020-02-02 17:10:36 -05:00
Paul Licameli 7f4d61257a Command manager stores checkmark predicates...
... and we use them to simplify (the misnamed) MenuManager::ModifyToolbarMenus.

It looked wrong that statically constructed menu descriptions should ever hold
constant boolean checkmark values, rather than functions to re-eveluate the
checkmark state as needed.
2020-02-01 12:53:55 -05:00
Paul Licameli a729dfec3b Reusable preference-populating code for other registries than Menus 2020-02-01 07:11:38 -05:00
Paul Licameli 98e6a0e339 More fixes for visitation of registry 2020-02-01 04:22:27 -05:00
Paul Licameli 4d43967add Restore commit c1d129ec98 2020-01-31 23:51:12 -05:00
Paul Licameli 229e2673c7 Fix errors in d233cbd 2020-01-31 23:47:42 -05:00
Paul Licameli 2c25a37994 Revert to a465ce0046 2020-01-31 22:34:25 -05:00
Paul Licameli ffe101f9a2 TransportMenus not link dependent on SelectMenus or Scrubbing 2020-01-31 21:22:47 -05:00
Paul Licameli 6225043ff3 ExtraMenus.cpp not link dependent on external sub-menu definitions...
... They use the registry
2020-01-31 21:22:44 -05:00
Paul Licameli de08d9ff86 Menus.cpp no longer link dependent on top level menu definitions...
... They all use the registry.

(This link dependency was not shown in diagrams generated by scripts/graph.pl,
because it was not reflected in Menus.h but was done using extern declarations
within Menus.cpp.  That was a cheat, but it let all the other dependencies
be exposed in the graph and mitigated first.)
2020-01-31 21:12:36 -05:00
Paul Licameli d9d3f95570 Several nonmodal top level window tools register their menu items...
... removing link dependencies on them from src/menus, so they are now suitable
for moving out into modules.

They are:
Mixer Board
Karaoke (also called Lyrics)
History
Contrast
Plot Spectrum

Their header files are now no longer included anywhere but in their own
implementation files!
2020-01-31 21:12:36 -05:00
Paul Licameli d233cbd881 Improvements and comments in visitation and merging of registry items 2020-01-31 21:11:58 -05:00
Paul Licameli 56cd24a062 Rewrite insertion of menu items by null and Nyquist modules...
... using the new registration system, and without the fragile hacks making
assumptions about the positions of menus within the menu bar.
2020-01-30 15:09:30 -05:00
Paul Licameli baada94567 Define AttachedItem registration struct for menu items 2020-01-30 15:04:08 -05:00
Paul Licameli c5495b3300 Ordering hints for insertion of newly discovered registry items...
... Now, a first-time registered item can specify that it go at the start or end
of the nodes under its parent, or before or after some named node.

Still it might happen that multiple first-time registrations might use the same
ordering hint, and so we must still sort by component name to resolve that
collision arbitrarily.
2020-01-30 14:46:35 -05:00
Paul Licameli 564a3ac708 Define the registry merging procedure...
... before we populate the registry.

This could apply to menu items, or more generally to other registries.

A registry is a tree of items identified by path names. Various code,
that need not coordinate, can specify items to attach to the tree, and the
merging procedure collects them into a single tree that can be visited.

Pathnames imply only an unordered tree.  Some visitation ordering must be
imposed on the nodes, and can be remembered in preferences for stability between
runs, independently of accidents of the unspecified sequence of initialization
of file-scope static objects in the various plug-ins.  It can be arbitrary --
not constrained to some fixed intrinsic criterion like alphabetical order.

Merging consults the preferences, and also updates them if previously unknown
items are found and inserted.  For now, such unknowns just go to the end of
the sequence of siblings, sorted by their path component names.
2020-01-30 14:18:26 -05:00
Paul Licameli a84da3dee1 Remove Separator items from menu descriptions; use Section(...) 2020-01-30 12:12:48 -05:00
Paul Licameli c7fac7ae09 Use class MenuSection in visitors 2020-01-30 11:50:48 -05:00
Paul Licameli 3c9cd7925a Fix crash on Linux startup since commit f6e5696 2020-01-28 17:39:40 -05:00
Paul Licameli 103a6050a0 Registry::Visit doesn't require an AudacityProject 2020-01-26 16:22:49 -05:00
Paul Licameli c7bfa7a2a6 Parametrize ComputedItem::Factory by the type of argument it expects 2020-01-26 16:22:02 -05:00
Paul Licameli bbccce4386 More rework of the class hierarchy of Registry items 2020-01-26 16:20:15 -05:00
Paul Licameli 356e5d545e Define abstract Visitor for menu items, and concrete subclass...
... The general visitation procedure will find reuse with other specific
actions, and maybe for other non-menu trees too
2020-01-25 15:10:01 -05:00
Paul Licameli 4eee417ded Visiting of menu items calculates paths (not yet used)...
... Computed, shared, and nameless grouping items don't (directly) affect paths,
and are expanded in a first pass before visiting the real items
2020-01-25 15:09:41 -05:00
Paul Licameli 90a22b3982 Split out namespace Registry for non-menu-specific tree manipulation 2020-01-25 15:09:16 -05:00
Paul Licameli 393a098b69 Store a string identifier in each menu item...
... which is not yet used for anything.

It could be used to describe textual paths for attaching plug-in menu items.

Strings are only path local, not necessarily globally unique, and may be
left empty for separators and for groups that should be transparent to
path identification.

It may also be empty for certain sub-menus, such as those that group effects
according to the changeable criteria in Preferences.
2020-01-24 18:05:56 -05:00
Paul Licameli f6e5696146 Most functions defining menus compute once and cache the result...
... Except a few where project or plugin manager state or preferences are
needed to compute the items, so evaluation is delayed, often inside lambdas

Comment "Delayed evaluation" wherever there are exceptions
2020-01-24 18:05:56 -05:00
Paul Licameli 33b4b409e8 Change class hierarchy of MenuTable::BaseItem...
... There are now four immediate subclasses (SharedItem and Computed Item,
which are final, and SingleItem and GroupItem, which are abstract), which may
serve future purposes more general than menu items.  There are further
subclasses specific to menu management.

The former concrete class GroupItem is renamed TransparentGroupItem.

Also allows direct construction of items in lists from shared pointers.
2020-01-24 18:05:56 -05:00
Paul Licameli 93c2bb9322 Delay evaluation of checkmark states...
... so that more menu item descriptions can be statically constructed once only
2020-01-24 18:05:56 -05:00
Paul Licameli 512c27d422 Simplify the FN macros in src/menus/*.cpp...
... Eliminate repetitious passing of the finder function into each of the
calls to Command and CommandGroup.
2020-01-24 18:05:56 -05:00
Paul Licameli 515e1277bf Eliminate GetActiveProject from Menus.cpp 2020-01-07 16:42:05 -05:00