1 /*
2  * Copyright (C) 2010-2011 David Robillard <d@drobilla.net>
3  * Copyright (C) 2010-2013 Paul Davis <paul@linuxaudiosystems.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __libardour_speakers_h__
21 #define __libardour_speakers_h__
22 
23 #include <vector>
24 #include <iostream>
25 
26 #include <pbd/signals.h>
27 #include <pbd/stateful.h>
28 
29 #include "ardour/speaker.h"
30 
31 class XMLNode;
32 
33 namespace ARDOUR  {
34 
35 class LIBARDOUR_API Speakers : public PBD::Stateful {
36 public:
37 	Speakers ();
38 	Speakers (const Speakers&);
39 	virtual ~Speakers ();
40 
41 	Speakers& operator= (const Speakers&);
42 
43 	virtual int  add_speaker (const PBD::AngularVector&);
44 	virtual void remove_speaker (int id);
45 	virtual void move_speaker (int id, const PBD::AngularVector& new_position);
46 	virtual void clear_speakers ();
size()47 	uint32_t size() const { return _speakers.size(); }
48 
49 	void setup_default_speakers (uint32_t nspeakers);
50 
speakers()51 	std::vector<Speaker>& speakers() { return _speakers; }
52 
53 	void dump_speakers (std::ostream&);
54 
55 	XMLNode& get_state ();
56 	int set_state (const XMLNode&, int version);
57 
58 	PBD::Signal0<void> Changed;
59 
60 protected:
61 	std::vector<Speaker>  _speakers;
62 
update()63 	virtual void update () {}
64 };
65 
66 } /* namespace */
67 
68 #endif /* __libardour_speakers_h__ */
69