Commit Graph

375 Commits

Author SHA1 Message Date
Paul Licameli b47e2f91e2 Make header dependencies for wxUSE_ACCESSIBILITY explicit 2019-03-18 12:14:16 -04:00
Paul Licameli 906e55f047 Experimental.h in all .h or .cpp files that directly use EXPERIMENTALs...
... except Audacity.h; and in no others.

Do so even if Experimental.h gets multiply included, as in both the .h and
.cpp files.

This makes it easier to do a text scan to be sure there are no unintended quiet
changes of meaning because of omission of Experimental.h when the flag is
an enabled one.

Also move inclusions of Experimental.h earlier.

Also don't require Experimental.h to be preceded by Audacity.h to define
EXPERIMENTAL_MIDI_OUT correctly.
2019-03-17 22:54:00 -04:00
Paul Licameli 15777834e0 Remove calls to TrackPanel::FindTrackRect for finding control area 2019-03-17 15:23:51 -04:00
Paul Licameli 3dba70120c CommandManager, MenuManager don't use Lyrics.h, MixerBoard.h ...
... instead define new base classes in src/commands that those other
windows can inherit.  The classes have nothing but a virtual destructor.  This
lets CommandManager use dynamic_cast to detect the special windows.

See commits cbfde23 and 68e4bf6 which added the #include directives
2019-03-16 13:10:59 -04:00
Paul Licameli 01329876c5 Remove unnecessary #include 2018-11-05 07:42:21 -05:00
Paul Licameli c4994ae9c2 kTrackInfoWidth was misleadingly named...
... keep the name, but change the value to be what it really says:
the proper width of the track control panel, agreeing with the hit-test
area, NOT including the left margin

And change places where the constant was used, adding the margin back again.
2018-11-04 18:23:29 -05:00
Paul Licameli 38005054f4 Make TrackInfo a namespace, not a class...
... Its functions take a pointer to TrackPanel when necessary, just to do the
reparenting of the global slider instances
2018-11-04 10:51:00 -05:00
Paul Licameli 55774fbb29 When drawing, treat track plus separator BELOW as the natural grouping...
... and treat the top margin of the first track specially.
2018-11-02 23:16:05 -04:00
Paul Licameli a2e392433a Paint left and right margins of the whole TrackPanel first 2018-11-02 22:38:11 -04:00
Paul Licameli e70b240338 The ruler and sash draw functions treat their own backgrounds 2018-11-02 21:10:30 -04:00
Paul Licameli 951e7d27da The vruler and sash draw functions treat their own left boundaries 2018-11-02 21:07:48 -04:00
Paul Licameli 0f17b309bc Fuse the two sash-drawing functions, pass a rectangle not a track...
... and be consistent about substituting the track before finding Y and height
2018-11-02 21:07:45 -04:00
Paul Licameli e31669f555 comment out unused function 2018-11-02 16:51:07 -04:00
Paul Licameli c1b729822c Remove unused arguments of some drawing functions 2018-11-02 16:51:07 -04:00
Paul Licameli 39fc20c5ee TrackPanelCellIterator is no longer needed 2018-11-01 18:25:02 -04:00
Paul Licameli 01551913f0 nonvirtual reimplementation of CellularPanel::FindRect using nodes 2018-11-01 18:25:02 -04:00
Paul Licameli cfa7afcb24 nonvirtual reimplementation of CellularPanel::FindCell using nodes 2018-11-01 18:25:02 -04:00
Paul Licameli 128ba93ae7 Implement TrackPanel::Root() 2018-11-01 18:25:01 -04:00
Paul Licameli 4fe97acbc9 Define CellularPanel::Root 2018-11-01 17:37:22 -04:00
James Crook 76166135d4 Fix many MSVC compiler warnings. 2018-10-29 13:19:33 +00:00
Paul Licameli 2741d58880 TrackList emits more events for certain changes of state of tracks...
... Also rewrote some of the existing event handling so all events from
TrackList are of the same, custom event class, and distinguishing addition
from resizing events, though this distinction is not yet used
2018-10-27 11:31:42 -04:00
Paul Licameli a68184f81d Remove GetLink(ed) in track panel drawing and refresh 2018-10-01 13:42:30 -04:00
Paul Licameli b94e8fec96 Remove VisibleTrackIterator 2018-10-01 11:20:52 -04:00
Paul Licameli a5c50a112a more const in drawing functions 2018-09-13 13:53:58 -04:00
Paul Licameli 22f85f244b Bug1917: TrackPanel should keep focus after click or drag...
... though ruler won't, and if you start to drag in TrackPanel but abort it
with the ESC key, that too returns focus
2018-08-07 10:42:38 -04:00
Paul Licameli f6609e5ffb Move class CellularPanel into its own files 2018-08-05 14:02:55 -04:00
Paul Licameli 7f84e71324 Context menu handling is also in CellularPanel 2018-08-05 14:02:55 -04:00
Paul Licameli c08c17eafa Add a method to find the rectangle of a given cell...
... Cells are not responsible to remember that; the cells' container determines
that.
2018-08-05 14:02:55 -04:00
Paul Licameli 062066eb79 Split base class CellularPanel out of TrackPanel...
... To be reused with the Ruler too.

The new base class does all the handling of hit tests on cells and managing
of UIHandles, and keyboard events and focus.

It has no knowledge of tracks -- that all resides in overriding functions in
TrackPanel.

Still to do, of course, is reorganizing drawing with callbacks to the cell
objects.
2018-08-05 14:02:52 -04:00
Paul Licameli 98514194a4 ProcessUIHandleResult takes pointers to TrackPanelCell 2018-08-05 13:28:34 -04:00
Paul Licameli 7395e5acbd Remove pTrack from FoundCell; new function hides some casting 2018-08-04 15:35:36 -04:00
Paul Licameli 79067e43f0 ProcessUIHandleResult is a member function of TrackPanel 2018-08-04 15:35:36 -04:00
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 3e7f82cf5e.
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
Paul Licameli 1a317af2f5 Move code for handling the menu button out of TrackPanel, but...
... Still to do, move out the code for menu items.  They remain accessible
from Shift-M but not from the menu button.

And ESC key is now implemented.
2017-06-15 08:21:36 -04:00
Paul Licameli c3f5fea5fc TrackPanel still draws Miminize and Close, but no longer handles...
clicks on them...

... also implemented ESC key for those drags
2017-06-15 08:21:36 -04:00
Paul Licameli 7cab380192 TrackPanel still draws Velocity, but no longer handles clicks on it...
... also implemented ESC key for that drag
2017-06-15 08:21:35 -04:00
Paul Licameli a569476e79 TrackPanel still draws Gain and Pan, but no longer handles clicks on them...
... also implemented ESC key for those drags
2017-06-15 08:21:35 -04:00
Paul Licameli 5ee73f944d TrackPanel still draws Mute and Solo, but no longer handles clicks on them...
... also implemented ESC key for those drags
2017-06-15 08:21:34 -04:00
Paul Licameli f89cbefc7b Temporary hack lets us defer encapsulation of track control panel drawing...
... while we can work on encapsulating the click-drag actions.
2017-06-15 08:21:33 -04:00
Paul Licameli 43968c4ac9 TrackPanel no longer implements clip joining or cutline expansion/deletion...
... also implement ESC key for these and added status bar message for
mouse-over
2017-06-15 08:21:30 -04:00
Paul Licameli 2496b0d7bc TrackPanel no longer implements the envelope tool...
... also implement ESC key for it
2017-06-15 08:21:02 -04:00
Paul Licameli ef38af71dd Move more time-shifting functions out of TrackPanel.cpp 2017-06-15 08:21:01 -04:00
Paul Licameli 251976d93d TrackPanel no longer implements the time shift tool...
... also implement ESC key for it
2017-06-15 08:21:01 -04:00
Paul Licameli f1f254f974 TrackPanel no longer implements the draw tool...
... also implement ESC key for it
2017-06-15 08:21:00 -04:00
Paul Licameli 85c03bb3b3 TrackPanel no longer implements the zoom tool...
... Also changed the behavior of drawing of dashed lines: make them
disappear when they approach close enough that right-up will zoom out,
not in.
2017-06-15 08:20:59 -04:00
Paul Licameli 14d45eda33 Define and use the UIHandle and TrackPanelCell protocols, but...
...no actions reimplemented to them yet.

Later commits will move special cases one at a time from TrackPanel, preserving
all click and drag capabilities at each step.  With a few exceptions, but those
lost abilities are restored in yet later commits.  (Ctrl+Click on the Label
track being one.)
2017-06-15 08:20:56 -04:00
James Crook f67cc7af25 Fix broken Windows build.
Was broken on MSVC 2013, due to a compiler bug.
2017-06-14 16:17:20 +01:00
Paul Licameli 5982dccd36 Redo layout tables as std::vector 2017-06-13 19:05:50 -04:00
Paul Licameli 063c6c236f Table includes draw functions for status items 2017-06-13 18:57:34 -04:00
Paul Licameli ce77f176b5 Table includes draw functions for Mute and Solo 2017-06-13 18:53:26 -04:00
Paul Licameli 4df84f126e Table includes draw functions for sliders 2017-06-13 14:02:10 -04:00