libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BuiltinModules.hpp
Go to the documentation of this file.
1 #ifndef BUILTINMODULES_HPP
2 #define BUILTINMODULES_HPP
3 /*
4 This file is part of AlgAudio.
5 
6 AlgAudio, Copyright (C) 2015 CeTA - Audiovisual Technology Center
7 
8 AlgAudio is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Lesser General Public License as
10 published by the Free Software Foundation, either version 3 of the
11 License, or (at your option) any later version.
12 
13 AlgAudio is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public License
19 along with AlgAudio. If not, see <http://www.gnu.org/licenses/>.
20 */
21 #include "Module.hpp"
22 #include <array>
23 
24 namespace AlgAudio{
25 namespace Builtin{
26 
27 class SubpatchEntrance;
28 class SubpatchExit;
29 
30 class Subpatch : public Module{
31 public:
33  void on_destroy() override;
34  void on_gui_build(std::shared_ptr<ModuleGUI> gui) override;
35  void state_store_xml(rapidxml::xml_node<char>*) const override;
37 
38  // Marks the given entrance as an entrance to this subpatch. If buses
39  // are ready, it applies their ids to the entrance. If buses are not
40  // ready, the ids will be applied as soon as the buses are ready.
41  void LinkToEntrance(std::shared_ptr<SubpatchEntrance>);
42  void LinkToExit(std::shared_ptr<SubpatchExit>);
43  bool HasEntrance() const {return entrance != nullptr;};
44  bool HasExit() const {return exit != nullptr;};
45 
46  void LinkOutput(int output_no, int busid);
47 
48  // Used for ordering calculation. TODO: Move to an interface imlpemented by both subpatch and poly.
49  int GetGroupID() const;
50 private:
51  std::shared_ptr<Canvas> internal_canvas;
52  std::shared_ptr<SubpatchEntrance> entrance;
53  std::shared_ptr<SubpatchExit> exit;
54 };
55 class SubpatchEntrance : public Module{
56 public:
57  void on_init() override;
58  void LinkOutput(int output_no, int busid);
59 private:
60 };
61 class SubpatchExit : public Module{
62 public:
64  std::shared_ptr<Subpatch> subpatch;
65 private:
66 };
67 
68 std::shared_ptr<Module> CreateInstance(std::string id);
69 
70 }} // namespace AlgAudio::Builtin
71 
72 #endif // BUILTINMODULES_HPP
Definition: BuiltinModules.hpp:55
void on_gui_build(std::shared_ptr< ModuleGUI > gui) override
void LinkToExit(std::shared_ptr< SubpatchExit >)
void state_load_xml(rapidxml::xml_node< char > *) override
Definition: BuiltinModules.hpp:61
bool HasExit() const
Definition: BuiltinModules.hpp:44
Definition: Module.hpp:96
Definition: Module.hpp:37
bool HasEntrance() const
Definition: BuiltinModules.hpp:43
Definition: Alertable.hpp:26
Definition: BuiltinModules.hpp:30
void LinkToEntrance(std::shared_ptr< SubpatchEntrance >)
LateReturn on_init_latereturn() override
void on_destroy() override
void state_store_xml(rapidxml::xml_node< char > *) const override
void LinkOutput(int output_no, int busid)
void LinkOutput(int output_no, int busid)
std::shared_ptr< Subpatch > subpatch
Definition: BuiltinModules.hpp:64
std::shared_ptr< Module > CreateInstance(std::string id)
Definition: LateReturn.hpp:35
LateReturn on_init_latereturn() override