merge with master and fix 4 conflicts by hand
[ardour.git] / libs / backends / wavesaudio / waves_audiobackend.latency.cc
1 /*
2     Copyright (C) 2013 Valeriy Kamyshniy
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
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #include "waves_dataport.h"
21 #include "waves_audiobackend.h"
22
23 using namespace ARDOUR;
24
25
26 int 
27 WavesAudioBackend::set_systemic_input_latency (uint32_t systemic_input_latency)
28 {
29     // COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_systemic_input_latency (): " << systemic_input_latency << std::endl;
30
31     _systemic_input_latency = systemic_input_latency;
32     return 0;
33 }
34
35
36 int 
37 WavesAudioBackend::set_systemic_output_latency (uint32_t systemic_output_latency)
38 {
39     // COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_systemic_output_latency (): " << systemic_output_latency << std::endl;
40
41     _systemic_output_latency = systemic_output_latency;
42     return 0;
43 }
44
45 uint32_t     
46 WavesAudioBackend::systemic_input_latency () const
47 {
48     // COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::systemic_input_latency ()" << std::endl;
49
50     return _systemic_input_latency;
51 }
52
53
54 uint32_t     
55 WavesAudioBackend::systemic_output_latency () const
56 {
57     // COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::systemic_output_latency ()" << std::endl;
58
59     return _systemic_output_latency;
60 }
61
62
63 void
64 WavesAudioBackend::update_latencies ()
65 {
66     // COMMENTED DBG LOGS */ std::cout << "update_latencies:" << std::endl;
67 }
68
69
70 void
71 WavesAudioBackend::set_latency_range (PortHandle port_handle, bool for_playback, LatencyRange latency_range)
72 {
73     if (!_registered (port_handle)) {
74         std::cerr << "WavesAudioBackend::set_latency_range (): Failed to find port [" << std::hex << port_handle << std::dec << "]!" << std::endl;
75         return;
76     }
77     ((WavesDataPort*)port_handle)->set_latency_range (latency_range, for_playback);
78 }
79
80
81 LatencyRange
82 WavesAudioBackend::get_latency_range (PortHandle port_handle, bool for_playback)
83 {
84     if (!_registered (port_handle)) {
85         std::cerr << "WavesAudioBackend::get_latency_range (): Failed to find port [" << std::hex << port_handle << std::dec << "]!" << std::endl;
86         LatencyRange lr = {0,0};
87         return lr;
88     }   
89     return ((WavesDataPort*)port_handle)->latency_range (for_playback);
90 }