1 //  prototype of a supercollider-synthdef-based synth prototype
2 //  Copyright (C) 2009 Tim Blechmann
3 //
4 //  This program is free software; you can redistribute it and/or modify
5 //  it under the terms of the GNU General Public License as published by
6 //  the Free Software Foundation; either version 2 of the License, or
7 //  (at your option) any later version.
8 //
9 //  This program is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //  GNU General Public License for more details.
13 //
14 //  You should have received a copy of the GNU General Public License
15 //  along with this program; see the file COPYING.  If not, write to
16 //  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 //  Boston, MA 02111-1307, USA.
18 
19 #pragma once
20 
21 #include <boost/filesystem/path.hpp>
22 
23 #include "sc_synthdef.hpp"
24 
25 #include "server/synth_definition.hpp"
26 #include "utilities/sized_array.hpp"
27 
28 namespace nova {
29 
30 using boost::filesystem::path;
31 
32 /* read synthdefs from path pattern */
33 std::vector<sc_synthdef> sc_read_synthdefs_file(path const& filename);
34 std::vector<sc_synthdef> sc_read_synthdefs_dir(path const& dir);
35 
36 class sc_synth_definition : public synth_definition, public sc_synthdef {
37 public:
38     sc_synth_definition(sc_synthdef&& sd);
39 
40 private:
41     friend class sc_synth;
42 
43     virtual abstract_synth* create_instance(int) override;
44 };
45 
46 typedef boost::intrusive_ptr<sc_synth_definition> sc_synth_definition_ptr;
47 
48 void register_synthdefs(class synth_factory& factory, std::vector<sc_synthdef>&&);
49 
50 } /* namespace nova */
51