2 Copyright (C) 2000 Paul Davis
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.
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.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_processor_h__
21 #define __ardour_processor_h__
27 #include <pbd/statefuldestructible.h>
29 #include <sigc++/signal.h>
31 #include <ardour/types.h>
32 #include <ardour/ardour.h>
33 #include <ardour/plugin_state.h>
34 #include <ardour/buffer_set.h>
35 #include <ardour/automatable.h>
44 /* A mixer strip element - plugin, send, meter, etc.
46 class Processor : public Automatable
49 static const string state_node_name;
51 Processor(Session&, const string& name, Placement p); // TODO: remove placement in favour of sort key
53 virtual ~Processor() { }
55 static boost::shared_ptr<Processor> clone (boost::shared_ptr<const Processor>);
57 uint32_t sort_key() const { return _sort_key; }
58 void set_sort_key (uint32_t key);
60 Placement placement() const { return _placement; }
61 void set_placement (Placement);
63 bool active () const { return _active; }
64 void set_active (bool yn);
66 bool get_next_ab_is_active () const { return _next_ab_is_active; }
67 void set_next_ab_is_active (bool yn) { _next_ab_is_active = yn; }
69 virtual nframes_t latency() { return 0; }
71 virtual void transport_stopped (nframes_t frame) {}
73 virtual void set_block_size (nframes_t nframes) {}
75 virtual void run (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, nframes_t nframes, nframes_t offset) = 0;
76 virtual void silence (nframes_t nframes, nframes_t offset) {}
78 virtual void activate () { _active = true; ActiveChanged.emit(); }
79 virtual void deactivate () { _active = false; ActiveChanged.emit(); }
81 virtual bool configure_io (ChanCount in, ChanCount out) { _configured_input = in; return (_configured = true); }
83 /* Act as a pass through, if not overridden */
84 virtual bool can_support_input_configuration (ChanCount in) const { return true; }
85 virtual ChanCount output_for_input_configuration (ChanCount in) const { return in; }
86 virtual ChanCount output_streams() const { return _configured_input; }
87 virtual ChanCount input_streams () const { return _configured_input; }
89 virtual XMLNode& state (bool full);
90 virtual XMLNode& get_state (void);
91 virtual int set_state (const XMLNode&);
93 void *get_gui () const { return _gui; }
94 void set_gui (void *p) { _gui = p; }
96 static sigc::signal<void,Processor*> ProcessorCreated;
98 sigc::signal<void> ActiveChanged;
99 sigc::signal<void> PlacementChanged;
103 bool _next_ab_is_active;
105 ChanCount _configured_input;
106 Placement _placement;
108 void* _gui; /* generic, we don't know or care what this is */
111 } // namespace ARDOUR
113 #endif /* __ardour_processor_h__ */