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

293 Commits

Author SHA1 Message Date
David Bailes
a13e7191c4 Add an option to use a dialog to enter the name of a new label
Motivation:
1. The text boxes in the label track are not fully accessible for users of screen readers, and I don't think that they can be made to be fully accessible using the accessibility API used by wxWidgets. When such an edit box becomes the focus, this is not announced, and for NVDA users typed characters are not echoed.

2. Provides a work around for bugs 1778 (cannot type diacritics into text label), and 1804 (Windows: Labels do not accept IME (Chinese/Japanese) input).

Fix: Provide an option for a dialog for entering the name. The text box in the dialog is accessible for screen readers. On windows the text box receives wm_keydown and wm_char messages and so is a work around for bug 1804. Being a standard text box, it will presumably be a work around for bug 1778.

1. There is a new option in track behaviors: "Use dialog for the name of new label", which is off by default.

2. When using the commands "Add label at selection" and "Add label at playback position", when the dialog closes, focus is returned to the track which was the focus before the dialog opened. I think this is more convenient for users of screen readers.
2018-05-11 10:23:48 +01:00
James Crook
1c988b4e3a Automation: AudacityCommand
This is a squash of 50 commits.

This merges the capabilities of BatchCommands and Effects using a new
AudacityCommand class.  AudacityCommand provides one function to specify the
parameters, and then we leverage that one function in automation, whether by chains,
mod-script-pipe or (future) Nyquist.

- Now have AudacityCommand which is using the same mechanism as Effect
- Has configurable parameters
- Has data-entry GUI (built using shuttle GUI)
- Registers with PluginManager.
- Menu commands now provided in chains, and to python batch.
   - Tested with Zoom Toggle.

- ShuttleParams now can set, get, set defaults, validate and specify
the parameters.
- Bugfix: Don't overwrite values with defaults first time out.
- Add DefineParams function for all built-in effects.
- Extend CommandContext to carry output channels for results.

We abuse EffectsManager.  It handles both Effects and
AudacityCommands now.  In time an Effect should become a special case of
AudacityCommand and we'll split and rename the EffectManager class.

- Don't use 'default' as a parameter name.
- Massive renaming for CommandDefinitionInterface
- EffectIdentInterface becomes EffectDefinitionInterface
- EffectAutomationParameters becomes CommandAutomationParameters
- PluginType is now a bit field.

This way we can search for related types at the same time.

- Most old batch commands made into AudacityCommands.
The ones that weren't are for a reason.  They are used by mod-script-pipe
to carry commands and responses across from a non-GUI thread to the GUI
thread.

- Major tidy up of ScreenshotCommand
- Reworking of SelectCommand
- GetPreferenceCommand and SetPreferenceCommand
- GetTrackInfo and SetTrackInfo
- GetInfoCommand
- Help, Open, Save, Import and Export commands.
- Removed obsolete commands ExecMenu, GetProjectInfo and SetProjectInfo
  which are now better handled by other commands.

- JSONify "GetInfo: Commands" output, i.e. commas in the right places.

- General work on better Doxygen.
    - Lyrics -> LyricsPanel
    - Meter -> MeterPanel
- Updated Linux makefile.
- Scripting commands added into Extra menu.
- Distinct names for previously duplicated find-clipping parameters.
- Fixed longstanding error with erroneous status field number which
  previously caused an ASSERT in debug.
- Sensible formatting of numbers in Chains, 0.1 not 0.1000000000137
2018-02-24 14:20:22 -05:00
Paul Licameli
e094dcbaf2 Fix unbalanced #pragma warning since commit 080dd34 2018-02-22 21:01:20 -05:00
Paul Licameli
080dd34e61 Get rid of wx object arrays, use std::vector 2018-02-21 19:33:27 -05:00
Paul Licameli
2fbe04eda0 Replace more Connect with Bind; needed redeclaration of custom events 2018-02-21 19:30:40 -05:00
Paul Licameli
5407079c62 Remove EXPERIMENTAL_OUTPUT_DISPLAY...
... Maybe a good feature idea, but the implementation pollutes the code in
too many places.

It's a special case of the more general idea of many-to-one associations
between screen rectangles and track objects.  More generalized ways to
accommodate that should be sought.
2018-01-12 12:08:09 -05:00
James Crook
27d2b7c51b Add AutomationCommands class
- AutomationCommands replaces GetAllMenuCommands, and can provide
information about menus, buttons and toolbars to a script.
- BatchCommands can now return textual results to a script.
- There's a new GUID for mod-script-pipe and it is included in the .sln.
2018-01-06 19:27:45 +00:00
James Crook
2108515938 Bug 63 - Analysis effects that create labels should give focus to label Track
If a generator, effect or analyser has created a new track, scroll to the bottom of the track list.
Acheived using new function, VerticalScroll()
2017-12-17 14:59:59 +00:00
Paul Licameli
7a038c9e51 Remove tab key target cycling and snap escape; reimplement for Esc 2017-07-15 20:37:39 -04:00
Paul Licameli
903cebafe1 Bug1669: Close and Menu buttons should never disappear...
... As they did with Ctrl+Shift+F, with a certain minimimum number of wave
tracks that depends on screen resolution.  On my Macbook, that was 13 tracks.

This bug was a consequence of James' TCP layout changes making buttons a little
taller plus my changes to hide any top controls for which there is not
sufficient height.

The fix makes the height of tracks after Ctrl+Shift+F a bit more (44 pixels
not 40) than in 2.1.3.

This fix also replaces some more "magic numbers" with calculation from
tabled data about TCP layout.
2017-07-14 12:03:16 -04:00
Paul Licameli
b7ae012ece A single UIHandle can define multiple rotation states 2017-07-13 12:11:25 -04:00
Paul Licameli
4d1ce201e4 Make TAB key act as before, when a Label track has focus. 2017-07-13 08:09:39 -04:00
Paul Licameli
5e4f453a81 Fix crashes when ESCaping a drag 2017-07-13 07:03:30 -04:00
Paul Licameli
6c0b3bb1bf Shift+TAB cycles hit test targets backwards 2017-07-12 16:39:14 -04:00
Paul Licameli
2cce171fe0 Implement TAB key rotation among hit test targets 2017-07-12 13:03:14 -04:00
Paul Licameli
4ec6baf059 Cursor handling always relies on current mouse state, not remembered 2017-07-12 13:03:13 -04:00
Paul Licameli
cddeb94c4b Revert "Highlighting of resizers"
This reverts commit 3e7f82cf5e4f4ce064a8bf5fcb136f12df933f9a.
2017-07-11 14:16:58 -04:00
Paul Licameli
3e7f82cf5e Highlighting of resizers 2017-07-11 13:57:59 -04:00
Paul Licameli
51e25cdfa0 Highlighting of Track Control Panel sliders 2017-07-09 12:34:46 -04:00
Paul Licameli
25641ae568 Highlight TCP buttons 2017-07-09 12:34:46 -04:00
Paul Licameli
ada4b6307d Pass more context information into drawing routines 2017-07-09 12:34:27 -04:00
Paul Licameli
f09a7be3dc TCP draw use hit target for button, slider state; remove hacky global 2017-07-09 12:34:27 -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
f5b0afc2fc Rename TrackPanel::HandleCursor as HandleMotion...
Call HitTest in just one place

Can now preserve repeatedly hit UIHandle objects during pre-click motion

Fields of HitTestResult besides the handle pointer are now unused

The need to repaint a track during mouse movement can be indicated when
constructing a UIHandle or when updating it for move; HitPreview no longer
does this

And the last allows simplifications of LabelTrack glyph highlighting

Also move the temporary state for label glyph dragging out of LabelTrack
2017-07-09 07:56:47 -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
Paul Licameli
e424f8e54e TrackPanel::mpClickedTrack is a safe weak_ptr 2017-06-28 01:46:59 -04:00
Paul Licameli
f8b74db76e Iterators over TrackPanelCell give shared_ptr 2017-06-26 17:14:33 -04:00
Paul Licameli
750fc34fac Clarify what the TrackList events are for...
Also fixes this bug:

Vertical rulers did not narrow as needed after deletion of the lowest track.
2017-06-25 03:00:28 -04:00
Paul Licameli
91c86fd937 TrackPanelCellIterator visits all cells, and FindCell simply uses it 2017-06-17 03:01:40 -04:00
Paul Licameli
ffbc4d5f90 Simplify iterations over TrackPanelCells with range-for 2017-06-17 03:01:40 -04:00
Paul Licameli
a94eb75b4e Further regularize the odd case of hit-test on the resizer region 2017-06-16 18:05:09 -04:00
Paul Licameli
34026d19fd Still better cursor handling: change cursor at once...
... on start or stop of transport, in cases as described in the previous
commit comment, even if the pointer does not move.
2017-06-16 18:05:08 -04:00
Paul Licameli
d9a91c1431 TrackPanel simplifications; improved cursor handling...
... in cases such as:  dragging an envelope point, then hitting space to play,
which forces the drag to finish early.  If you move the mouse, cursor will
remain "ban", even while the mouse button remains down but no drag is really
happening.
2017-06-16 18:05:08 -04:00
Paul Licameli
41a56441dc Remove unnecessary "virtual" 2017-06-16 18:05:08 -04:00
Paul Licameli
ef9e6465d0 Use override 2017-06-16 18:05:08 -04:00
Paul Licameli
d6b430c262 Remove unused function 2017-06-16 18:05:07 -04:00
Paul Licameli
770b3b52ef TrackPanel no longer implements the selection tool or MIDI stretch...
This one's big!

Also restores the effect of ctrl-click on label track.

Also adds ESC key handling for the Stretch.
2017-06-15 08:54:59 -04:00
Paul Licameli
efdb9889b1 TrackPanel no longer implements label keystrokes, drags, text selection...
... also implemented ESC key for those drags

... temporarily loses the special CTRL click handling
2017-06-15 08:54:58 -04:00
Paul Licameli
bbfa574790 Move track resizing code out of TrackPanel.cpp, though it still...
... cooperates more closely with TrackPanel than the other UIHandle subclasses
do.
2017-06-15 08:54:58 -04:00
Paul Licameli
703abe87bc TrackPanel no longer implements track selection click or rearrange drag...
... also implement ESC key for the drag
2017-06-15 08:54:57 -04:00
Paul Licameli
e4627b1668 TrackPanel no longer implements other mouse wheel actions 2017-06-15 08:21:42 -04:00
Paul Licameli
674ccc5e15 Clean up last bits of old popup menu code 2017-06-15 08:21:40 -04:00
Paul Licameli
91e6239eeb Move code for vertical ruler clicks, drags, popup menus, scroll wheel 2017-06-15 08:21:40 -04:00
Paul Licameli
a313bcdb11 Move code for Wave track menu items 2017-06-15 08:21:40 -04:00
Paul Licameli
ba5f6ce411 Move code for Note track menu items 2017-06-15 08:21:39 -04:00
Paul Licameli
01d5d30b7e Move code for Label track menu items 2017-06-15 08:21:38 -04:00
Paul Licameli
516d812f3a Move code for Time track menu items 2017-06-15 08:21:38 -04:00
Paul Licameli
0e5e7b1c05 Move code for common track menu items 2017-06-15 08:21:37 -04:00
Paul Licameli
bd0603b66a Remove the duplicate button-drawing functions that are now unused 2017-06-15 08:21:37 -04:00