Skip to content

Commit a46cf72

Browse files
author
user
committed
Fixed missing effect plugins bug by copying files ModuleManager.cpp, ModuleManager.h, PluginManager.cpp, PluginManager.h from upstream commit 2e7f711 (the last version known to work correctly) and applying sneedification filter to the whole src directory.
1 parent 107b327 commit a46cf72

22 files changed

+92
-69
lines changed

src/AboutDialog.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void AboutDialog::CreateCreditsList()
138138
// otherwise distinguished contribution, but who are no
139139
// longer active.
140140
AddCredit(
141-
wxT("[[https://wiki.audacityteam.org/wiki/User:Galeandrews|Gale Andrews]]"),
141+
wxT("[[https://wiki.sneedacityteam.org/wiki/User:Galeandrews|Gale Andrews]]"),
142142
qualityAssuranceFormat, roleEmeritusTeam);
143143
AddCredit(wxT("Richard Ash"), developerFormat, roleEmeritusTeam);
144144
AddCredit(wxT("Christian Brochec"),
@@ -331,8 +331,8 @@ void AboutDialog::PopulateSneedacityPage( ShuttleGui & S )
331331
// DA: Says that it is a customised version.
332332
#ifdef EXPERIMENTAL_DA
333333
wxT(
334-
"Sneedacity, which this is a customised version of, is a free program written by a worldwide team of [[https://www.audacityteam.org/about/credits|volunteers]]. \
335-
Sneedacity is [[https://www.audacityteam.org/download|available]] for Windows, Mac, and GNU/Linux (and other Unix-like systems).")
334+
"Sneedacity, which this is a customised version of, is a free program written by a worldwide team of [[https://www.sneedacityteam.org/about/credits|volunteers]]. \
335+
Sneedacity is [[https://www.sneedacityteam.org/download|available]] for Windows, Mac, and GNU/Linux (and other Unix-like systems).")
336336
#else
337337
/* Do the i18n of a string with markup carefully with hints.
338338
(Remember languages with cases.) */
@@ -343,11 +343,11 @@ Sneedacity is [[https://www.audacityteam.org/download|available]] for Windows, M
343343
%s is %s for Windows, Mac, and GNU/Linux (and other Unix-like systems).")
344344
.Format(
345345
ProgramName,
346-
Verbatim("[[https://www.audacityteam.org/about/credits|%s]]")
346+
Verbatim("[[https://www.sneedacityteam.org/about/credits|%s]]")
347347
/* i18n-hint: substitutes into "a worldwide team of %s" */
348348
.Format( XO("volunteers") ),
349349
ProgramName,
350-
Verbatim("[[https://www.audacityteam.org/download|%s]]")
350+
Verbatim("[[https://www.sneedacityteam.org/download|%s]]")
351351
/* i18n-hint: substitutes into "Sneedacity is %s" */
352352
.Format( XO("available") ) )
353353
#endif
@@ -361,13 +361,13 @@ Sneedacity is [[https://www.audacityteam.org/download|available]] for Windows, M
361361
For help, view the tips and tricks on our %s or \
362362
visit our %s.")
363363
.Format(
364-
Verbatim("[[https://forum.audacityteam.org/|%s]]")
364+
Verbatim("[[https://forum.sneedacityteam.org/|%s]]")
365365
/* i18n-hint substitutes into "write to our %s" */
366366
.Format( XC("forum", "dative") ),
367-
Verbatim("[[https://wiki.audacityteam.org/|%s]]")
367+
Verbatim("[[https://wiki.sneedacityteam.org/|%s]]")
368368
/* i18n-hint substitutes into "view the tips and tricks on our %s" */
369369
.Format( XO("wiki") ),
370-
Verbatim("[[https://forum.audacityteam.org/|%s]]")
370+
Verbatim("[[https://forum.sneedacityteam.org/|%s]]")
371371
/* i18n-hint substitutes into "visit our %s" */
372372
.Format( XC("forum", "accusative") ) );
373373
auto par2StrTranslated = par2Str.Translation();
@@ -482,7 +482,7 @@ visit our %s.")
482482
<< wxT("<p><br>")
483483
/* i18n-hint: The program's name substitutes for %s */
484484
<< XO("%s website: ").Format( ProgramName )
485-
<< wxT("[[https://www.audacityteam.org/|https://www.audacityteam.org/]]")
485+
<< wxT("[[https://www.sneedacityteam.org/|https://www.sneedacityteam.org/]]")
486486

487487
// DA: Link for DA url too
488488
#ifdef EXPERIMENTAL_DA

src/FileNames.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ bool FileNames::DoCopyFile(
156156
#else
157157
// PRL: Compensate for buggy wxCopyFile that returns false success,
158158
// which was a cause of case 4 in comment 10 of
159-
// http://bugzilla.audacityteam.org/show_bug.cgi?id=1759
159+
// http://bugzilla.sneedacityteam.org/show_bug.cgi?id=1759
160160
// Destination file was created, but was empty
161161
// Bug was introduced after wxWidgets 2.8.12 at commit
162162
// 0597e7f977c87d107e24bf3e95ebfa3d60efc249 of wxWidgets repo

src/HelpText.cpp

+17-17
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static wxString InnerLink( const wxString &Key, const wxString& Text )
5858
static wxString WikiLink( const wxString &Key, const wxString& Text )
5959
{
6060
return wxString(wxT("")) +
61-
wxT("<a href='https://www.audacityteam.org/wiki/index.php?title=") +
61+
wxT("<a href='https://www.sneedacityteam.org/wiki/index.php?title=") +
6262
Key +
6363
wxT("'>") +
6464
Text +
@@ -233,7 +233,7 @@ static wxString HelpTextBuiltIn( const wxString & Key )
233233
<< XO(
234234
"We strongly recommend that you use our latest stable released version, which has full documentation and support.<br><br>")
235235
<< XO(
236-
"You can help us get Sneedacity ready for release by joining our [[https://www.audacityteam.org/community/|community]].<hr><br><br>")
236+
"You can help us get Sneedacity ready for release by joining our [[https://www.sneedacityteam.org/community/|community]].<hr><br><br>")
237237
#endif
238238

239239
// DA: Support methods text.
@@ -247,16 +247,16 @@ static wxString HelpTextBuiltIn( const wxString & Key )
247247
<< wxT(" [[http://www.darksneedacity.com|www.darksneedacity.com]] - for differences between them.")
248248
<< wxT("</li><li>")
249249
<< wxT(
250-
" email to [[mailto:james@audacityteam.org|james@audacityteam.org]] - for help using DarkSneedacity.")
250+
" email to [[mailto:james@sneedacityteam.org|james@sneedacityteam.org]] - for help using DarkSneedacity.")
251251
<< wxT("</li><li>")
252252
<< wxT(
253253
" [[http://www.darksneedacity.com/video.html|Tutorials]] - for getting started with DarkSneedacity.")
254254
<< wxT("</li></ul>")
255255
<< wxT("<br><br>Sneedacity has these support methods:")
256256
<< wxT("<ul><li>")
257-
<< wxT(" [[https://manual.audacityteam.org/|Manual]] - for comprehensive Sneedacity documentation")
257+
<< wxT(" [[https://manual.sneedacityteam.org/|Manual]] - for comprehensive Sneedacity documentation")
258258
<< wxT("</li><li>")
259-
<< wxT(" [[https://forum.audacityteam.org/|Forum]] - for large knowledge base on using Sneedacity.")
259+
<< wxT(" [[https://forum.sneedacityteam.org/|Forum]] - for large knowledge base on using Sneedacity.")
260260
<< wxT("</li></ul>")
261261
#else
262262
<< wxT("<center><h3>Sneedacity ")
@@ -267,25 +267,25 @@ static wxString HelpTextBuiltIn( const wxString & Key )
267267
<< XO("These are our support methods:")
268268
<< wxT("<p><ul><li>")
269269
/* i18n-hint: Preserve '[[help:Quick_Help|' as it's the name of a link.*/
270-
<< XO("[[help:Quick_Help|Quick Help]] - if not installed locally, [[https://manual.audacityteam.org/quick_help.html|view online]]")
270+
<< XO("[[help:Quick_Help|Quick Help]] - if not installed locally, [[https://manual.sneedacityteam.org/quick_help.html|view online]]")
271271
<< wxT("</li><li>")
272272
<< XO(
273273
/* i18n-hint: Preserve '[[help:Main_Page|' as it's the name of a link.*/
274-
" [[help:Main_Page|Manual]] - if not installed locally, [[https://manual.audacityteam.org/|view online]]")
274+
" [[help:Main_Page|Manual]] - if not installed locally, [[https://manual.sneedacityteam.org/|view online]]")
275275
<< wxT("</li><li>")
276276
<< XO(
277-
" [[https://forum.audacityteam.org/|Forum]] - ask your question directly, online.")
277+
" [[https://forum.sneedacityteam.org/|Forum]] - ask your question directly, online.")
278278
<< wxT("</li></ul></p><p>")
279279
<< wxT("<b>")
280-
<< XO("More:</b> Visit our [[https://wiki.audacityteam.org/index.php|Wiki]] for tips, tricks, extra tutorials and effects plug-ins.")
280+
<< XO("More:</b> Visit our [[https://wiki.sneedacityteam.org/index.php|Wiki]] for tips, tricks, extra tutorials and effects plug-ins.")
281281
<< wxT("</p>")
282282
#endif
283283
;
284284

285285
auto result = o.GetString();
286286
#ifdef USE_ALPHA_MANUAL
287-
result.Replace( "//manual.audacityteam.org/quick_help.html","//alphamanual.audacityteam.org/man/Quick_Help" );
288-
result.Replace( "//manual.audacityteam.org/","//alphamanual.audacityteam.org/man/" );
287+
result.Replace( "//manual.sneedacityteam.org/quick_help.html","//alphamanual.sneedacityteam.org/man/Quick_Help" );
288+
result.Replace( "//manual.sneedacityteam.org/","//alphamanual.sneedacityteam.org/man/" );
289289
#endif
290290

291291
return WrapText( result );
@@ -299,13 +299,13 @@ static wxString HelpTextBuiltIn( const wxString & Key )
299299
<< XO(
300300
"Sneedacity can import unprotected files in many other formats (such as M4A and WMA, \
301301
compressed WAV files from portable recorders and audio from video files) if you download and install \
302-
the optional [[https://manual.audacityteam.org/man/faq_opening_and_saving_files.html#foreign| \
302+
the optional [[https://manual.sneedacityteam.org/man/faq_opening_and_saving_files.html#foreign| \
303303
FFmpeg library]] to your computer.")
304304
<< wxT("</p><p>")
305305
<< XO(
306306
"You can also read our help on importing \
307-
[[https://manual.audacityteam.org/man/playing_and_recording.html#midi|MIDI files]] \
308-
and tracks from [[https://manual.audacityteam.org/man/faq_opening_and_saving_files.html#fromcd| \
307+
[[https://manual.sneedacityteam.org/man/playing_and_recording.html#midi|MIDI files]] \
308+
and tracks from [[https://manual.sneedacityteam.org/man/faq_opening_and_saving_files.html#fromcd| \
309309
audio CDs]].")
310310
<< wxT("</p>")
311311
;
@@ -332,7 +332,7 @@ Interface Preferences to \"From Internet\".")
332332
<< XO(
333333
"The Manual does not appear to be installed. \
334334
Please [[*URL*|view the Manual online]] or \
335-
[[https://manual.audacityteam.org/man/unzipping_the_manual.html| \
335+
[[https://manual.sneedacityteam.org/man/unzipping_the_manual.html| \
336336
download the Manual]].<br><br>\
337337
To always view the Manual online, change \"Location of Manual\" in \
338338
Interface Preferences to \"From Internet\".")
@@ -404,9 +404,9 @@ const wxString VerCheckHtml()
404404
const URLString VerCheckUrl()
405405
{
406406
//The version we intend to use for live Sneedacity.
407-
#define VER_CHECK_URL "https://www.audacityteam.org/download/?"
407+
#define VER_CHECK_URL "https://www.sneedacityteam.org/download/?"
408408
//For testing of our scriptlet.
409-
//#define VER_CHECK_URL "http://www.audacityteam.org/slug/?"
409+
//#define VER_CHECK_URL "http://www.sneedacityteam.org/slug/?"
410410
//For testing locally
411411
//#define VER_CHECK_URL "http://localhost:63342/WorkingDocs/demos/download.html?"
412412

src/InconsistencyException.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ TranslatableString InconsistencyException::ErrorMessage() const
2525

2626
#ifdef __func__
2727
return
28-
XO("Internal error in %s at %s line %d.\nPlease inform the Sneedacity team at https://forum.audacityteam.org/.")
28+
XO("Internal error in %s at %s line %d.\nPlease inform the Sneedacity team at https://forum.sneedacityteam.org/.")
2929
.Format( func, path, line );
3030
#else
3131
return
32-
XO("Internal error at %s line %d.\nPlease inform the Sneedacity team at https://forum.audacityteam.org/.")
32+
XO("Internal error at %s line %d.\nPlease inform the Sneedacity team at https://forum.sneedacityteam.org/.")
3333
.Format( path, line );
3434
#endif
3535
}

src/Menus.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ void MenuCreator::RebuildAllMenuBars()
682682
#if defined(__WXGTK__)
683683
// Workaround for:
684684
//
685-
// http://bugzilla.audacityteam.org/show_bug.cgi?id=458
685+
// http://bugzilla.sneedacityteam.org/show_bug.cgi?id=458
686686
//
687687
// This workaround should be removed when Sneedacity updates to wxWidgets 3.x which has a fix.
688688
auto &window = GetProjectFrame( *p );

src/ModuleManager.cpp

+37-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ i.e. an alternative to the usual interface, for Sneedacity.
3131

3232
#include "FileNames.h"
3333
#include "MemoryX.h"
34+
#include "PluginManager.h"
3435

3536
#include "sneedacity/PluginInterface.h"
3637

@@ -447,15 +448,29 @@ bool ModuleManager::DiscoverProviders()
447448
FileNames::FindFilesInPathList(wxT("*.so"), pathList, provList);
448449
#endif
449450

450-
for ( const auto &path : provList )
451-
LoadModule(path);
451+
PluginManager & pm = PluginManager::Get();
452+
453+
for (int i = 0, cnt = provList.size(); i < cnt; i++)
454+
{
455+
ModuleInterface *module = LoadModule(provList[i]);
456+
if (module)
457+
{
458+
// Register the provider
459+
pm.RegisterPlugin(module);
460+
461+
// Now, allow the module to auto-register children
462+
module->AutoRegisterPlugins(pm);
463+
}
464+
}
452465
#endif
453466

454467
return true;
455468
}
456469

457470
void ModuleManager::InitializeBuiltins()
458471
{
472+
PluginManager & pm = PluginManager::Get();
473+
459474
for (auto moduleMain : builtinModuleList())
460475
{
461476
ModuleInterfaceHandle module {
@@ -466,10 +481,13 @@ void ModuleManager::InitializeBuiltins()
466481
{
467482
// Register the provider
468483
ModuleInterface *pInterface = module.get();
469-
auto id = GetID(pInterface);
484+
const PluginID & id = pm.RegisterPlugin(pInterface);
470485

471486
// Need to remember it
472487
mDynModules[id] = std::move(module);
488+
489+
// Allow the module to auto-register children
490+
pInterface->AutoRegisterPlugins(pm);
473491
}
474492
else
475493
{
@@ -487,6 +505,22 @@ void ModuleInterfaceDeleter::operator() (ModuleInterface *pInterface) const
487505
}
488506
}
489507

508+
PluginPaths ModuleManager::FindPluginsForProvider(const PluginID & providerID,
509+
const PluginPath & path)
510+
{
511+
// Instantiate if it hasn't already been done
512+
if (mDynModules.find(providerID) == mDynModules.end())
513+
{
514+
// If it couldn't be created, just give up and return an empty list
515+
if (!CreateProviderInstance(providerID, path))
516+
{
517+
return {};
518+
}
519+
}
520+
521+
return mDynModules[providerID]->FindPluginPaths(PluginManager::Get());
522+
}
523+
490524
bool ModuleManager::RegisterEffectPlugin(const PluginID & providerID, const PluginPath & path, TranslatableString &errMsg)
491525
{
492526
errMsg = {};

src/ModuleManager.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#ifndef __SNEEDACITY_MODULEMANAGER_H__
1313
#define __SNEEDACITY_MODULEMANAGER_H__
1414

15-
#include "MemoryX.h"
16-
#include <functional>
15+
#include <memory>
1716
#include <map>
1817
#include <vector>
1918

@@ -99,10 +98,7 @@ class SNEEDACITY_DLL_API ModuleManager final
9998
// Can be called before Initialize()
10099
bool DiscoverProviders();
101100

102-
// Supports range-for iteration
103-
auto Providers() const
104-
{ return make_iterator_range(mDynModules.cbegin(), mDynModules.cend()); }
105-
101+
PluginPaths FindPluginsForProvider(const PluginID & provider, const PluginPath & path);
106102
bool RegisterEffectPlugin(const PluginID & provider, const PluginPath & path,
107103
TranslatableString &errMsg);
108104

src/NoteTrack.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ void NoteTrack::Paste(double t, const Track *src)
573573
auto myOffset = this->GetOffset();
574574
if (t < myOffset) {
575575
// workaround strange behavior described at
576-
// http://bugzilla.audacityteam.org/show_bug.cgi?id=1735#c3
576+
// http://bugzilla.sneedacityteam.org/show_bug.cgi?id=1735#c3
577577
SetOffset(t);
578578
InsertSilence(t, myOffset - t);
579579
}

src/PluginManager.cpp

+3-10
Original file line numberDiff line numberDiff line change
@@ -722,13 +722,8 @@ void PluginManager::Initialize()
722722
// And force load of setting to verify it's accessible
723723
GetSettings();
724724

725-
auto &mm = ModuleManager::Get();
726-
mm.DiscoverProviders();
727-
for (const auto &[id, module] : mm.Providers()) {
728-
RegisterPlugin(module.get());
729-
// Allow the module to auto-register children
730-
module->AutoRegisterPlugins(*this);
731-
}
725+
// Then look for providers (they may autoregister plugins)
726+
ModuleManager::Get().DiscoverProviders();
732727

733728
// And finally check for updates
734729
#ifndef EXPERIMENTAL_EFFECT_MANAGEMENT
@@ -1382,9 +1377,7 @@ void PluginManager::CheckForUpdates(bool bFast)
13821377
else
13831378
{
13841379
// Collect plugin paths
1385-
PluginPaths paths;
1386-
if (auto provider = mm.CreateProviderInstance( plugID, plugPath ) )
1387-
paths = provider->FindPluginPaths( *this );
1380+
auto paths = mm.FindPluginsForProvider(plugID, plugPath);
13881381
for (size_t i = 0, cnt = paths.size(); i < cnt; i++)
13891382
{
13901383
wxString path = paths[i].BeforeFirst(wxT(';'));;

src/ProjectFileManager.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ SneedacityProject *ProjectFileManager::OpenFile( const ProjectChooserFn &chooser
876876
// and SneedacityApp::MRUOpen(), but if you open an aup file by double-clicking it
877877
// from, e.g., Win Explorer, it would bypass those, get to here with no check,
878878
// then open a NEW project from the same data with no warning.
879-
// This was reported in http://bugzilla.audacityteam.org/show_bug.cgi?id=137#c17,
879+
// This was reported in http://bugzilla.sneedacityteam.org/show_bug.cgi?id=137#c17,
880880
// but is not really part of that bug. Anyway, prevent it!
881881
if (IsAlreadyOpen(fileName))
882882
return nullptr;
@@ -1040,7 +1040,7 @@ SneedacityProject *ProjectFileManager::OpenProjectFile(
10401040
}
10411041
else {
10421042
// Vaughan, 2011-10-30:
1043-
// See first topic at http://bugzilla.audacityteam.org/show_bug.cgi?id=451#c16.
1043+
// See first topic at http://bugzilla.sneedacityteam.org/show_bug.cgi?id=451#c16.
10441044
// Calling mTracks->Clear() with deleteTracks true results in data loss.
10451045

10461046
// PRL 2014-12-19:

src/Sequence.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ bool Sequence::ConvertToSampleFormat(sampleFormat format,
187187
ensureSampleBufferSize(bufferNew, format, newSize, len);
188188
CopySamples(bufferOld.ptr(), oldFormat, bufferNew.ptr(), format, len);
189189

190-
// Note this fix for http://bugzilla.audacityteam.org/show_bug.cgi?id=451,
190+
// Note this fix for http://bugzilla.sneedacityteam.org/show_bug.cgi?id=451,
191191
// using Blockify, allows (len < mMinSamples).
192192
// This will happen consistently when going from more bytes per sample to fewer...
193193
// This will create a block that's smaller than mMinSamples, which
@@ -966,7 +966,7 @@ void Sequence::WriteXML(XMLWriter &xmlFile) const
966966
for (b = 0; b < mBlock.size(); b++) {
967967
const SeqBlock &bb = mBlock[b];
968968

969-
// See http://bugzilla.audacityteam.org/show_bug.cgi?id=451.
969+
// See http://bugzilla.sneedacityteam.org/show_bug.cgi?id=451.
970970
if (bb.sb->GetSampleCount() > mMaxSamples)
971971
{
972972
// PRL: Bill observed this error. Not sure how it was caused.
@@ -1849,7 +1849,7 @@ void Sequence::ConsistencyCheck
18491849
wxString str;
18501850
DebugPrintf(mBlock, mNumSamples, &str);
18511851
wxLogError(wxT("%s"), str);
1852-
wxLogError(wxT("*** Please report this error to https://forum.audacityteam.org/. ***\n\n")
1852+
wxLogError(wxT("*** Please report this error to https://forum.sneedacityteam.org/. ***\n\n")
18531853
wxT("Recommended course of action:\n")
18541854
wxT("Undo the failed operation(s), then export or save your work and quit."));
18551855

src/SneedacityException.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class SneedacityException /* not final */
4343
SneedacityException( const SneedacityException& ) = default;
4444

4545
//! Don't allow moves of this class or subclasses
46-
// see https://bugzilla.audacityteam.org/show_bug.cgi?id=2442
46+
// see https://bugzilla.sneedacityteam.org/show_bug.cgi?id=2442
4747
SneedacityException( SneedacityException&& ) = delete;
4848

4949
//! Disallow assignment

src/SplashDialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ SplashDialog::SplashDialog(wxWindow * parent)
8989
void SplashDialog::OnChar(wxMouseEvent &event)
9090
{
9191
if ( event.ShiftDown() && event.ControlDown() )
92-
wxLaunchDefaultBrowser("https://www.audacityteam.org");
92+
wxLaunchDefaultBrowser("https://www.sneedacityteam.org");
9393
}
9494

9595
void SplashDialog::Populate( ShuttleGui & S )

0 commit comments

Comments
 (0)