1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-01 16:19:43 +02:00

11387 Commits

Author SHA1 Message Date
Paul Licameli
a465ce0046 Naming of many menu sections, so they can be attachment sites 2020-01-31 21:12:36 -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
Leland Lucius
6da68f2035 Remove obsolete config*.h files
These are ancient and "configunix.h" was being pulled in
via Types.h.  Nothing major, but they were generated for
a 32-bit system and "may" cause problems when used on
64-bit systems.

(That's unlikely though since they haven't all this time.)
2020-01-31 09:29:15 -06:00
David Bailes
46a6d21585 Bug 2299 - Keyboard preferences: names of commands contain &
Caused by this commit: 0021a98091a70b : Remove another unnecessary stripping of accelerators from labels

Unfortunately, the stripping was necessary.

Fix:
Reinstate stripping.

Derives from tag: Audacity-2.3.3 + 94 commits
2020-01-31 15:11:18 +00:00
Binary Wisdom
9bce51a60e Bug 624: Keyboard Prefs: importing XML file can cause duplicated bindings
The fix follows the agreed behavior (see emails from around October 25) . For the sake of convenience see the agreed behavior below:

_"- first, check the xml-file. If it contains illegal shortcut duplicates, refuse importing. Shortcut duplicates are LEGAL if default settings also have those operations with the matching shortcuts. A refusal to import shortcuts must happen with the message that warns the user of a failure and explains the reason.

if the xml-file looks ok, import the shortcuts. As discussed before, because different versions of Audacity might have different sets of operations with shortcuts, it is still possible to end up with illegal shortcut duplicates for a perfectly correct xml-file. This situation must be monitored. In case of any conflicts, the shortcut from the xml-file is used, and the pre-existing shortcut is wiped clean.
When telling the user the commands which have had their shortcut removed, I think it would be useful to tell the user the name of the command, the shortcut, and and name of the command which still has that shortcut."_

I didn't find a clean way to intercept the imported content before it makes its way to the shortcut preferences, so I had to jump through some hoops right in KeyConfigPrefs::OnImport().
In general, I tried to keep changes minimal.
2020-01-31 11:32:23 +00:00
Paul Licameli
f949a05952 Registration of plugin menu items; redo null & Nyquist modules...
... without ugly fragile hacks making assumptions about number and sequence of
other menu items.  Instead, specify where new items go with textual paths.
2020-01-30 15:16:28 -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
9d7f151cf6 No more Seperator items in menu descriptions...
... Instead, new grouping items describe the menu sub-sections, and names might
be attached to them, though not yet.
2020-01-30 12:15:05 -05:00
Paul Licameli
6b551d10c5 Fix indentations 2020-01-30 12:14:22 -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
d84c994088 Redefine return type of MenuTable::Items 2020-01-30 09:06:20 -05:00
Paul Licameli
9639ba84f4 Reimplement commit 512c27d, fixing menus & shortcut keys on Windows 2020-01-29 13:39:19 -05:00
Paul Licameli
ff2d20f335 Fix identifier string for new experimental command 2020-01-29 12:23:43 -05:00
Paul Licameli
ef41b8f2ee Fix static initialization order problem for more ReservedCommandFlags 2020-01-29 11:24:25 -05:00
Leland Lucius
25afa10bc4 Adding "autogen" to reduce false failures 2020-01-28 19:27:37 -06:00
Paul Licameli
873d067e74 CommonCommandFlags does not depend on LabelTrack 2020-01-28 17:49:28 -05:00
Paul Licameli
9093364b8c Fix other problems since commit f6e5696...
... Problem with static initialization order of ReservedCommandFlags, caused
wrong enablement of menu items (at least on Mac), such as Plot Spectrum or
Contrast enabled when there was no selection
2020-01-28 17:49:07 -05:00
Paul Licameli
3c9cd7925a Fix crash on Linux startup since commit f6e5696 2020-01-28 17:39:40 -05:00
Paul Licameli
c44f2cf755 Improve registry visitation procedure so it doesn't require a project...
... though the specific visitations for Menu items (the only ones that exist
now) still do require a project, to construct the visitor.
2020-01-26 17:31:06 -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
cd907ad80d Generalize menu tree visitation beyond populating of menus...
... and apply it to implement a new alpha-only command, that dumps the menu
tree as text
2020-01-25 15:21:29 -05:00
Paul Licameli
27ffd9c8fb Implement alpha-only diagnostic command to dump the menu tree...
... This demonstrates the possibility of visitation of the menu tree specifying
other actions.

This dumps the internal path identifiers of the registry -- not the user visible
names.

Note that lines don't exactly correspond with menu items, where there are
command groups such as Align, or special steps such as population of the
recent files sub-menu.

Perhaps this should be adapted as another case of the GetInfo macro command.
2020-01-25 15:10:02 -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
Leland Lucius
d28009c93e Remove unneeded include 2020-01-24 22:25:52 -06:00
Paul Licameli
c77d4e1961 Menu descriptions mostly computed once only & have string identifiers 2020-01-24 18:24:43 -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
702b8b1e9d More specific return types for builders of menu descriptions 2020-01-24 18:05:56 -05:00
Max Maisel
17ef5b1c75 Fix two bugs in loudness effect (#410)
* Calculate loudness for short or silent selections as well.

In case of selections shorter than 400ms (one momentary loudness block),
take what we have got and divide only be the actual length.

Abort loudness normalization silently if the selected audio is all
silent.

* Fix loudness effect bug when selection includes a gap.

If the selected audio in a track contained a gap between two clips,
an incorrect amount of samples was processed.
2020-01-24 18:04:19 +00:00
Paul Licameli
921d7f28ef Correct a naked new 2020-01-24 10:25:51 -05:00
Paul Licameli
5ecd090266 EffectUIHost uses ShuttleGui 2020-01-23 19:10:38 -05:00
Paul Licameli
b5b9ab6ecd EffectUIHost::BuildButtonBar uses ShuttleGui 2020-01-23 19:06:23 -05:00
Paul Licameli
c28c170cc0 EffectUIHost::Initialize uses ShuttleGui 2020-01-23 19:06:23 -05:00
Paul Licameli
eb3e5d8f6f Factor EffectUIHost::Initialize 2020-01-23 19:06:23 -05:00
Paul Licameli
1c84932dfa EffectUIClientInterface::PopulateUI takes ShuttleGui & 2020-01-23 19:06:23 -05:00
Paul Licameli
eff5b2ef92 Make Effect::PopulateUI final (no special case for Equalization) 2020-01-23 19:06:23 -05:00
Paul Licameli
358aac3181 Change some behavior of ShuttleGui::AddBitmapButton...
... which is not now used, but soon will be
2020-01-23 19:06:17 -05:00