Commit Graph

232 Commits

Author SHA1 Message Date
Paul Licameli
c3aad2e026 Remove wx/event.h from headers 2019-03-27 04:36:51 -04:00
Paul Licameli
71adb89342 Remove non-UI functions in TrackPanelListener 2019-03-27 04:06:15 -04:00
Paul Licameli
40b4361732 Remove wx/arrstr.h from headers 2019-03-26 12:41:44 -04:00
Paul Licameli
02db402b54 Bug2064: ESC key should abort drags in time ruler on Linux...
... Reimplement the ESC key handling in TrackPanel and time ruler on all
operating systems so that it does not rely on the focused window, but instead
uses the application-wide event filter.

This includes reversion of 9491605cfc
2019-03-18 12:43:14 -04:00
Paul Licameli
173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli
71036bed01 Remove PluginManager.h from other headers 2019-03-17 15:05:19 -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
1bcb7c20a5 Remove some nested #include from Project.h 2019-03-16 13:09:54 -04:00
Paul Licameli
f7162d3326 OverlayPanel uses weak_ptr to Overlay, which simplifies other dtors 2019-03-16 08:21:03 -04:00
Paul Licameli
a30000cf74 Use type aliases FilePath, FilePaths...
... for wxString and wxArrayStringEx, holding file paths (absolute or relative,
directory or plain file); to be replaced later with different types

(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)
2019-03-15 15:18:11 -04:00
Paul Licameli
135c2a71ce Replace "" and wxEmptyString with {} in default argument values 2019-03-15 15:18:11 -04:00
Paul Licameli
dfeb7e18aa Type aliases for some uses of ComponentInterfaceSymbol...
... to be replaced later with distinct types

Also changing FamilyId => Family in function names

Also NumericFormatId => NumericFormatSymbol
2019-03-14 17:26:20 -04:00
Paul Licameli
50f8579475 Move AudacityProject::DoTrackMute and DoTrackSolo...
... also fixed the bug that muting and soloing from the mixer board did not
update accessibility.
2018-10-28 16:50:01 -04:00
Paul Licameli
51c3541716 Move AudacityProject::RemoveTrack 2018-10-28 16:45:38 -04:00
Paul Licameli
83f504e30f Move AudacityProject::SetTrackPan and SetTrackGain 2018-10-28 16:43:20 -04:00
Paul Licameli
edd23e2634 Move AudacityProject::GetZoomOf* 2018-10-28 16:43:17 -04:00
Paul Licameli
b2ea8ab6e9 Move AudacityProject::EditByLabel and EditClipboardByLabel 2018-10-28 16:30:39 -04:00
Paul Licameli
95cca91eb1 Move AudacityProject::Clear 2018-10-28 16:26:03 -04:00
Paul Licameli
012ea76132 Moved mixer board update code out of class AudacityProject...
... And we don't need GetMixerBoard() any more
2018-10-27 18:01:09 -04:00
Paul Licameli
1fc4c5724e MixerBoard no longer needs update at undo push...
... it does that sooner, and ony when needed, when relevant track data really
change, by listening to the TrackList.
2018-10-27 18:01:08 -04:00
Paul Licameli
96d104cb38 Lyrics panel listens; AudacityProject not responsible for updating it 2018-10-27 12:52:06 -04:00
Paul Licameli
193c4ae4c2 Remove unused things and obsolete comments in Menus.* ...
... This includes all that remained of MenuCommandHandler
2018-10-24 12:20:31 -04:00
Paul Licameli
800f6500ba No more member definitions of AudacityProject inside Menus.cpp 2018-10-24 12:16:46 -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
James Crook
b7abde8527 Fix class/struct warning. 2018-10-19 17:56:53 +01:00
Paul Licameli
16ab48079b Don't include CommandManager.h in other headers 2018-10-18 09:25:14 -04:00
Paul Licameli
ce9f2e2538 Include Menus.h directly, only where needed, not via Project.h 2018-10-16 16:45:26 -04: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
0c0c2c0d1e Rewrite iteration over visible tracks in TrackArtist...
... also eliminating AudacityProject::GetFirstVisible.
2018-10-01 13:41:51 -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
e456b53344 Add and remove some private: and public: 2018-09-29 12:48:52 -04:00
Paul Licameli
9481587fa8 Move menu handling functions out of class AudacityProject 2018-09-29 12:10:27 -04:00
Paul Licameli
544c3b9770 spelling in comments 2018-09-04 23:04:18 -04:00
James Crook
3bb48a21df Bug 1932 - (Residual) Fix stopping behavior with Play-At-Speed.
1. The rate actually used by the sound card now sets the stopping sample number.
2. The tolerance in the 'stop position' is additionally trimmed to 20 samples.
2018-08-19 10:37:43 +01:00
Paul Licameli
b502d88285 Better enum value name 2018-08-06 21:58:41 -04:00
Paul Licameli
74efec9d39 Bug1756 (shouldn't lose record status message) refixed differently...
... Don't let the status message during recording, about remaining disk
capacity, get lost when mouse moves across TrackPanel hit targets or toolbar
buttons.

But, will show those other messages too, only for limited time if the
mouse stops moving; then restore the capacity message.

Needed to correct for unreliability of wxTimer in AudacityProject, as with the
TrackPanel timer, by restarting it sometimes.

The intention evident in previous code was to refresh messages once every 3
seconds.  Should be better realized now.

See also the prior fix at b49e467412
2018-08-06 20:09:39 -04:00
James Crook
9357c90b43 Bug 1859 - Macros on files - Save Project causes overwrites. thus loses data
AudacityProject::Save() is now batch mode sensitive, and if in batch mode (and not overwriting) will save without prompting.
The loop for applying macros to multiple files now also clears down the project, using the new function ResetProjectToEmpty().
2018-08-05 21:34:24 +01:00
Paul Licameli
ff98ca5a32 CellularPanel saves and restores focus for each click-drag-release...
... while the project makes note of which window has temporarily given up the
focus; and TrackPanel can detect that, so that the yellow border of the focused
track is still drawn while the panel "lends" the focus.

Why do all this?  So that, when the ruler is another CellularPanel, ESC key
will work to abort drags in the ruler, but TrackPanel appearance won't change
during the drags.
2018-08-05 14:51:58 -04:00
James Crook
c94df54157 Bug 1856 - Applying Macros to Files is no longer a batch process
This restores the 2.2.2 behaviour, with a subdirectory called 'cleaned'.  The problem was that 2.2.2 used special cases for MP3 Ogg and WAV exports, which were stripped out in favour of using the built-in Export command.  However, the differences in behaviour (prompting) between batch and non batch mode were not taken into account.
2018-08-04 19:16:32 +01:00
Steve Daulton
419ecd411d Save lossless copy of project 2018-05-14 21:09:07 +01:00
James Crook
b60fae4470 Fix some warnings on mac
These are mostly missing 'overrides'
2018-04-07 20:28:27 +01:00
Paul Licameli
0fb02a8024 IdentInterfaceSymbol in NumericTextCtrl; don't persist translated 2018-03-28 14:00:17 -04:00
Paul Licameli
293f22db37 Redo zoom setting choices in Tracks preferences 2018-03-25 14:39:45 -04: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
8ab69ae5c3 Update tools menu on Mac too.
This entailed making the Edit Chains and Apply Chain dialogs modeless.
That is good for other reasons too.
2018-03-03 19:16:50 +00:00
James Crook
f7fe295651 Make Message command into an AudacityCommand. 2018-02-24 14:20:27 -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
3b32d39b54 Remove wxArrays of pointers 2018-02-21 19:33:32 -05:00
Paul Licameli
bf5228267a Calls to Disconnect or Unbind in destructors are not needed, if...
... it's either the source of the connection that is being destroyed, or other
object (such as an ancestor window) transitively owning it and so causing it to
be destroyed too;

or, the sink is being destroyed, and that sink is a wxEvtHandler (which is
always so for Disconnect, though not for Unbind in case Bind was passed a
member function of a non-wxEvtHandler).

wxWidgets takes care of erasing the connection in such cases.

This removes most calls to Disconnect and Unbind.  Many destructors shrank to
nothing.

Notably, in case of popup menu handling, the call to Disconnect is not removable
because the object being destroyed is neither the source nor the sink.
2018-02-21 19:28:06 -05:00