Skip to content

Commit

Permalink
Fix issue 1243 Slow startup. Fix missing simpledrums.
Browse files Browse the repository at this point in the history
  • Loading branch information
terminator356 committed Sep 20, 2023
1 parent b116a3a commit a362f7b
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
20.09.2023
- Fixed issue 1243 Slow startup: Always rescanning when file contains no plugins. (Tim)
File ladspa_dsp.so was causing rescanning all the time because it is normally empty
until a configuration file is hand-entered by the user.
- Fixed missing simpledrums MESS synth: Moved files automation_mode_toolbar.h/.cpp
from widgets folder to components folder because it contains icons, and simpledrums
uses our widgets library and it is not supposed to contain icons.
10.09.2023
*** MusE 4.2 ***
03.09.2023
Expand Down
6 changes: 5 additions & 1 deletion src/libs/plugin/plugin_cache_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,9 @@ bool readPluginScanInfo(MusECore::Xml& xml, PluginScanInfoStruct* info, bool rea
// return true on error
//---------------------------------------------------------

bool readPluginScan(MusECore::Xml& xml, PluginScanList* list, bool readPorts, bool readEnums)
bool readPluginScan(MusECore::Xml& xml, PluginScanList* list, bool readPorts, bool readEnums, int *numPlugins)
{
int plugins = 0;
for (;;) {
MusECore::Xml::Token token(xml.parse());
const QString& tag(xml.s1());
Expand All @@ -412,6 +413,7 @@ bool readPluginScan(MusECore::Xml& xml, PluginScanList* list, bool readPorts, bo
{
// We must include all plugins.
list->add(new PluginScanInfo(info));
++plugins;
}
break;
}
Expand All @@ -428,6 +430,8 @@ bool readPluginScan(MusECore::Xml& xml, PluginScanList* list, bool readPorts, bo
case MusECore::Xml::TagEnd:
if (tag == "muse")
{
if(numPlugins)
*numPlugins = plugins;
return false;
}
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/libs/plugin/plugin_cache_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ bool readPluginScanInfoPortEnum(MusECore::Xml& xml, PluginPortInfo* port_info);
bool readPluginScanInfoPort(MusECore::Xml& xml, PluginScanInfoStruct* info);
// Return true on error
bool readPluginScanInfo(MusECore::Xml& xml, PluginScanInfoStruct* info, bool readPorts = false, bool readEnums = false);
// Return true on error
bool readPluginScan(MusECore::Xml& xml, PluginScanList* list, bool readPorts = false, bool readEnums = false);
// Return true on error. If successful, numPlugins, if valid, is set to the number of plugins found.
bool readPluginScan(MusECore::Xml& xml, PluginScanList* list, bool readPorts = false, bool readEnums = false, int *numPlugins = nullptr);

// Read the plugin cache text file to a plugin list.
bool readPluginCacheFile(
Expand Down
10 changes: 9 additions & 1 deletion src/libs/plugin/plugin_cache_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1696,12 +1696,20 @@ static bool pluginScan(

// Read the list of plugins found in the xml.
// For now we don't supply a separate scanEnums flag in pluginScan(), so just use scanPorts instead.
if(readPluginScan(xml, list, scanPorts, scanPorts))
int numPlugins = 0;
if(readPluginScan(xml, list, scanPorts, scanPorts, &numPlugins))
{
std::fprintf(stderr, "\npluginScan FAILED: On readPluginScan(): file: %s\n\n", filename_ba.constData());
fail = true;
}

// No plugins found in this file?
if(numPlugins == 0)
{
std::fprintf(stderr, "\npluginScan: No plugins found in file:%s! Putting this file in 'unknown' cache.\n\n", filename_ba.constData());
fail = true;
}

// Close the temp file.
infile.close();

Expand Down
2 changes: 2 additions & 0 deletions src/muse/components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ QT5_WRAP_CPP (components_mocs
arrangercolumns.h
# action.h
audio_converter_settings.h
automation_mode_toolbar.h
background_painter.h
bigtime.h
canvas.h
Expand Down Expand Up @@ -215,6 +216,7 @@ file (GLOB components_source_files
appearance.cpp
arrangercolumns.cpp
audio_converter_settings.cpp
automation_mode_toolbar.cpp
background_painter.cpp
bigtime.cpp
canvas.cpp
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions src/muse/widgets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
## controls which are too dependent on other MusE modules or
## controls and dialogs which are really only useful to the
## main app or could never really be publicly exposed.
## NOTE: Do not put any widgets here that use our icons since
## this might be shared with plugins for example. Instead,
## put such widgets in the components folder.
##
## As more of the 'components' might be stripped down and moved
## into the 'widgets' folder, the original structure of the
Expand All @@ -49,7 +52,6 @@ QT5_WRAP_CPP (widget_mocs
# aboutbox_impl.h
# arrangercolumns.h
# action.h
automation_mode_toolbar.h
# bigtime.h
# canvas.h
checkbox.h
Expand Down Expand Up @@ -196,7 +198,6 @@ QT5_WRAP_CPP (widget_mocs
file (GLOB widgets_source_files
# aboutbox_impl.cpp
# arrangercolumns.cpp
automation_mode_toolbar.cpp
# background_painter.cpp
# bigtime.cpp
# canvas.cpp
Expand Down

0 comments on commit a362f7b

Please sign in to comment.