X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fjackrack%2Fplugin_mgr.c;h=37d7510417c4fcac5b299e2cabed90e2ad02b15e;hb=f4d4669b66a9f23be85527f65dec19a566db561c;hp=b666e354031821f0b47513d0cce780293b77d0f8;hpb=b7241ba1f8be71fd66d670436db163957508eaab;p=melted diff --git a/src/modules/jackrack/plugin_mgr.c b/src/modules/jackrack/plugin_mgr.c index b666e35..37d7510 100644 --- a/src/modules/jackrack/plugin_mgr.c +++ b/src/modules/jackrack/plugin_mgr.c @@ -1,21 +1,26 @@ /* - * jack-ladspa-host - * - * Copyright (C) Robert Ham 2002, 2003 (node@users.sourceforge.net) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * JACK Rack * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Original: + * Copyright (C) Robert Ham 2002, 2003 (node@users.sourceforge.net) * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Modification for MLT: + * Copyright (C) 2004 Ushodaya Enterprises Limited + * Author: Dan Dennedy + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include @@ -29,10 +34,11 @@ #include #include #include +#include +#include #include "plugin_mgr.h" #include "plugin_desc.h" -#include "ui.h" static gboolean @@ -60,7 +66,7 @@ plugin_is_valid (const LADSPA_Descriptor * descriptor) } static void -plugin_mgr_get_object_file_plugins (ui_t * ui, plugin_mgr_t * plugin_mgr, const char * filename) +plugin_mgr_get_object_file_plugins (plugin_mgr_t * plugin_mgr, const char * filename) { const char * dlerr; void * dl_handle; @@ -146,7 +152,7 @@ plugin_mgr_get_object_file_plugins (ui_t * ui, plugin_mgr_t * plugin_mgr, const } static void -plugin_mgr_get_dir_plugins (ui_t * ui, plugin_mgr_t * plugin_mgr, const char * dir) +plugin_mgr_get_dir_plugins (plugin_mgr_t * plugin_mgr, const char * dir) { DIR * dir_stream; struct dirent * dir_entry; @@ -166,6 +172,8 @@ plugin_mgr_get_dir_plugins (ui_t * ui, plugin_mgr_t * plugin_mgr, const char * d while ( (dir_entry = readdir (dir_stream)) ) { + struct stat info; + if (strcmp (dir_entry->d_name, ".") == 0 || strcmp (dir_entry->d_name, "..") == 0) continue; @@ -181,7 +189,11 @@ plugin_mgr_get_dir_plugins (ui_t * ui, plugin_mgr_t * plugin_mgr, const char * d strcpy (file_name + dirlen + 1, dir_entry->d_name); } - plugin_mgr_get_object_file_plugins (ui, plugin_mgr, file_name); + stat (file_name, &info); + if (S_ISDIR (info.st_mode)) + plugin_mgr_get_dir_plugins (plugin_mgr, file_name); + else + plugin_mgr_get_object_file_plugins (plugin_mgr, file_name); g_free (file_name); } @@ -193,7 +205,7 @@ plugin_mgr_get_dir_plugins (ui_t * ui, plugin_mgr_t * plugin_mgr, const char * d } static void -plugin_mgr_get_path_plugins (ui_t * ui, plugin_mgr_t * plugin_mgr) +plugin_mgr_get_path_plugins (plugin_mgr_t * plugin_mgr) { char * ladspa_path, * dir; @@ -203,7 +215,7 @@ plugin_mgr_get_path_plugins (ui_t * ui, plugin_mgr_t * plugin_mgr) dir = strtok (ladspa_path, ":"); do - plugin_mgr_get_dir_plugins (ui, plugin_mgr, dir); + plugin_mgr_get_dir_plugins (plugin_mgr, dir); while ((dir = strtok (NULL, ":"))); g_free (ladspa_path); @@ -221,7 +233,7 @@ plugin_mgr_sort (gconstpointer a, gconstpointer b) } plugin_mgr_t * -plugin_mgr_new (ui_t * ui) +plugin_mgr_new () { plugin_mgr_t * pm; @@ -230,7 +242,7 @@ plugin_mgr_new (ui_t * ui) pm->plugins = NULL; pm->plugin_count = 0; - plugin_mgr_get_path_plugins (ui, pm); + plugin_mgr_get_path_plugins (pm); if (!pm->all_plugins) {