NO-OP: whitespace and comments
[ardour.git] / libs / ardour / latent.cc
1 /*
2  * Copyright (C) 2019 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (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 along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 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 PBD::Signal0<void> Latent::DisableSwitchChanged;
27
28 Latent::Latent ()
29         : HasLatency ()
30         , _use_user_latency (false)
31         , _user_latency (0)
32 {}
33
34 Latent::Latent (Latent const& other)
35         : HasLatency ()
36         , _use_user_latency (other._use_user_latency)
37         , _user_latency (other._user_latency)
38 {}
39
40
41 int
42 Latent::set_state (const XMLNode& node, int version)
43 {
44         node.get_property ("user-latency", _user_latency);
45         if (!node.get_property ("use-user-latency", _use_user_latency)) {
46                 _use_user_latency = _user_latency > 0;
47         }
48         return 0;
49 }
50
51 void
52 Latent::add_state (XMLNode* node) const
53 {
54         node->set_property ("user-latency", _user_latency);
55         node->set_property ("use-user-latency", _use_user_latency);
56 }