Skip to content

Commit

Permalink
VST2: new scanner implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
x42 committed Jul 3, 2021
1 parent a74b4e8 commit ef06f01
Show file tree
Hide file tree
Showing 6 changed files with 1,161 additions and 179 deletions.
49 changes: 49 additions & 0 deletions gtk2_ardour/arvst2
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/sh
TOP=`dirname "$0"`/..
. $TOP/build/gtk2_ardour/ardev_common_waf.sh
export UBUNTU_MENUPROXY=""

if [ $# -gt 0 ] ; then
case $1 in
-g|--gdb) DBG=gdb; shift ;;
esac
case $1 in
--valgrind) DBG=valgrind; shift ;;
esac
case $1 in
--callgrind) DBG=callgrind; shift ;;
esac
fi

if test -z "$DBG"; then
exec $TOP/build/libs/fst/ardour-vst-scanner "$@"
fi

if test "$DBG" = "valgrind"; then
export ARDOUR_RUNNING_UNDER_VALGRIND=TRUE
exec valgrind \
--error-limit=no --num-callers=50 \
--tool=memcheck \
--track-origins=yes \
--leak-check=full --show-leak-kinds=all \
--suppressions=${TOP}/tools/valgrind.supp \
$TOP/build/libs/fst/ardour-vst-scanner "$@"
fi

if test "$DBG" = "callgrind"; then
exec valgrind \
--error-limit=no --num-callers=50 \
--tool=callgrind \
--separate-callers=3 \
--separate-threads=yes \
--collect-systime=yes \
--collect-jumps=yes \
$TOP/build/libs/fst/ardour-vst-scanner "$@"
fi

if test -n "`which gdb`"; then
exec gdb --args $TOP/build/libs/fst/ardour-vst-scanner "$@"
fi
if test -n "`which lldb`"; then
exec lldb -- $TOP/build/libs/fst/ardour-vst-scanner "$@"
fi
81 changes: 81 additions & 0 deletions libs/ardour/ardour/vst2_scan.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright (C) 2021 Robin Gareus <robin@gareus.org>
*
* 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.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef _ardour_vst2_scan_h_
#define _ardour_vst2_scan_h_

#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>

#include "pbd/xml++.h"

#include "ardour/libardour_visibility.h"
#include "ardour/types.h"

namespace ARDOUR {

struct VST2Info {
VST2Info ()
: id (0)
, n_inputs (0)
, n_outputs (0)
, n_midi_inputs (0)
, n_midi_outputs (0)
, is_instrument (false)
, can_process_replace (false)
, has_editor (false)
{}

VST2Info (XMLNode const&);
XMLNode& state () const;

int32_t id;
std::string name;
std::string creator; // vendor;
std::string category;
std::string version;

int n_inputs;
int n_outputs;
int n_midi_inputs;
int n_midi_outputs;

bool is_instrument;
bool can_process_replace;
bool has_editor;
};

LIBARDOUR_API extern std::string
vst2_arch ();

LIBARDOUR_API extern std::string
vst2_id_to_str (int32_t);

LIBARDOUR_API extern std::string
vst2_cache_file (std::string const& path);

LIBARDOUR_API extern std::string
vst2_valid_cache_file (std::string const& path, bool verbose = false, bool* is_new = NULL);

LIBARDOUR_API extern bool
vst2_scan_and_cache (std::string const& path, ARDOUR::PluginType, boost::function<void (std::string const&, PluginType, VST2Info const&)> cb, bool verbose = false);

} // namespace ARDOUR

#endif
Loading

0 comments on commit ef06f01

Please sign in to comment.