1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-11 09:31:13 +02:00

474 Commits

Author SHA1 Message Date
Paul Licameli
127696879d
Unitary changes (#599)
* Define SampleBlockFactory replacing static members of SampleBlock...

... This will become an abstract base class

* Sequence and WaveTrack only store SampleBlockFactory not Project...

... This adds a dependency from Track to SampleBlock which temporarily enlarges
a cycle in the dependency graph

* Register a global factory of SampleBlockFactory...

... so that later we can make an abstract SampleBlockFactory, separate from the
concrete implementation in terms of sqlite, and inject the dependency at startup
avoiding static dependency

* New concrete classes SqliteSampleBlock, SqliteSampleBlockFactory...

... separated from abstract base classes and put into a new source file,
breaking dependency cycles, and perhaps allowing easy reimplementation for other
databases in the future.

Note that the new file is a header-less plug-in!  Nothing depends on it.  It
uses static initialization to influence the program's behavior.

* Compile dependency on sqlite3.h limited to just two .cpp files...

... these are ProjectFileIO.cpp and SqliteSampleBlock.cpp.

But there is still close cooperation of ProjectFileIO and SqliteSampleBlock.cpp.
This suggests that these files ought to be merged, and perhaps ProjectFileIO
also needs to be split into abstract and concrete classes, and there should be
another injection of a factory function at startup.  That will make the choice
of database implementation even more modular.

Also removed one unnecessary inclusion of ProjectFileIO.h

* Fix crashes cutting and pasting cross-project...

... in case the source project is closed before the paste happens.

This caused destruction of the ProjectFileIO object and a closing of the sqlite
database with the sample data in it, leaving dangling references in the
SqliteSampleBlock objects.

The fix is that the SqliteSampleBlockFactory object holds a shared_ptr to the
ProjectFileIO object.  So the clipboard may own WaveTracks, which own WaveClips,
which own Sequences, which own SqliteSampleBlockFactories, which keep the
ProjectFileIO and the database connection alive until the clipboard is cleared.

The consequence of the fix is delayed closing of the entire database associated
with the source project.

If the source project is reopened before the clipboard is cleared, will there
be correct concurrent access to the same persistent store?  My preliminary
trials suggest this is so (reopening a saved project, deleting from it, closing
it again -- the clipboard contents are still unchanged and available).
2020-07-02 18:11:38 -05:00
Paul Licameli
b4ce083185 Prevent possible dangling pointers to Project from Clipboard 2020-07-01 18:38:45 -04:00
Leland Lucius
d39590cf41 AUP3: First round of updates
!!! THERE WILL NO DOUBT BE BUGS !!!

This is a big one and there's still several things to
complete. Just want to get this in the wild to start
receiving feedback.

One big thing right now is that it will NOT load pre-aup3
files.  An importer is on the way for that.
2020-07-01 02:30:18 -05:00
Leland Lucius
cbf1bb558e AUP3: Removes OD code related to project file handling
This removes all of the OnDemand code embedded throughout
    the main codebase. Individual files related specifically
    to OD have been left in place, but removed from the build.
2020-07-01 01:14:05 -05:00
Paul Licameli
da93757401 Remove ImportRaw.h from other headers 2020-06-13 12:19:38 -04:00
David Bailes
ce07da936c Bug 1549: Retrieve Region does not ensure it is visible 2020-06-10 12:43:28 +01:00
Paul Licameli
1bce7c1979 Disambiguate "Silence" 2020-06-06 15:14:42 -04:00
James Crook
6f20ca2403 Fix ResetConfiguration Device Toolbar Size
The device toolbar was coming out too short after a 'ResetConfiguration'.
The upgrade detection process was messing with it.  The fix is to
remember what version we are on.
2020-06-05 21:10:38 +01:00
James Crook
fb8214afc9 Reset session data directory on a Reset Configuration. 2020-06-03 13:28:47 +01:00
David Bailes
8e6c5c0027 Tools menu: fix duplicate access key 2020-06-03 08:20:37 +01:00
James Crook
3a537540cc Move ResetConfiguration from Help to Tools menu.
Requested by Peter, and I agreed.
2020-06-02 18:01:18 +01:00
James Crook
bc621158b8 Update OnResetConfig
Now it resets the toolbars, and fixes three common 'stuck-in-a-mode' issues.

Paul wrote: "I would move that function [OnResetToolBars(context)] into ToolManager.cpp so it can be called from ToolBarMenus.cpp and HelpMenus.cpp, with neither of those two dependent on the other."
2020-05-31 12:22:08 +01:00
James Crook
0417b2bf41 Bug 2348 - Residual. Don't select new tracks. 2020-05-30 11:54:21 +01:00
James Crook
d6f8410d56 Bug 2408 part 2.
Only modify label tracks with sync lock, when they are also part of the sync lock group.  This corrects a problem where edits in a wave track culd affect later label tracks that were not in its group.
2020-05-29 22:37:49 +01:00
James Crook
6b1b9cc088 Bug 2408 - A region label gets split on inserting audio when Sync-lock is turned on 2020-05-29 22:27:04 +01:00
James Crook
6d49228d65 Bug 2439 - Mix and Render to New Track selects left channel of new stereo track 2020-05-29 21:13:37 +01:00
David Bailes
ef98e5d25f Help menu: add missing access key 2020-05-29 08:31:50 +01:00
Paul Licameli
9dfa8f205c Rewrite QuickFix button (Dark Audacity) without SetClientData...
... Instead, it's easier to capture data in a lambda and use Bind.

Eliminates client data, casting, and use of the fields of the event object.
2020-05-27 10:32:32 -04:00
James Crook
62c4e10a16 Comment about resetting toolbars in OnResetConfig 2020-05-27 12:16:20 +01:00
Paul Licameli
66c5b76573 Simplify public interface of FileHistory 2020-05-26 10:47:47 -04:00
Paul Licameli
3313b33050 Move helper structure definitions out of CommandManager.h...
... and remove an indirection in handling one of them
2020-05-26 09:49:22 -04:00
James Crook
f5afb28f54 Bug 363 - (Part I) Provide a Reset Preferences command inside Audacity
This is the beginning of a configuration reset mechanism within Audacity.
2020-05-25 17:39:33 +01:00
Paul Licameli
1ef29b7a51 Don't encode command options as part of accelerator string...
... also restore the intended meaning of "allowDup" (for debugging checks only),
which had never been properly implemented because the label, not the
accelerator, was scanned for it; see commit f2f7568
2020-05-23 22:41:35 -04:00
Leland Lucius
1efb10cf78 Exclude Window menu if build with wx313
I'm not sure exactly when the Window menu started working again,
but when built with wx313, the system provides the Window menu
just fine on all OSX versions from 10.7 - 10.15.
2020-05-23 21:10:38 -05:00
Paul Licameli
db690d94f7 Remove 27 various macro _ ...
... and supply a few missing translations in Dependencies.cpp

And substitute-don't-concatenate in a few places in Internat.cpp
2020-05-23 08:07:24 -04:00
Paul Licameli
2527bdecaf Add and correct various comments 2020-05-23 06:00:56 -04:00
Paul Licameli
1689050c9c Remove duplication of enum definition 2020-05-23 05:37:15 -04:00
Paul Licameli
9c196860db Rewrite sort comparisons for plugin menus...
... Don't concatenate strings just to compare.  Just do easy tuple comparisons.

Results might be different in case one plugin's symbol name, vendor, or family
is a prefix of the other one's.
2020-05-22 20:45:07 -04:00
Paul Licameli
4d09705a73 Change XO to XXO in many more places, with no effects at all...
... because the two macros have the same expansion, and are both checked for
in the --keyword arguments passed to msgfmt by locale/update_po_files.sh.

This commit makes ONLY such changes, and comments in Internat.h.  It is big
but quite harmless.

The intention is to introduce a type distinction in a later release, by defining
XXO differently.  XXO is used where & characters in strings (for hotkeys of menu
items or control prompts) are permitted, XO where not.
2020-05-22 13:07:50 -04:00
Paul Licameli
d8a096ba03 Correct placement of i18n-hint comments for plurals, no dummies needed 2020-05-22 12:48:49 -04:00
Paul Licameli
f8a070dde7 Rename macro wxPLURAL as XP (brief, and eliminates mention of "wx") 2020-05-22 12:48:49 -04:00
Paul Licameli
2e3c072fd5 Bug1119: Windows menu on Mac should list all project names...
... Reimplemented without making dependency cycles.

Project and ProjectFileManager publish events for change of active project or
change of a project title.

WindowMenus.cpp can listen for those events, so that it can update the menu
appropriately.  So it's all done nonintrusively in the rest of the code.
2020-05-22 10:09:47 -04:00
Paul Licameli
ecb65f8c2b Bug2436: Cross-project paste should duplicate block files...
... to avoid data loss!

Bug caused by commit c2feee6
2020-05-18 10:57:23 -04:00
James Crook
075fb54bbb Bug 2128 - Residual: One update to error messages was missed. 2020-04-25 10:01:47 +01:00
Paul Licameli
eb92fc07bf
Bug1119 residuals... (#496)
... Fix assertion violations when language isn't English
2020-04-21 13:21:05 -05:00
James Crook
018a8681ef Revert changes for Bug 1119 made by Paul.
These changes were made too close to release and are considered too dangerous for 2.4.0.
We will use the changes Leland provided.  We can review these proposed changes by Paul after 2.4.0 is released.
2020-04-21 17:45:16 +01:00
Paul Licameli
c3d0d0370b Bug1119: Windows menu on Mac should list all project names...
... Reimplemented without making dependency cycles.

Project and ProjectFileManager publish events for change of active project or
change of a project title.

WindowMenus.cpp can listen for those events, so that it can update the menu
appropriately.  So it's all done nonintrusively in the rest of the code.
2020-04-21 12:36:43 -04:00
Paul Licameli
3348e2fecd Revert fix for bug 1119, which made bad dependency cycles
This reverts commit 4475dee373b8c9376153684b8b2a246c53d5b7ed.
This reverts commit 18cbc2e574007a48ee0eb1bd384b3e0f012b0894.
2020-04-21 12:28:39 -04:00
James Crook
ef659ed822 Bug 2128 - (Residual) Better error messages for mismatched rates. 2020-04-20 20:45:42 +01:00
SteveDaulton
70b7487820 Bug 2128 fix
Fixes incorrect recording speed when Track rate not matched to Project Rate.
Fix by binarywisdom. Pull request 423.
2020-04-20 18:54:25 +01:00
Leland Lucius
4475dee373 Forgot to add new file 2020-04-18 02:05:16 -05:00
Leland Lucius
18cbc2e574 Bug 1119 - Mac: Window menu's list of open windows not available 2020-04-18 01:49:17 -05:00
Leland Lucius
b68c417d8e Bug 2382 - Timer record: if a labels are present recording starts at last label position - not cursor position 2020-04-14 12:28:03 -05:00
Yuri Chornoivan
d1ada5f08c Fix minor typos 2020-04-11 10:06:24 +01:00
Paul Licameli
61abb87a77 Reviewed all i18n-hint comments...
... Moved many misplaced ones, which msgfmt would not have extracted into
audacity.pot.

Duplicated some of them, to appear with related but distinct msgids.

Added a few new comments.

Deleted one that was no longer needed in ProjectManager.cpp.
2020-04-05 09:00:00 -04:00
David Bailes
d35150911a Extra menu: remove duplicate access keys 2020-03-26 09:40:02 +00:00
Paul Licameli
c2feee6cea Bug2346: Complete fix...
... without making undesirable dependency cycles.

Eliminate calls to NewWaveTrack in effects, but in Edit>Copy too, which was
not mentioned in the bug report.  (Copying a track, deselecting all, and pasting
preserved CLIP colors, but not the TRACK color setting which applies to newly
generated clips.)

Instead, always use the new function WaveTrack::EmptyCopy from the track to be
later replaced, getting color information.

NewWaveTrack is still used in benchmark test, import, the Track menu
commands that make new tracks, recording to new tracks, and generators without
a selection, where there is no track to copy from.

Also when deserializing tracks from the .aup file, in which case the saved
color is later retrieved from the file.

Also, in mix-and-render, where other logic decides whether to copy colors
afterward.

See commit a9658e6ef7f7eaefce4dc37a93d389cca7705f41
2020-03-10 22:32:23 -04:00
Paul Licameli
06b2831d9b Some compilation fixes for EXPERIMENTAL_DA 2020-03-10 16:37:19 -04:00
David Bailes
72e24b82d2 Mute/Unmute selected tracks: change names of commands
Commands for muting and unmuting the selected tracks were added in commit 6d30936.
This commit:
1. Removes the word selected, as the user would already assume this to be the case, and the other commands in the Tracks menu which act on the selected tracks do not include the word selected.

2. Fix the duplicate access keys.
2020-03-10 08:41:54 +00:00
James Crook
91bf05d18c Clearer code for OnPlayStop
The function naming is unfortunate as it is not clear that this
is a toggle between Play and Stop.  Added comments, renaming,
and split a function, and removed a little duplication.
2020-03-09 11:12:41 +00:00