Commit Graph

227 Commits

Author SHA1 Message Date
Paul Licameli 574fc7f2ec Extra Menus 2018-10-24 12:16:45 -04:00
Paul Licameli 4a8a30f1a9 Navigation Menus 2018-10-24 12:16:45 -04:00
Paul Licameli c7521b211d Window Menu for Mac 2018-10-24 12:16:44 -04:00
Paul Licameli 9759c6bd4f Plugin Menus 2018-10-24 12:16:44 -04:00
Paul Licameli 1be1217d1d Tracks Menus 2018-10-24 12:16:40 -04:00
Paul Licameli 903b42f84a Transport Menus 2018-10-24 12:16:35 -04:00
Paul Licameli c65fd0ebe1 View and Toolbar Menus 2018-10-24 12:16:35 -04:00
Paul Licameli fb8b5029e5 Select and Clip Menus 2018-10-24 12:16:33 -04:00
Paul Licameli 2792faa114 Edit and Label Menus 2018-10-24 12:14:05 -04:00
Paul Licameli 4d6cad8ebc File Menus 2018-10-24 12:14:01 -04:00
Paul Licameli 280e8d9bac Some machinery to add more menu handler object classes...
...without adding linkage dependencies to AudacityProject constructor
2018-10-24 11:02:33 -04:00
Paul Licameli b7f35609ad Clarify inheritance of MenuCommandHandler 2018-10-24 11:02:33 -04:00
Paul Licameli 8ca9edc2a4 Move some label editing functions into class LabelTrack 2018-10-24 11:02:33 -04:00
David Bailes 5494185a88 Dialog for the name of a label: positioning fixes
Problems fixed:
1. When adding a label at playback position, the position of the dialog was calculated using the position of the edit cursor
2. When adding a label at selection, the dialog could be to the left of the Audacity Window, and indeed offscreen.
2018-10-24 11:07:17 +01:00
Paul Licameli 1b05ba9a78 A compile-time constant for the number of align menu items 2018-10-20 09:21:22 -04:00
Paul Licameli 474f80912a Some functions can be static, don't need to be members of MenuBuilder 2018-10-20 09:21:22 -04:00
James Crook e8762a478f Add 'Quick Fix' menu item to Help.
This helps with 3 of the stuck-in-a-mode problems, adding fix buttons for the issues.
2018-10-19 18:31:44 +01:00
Paul Licameli 9ad88e091c Use weak pointers to simplify MenuCreator 2018-10-18 15:43:21 -04:00
Paul Licameli 2fafe5c328 Fix Linux build 2018-10-16 17:35:15 -04:00
Paul Licameli ce9f2e2538 Include Menus.h directly, only where needed, not via Project.h 2018-10-16 16:45:26 -04:00
James Crook 708cbe173e Consitently use On<something> iff it is a direct menu handler.
Some former 'On' functions have been renamed 'Do' since they didn't directly handle the menu item.  Some functions that used 'Context' now use 'Project'.
2018-10-16 15:15:35 +01:00
Paul Licameli fc6570646d MenuCommandHandler is not a base class of MenuManager...
... This forces a better placement of state variables in the appropriate
classes.

In future perhaps, MenuManager should be splintered into several classes, one
for each of the main toolbar menus.
2018-10-16 13:01:22 +01:00
James Crook 26086a4142 Split MenuCommandHandler into three classes.
Menus.cpp is over 10,000 lines.  The main point of the split is to make possible a new .cpp file for MenuCreator, which is responsible for the creation of the menu bar, and which contains the near 2,000 line function MenuCreator::CreateMenusAndCommands()

The menu handlers are also (better) separated from the menu management.
2018-10-13 21:38:34 +01:00
Paul Licameli 2ee87082cb Track::GetLink and GetLinked are private, but SetLinked isn't yet 2018-10-01 13:42:34 -04:00
Paul Licameli f276373f3c Remove GetLink(ed) in clip-moving functions 2018-10-01 13:42:29 -04:00
Paul Licameli e17c4acd5d Rewrite sorting of tracks 2018-10-01 10:54:37 -04:00
James Crook e7c4e8bde9 Help intellisense find MenuCommandHandlers
Once the struct definition is in the Menus.h file, intellisense can find the definitions of the functions.
2018-09-29 22:56:34 +01:00
Paul Licameli 9481587fa8 Move menu handling functions out of class AudacityProject 2018-09-29 12:10:27 -04:00
Paul Licameli 69bf7fd120 remove unused function 2018-09-04 23:04:18 -04:00
James Crook 0ea4ff1395 Add internationalization hints. 2018-08-28 16:35:06 +01:00
James Crook 71005cf125 Add File->Reset Menu Item (#ifdeffed out)
An compile-time optional menu item for checking the ResetProjectToEmpty() functionality.
2018-08-05 21:34:24 +01:00
Paul Licameli 2892dfd956 menu item, tentative shortcut Shift+D ("do-over") 2018-06-01 04:29:01 -04:00
Steve Daulton 419ecd411d Save lossless copy of project 2018-05-14 21:09:07 +01: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 ce9b5bb9ee Add Select->Region->Track Start to End
Also fixed Select Track Start To cursor.
Also made two script IDs longer, so they will appear in command selection dialog.
2018-03-18 20:43:45 +00:00
James Crook 2d62013fac Add Macros Palette to Apply Macro -> submenu, 2018-03-16 18:38:06 +00:00
Paul Licameli bb7b77cde0 Change expansion of XXO and pass more arguments to CommandManager 2018-03-15 23:29:27 -04:00
James Crook dab9ad812f Condense SeekLeftOrRight code further. 2018-03-14 13:48:11 +00:00
Evan Short 7c4ca093f3 use enums instead of bool in seekLeftOrRight 2018-03-14 13:48:11 +00:00
Evan Short 3f29d1948d refactor SeekLeftOrRight 2018-03-14 13:48:10 +00:00
James Crook c0dcba66dd Rename Chains to Macros.
Lots of renaming.
Did not rename the containing files (yet) since that will require makefile updates.
2018-03-03 19:17:18 +00:00
James Crook e6a2d0f99a Add all chains into the Tools menu. 2018-03-03 12:57:35 +00:00
James Crook 8cd5d7f4fe Tools menu and EffectTypeTool
- Also add a 'Nyquist Prompt' to the Tools Menu.
- Currently it is the same as the Effects Nyquist Prompt.
- Chains moved into the Tools prompt.
2018-03-03 12:57:32 +00:00
James Crook bcf0865c1a UnmuteAllTracks, not UnMuteAllTracks. 2018-02-24 14:20:28 -05:00
James Crook 99e18a8896 Implement ReloadPreferences for SetPreferences Command. 2018-02-24 14:20:25 -05:00
James Crook 1d9477a455 SetClip, SetLabel, SetProject added
- SetTrack also updated with more options.
2018-02-24 14:20:24 -05: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 d77daa027e OnShowEffectsRack follows the unused argument convention 2018-02-22 00:17:30 -05:00
Paul Licameli 3b32d39b54 Remove wxArrays of pointers 2018-02-21 19:33:32 -05:00
Paul Licameli 9dd5b521ea Make the experimental effects rack window compilable and usable...
... though there remain crash bugs to figure out, turning it on and off
during play.
2018-02-21 19:20:54 -05:00
Paul Licameli e57afb3729 Fix many unused argument warnings in Menus.cpp 2018-02-21 15:18:38 -05:00
Paul Licameli f78a418df8 An alpha-only toggle command for extra dropout detection; default off 2018-01-17 20:35:56 -05:00
Paul Licameli 9777d3e880 Alert user to drop-outs during recording...
1) When the program detects this, insert zeroes into the recording to keep the
other good parts synchronized.

2) When recording stops, a message box alerts the user, and a label track is
added showing the lost parts, labelled with consecutive numbers.

3) A menu item visible in alpha builds only is added to Tools, to simulate
recording errors at random times and test the reporting feature.
2018-01-15 14:48:39 -05:00
David Bailes 6ca8cef34a Fix for select next/previous clip
Problem (at least on Windows 10): The commands no longer work properly. For a simple example, with one track selected, and the last clip selected, next clip moves to a non existant clip.
This was caused be commit baec816. In this commit, a member function was added to the struct FoundClip. Because FoundClip is no longer POD, statements such as:
AudacityProject::FoundClip result{}; no longer zero initialize the struct.

Fix: explicitly zero initialize the data members of FoundClip. I've also zero initialized the data members of FoundClipBoundary, where their are potentially similar problems, although there were no problems in my tests.
2018-01-09 11:24:57 +00:00
James Crook 0cc9c6bc3b Zoom Toggle
Added preferences for Zoom-Toggle and put into menus.
New helper functions for determining zoom scaling.

Optional EXPERIMENTAL_ZOOM_TOGGLE_BUTTON added, and Light theme updated.
Not enabled for 2.2.2.
2018-01-07 17:14:33 +00:00
Paul Licameli ab6de1181d No more functor objects; all command handler functions take same args 2018-01-05 09:27:29 -05:00
Paul Licameli 77c392d29c AudacityProject::OnEffect wraps new function DoEffect 2018-01-05 09:27:28 -05:00
Paul Licameli 1f7b62f056 AudacityProject::RebuildAllMenuBars is static 2018-01-05 09:19:07 -05:00
Paul Licameli baec816142 Rewrite the composition of clip messages in i18n-friendly way 2018-01-04 09:43:25 -05:00
Paul Licameli f0de38dec1 Scanned for bad naked new; found none; changed comments, used safenew 2017-07-23 09:35:01 -04:00
Pokechu22 681161f60b Add MIDI device diagnostics
* MIDI Device Info menu item, like Audio Device Info

 * MIDI device info in crash reports

 * Only enabled with EXPERIMENTAL_MIDI_OUT, but tracks info related to the (unimplemented) EXPERIMENTAL_MIDI_IN
2017-07-16 10:58:53 -04:00
David Bailes 71ac4bb2f5 Fixes for commands to move cursor to or select to clip boundaries
The messages sent to screen readers for these commands were incorrect when stereo tracks were present. This has been fixed, including the case where the two channels of a stereo track have different clip boundaries.
2017-07-11 15:27:33 +01:00
David Bailes 71a75fc28d Fixes for commands to select next/previous clip
The messages sent to screen readers for these commands were incorrect when stereo tracks were present. This has been fixed, including the case where the two channels of a stereo track have different clip boundaries.
2017-07-11 11:30:18 +01:00
Paul Licameli ef38af71dd Move more time-shifting functions out of TrackPanel.cpp 2017-06-15 08:21:01 -04:00
Paul Licameli e2d77b399d Move one more selection function out of TrackPanel 2017-06-11 16:14:26 -04:00
Paul Licameli d834bcdbd1 Move some command handlers for selection and focus out of TrackPanel 2017-06-11 11:03:28 -04:00
James Crook adc7312954 Auto-Select off by default.
I've implemented three states for what to do if no selection:
0 - Grey out (no longer used)
1 - Auto-select
2 - Give the warning message and try again.
2017-06-09 19:40:28 +01:00
Paul Licameli a33ec61ddf Move code for toggling spectral selection (Q key) out of TrackPanel 2017-06-08 12:48:28 -04:00
Paul Licameli d210b18aad Limit consolidation of undo items by other means 2017-05-24 00:23:25 -04:00
David Bailes cd6c9834f6 Clip move commands - minor fix.
Forgot that the name of data members should begin with the letter m. Fixed this.
2017-05-23 12:56:11 +01:00
David Bailes f46ac268f4 Update commands for moving clips using the keyboard
Second attempt at getting the commands to update history, so that they can be undone (previous attempt at b911607, which didn't call the undo manager for each keydown).

Both a single keypress (keydown, then keyup), and holding down a key (multiple keydowns followed by a keyup) result in a single entry in Audacity's history dialog. Note that this code relies on a change to the undo mananger in commit 63ae687.
2017-05-23 10:29:49 +01:00
Paul Licameli f7578193b4 TrackPanel::OnClipMove is a static function 2017-05-18 07:46:54 -04:00
Paul Licameli d36ac2cedb Revert "Fix for keyboard commands for time shifting clips"
This reverts commit b91160795d.
2017-05-18 07:06:22 -04:00
David Bailes b91160795d Fix for keyboard commands for time shifting clips
Commands didn't update history etc.

Fix: Commands now call TrackPanel::MakeParentPushState.
2017-05-15 13:12:11 +01:00
James Crook 0ac2d90d8a SelectAllIfNone now selects all time if none, and all tracks if none.
This means you can now select just a time, and get all tracks selected, or some tracks, and get all time selected.
One side effect of this is that if you select a label (only) and apply 'cut' you now just cut the label, rather than cutting all tracks.  If you select a label and apply echo, you now get an error message, rather than applying echo to all tracks.
2017-05-13 10:06:52 +01:00
James Crook 35fe313f30 Smarter SelectAllIfNone
Now if there is a time selection and no tracks selected, then just select all the tracks, preserving the time selection.
This helps in the case a user has made a time selection, e.g. with selection toolbar, and then clicked on track panel, losing the selection of tracks but preserving the time selection.

I also shortened some repeated cut-and-pasted code.
2017-05-11 22:36:55 +01:00
David Bailes b2d8f36969 Fix for bugs in keyboard clip commands due to rounding errors
When When two clips are immediately next to each other, the GetEndTime() of the first clip and the GetStartTime() of the second clip may not be exactly equal due to rounding errors. The existing code assumed they were equal, and this lead to the wrong clip boundaries or clips being found.

There are a number of ways of fixing this which could be explored. The current solution involves changing only the code for the keyboard interaction with clips.

The fix:
1. The test used for two clips being immediately next to each other is that GetEndSample() on the first clip is equal to to GetStartSample() on the second clip.
2. When searching for the start/end times of clips, the cases where GetEndTime() and GetStartTime() are not equal are taken into account. This is done in the two functions AudacityProject::AdjustForFindingStartTimes and AudacityProject::AdjustForFindingEndTimes.
2017-05-10 09:24:25 +01:00
James Crook 9d501f69d6 Add preference for Record being to new track. 2017-05-01 12:04:27 +01:00
David Bailes baf46c1f85 Update to Select Previous/Next clip commands
Previously, these two commands used the clips in the focused track. They now have similar to the Tracks->Pan->Left/Right/Center commands. That is if any audio tracks are selected, the clips in these tracks are used, otherwise the clips in all audio tracks are used.
2017-05-01 09:20:44 +01:00
David Bailes ce1d067f84 Update to Clip Boundary commands
This update affects the four commands:
Cursor to Previous clip boundary
Cursor to Next clip boundary
Select previous clip boundary to cursor
Select cursor to next clip boundary

Previously these commands all used the clips in the focused track. This update changes this so that their behaviour is the same as the Tracks->Pan->Left/Right/Center commands. That is, if any audio tracks are selected, all the clips in these tracks are used, else the clips in all audio tracks are used.
2017-05-01 08:58:46 +01:00
James Crook 6d361687d6 Add Show/Hide Extra menus preference.
The new preference is in the view menu and on the Gui preferences page.
Also Ext Menus rearranged to more closely match default toolbar order.
Also F11 (a new menu command to show/hide maximised) now has a check mark.

This change needs testing on mac as mac is pickier about when menus are updated.
2017-04-21 17:32:53 +01:00
David Bailes 592453082b Removed zoom presets
Removed the zoom presets which I added in commit 1fa97a4. Nobody else wanted them.
2017-04-21 15:15:38 +01:00
James Crook 221b0271ca Bug 1628 - Tracks > Align items two submenus deep
Fixed by adding a new on/off option, "Move  Selection With Tracks".
2017-04-08 11:54:25 +01:00
David Bailes caca4d20f3 Zoom presets: wording change
Thousandth second -> Millisecond
2017-04-07 08:57:48 +01:00
David Bailes 1fa97a4b37 Added zoom presets
Please Note:
In ViewInfo.h there is the comment left by Paul:
// There is NO GetZoom()!
// Use TimeToPosition and PositionToTime and OffsetTimeByPixels!

I needed to get the value of the current zoom so that I could use the functions AudacityProject::ZoomInByFactor and AudacityProject::ZoomOutByFactor to handle the change in zoom when a preset zoom is chosen. So I added GetZoom() for this use.
2017-04-06 12:49:38 +01:00
James Crook 52f0f750d9 Add Tracks->Pan->Left/Right/Center 2017-04-03 22:35:19 +01:00
David Bailes a7a4a70e5f Two commands added, neither on a menu:
Clip Left
Clip Right

If the cursor lies within a clip, the clip and the cursor is moved 1 pixel left/right.
If the cursor position is at both a clip end and a clip start, the second of these clips is moved.

The movement currently ignores the snap to setting on the selection bar, and there is no snapping to the clip boundaries of other clips.
Following the behaviour or shifting with the mouse, the distance moved is rounded to an integral number of samples, and the minimum distance moved is one sample.
2017-04-03 13:53:48 +01:00
David Bailes c382139c05 New commands for selecting clips using the keyboard
Added two commands:
Select > Previous clip. Select the previous clip for which clip start < selection start/cursor position.

Select > Next clip. If the position of selection start/cursor is at the start of a clip, and selection end is not at the end of the clip, select that clip. Otherwise, select the next clip for which clip start > selection start/cursor position.
2017-04-03 13:45:58 +01:00
David Bailes a519e6fc7d New commands for clip boundaries using the keyboard
Added the commands:
Cursor to > Previous clip boundary
Cursor to > Next clip boundary
Select > Previous clip boundary to cursor
Select > Cursor to next clip boundary
2017-04-03 13:35:46 +01:00
Paul Licameli 1552ff188f When opening a file into a new project, delete the project on failure 2017-03-21 14:11:28 -04:00
James Crook 5c1f4d24b5 Menu rearrangement merged from DarkAudacity 2017-03-19 16:43:51 +00:00
Paul Licameli 9eaa40659e Utility for track editing leaves fewer direct calls to GetLinked() 2017-03-17 17:52:28 -04:00
Paul Licameli 6665370f61 Fix spelling in a function name 2017-03-17 17:52:21 -04:00
James Crook c53e2dbb77 Bug 1597 - Enh: Greater clarity over status of versions needed
- For ALPHA builds we do a check version with the Welcome screen (if welcome screen is enabled).
- A 'Check Online' in the About box provides a new route to check version
- Check Version now passes CommitId and Build Date/Time to identify a version.

To actually close the bug we need the javascript on the server page to put up informative messages.
2017-02-25 23:00:39 +00:00
Steve Daulton 15aa84f10b Fix bug 1575
Includes fix by PRL:
https://github.com/Paul-Licameli/audacity/commit/cbca44e
2017-01-16 12:35:07 +00:00
David Bailes 87c0eb1563 Rename the two commands for the Saved cursor position
After discussion on Audacity-quality mailing list, the commands now refer to the stored cursor position, rather than the saved cursor position. (This position is not saved to disc).
2016-11-20 12:44:13 +00:00
David Bailes cc24472d09 Add two new commands for selecting a time range using the keyboard
The new commands are "Save Cursor Position" and "(Select) Cursor to Saved Cursor Position"
2016-11-08 08:58:48 +00:00
David Bailes 5542f88089 Changed names of the commands to move to next/previous label
Selection to next label => Move to Next Label
Selection to previous label => Move to Previous Label
2016-11-01 14:09:03 +00:00
David Bailes a79596fb4e Add a setting for whether labels can be created by typing
Added a setting for whether labels can be created by typing in a label track.
The setting can be changed in either the Tracks menu, or the Tracks category in Preferences.
By default the setting is set to on.
2016-10-26 13:11:07 +01:00
David Bailes ff9763f984 Add two commands to move the cursor/selection to next/prev label
The two commands are "selection to next label" and "selection to previous label".
They have default shortcuts alt+right and alt+left.

A label track does not have to be the focus. If there is a single label track in the project, that it used. If there is more than one label track, then the first label track, if any, starting at the focused track is used.

If the commands are used during playback of the project, playback continues from the new cursor/selection.

The commands provide feedback to screen readers: the name of the label, and position in the form of "i of n".
2016-10-24 14:24:20 +01:00