Commit Graph

431 Commits

Author SHA1 Message Date
Paul Licameli
c7984a2c83 Fix mistaken usage of ProjectSettings 2020-01-06 13:48:51 -05:00
Paul Licameli
bb26b2f2c4 Require a ProjectWindow as ancestor of effect dialog...
... by passing parent as reference, not pointer, and testing in the dialog
factory function.

This is important so that we know the lifetime of an effect dialog, even when
it is non-modal, is bounded by the lifetime of the associated project.
2020-01-06 11:30:47 -05:00
Paul Licameli
91515520bc Remove the nullary override of Effect::Preview 2020-01-05 19:59:30 -05:00
Paul Licameli
23a0206d2a Remove CreateUI; pass dialog factory to effect client instead 2020-01-05 16:11:55 -05:00
Paul Licameli
738c5c5e90 Remove Effect::PromptUser...
... it was only a thin wrapper of ShowInterface when not overridden, not
clearly serving a distinct purpose.
2020-01-05 16:11:55 -05:00
Paul Licameli
fb678c0eb8 Remove EffectHostInterface::Apply so Effect doesn't use EffectManager 2020-01-05 16:11:54 -05:00
Paul Licameli
8c4d8db133 Move classes EffectUIHost and EffectPanel to EffectUI.cpp 2020-01-05 16:11:54 -05:00
Paul Licameli
0704f6919a EffectPresetsDialog::SetPrefix takes TranslatableString 2019-12-29 00:01:57 -05:00
Paul Licameli
d1637c22c0 TranslatableString for explicit prompts and units in ShuttleGui 2019-12-23 19:22:03 -05:00
Paul Licameli
5168d62e3d TranslatableString for captions of text entry boxes 2019-12-23 18:53:00 -05:00
Paul Licameli
2007346551 Pass TranslatableString to help, warning, and error dialogs 2019-12-20 21:48:21 -05:00
Paul Licameli
dc39f22442 AudacityMessageBox takes TranslatableString message and caption 2019-12-20 21:32:50 -05:00
Paul Licameli
d8c2610d88 TranslatableString in AudacityCommand::MessageBox, Effect::MessageBox 2019-12-20 21:32:47 -05:00
Paul Licameli
71e9e38083 AudacityMessageDialog takes TranslatableString message and caption 2019-12-20 13:40:20 -05:00
Paul Licameli
e3ea93a624 Define and use function Verbatim...
... in cases of "TranslatableString" that are not really translated.

This makes it easier to scan the code for such unusual constructions of
TranslatableString, distinct from mere mentions of the TranslatableString type.
2019-12-19 22:49:23 -05:00
Paul Licameli
092033b284 Just one accessor for the name of a ComponentInterface...
... Translate it explicitly where needed.
2019-12-19 11:47:37 -05:00
Paul Licameli
618fee21ec TranslatableString for ComponentInterface::GetDescription() 2019-12-16 14:21:57 -05:00
Paul Licameli
681950fc61 TranslatableString for names, labels, tooltips of wxPanelWrapper...
... and Grabber too
2019-12-16 10:58:05 -05:00
Paul Licameli
53ee9c9800 TranslatableString for titles, names, labels of wxDialogWrappers...
... Found one missed translation in CommandTargets.cpp
2019-12-16 10:58:05 -05:00
Paul Licameli
5639f834c8 CommandManager stores labels as TranslatableString 2019-12-16 10:58:05 -05:00
Paul Licameli
9a609fe1fe TranslatableString in ProgressDialog 2019-12-14 01:48:15 -05:00
Paul Licameli
30d375d6fa Remove style argument from ShuttleGui::AddCombo & AddListBox...
... use the Style() chain-call instead, as needed
2019-12-02 17:26:38 -05:00
Paul Licameli
b256a4fd1a Less code directly inside ShuttleGui code blocks...
... Trying to reduce that just to chained calls on S, or conditional and looping
logic for variations in layout.

Lift some declarations to higher scope; or use expressions that avoid local
variables; or even use lambdas for more complicated computation of arguments
for the member functions of S.
2019-11-29 15:16:51 -05:00
SteveDaulton
5d4c884764 Fix bug 1824
Generate effect preview fails when no selection
2019-09-05 21:01:46 +01:00
Paul Licameli
33f3d4b82d Heavyweight version of SelectedRegion stored in ViewInfo emits events 2019-07-17 12:43:39 -04:00
Paul Licameli
6ccca16a75 Move display type from WaveTrack to WaveTrackView 2019-07-09 20:09:59 -04:00
Paul Licameli
7e1c469d7f Remove some unnecessary #include directives 2019-07-09 12:45:50 -04:00
Paul Licameli
13c2e4de0f Move members from ControlToolBar into class ProjectAudioManager...
... and ControlToolBar is included in fewer places
2019-07-03 16:52:16 -04:00
Paul Licameli
6aba4a3fc7 Bug2129: Effect preview button should work...
... mistake was introduced at 8506282
2019-06-28 10:51:41 -04:00
Paul Licameli
ff2cf496cd Move DoEffect out of PluginMenus 2019-06-25 00:14:52 -04:00
Paul Licameli
1c588fa014 Move enum into EffectManager...
... tying Effect into a cycle of 3 with EffectManager and EffectRack, which is
only revealing the true dependencies
2019-06-25 00:12:45 -04:00
Paul Licameli
cd9e4e3987 RealtimeEffectState into RealtimeEffectManager...
... which doesn't need Effect.h then.

Freeing Effect and RealtimeEffectManager from cycles, leaving 25 in the big
s.c.c.
2019-06-24 01:04:03 -04:00
Paul Licameli
5caeaf520b RealtimeEffectState needs only EffectClientInterface, not Effect 2019-06-24 00:49:14 -04:00
Paul Licameli
867e6a8d9e Move fields out of Effect, into new class RealtimeEffectState...
... and simplify, using a std::atomic instead of a critical section.

(But did this before, and does this now, correctly synchronize across threads?
I defer that question.)
2019-06-24 00:49:14 -04:00
Paul Licameli
0f62046313 Define EffectClientInterface::GetBlockSize() 2019-06-24 00:49:14 -04:00
Paul Licameli
ab5a98003a Free EffectManager and EffectRack from the big s.c.c. ...
... though in a small cycle with each other, by moving RealtimeEffectManager to
new files, which remain in the big component.

Net loss of 1, the big component now has 27 files
2019-06-24 00:49:12 -04:00
Paul Licameli
04a3ed9d04 Separate class RealtimeEffectManager 2019-06-24 00:37:02 -04:00
Paul Licameli
dee27e052f Free Nyquist.cpp from cycles...
... Very easily, just by demoting two macros from Nyquist.h to Effect.h.

The graph improvement is worth this bit of preprocessor namespace pollution.
2019-06-23 23:20:03 -04:00
Paul Licameli
86320838de WaveTrack.cpp does not depend on ODManager.cpp ...
... Breaking up an s.c.c. of 6 into 3 components:
ODManager, ODTask, ODWaveTrackTaskQueue
UndoManager
WaveClip, WaveTrack

Rewrite the OD tasks and queues to hold weak pointers to tracks, so the
track destructor need not notify them.
2019-06-22 21:46:35 -04:00
Paul Licameli
a6e2ca0aa8 Move some enums into new files WaveTrackViewConstants.* ...
... freeing TracksPrefs from the second largest s.c.c. which is now only 20
2019-06-22 21:46:32 -04:00
Paul Licameli
c0adb35839 Command flag functions out of Menus.cpp, reducing its dependencies...
... Mostly into CommonCommandFlags.cpp, but some elsewhere, to avoid giving
that new file problematic dependencies on LabelTrack, ControlToolBar, and
EffectManager.

Note that CutCopyAvailableFlag is critically ordered, for message purposes,
only with AudioIONotAvailableFlag, the only flag with a message that it combines
with in menu item definitions.

The dependency on LabelTrack.cpp might not be a bad one later, if the track and
its view can be separated, and that would allow CutCopyAvailableFlag to be
put with the others.  But much other work on LabelTrack must happen first.
2019-06-16 01:21:05 -04:00
Paul Licameli
e5a786c420 4th arg of ReportIfActionNotAllowed always == 3rd; eliminate it 2019-06-14 10:12:45 -04:00
Paul Licameli
36e3a03c7f Redo CommandFlags as std::bitset, allow registration of values 2019-06-14 00:31:15 -04:00
Paul Licameli
ef8c100cee MenuManager holds a back-reference to project; simplifies calls 2019-06-12 11:08:50 -04:00
Paul Licameli
42a4f55ffe Prepare to split AudioIOBase from AudioIO...
... New files, but (almost) empty; don't use the global variable gAudioIO,
but use one of two accessor function names (which are the same function for
now).

AudioIOBase will have fewer dependencies than AudioIO -- in particular, no
dependency on tracks.

It won't include StartStream.  It will contain functions to query the
present state of streams, and device capabilities.
2019-06-10 20:48:38 -04:00
Paul Licameli
d979a8959b New files for ProjectAudioManager...
... This eliminates some inclusions of ProjectManager, helping to free it from
cycles into a higher level
2019-06-09 12:10:47 -04:00
Paul Licameli
63b93fd2d1 Play region and its lock are stored together in ViewInfo 2019-06-03 01:43:27 -04:00
Paul Licameli
fee5582826 New files for ProjectManager 2019-06-03 01:21:12 -04:00
Paul Licameli
850628275b AudioIO.cpp does not depend on ProjectAudioIO.h and GetActiveProject 2019-06-03 01:18:11 -04:00
Paul Licameli
05efeeb5bd New files for ProjectSettings 2019-06-03 01:13:13 -04:00
Paul Licameli
dd10e00a2d New attached structure ProjectSettings stores rate, snap-to, et al. 2019-06-02 14:42:00 -04:00
Paul Licameli
327845b0ee Remove unneeded things from Project.h 2019-06-02 14:41:47 -04:00
Paul Licameli
ae18f2f220 Construction of default play options moved out of AudacityProject 2019-05-28 19:33:21 -04:00
Paul Licameli
37e176dc82 Don't set color index of temp tracks only pasted into other tracks 2019-05-26 11:29:12 -04:00
Paul Licameli
3416b5bad6 Toolbars accessed by static Get() functions, not through AudacityProject 2019-05-24 16:08:29 -04:00
Paul Licameli
0923bc19a9 static MenuManager::Get()...
... not member functions of AudacityProject
2019-05-23 16:34:47 -04:00
Paul Licameli
b5a57682b6 static ViewInfo::Get() and ZoomInfo::Get()...
... not member functions of AudacityProject
2019-05-23 12:58:47 -04:00
Paul Licameli
dccb716f39 enum PlayMode tells whether there's cut preview; out of Project.h 2019-05-20 21:38:12 -04:00
Paul Licameli
f86403378b Move AudacityMessageBox to its own files...
... breaking cycles among low-level files introduced by 273ba9f
2019-05-20 14:48:36 -04:00
Paul Licameli
13713aab67 Remove nullary overload of AudacityCommand::Apply...
... which by default used GetActiveProject(); do that call instead at a
higher level; so that AudacityCommand.cpp does not depend on Project.cpp.

We lose the override of that for CompareAudioCommand which just did nothing.

But in fact this overload of the base class method could only be used
by EffectUIHost constructed from a command, which never happened: it was only
ever constructed from effects.

This frees two files from dependency cycles
2019-05-18 20:31:17 -04:00
Paul Licameli
87a9f34c22 ScreenshotCommand uses hooks in AudacityCommand and Effect dialogs...
... so that they don't have a static linkage dependency on it, and that frees
it from dependency cycles, to a high level
2019-05-18 20:31:17 -04:00
Paul Licameli
6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
Paul Licameli
8d489b9c6f Bug 2096: High quality stretching in Change Pitch/Tempo ...
... should Preview properly and not change the selection (even temporarily)
2019-04-22 10:58:19 -04:00
Paul Licameli
9eb408db56 Revert fixes for bug 2096
This reverts commit b83781ccde.
This reverts commit 55f7c0f6af.
2019-04-22 10:58:19 -04:00
Paul Licameli
b83781ccde Bug2096: complete the fix started at 55f7c0f 2019-04-22 00:08:05 -04:00
Paul Licameli
55f7c0f6af Fix bug 2096 differently...
... without reverting commit 0aad028

(which was done at commit fe22b2a, but I reverted that reversion at the
previous commit)
2019-04-20 12:37:22 -04:00
Paul Licameli
fe1be2b6a8 Revert "2096: Windows & Mac high quality Change Pitch/Tempo preview"
This reverts commit fe22b2ae22.
2019-04-20 12:37:22 -04:00
David Bailes
fe22b2ae22 2096: Windows & Mac high quality Change Pitch/Tempo preview
Problem:
Preview plays the original, and removes the selection.
This appears to have been caused by the commit: 0aad028

Fix: revert that commit. Note that in the #ifdef EXPERIMENTAL_SPECTRAL_EDITING code has not been reinstated.
I have not looked at why the commit caused the problem, just reverted it.
2019-04-17 10:48:56 +01:00
Paul Licameli
2e05d2d884 Remove wx/{radiobut,ownerdrw,menuitem,menu,listbox}.h from *.h 2019-03-30 12:15:53 -04:00
Paul Licameli
08c16b6eb7 Remove wx/{html/htmlwin,fileconf,dragimag,debug,dcclient}.h from *.h 2019-03-30 10:53:22 -04:00
Paul Licameli
3a7324984c wx/hashmap.h no longer used anywhere 2019-03-30 10:06:52 -04:00
Paul Licameli
70e88782fe Remove wx/{grid,font,ffile,colour,button,bmpbuttn}.h from headers 2019-03-28 12:27:10 -04:00
Paul Licameli
803d8b9559 Remove wx/filename.h, wx/choice.h, wxFileNameWrapper.h from headers 2019-03-28 03:12:42 -04:00
Paul Licameli
4018b191b4 Remove Get/Set functions for selection bounds from AudacityProject 2019-03-27 13:32:53 -04:00
Paul Licameli
51f0362e9f Remove wx/wx.h from headers 2019-03-26 11:17:41 -04:00
Paul Licameli
0dd0a5cb5a Remove <wx/menu.h> from CommandManager.h, moving inline functions out 2019-03-23 10:56:43 -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
71036bed01 Remove PluginManager.h from other headers 2019-03-17 15:05:19 -04:00
Paul Licameli
41175e94cd Simplify by removing many std::move of shared_ptr to tracks...
... Don't need them, as we did with std::unique_ptr
2019-03-16 13:11:33 -04:00
Paul Licameli
a0aa69a248 All tracks allocated with make_shared, no more make_unique...
... so that we can use Track::SharedPointer without undefined behavior even on
tracks that don't yet belong to any TrackList.

Also fix the return type of function template TrackList::Add and remove some
casts.
2019-03-16 13:11:33 -04:00
Paul Licameli
1bcb7c20a5 Remove some nested #include from Project.h 2019-03-16 13:09:54 -04:00
Paul Licameli
dd86346156 ShuttlegGUI: const wxArrayStringEx & arguments, not wxArrayString *...
... for choice, combo, and listbox; reference allows passing temporaries,
eliminating need for some variables to hold the string arrays.
2019-03-16 07:17:21 -04:00
Paul Licameli
dcd82b8ef5 ShuttleGui::AddChoice takes int to specify selection, with a default...
... This makes things brief and where non-default avoids some repetition of
literal strings
2019-03-15 23:35:13 -04:00
Paul Licameli
df6a2cf479 Use type aliases RegistryPath, RegistryPaths...
... for wxString and vector thereof, holding strings that key into wxConfigBase;
to be replaced later with different types
2019-03-15 15:18:11 -04:00
Paul Licameli
dcd211affa Use type aliases PluginPath, PluginPaths...
... for wxString and vector thereof, when holding plugin paths (which may or
may not be interpreted as file paths, depending on the module); to be replaced
later with different types
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
da33daf197 Some replacements of wxArrayString with auto 2019-03-10 14:47:12 -04:00
Paul Licameli
795b6a2e42 More std:: style for wxString and wxArrayString...
... Replacing:

Insert => insert
RemoveAt => erase
Remove => erase
IsSameAs => operator == or operator !=
   (but only when second argument was true or default)
2019-03-10 14:45:12 -04:00
Paul Licameli
dd8eb9e3d9 Less use of wxArrayString::Index() ...
... instead use the utility make_iterator_range and its index() or contains()
method.  This generic utility works with any container defining begin() and
end().

This further lessens dependency on wxWidgets container idioms.
2019-03-10 14:45:06 -04:00
Paul Licameli
2db49dc1f0 Use standard library style members of wxArrayString (and wxString) ...
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes

for wxString,

IsEmpty => empty
Clear => clear
Alloc => reserve

for wxArrayString,

Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
2019-03-10 14:43:57 -04:00
Steve Daulton
800ddae34b Fix bug 2041
Nyquist: Generating audio at a point within a track, deletes audio
after the generated audio.

This fix corrects errors in b9ec434.
2018-11-29 11:43:00 +00:00
Steve Daulton
85af1b981a Fix for bug 2030 - Manage dialog
Windows: Manage dialog in effects has reduced vertical height
OK and Cancel buttons.
Bug also affected Linux.
2018-11-19 01:48:14 +00:00
James Crook
466e9c179e Create ComponentInterface
It combines the old IdentInterface with the ParamsInterface, providing an identifier and parameters (if needed).
The main purpose of the change is to make the class hierarchy (as viewed via doxygen) much easier to follow.
2018-11-02 17:04:43 +00:00
Paul Licameli
e048a4aacd Move a static function and an enumeration out of MenuCommandHandler 2018-10-24 12:16:46 -04:00
Paul Licameli
9759c6bd4f Plugin Menus 2018-10-24 12:16:44 -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
5fd95dd131 Fix C4456 Warnings.
"C4456 declaration hides previous local declaration."
These arise from repeated declarations of the same name.
2018-10-10 17:28:50 +01:00
Paul Licameli
90e2da7f14 Fix uses of TrackList::GroupChannels in Mix and effect preview 2018-10-04 11:34:14 -04:00
Paul Licameli
beebe648fb Remove more uses of Track::SetLinked() and Track::SetChannel() 2018-10-01 13:42:36 -04:00