mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-21 22:26:29 +01:00
Replace all use of PathScanner with equivalent functions from pbd/file_utils.h
This commit is contained in:
parent
576c81d50e
commit
10a6fe553e
10 changed files with 37 additions and 72 deletions
|
|
@ -28,7 +28,7 @@
|
||||||
#include "pbd/xml++.h"
|
#include "pbd/xml++.h"
|
||||||
#include "pbd/convert.h"
|
#include "pbd/convert.h"
|
||||||
#include "pbd/whitespace.h"
|
#include "pbd/whitespace.h"
|
||||||
#include "pbd/pathscanner.h"
|
#include "pbd/file_utils.h"
|
||||||
#include "pbd/locale_guard.h"
|
#include "pbd/locale_guard.h"
|
||||||
|
|
||||||
#include <glibmm/threads.h>
|
#include <glibmm/threads.h>
|
||||||
|
|
@ -2049,20 +2049,19 @@ AUPlugin::current_preset() const
|
||||||
void
|
void
|
||||||
AUPlugin::find_presets ()
|
AUPlugin::find_presets ()
|
||||||
{
|
{
|
||||||
vector<string*>* preset_files;
|
vector<string> preset_files;
|
||||||
PathScanner scanner;
|
|
||||||
|
|
||||||
user_preset_map.clear ();
|
user_preset_map.clear ();
|
||||||
|
|
||||||
preset_files = scanner (preset_search_path, au_preset_filter, this, true, true, -1, true);
|
find_files_matching_filter (preset_files, preset_search_path, au_preset_filter, this, true, true, -1, true);
|
||||||
|
|
||||||
if (!preset_files) {
|
if (preset_files.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (vector<string*>::iterator x = preset_files->begin(); x != preset_files->end(); ++x) {
|
for (vector<string>::iterator x = preset_files.begin(); x != preset_files.end(); ++x) {
|
||||||
|
|
||||||
string path = *(*x);
|
string path = *x;
|
||||||
string preset_name;
|
string preset_name;
|
||||||
|
|
||||||
/* make an initial guess at the preset name using the path */
|
/* make an initial guess at the preset name using the path */
|
||||||
|
|
@ -2079,12 +2078,8 @@ AUPlugin::find_presets ()
|
||||||
user_preset_map[preset_name] = path;
|
user_preset_map[preset_name] = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete *x;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vector_delete (preset_files);
|
|
||||||
delete preset_files;
|
|
||||||
|
|
||||||
/* now fill the vector<string> with the names we have */
|
/* now fill the vector<string> with the names we have */
|
||||||
|
|
||||||
for (UserPresetMap::iterator i = user_preset_map.begin(); i != user_preset_map.end(); ++i) {
|
for (UserPresetMap::iterator i = user_preset_map.begin(); i != user_preset_map.end(); ++i) {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
|
|
||||||
#include "pbd/clear_dir.h"
|
#include "pbd/clear_dir.h"
|
||||||
#include "pbd/pathscanner.h"
|
#include "pbd/file_utils.h"
|
||||||
#include "pbd/stl_delete.h"
|
#include "pbd/stl_delete.h"
|
||||||
#include "pbd/compose.h"
|
#include "pbd/compose.h"
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
|
|
@ -2013,10 +2013,10 @@ void
|
||||||
LV2World::load_bundled_plugins()
|
LV2World::load_bundled_plugins()
|
||||||
{
|
{
|
||||||
if (!_bundle_checked) {
|
if (!_bundle_checked) {
|
||||||
PathScanner scanner;
|
|
||||||
cout << "Scanning folders for bundled LV2s: " << ARDOUR::lv2_bundled_search_path().to_string() << endl;
|
cout << "Scanning folders for bundled LV2s: " << ARDOUR::lv2_bundled_search_path().to_string() << endl;
|
||||||
|
|
||||||
vector<string> plugin_objects = scanner (ARDOUR::lv2_bundled_search_path().to_string(), lv2_filter, 0, true, true);
|
vector<string> plugin_objects;
|
||||||
|
find_files_matching_filter (plugin_objects, ARDOUR::lv2_bundled_search_path().to_string(), lv2_filter, 0, true, true);
|
||||||
for ( vector<string>::iterator x = plugin_objects.begin(); x != plugin_objects.end (); ++x) {
|
for ( vector<string>::iterator x = plugin_objects.begin(); x != plugin_objects.end (); ++x) {
|
||||||
#ifdef PLATFORM_WINDOWS
|
#ifdef PLATFORM_WINDOWS
|
||||||
string uri = "file:///" + *x + "/";
|
string uri = "file:///" + *x + "/";
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/compose.h"
|
#include "pbd/compose.h"
|
||||||
#include "pbd/pathscanner.h"
|
#include "pbd/file_utils.h"
|
||||||
#include "pbd/stl_delete.h"
|
#include "pbd/stl_delete.h"
|
||||||
|
|
||||||
#include "ardour/debug.h"
|
#include "ardour/debug.h"
|
||||||
|
|
@ -90,13 +90,12 @@ static bool panner_filter (const string& str, void */*arg*/)
|
||||||
void
|
void
|
||||||
PannerManager::discover_panners ()
|
PannerManager::discover_panners ()
|
||||||
{
|
{
|
||||||
PathScanner scanner;
|
|
||||||
std::vector<std::string> panner_modules;
|
std::vector<std::string> panner_modules;
|
||||||
std::string search_path = panner_search_path().to_string();
|
std::string search_path = panner_search_path().to_string();
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Panning, string_compose (_("looking for panners in %1\n"), search_path));
|
DEBUG_TRACE (DEBUG::Panning, string_compose (_("looking for panners in %1\n"), search_path));
|
||||||
|
|
||||||
panner_modules = scanner (search_path, panner_filter, 0, false, true, 1, true);
|
find_files_matching_filter (panner_modules, search_path, panner_filter, 0, false, true, 1, true);
|
||||||
|
|
||||||
for (vector<std::string>::iterator i = panner_modules.begin(); i != panner_modules.end(); ++i) {
|
for (vector<std::string>::iterator i = panner_modules.begin(); i != panner_modules.end(); ++i) {
|
||||||
panner_discover (*i);
|
panner_discover (*i);
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@
|
||||||
#include <glibmm/miscutils.h>
|
#include <glibmm/miscutils.h>
|
||||||
#include <glibmm/pattern.h>
|
#include <glibmm/pattern.h>
|
||||||
|
|
||||||
#include "pbd/pathscanner.h"
|
|
||||||
#include "pbd/whitespace.h"
|
#include "pbd/whitespace.h"
|
||||||
#include "pbd/file_utils.h"
|
#include "pbd/file_utils.h"
|
||||||
|
|
||||||
|
|
@ -242,10 +241,8 @@ PluginManager::clear_vst_cache ()
|
||||||
// see also libs/ardour/vst_info_file.cc - vstfx_infofile_path()
|
// see also libs/ardour/vst_info_file.cc - vstfx_infofile_path()
|
||||||
#ifdef WINDOWS_VST_SUPPORT
|
#ifdef WINDOWS_VST_SUPPORT
|
||||||
{
|
{
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> fsi_files;
|
vector<string> fsi_files;
|
||||||
|
find_files_matching_regex (fsi_files, Config->get_plugin_path_vst(), "\\.fsi$", true, true, -1, false);
|
||||||
fsi_files = scanner (Config->get_plugin_path_vst(), "\\.fsi$", true, true, -1, false);
|
|
||||||
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
||||||
::g_unlink(i->c_str());
|
::g_unlink(i->c_str());
|
||||||
}
|
}
|
||||||
|
|
@ -254,9 +251,8 @@ PluginManager::clear_vst_cache ()
|
||||||
|
|
||||||
#ifdef LXVST_SUPPORT
|
#ifdef LXVST_SUPPORT
|
||||||
{
|
{
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> fsi_files;
|
vector<string> fsi_files;
|
||||||
fsi_files = scanner (Config->get_plugin_path_lxvst(), "\\.fsi$", true, true, -1, false);
|
find_files_matching_regex (fsi_files, Config->get_plugin_path_lxvst(), "\\.fsi$", true, true, -1, false);
|
||||||
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
||||||
::g_unlink(i->c_str());
|
::g_unlink(i->c_str());
|
||||||
}
|
}
|
||||||
|
|
@ -266,9 +262,8 @@ PluginManager::clear_vst_cache ()
|
||||||
#if (defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT)
|
#if (defined WINDOWS_VST_SUPPORT || defined LXVST_SUPPORT)
|
||||||
{
|
{
|
||||||
string personal = get_personal_vst_info_cache_dir();
|
string personal = get_personal_vst_info_cache_dir();
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> fsi_files;
|
vector<string> fsi_files;
|
||||||
fsi_files = scanner (personal, "\\.fsi$", true, true, -1, false);
|
find_files_matching_regex (fsi_files, personal, "\\.fsi$", true, true, -1, false);
|
||||||
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
||||||
::g_unlink(i->c_str());
|
::g_unlink(i->c_str());
|
||||||
}
|
}
|
||||||
|
|
@ -281,10 +276,8 @@ PluginManager::clear_vst_blacklist ()
|
||||||
{
|
{
|
||||||
#ifdef WINDOWS_VST_SUPPORT
|
#ifdef WINDOWS_VST_SUPPORT
|
||||||
{
|
{
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> fsi_files;
|
vector<string> fsi_files;
|
||||||
|
find_files_matching_regex (fsi_files, Config->get_plugin_path_vst(), "\\.fsb$", true, true, -1, false);
|
||||||
fsi_files = scanner (Config->get_plugin_path_vst(), "\\.fsb$", true, true, -1, false);
|
|
||||||
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
||||||
::g_unlink(i->c_str());
|
::g_unlink(i->c_str());
|
||||||
}
|
}
|
||||||
|
|
@ -293,9 +286,8 @@ PluginManager::clear_vst_blacklist ()
|
||||||
|
|
||||||
#ifdef LXVST_SUPPORT
|
#ifdef LXVST_SUPPORT
|
||||||
{
|
{
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> fsi_files;
|
vector<string> fsi_files;
|
||||||
fsi_files = scanner (Config->get_plugin_path_lxvst(), "\\.fsb$", true, true, -1, false);
|
find_files_matching_regex (fsi_files, Config->get_plugin_path_lxvst(), "\\.fsb$", true, true, -1, false);
|
||||||
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
||||||
::g_unlink(i->c_str());
|
::g_unlink(i->c_str());
|
||||||
}
|
}
|
||||||
|
|
@ -306,9 +298,8 @@ PluginManager::clear_vst_blacklist ()
|
||||||
{
|
{
|
||||||
string personal = get_personal_vst_blacklist_dir();
|
string personal = get_personal_vst_blacklist_dir();
|
||||||
|
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> fsi_files;
|
vector<string> fsi_files;
|
||||||
fsi_files = scanner (personal, "\\.fsb$", true, true, -1, false);
|
find_files_matching_regex (fsi_files, personal, "\\.fsb$", true, true, -1, false);
|
||||||
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
for (vector<string>::iterator i = fsi_files.begin(); i != fsi_files.end (); ++i) {
|
||||||
::g_unlink(i->c_str());
|
::g_unlink(i->c_str());
|
||||||
}
|
}
|
||||||
|
|
@ -385,7 +376,6 @@ void
|
||||||
PluginManager::add_presets(string domain)
|
PluginManager::add_presets(string domain)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LRDF
|
#ifdef HAVE_LRDF
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> presets;
|
vector<string> presets;
|
||||||
vector<string>::iterator x;
|
vector<string>::iterator x;
|
||||||
|
|
||||||
|
|
@ -395,7 +385,7 @@ PluginManager::add_presets(string domain)
|
||||||
}
|
}
|
||||||
|
|
||||||
string path = string_compose("%1/.%2/rdf", envvar, domain);
|
string path = string_compose("%1/.%2/rdf", envvar, domain);
|
||||||
presets = scanner (path, rdf_filter, 0, false, true);
|
find_files_matching_filter (presets, path, rdf_filter, 0, false, true);
|
||||||
|
|
||||||
for (x = presets.begin(); x != presets.end (); ++x) {
|
for (x = presets.begin(); x != presets.end (); ++x) {
|
||||||
string file = "file:" + *x;
|
string file = "file:" + *x;
|
||||||
|
|
@ -411,11 +401,10 @@ void
|
||||||
PluginManager::add_lrdf_data (const string &path)
|
PluginManager::add_lrdf_data (const string &path)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LRDF
|
#ifdef HAVE_LRDF
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> rdf_files;
|
vector<string> rdf_files;
|
||||||
vector<string>::iterator x;
|
vector<string>::iterator x;
|
||||||
|
|
||||||
rdf_files = scanner (path, rdf_filter, 0, false, true);
|
find_files_matching_filter (rdf_files, path, rdf_filter, 0, false, true);
|
||||||
|
|
||||||
for (x = rdf_files.begin(); x != rdf_files.end (); ++x) {
|
for (x = rdf_files.begin(); x != rdf_files.end (); ++x) {
|
||||||
const string uri(string("file://") + *x);
|
const string uri(string("file://") + *x);
|
||||||
|
|
@ -628,14 +617,13 @@ static bool windows_vst_filter (const string& str, void * /*arg*/)
|
||||||
int
|
int
|
||||||
PluginManager::windows_vst_discover_from_path (string path, bool cache_only)
|
PluginManager::windows_vst_discover_from_path (string path, bool cache_only)
|
||||||
{
|
{
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> plugin_objects;
|
vector<string> plugin_objects;
|
||||||
vector<string>::iterator x;
|
vector<string>::iterator x;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::PluginManager, string_compose ("detecting Windows VST plugins along %1\n", path));
|
DEBUG_TRACE (DEBUG::PluginManager, string_compose ("detecting Windows VST plugins along %1\n", path));
|
||||||
|
|
||||||
plugin_objects = scanner (Config->get_plugin_path_vst(), windows_vst_filter, 0, false, true);
|
find_files_matching_filter (plugin_objects, Config->get_plugin_path_vst(), windows_vst_filter, 0, false, true);
|
||||||
|
|
||||||
for (x = plugin_objects.begin(); x != plugin_objects.end (); ++x) {
|
for (x = plugin_objects.begin(); x != plugin_objects.end (); ++x) {
|
||||||
ARDOUR::PluginScanMessage(_("VST"), *x, !cache_only && !cancelled());
|
ARDOUR::PluginScanMessage(_("VST"), *x, !cache_only && !cancelled());
|
||||||
|
|
@ -744,7 +732,6 @@ static bool lxvst_filter (const string& str, void *)
|
||||||
int
|
int
|
||||||
PluginManager::lxvst_discover_from_path (string path, bool cache_only)
|
PluginManager::lxvst_discover_from_path (string path, bool cache_only)
|
||||||
{
|
{
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> plugin_objects;
|
vector<string> plugin_objects;
|
||||||
vector<string>::iterator x;
|
vector<string>::iterator x;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
@ -755,7 +742,7 @@ PluginManager::lxvst_discover_from_path (string path, bool cache_only)
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Discovering linuxVST plugins along %1\n", path));
|
DEBUG_TRACE (DEBUG::PluginManager, string_compose ("Discovering linuxVST plugins along %1\n", path));
|
||||||
|
|
||||||
plugin_objects = scanner (Config->get_plugin_path_lxvst(), lxvst_filter, 0, false, true);
|
find_files_matching_filter (plugin_objects, Config->get_plugin_path_lxvst(), lxvst_filter, 0, false, true);
|
||||||
|
|
||||||
for (x = plugin_objects.begin(); x != plugin_objects.end (); ++x) {
|
for (x = plugin_objects.begin(); x != plugin_objects.end (); ++x) {
|
||||||
ARDOUR::PluginScanMessage(_("LXVST"), *x, !cache_only && !cancelled());
|
ARDOUR::PluginScanMessage(_("LXVST"), *x, !cache_only && !cancelled());
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,6 @@
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/file_utils.h"
|
#include "pbd/file_utils.h"
|
||||||
#include "pbd/pathexpand.h"
|
#include "pbd/pathexpand.h"
|
||||||
#include "pbd/pathscanner.h"
|
|
||||||
#include "pbd/pthread_utils.h"
|
#include "pbd/pthread_utils.h"
|
||||||
#include "pbd/stacktrace.h"
|
#include "pbd/stacktrace.h"
|
||||||
#include "pbd/convert.h"
|
#include "pbd/convert.h"
|
||||||
|
|
@ -2308,8 +2307,8 @@ remove_end(string state)
|
||||||
vector<string>
|
vector<string>
|
||||||
Session::possible_states (string path)
|
Session::possible_states (string path)
|
||||||
{
|
{
|
||||||
PathScanner scanner;
|
vector<string> states;
|
||||||
vector<string> states = scanner (path, state_file_filter, 0, false, false);
|
find_files_matching_filter (states, path, state_file_filter, 0, false, false);
|
||||||
|
|
||||||
transform(states.begin(), states.end(), states.begin(), remove_end);
|
transform(states.begin(), states.end(), states.begin(), remove_end);
|
||||||
|
|
||||||
|
|
@ -2542,7 +2541,6 @@ Session::find_all_sources (string path, set<string>& result)
|
||||||
int
|
int
|
||||||
Session::find_all_sources_across_snapshots (set<string>& result, bool exclude_this_snapshot)
|
Session::find_all_sources_across_snapshots (set<string>& result, bool exclude_this_snapshot)
|
||||||
{
|
{
|
||||||
PathScanner scanner;
|
|
||||||
vector<string> state_files;
|
vector<string> state_files;
|
||||||
string ripped;
|
string ripped;
|
||||||
string this_snapshot_path;
|
string this_snapshot_path;
|
||||||
|
|
@ -2555,7 +2553,7 @@ Session::find_all_sources_across_snapshots (set<string>& result, bool exclude_th
|
||||||
ripped = ripped.substr (0, ripped.length() - 1);
|
ripped = ripped.substr (0, ripped.length() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
state_files = scanner (ripped, accept_all_state_files, (void *) 0, true, true);
|
find_files_matching_filter (state_files, ripped, accept_all_state_files, (void *) 0, true, true);
|
||||||
|
|
||||||
if (state_files.empty()) {
|
if (state_files.empty()) {
|
||||||
/* impossible! */
|
/* impossible! */
|
||||||
|
|
@ -2622,13 +2620,11 @@ Session::cleanup_sources (CleanupReport& rep)
|
||||||
// FIXME: needs adaptation to midi
|
// FIXME: needs adaptation to midi
|
||||||
|
|
||||||
vector<boost::shared_ptr<Source> > dead_sources;
|
vector<boost::shared_ptr<Source> > dead_sources;
|
||||||
PathScanner scanner;
|
|
||||||
string audio_path;
|
string audio_path;
|
||||||
string midi_path;
|
string midi_path;
|
||||||
vector<space_and_path>::iterator i;
|
vector<space_and_path>::iterator i;
|
||||||
vector<space_and_path>::iterator nexti;
|
vector<space_and_path>::iterator nexti;
|
||||||
vector<string> candidates;
|
vector<string> candidates;
|
||||||
vector<string> candidates2;
|
|
||||||
vector<string> unused;
|
vector<string> unused;
|
||||||
set<string> all_sources;
|
set<string> all_sources;
|
||||||
bool used;
|
bool used;
|
||||||
|
|
@ -2710,14 +2706,8 @@ Session::cleanup_sources (CleanupReport& rep)
|
||||||
i = nexti;
|
i = nexti;
|
||||||
}
|
}
|
||||||
|
|
||||||
candidates = scanner (audio_path, accept_all_audio_files, (void *) 0, true, true);
|
find_files_matching_filter (candidates, audio_path, accept_all_audio_files, (void *) 0, true, true);
|
||||||
candidates2 = scanner (midi_path, accept_all_midi_files, (void *) 0, true, true);
|
find_files_matching_filter (candidates, midi_path, accept_all_midi_files, (void *) 0, true, true);
|
||||||
|
|
||||||
/* merge them */
|
|
||||||
|
|
||||||
for (vector<string>::iterator i = candidates2.begin(); i != candidates2.end(); ++i) {
|
|
||||||
candidates.push_back (*i);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* find all sources, but don't use this snapshot because the
|
/* find all sources, but don't use this snapshot because the
|
||||||
state file on disk still references sources we may have already
|
state file on disk still references sources we may have already
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
#include <glibmm.h>
|
#include <glibmm.h>
|
||||||
|
|
||||||
#include "pbd/basename.h"
|
#include "pbd/basename.h"
|
||||||
#include "pbd/pathscanner.h"
|
#include "pbd/file_utils.h"
|
||||||
#include "pbd/stl_delete.h"
|
#include "pbd/stl_delete.h"
|
||||||
#include "pbd/xml++.h"
|
#include "pbd/xml++.h"
|
||||||
|
|
||||||
|
|
@ -82,10 +82,9 @@ void
|
||||||
find_session_templates (vector<TemplateInfo>& template_names)
|
find_session_templates (vector<TemplateInfo>& template_names)
|
||||||
{
|
{
|
||||||
vector<string> templates;
|
vector<string> templates;
|
||||||
PathScanner scanner;
|
|
||||||
Searchpath spath (template_search_path());
|
Searchpath spath (template_search_path());
|
||||||
|
|
||||||
templates = scanner (spath.to_string(), template_filter, 0, true, true);
|
find_files_matching_filter (templates, spath.to_string(), template_filter, 0, true, true);
|
||||||
|
|
||||||
if (templates.empty()) {
|
if (templates.empty()) {
|
||||||
cerr << "Found nothing along " << spath.to_string() << endl;
|
cerr << "Found nothing along " << spath.to_string() << endl;
|
||||||
|
|
@ -116,10 +115,9 @@ void
|
||||||
find_route_templates (vector<TemplateInfo>& template_names)
|
find_route_templates (vector<TemplateInfo>& template_names)
|
||||||
{
|
{
|
||||||
vector<string> templates;
|
vector<string> templates;
|
||||||
PathScanner scanner;
|
|
||||||
Searchpath spath (route_template_search_path());
|
Searchpath spath (route_template_search_path());
|
||||||
|
|
||||||
templates = scanner (spath.to_string(), route_template_filter, 0, false, true);
|
find_files_matching_filter (templates, spath.to_string(), route_template_filter, 0, false, true);
|
||||||
|
|
||||||
if (templates.empty()) {
|
if (templates.empty()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@
|
||||||
#include "pbd/file_utils.h"
|
#include "pbd/file_utils.h"
|
||||||
#include "pbd/debug.h"
|
#include "pbd/debug.h"
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/pathscanner.h"
|
|
||||||
#include "pbd/pathexpand.h"
|
#include "pbd/pathexpand.h"
|
||||||
#include "pbd/stl_delete.h"
|
#include "pbd/stl_delete.h"
|
||||||
|
|
||||||
|
|
@ -354,8 +353,8 @@ bool accept_all_files (string const &, void *)
|
||||||
void
|
void
|
||||||
copy_files(const std::string & from_path, const std::string & to_dir)
|
copy_files(const std::string & from_path, const std::string & to_dir)
|
||||||
{
|
{
|
||||||
PathScanner scanner;
|
vector<string> files;
|
||||||
vector<string> files = scanner (from_path, accept_all_files, 0, true, false);
|
find_files_matching_filter (files, from_path, accept_all_files, 0, true, false);
|
||||||
|
|
||||||
for (vector<string>::iterator i = files.begin(); i != files.end(); ++i) {
|
for (vector<string>::iterator i = files.begin(); i != files.end(); ++i) {
|
||||||
std::string from = Glib::build_filename (from_path, *i);
|
std::string from = Glib::build_filename (from_path, *i);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
#include "pbd/controllable_descriptor.h"
|
#include "pbd/controllable_descriptor.h"
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/failed_constructor.h"
|
#include "pbd/failed_constructor.h"
|
||||||
#include "pbd/pathscanner.h"
|
#include "pbd/file_utils.h"
|
||||||
#include "pbd/xml++.h"
|
#include "pbd/xml++.h"
|
||||||
|
|
||||||
#include "midi++/port.h"
|
#include "midi++/port.h"
|
||||||
|
|
@ -137,11 +137,10 @@ void
|
||||||
GenericMidiControlProtocol::reload_maps ()
|
GenericMidiControlProtocol::reload_maps ()
|
||||||
{
|
{
|
||||||
vector<string> midi_maps;
|
vector<string> midi_maps;
|
||||||
PathScanner scanner;
|
|
||||||
Searchpath spath (system_midi_map_search_path());
|
Searchpath spath (system_midi_map_search_path());
|
||||||
spath += user_midi_map_directory ();
|
spath += user_midi_map_directory ();
|
||||||
|
|
||||||
midi_maps = scanner (spath.to_string(), midi_map_filter, 0, false, true);
|
find_files_matching_filter (midi_maps, spath.to_string(), midi_map_filter, 0, false, true);
|
||||||
|
|
||||||
if (midi_maps.empty()) {
|
if (midi_maps.empty()) {
|
||||||
cerr << "No MIDI maps found using " << spath.to_string() << endl;
|
cerr << "No MIDI maps found using " << spath.to_string() << endl;
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include "pbd/xml++.h"
|
#include "pbd/xml++.h"
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/pathscanner.h"
|
#include "pbd/file_utils.h"
|
||||||
#include "pbd/convert.h"
|
#include "pbd/convert.h"
|
||||||
#include "pbd/stl_delete.h"
|
#include "pbd/stl_delete.h"
|
||||||
|
|
||||||
|
|
@ -472,10 +472,9 @@ DeviceInfo::reload_device_info ()
|
||||||
DeviceInfo di;
|
DeviceInfo di;
|
||||||
vector<string> s;
|
vector<string> s;
|
||||||
vector<string> devinfos;
|
vector<string> devinfos;
|
||||||
PathScanner scanner;
|
|
||||||
Searchpath spath (devinfo_search_path());
|
Searchpath spath (devinfo_search_path());
|
||||||
|
|
||||||
devinfos = scanner (spath.to_string(), devinfo_filter, 0, false, true);
|
find_files_matching_filter (devinfos, spath.to_string(), devinfo_filter, 0, false, true);
|
||||||
device_info.clear ();
|
device_info.clear ();
|
||||||
|
|
||||||
if (devinfos.empty()) {
|
if (devinfos.empty()) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "pbd/xml++.h"
|
#include "pbd/xml++.h"
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
#include "pbd/pathscanner.h"
|
#include "pbd/file_utils.h"
|
||||||
#include "pbd/stl_delete.h"
|
#include "pbd/stl_delete.h"
|
||||||
#include "pbd/replace_all.h"
|
#include "pbd/replace_all.h"
|
||||||
|
|
||||||
|
|
@ -91,10 +91,9 @@ DeviceProfile::reload_device_profiles ()
|
||||||
DeviceProfile dp;
|
DeviceProfile dp;
|
||||||
vector<string> s;
|
vector<string> s;
|
||||||
vector<string> devprofiles;
|
vector<string> devprofiles;
|
||||||
PathScanner scanner;
|
|
||||||
Searchpath spath (devprofile_search_path());
|
Searchpath spath (devprofile_search_path());
|
||||||
|
|
||||||
devprofiles = scanner (spath.to_string(), devprofile_filter, 0, false, true);
|
find_files_matching_filter (devprofiles, spath.to_string(), devprofile_filter, 0, false, true);
|
||||||
device_profiles.clear ();
|
device_profiles.clear ();
|
||||||
|
|
||||||
if (devprofiles.empty()) {
|
if (devprofiles.empty()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue