root/trunk/libffado/src/bebob/terratec/terratec.cpp

Revision 580, 5.4 kB (checked in by ppalmers, 17 years ago)

move vendor specific stuff to vendor directory

Line 
1 /*
2  * Copyright (C) 2005-2007 by Pieter Palmers
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
22  */
23
24 #include "terratec.h"
25
26 #include <netinet/in.h>
27 #include <iostream>
28
29 using namespace std;
30 using namespace AVC;
31
32 namespace BeBoB {
33
34 TerratecVendorDependentCmd::TerratecVendorDependentCmd(Ieee1394Service& ieee1394service)
35     : VendorDependentCmd( ieee1394service )
36     , m_subfunction ( 0x00 )
37 {
38     m_companyId=0x000aac;
39 }
40
41 bool
42 TerratecVendorDependentCmd::serialize( IOSSerialize& se )
43 {
44     bool result=true;
45     result &= VendorDependentCmd::serialize( se );
46     result &= se.write(m_subfunction,"TerratecVendorDependentCmd subfunction");
47
48     return result;
49 }
50
51 bool
52 TerratecVendorDependentCmd::deserialize( IISDeserialize& de )
53 {
54     bool result=true;
55     result &= VendorDependentCmd::deserialize( de );
56     result &= de.read(&m_subfunction);
57
58
59     return result;
60 }
61
62 //---------
63
64 TerratecSyncStateCmd::TerratecSyncStateCmd(Ieee1394Service& ieee1394service)
65     : TerratecVendorDependentCmd( ieee1394service )
66 {
67     m_subfunction=0x21;
68 }
69
70 bool
71 TerratecSyncStateCmd::serialize( IOSSerialize& se )
72 {
73     bool result=true;
74     result &= TerratecVendorDependentCmd::serialize( se );
75     result &= se.write(m_syncstate,"TerratecSyncStateCmd m_syncstate");
76     return result;
77 }
78
79 bool
80 TerratecSyncStateCmd::deserialize( IISDeserialize& de )
81 {
82     bool result=true;
83     result &= TerratecVendorDependentCmd::deserialize( de );
84     result &= de.read(&m_syncstate);
85     return result;
86 }
87
88 //---------
89
90 TerratecStoreMixerSettingsCmd::TerratecStoreMixerSettingsCmd(Ieee1394Service& ieee1394service)
91     : TerratecVendorDependentCmd( ieee1394service )
92 {
93     m_subfunction=0x22;
94 }
95
96 bool
97 TerratecStoreMixerSettingsCmd::serialize( IOSSerialize& se )
98 {
99     return TerratecVendorDependentCmd::serialize( se );;
100 }
101
102 bool
103 TerratecStoreMixerSettingsCmd::deserialize( IISDeserialize& de )
104 {
105     return TerratecVendorDependentCmd::deserialize( de );;
106 }
107
108
109 //---------
110
111 TerratecSetMidiRemoteChannelCmd::TerratecSetMidiRemoteChannelCmd(Ieee1394Service& ieee1394service)
112     : TerratecVendorDependentCmd( ieee1394service )
113 {
114     m_subfunction=0x23;
115 }
116
117 bool
118 TerratecSetMidiRemoteChannelCmd::serialize( IOSSerialize& se )
119 {
120     bool result=true;
121     result &= TerratecVendorDependentCmd::serialize( se );
122     result &= se.write(m_midichannel,"TerratecSetMidiRemoteChannelCmd m_midichannel");
123     return result;
124 }
125
126 bool
127 TerratecSetMidiRemoteChannelCmd::deserialize( IISDeserialize& de )
128 {
129     bool result=true;
130     result &= TerratecVendorDependentCmd::deserialize( de );
131     result &= de.read(&m_midichannel);
132     return result;
133 }
134
135 //---------
136
137 TerratecSetMidiControlCmd::TerratecSetMidiControlCmd(Ieee1394Service& ieee1394service)
138     : TerratecVendorDependentCmd( ieee1394service )
139 {
140     m_subfunction=0x24;
141 }
142
143 bool
144 TerratecSetMidiControlCmd::serialize( IOSSerialize& se )
145 {
146     bool result=true;
147     result &= TerratecVendorDependentCmd::serialize( se );
148     result &= se.write(m_mixercontrol,"TerratecSetMidiControlCmd m_mixercontrol");
149     result &= se.write(m_midicontroller,"TerratecSetMidiControlCmd m_midicontroller");
150     return result;
151 }
152
153 bool
154 TerratecSetMidiControlCmd::deserialize( IISDeserialize& de )
155 {
156     bool result=true;
157     result &= TerratecVendorDependentCmd::deserialize( de );
158     result &= de.read(&m_mixercontrol);
159     result &= de.read(&m_midicontroller);
160     return result;
161 }
162
163 //---------
164
165 TerratecSetDefaultRoutingCmd::TerratecSetDefaultRoutingCmd(Ieee1394Service& ieee1394service)
166     : TerratecVendorDependentCmd( ieee1394service )
167 {
168     m_subfunction=0x25;
169 }
170
171 bool
172 TerratecSetDefaultRoutingCmd::serialize( IOSSerialize& se )
173 {
174     bool result=true;
175     result &= TerratecVendorDependentCmd::serialize( se );
176     result &= se.write(m_output,"TerratecSetDefaultRoutingCmd m_output");
177     result &= se.write(m_source,"TerratecSetDefaultRoutingCmd m_source");
178     return result;
179 }
180
181 bool
182 TerratecSetDefaultRoutingCmd::deserialize( IISDeserialize& de )
183 {
184     bool result=true;
185     result &= TerratecVendorDependentCmd::deserialize( de );
186     result &= de.read(&m_output);
187     result &= de.read(&m_source);
188     return result;
189 }
190
191 //---------
192
193 TerratecDeviceIdCmd::TerratecDeviceIdCmd(Ieee1394Service& ieee1394service)
194     : TerratecVendorDependentCmd( ieee1394service )
195 {
196     m_subfunction=0x26;
197 }
198
199 bool
200 TerratecDeviceIdCmd::serialize( IOSSerialize& se )
201 {
202     bool result=true;
203     result &= TerratecVendorDependentCmd::serialize( se );
204     result &= se.write(m_deviceid,"TerratecDeviceIdCmd m_deviceid");
205     return result;
206 }
207
208 bool
209 TerratecDeviceIdCmd::deserialize( IISDeserialize& de )
210 {
211     bool result=true;
212     result &= TerratecVendorDependentCmd::deserialize( de );
213     result &= de.read(&m_deviceid);
214     return result;
215 }
216
217 }
Note: See TracBrowser for help on using the browser.