Das BlinkenSendButtons
[ardour.git] / libs / ardour / ardour / delivery.h
1 /*
2     Copyright (C) 2006 Paul Davis 
3     
4     This program is free software; you can redistribute it and/or modify it
5     under the terms of the GNU General Public License as published by the Free
6     Software Foundation; either version 2 of the License, or (at your option)
7     any later version.
8     
9     This program is distributed in the hope that it will be useful, but WITHOUT
10     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12     for more details.
13     
14     You should have received a copy of the GNU General Public License along
15     with this program; if not, write to the Free Software Foundation, Inc.,
16     675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19 #ifndef __ardour_delivery_h__
20 #define __ardour_delivery_h__
21
22 #include <string>
23 #include "ardour/types.h"
24 #include "ardour/chan_count.h"
25 #include "ardour/io_processor.h"
26
27 namespace ARDOUR {
28
29 class BufferSet;
30 class IO;
31
32 class Delivery : public IOProcessor {
33 public:
34         enum Role {
35                 Send   = 0x1,
36                 Solo   = 0x2,
37                 Listen = 0x4,
38                 Main   = 0x8
39         };
40
41         Delivery (Session& s, IO* io, const std::string& name, Role);
42         Delivery (Session& s, const std::string& name, Role);
43         Delivery (Session&, const XMLNode&);
44
45         bool visible() const;
46
47         Role role() const { return _role; }
48
49         bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
50         bool configure_io (ChanCount in, ChanCount out);
51
52         void run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
53
54         void set_metering (bool yn);
55         
56         bool muted_by_self() const { return _muted_by_self; }
57         bool muted_by_others() const { return _muted_by_others; }
58
59         void set_self_mute (bool);
60         void set_nonself_mute (bool);
61         
62         sigc::signal<void> SelfMuteChange;
63         sigc::signal<void> OtherMuteChange;
64
65         XMLNode& state (bool full);
66         int set_state (const XMLNode&);
67
68 private:
69         Role _role;
70         bool _metering;
71         bool _muted_by_self;
72         bool _muted_by_others;
73 };
74
75
76 } // namespace ARDOUR
77
78 #endif // __ardour__h__
79