Ardour  9.0-pre0-582-g084a23a80d
speakers.h
Go to the documentation of this file.
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 #pragma once
21 
22 #include <vector>
23 #include <iostream>
24 
25 #include <pbd/signals.h>
26 #include <pbd/stateful.h>
27 
28 #include "ardour/speaker.h"
29 
30 class XMLNode;
31 
32 namespace ARDOUR {
33 
35 public:
37  Speakers (const Speakers&);
38  virtual ~Speakers ();
39 
40  Speakers& operator= (const Speakers&);
41 
42  virtual int add_speaker (const PBD::AngularVector&);
43  virtual void remove_speaker (int id);
44  virtual void move_speaker (int id, const PBD::AngularVector& new_position);
45  virtual void clear_speakers ();
46  uint32_t size() const { return _speakers.size(); }
47 
48  void setup_default_speakers (uint32_t nspeakers);
49 
50  std::vector<Speaker>& speakers() { return _speakers; }
51 
52  void dump_speakers (std::ostream&);
53 
54  XMLNode& get_state () const;
55  int set_state (const XMLNode&, int version);
56 
58 
59 protected:
60  std::vector<Speaker> _speakers;
61 
62  virtual void update () {}
63 };
64 
65 } /* namespace */
66 
virtual int add_speaker(const PBD::AngularVector &)
int set_state(const XMLNode &, int version)
void setup_default_speakers(uint32_t nspeakers)
Speakers(const Speakers &)
std::vector< Speaker > _speakers
Definition: speakers.h:60
void dump_speakers(std::ostream &)
PBD::Signal< void()> Changed
Definition: speakers.h:57
virtual void move_speaker(int id, const PBD::AngularVector &new_position)
uint32_t size() const
Definition: speakers.h:46
virtual void update()
Definition: speakers.h:62
virtual void remove_speaker(int id)
virtual void clear_speakers()
std::vector< Speaker > & speakers()
Definition: speakers.h:50
virtual ~Speakers()
XMLNode & get_state() const
Definition: xml++.h:114
#define LIBARDOUR_API