From cbf530b6b57e391e28f148e8805da817c97c9d1d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 4 Mar 2011 17:35:02 +0000 Subject: Make speaker dialogue manage the session's Speakers. Make azimuth control work. Various tweaks. git-svn-id: svn://localhost/ardour2/branches/3.0@9073 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/speakers.cc | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'libs/ardour/speakers.cc') diff --git a/libs/ardour/speakers.cc b/libs/ardour/speakers.cc index 0120e56bfa..4bb843021c 100644 --- a/libs/ardour/speakers.cc +++ b/libs/ardour/speakers.cc @@ -35,11 +35,35 @@ Speaker::Speaker (int i, const AngularVector& position) move (position); } +Speaker::Speaker (Speaker const & o) + : id (o.id) + , _coords (o._coords) + , _angles (o._angles) +{ + +} + +Speaker & +Speaker::operator= (Speaker const & o) +{ + if (&o == this) { + return *this; + } + + id = o.id; + _coords = o._coords; + _angles = o._angles; + + return *this; +} + void Speaker::move (const AngularVector& new_position) { _angles = new_position; _angles.cartesian (_coords); + + PositionChanged (); /* EMIT SIGNAL */ } Speakers::Speakers () @@ -100,12 +124,12 @@ Speakers::add_speaker (const AngularVector& position) void Speakers::remove_speaker (int id) { - for (vector::iterator i = _speakers.begin(); i != _speakers.end(); ) { - if ((*i).id == id) { + for (vector::iterator i = _speakers.begin(); i != _speakers.end(); ++i) { + if (i->id == id) { i = _speakers.erase (i); update (); break; - } + } } } -- cgit v1.2.3