Revert "update wavesaudio backend, now supports Windows (ASIO) as well as OS X (CoreA...
[ardour.git] / libs / backends / wavesaudio / waves_audiobackend.latency.cc
1 /*\r
2     Copyright (C) 2014 Waves Audio Ltd.\r
3 \r
4     This program is free software; you can redistribute it and/or modify\r
5     it under the terms of the GNU General Public License as published by\r
6     the Free Software Foundation; either version 2 of the License, or\r
7     (at your option) any later version.\r
8 \r
9     This program is distributed in the hope that it will be useful,\r
10     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12     GNU General Public License for more details.\r
13 \r
14     You should have received a copy of the GNU General Public License\r
15     along with this program; if not, write to the Free Software\r
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
17 \r
18 */\r
19 \r
20 #include "waves_dataport.h"\r
21 #include "waves_audiobackend.h"\r
22 \r
23 using namespace ARDOUR;\r
24 \r
25 \r
26 int \r
27 WavesAudioBackend::set_systemic_input_latency (uint32_t systemic_input_latency)\r
28 {\r
29     // COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_systemic_input_latency (): " << systemic_input_latency << std::endl;\r
30 \r
31     _systemic_input_latency = systemic_input_latency;\r
32     return 0;\r
33 }\r
34 \r
35 \r
36 int \r
37 WavesAudioBackend::set_systemic_output_latency (uint32_t systemic_output_latency)\r
38 {\r
39     // COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_systemic_output_latency (): " << systemic_output_latency << std::endl;\r
40 \r
41     _systemic_output_latency = systemic_output_latency;\r
42     return 0;\r
43 }\r
44 \r
45 uint32_t     \r
46 WavesAudioBackend::systemic_input_latency () const\r
47 {\r
48     // COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::systemic_input_latency ()" << std::endl;\r
49 \r
50     return _systemic_input_latency;\r
51 }\r
52 \r
53 \r
54 uint32_t     \r
55 WavesAudioBackend::systemic_output_latency () const\r
56 {\r
57     // COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::systemic_output_latency ()" << std::endl;\r
58 \r
59     return _systemic_output_latency;\r
60 }\r
61 \r
62 \r
63 void\r
64 WavesAudioBackend::update_latencies ()\r
65 {\r
66     // COMMENTED DBG LOGS */ std::cout << "update_latencies:" << std::endl;\r
67 }\r
68 \r
69 \r
70 void\r
71 WavesAudioBackend::set_latency_range (PortHandle port_handle, bool for_playback, LatencyRange latency_range)\r
72 {\r
73     if (!_registered (port_handle)) {\r
74         std::cerr << "WavesAudioBackend::set_latency_range (): Failed to find port [" << std::hex << port_handle << std::dec << "]!" << std::endl;\r
75         return;\r
76     }\r
77     ((WavesDataPort*)port_handle)->set_latency_range (latency_range, for_playback);\r
78 }\r
79 \r
80 \r
81 LatencyRange\r
82 WavesAudioBackend::get_latency_range (PortHandle port_handle, bool for_playback)\r
83 {\r
84     if (!_registered (port_handle)) {\r
85         std::cerr << "WavesAudioBackend::get_latency_range (): Failed to find port [" << std::hex << port_handle << std::dec << "]!" << std::endl;\r
86         LatencyRange lr = {0,0};\r
87         return lr;\r
88     }   \r
89     return ((WavesDataPort*)port_handle)->latency_range (for_playback);\r
90 }\r