NO-OP: whitespace
[ardour.git] / libs / ardour / latent.cc
1 /*
2  * Copyright (C) 2018 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
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.
13  *
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18
19 #include "pbd/xml++.h"
20
21 #include "ardour/latent.h"
22
23 using namespace ARDOUR;
24
25 bool ARDOUR::Latent::_zero_latency = false;
26
27 Latent::Latent ()
28         : HasLatency ()
29         , _use_user_latency (false)
30         , _user_latency (0)
31 {}
32
33 Latent::Latent (Latent const& other)
34         : HasLatency ()
35         , _use_user_latency (other._use_user_latency)
36         , _user_latency (other._user_latency)
37 {}
38
39
40 int
41 Latent::set_state (const XMLNode& node, int version)
42 {
43         node.get_property ("user-latency", _user_latency);
44         if (!node.get_property ("use-user-latency", _use_user_latency)) {
45                 _use_user_latency = _user_latency > 0;
46         }
47         return 0;
48 }
49
50 void
51 Latent::add_state (XMLNode* node) const
52 {
53         node->set_property ("user-latency", _user_latency);
54         node->set_property ("use-user-latency", _use_user_latency);
55 }