1 |
/* |
---|
2 |
* Copyright (C) 2005-2008 by Daniel Wagner |
---|
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 program is free software: you can redistribute it and/or modify |
---|
10 |
* it under the terms of the GNU General Public License as published by |
---|
11 |
* the Free Software Foundation, either version 2 of the License, or |
---|
12 |
* (at your option) version 3 of the License. |
---|
13 |
* |
---|
14 |
* This program is distributed in the hope that it will be useful, |
---|
15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 |
* GNU General Public License for more details. |
---|
18 |
* |
---|
19 |
* You should have received a copy of the GNU General Public License |
---|
20 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
21 |
* |
---|
22 |
*/ |
---|
23 |
|
---|
24 |
#ifndef AVCSUBUNITINFO_H |
---|
25 |
#define AVCSUBUNITINFO_H |
---|
26 |
|
---|
27 |
#include "avc_generic.h" |
---|
28 |
|
---|
29 |
#include <libavc1394/avc1394.h> |
---|
30 |
|
---|
31 |
|
---|
32 |
namespace AVC { |
---|
33 |
|
---|
34 |
// No extended subunit queries supported |
---|
35 |
|
---|
36 |
class SubUnitInfoCmd: public AVCCommand |
---|
37 |
{ |
---|
38 |
public: |
---|
39 |
SubUnitInfoCmd( Ieee1394Service& ieee1349service ); |
---|
40 |
virtual ~SubUnitInfoCmd(); |
---|
41 |
|
---|
42 |
virtual bool serialize( Util::Cmd::IOSSerialize& se ); |
---|
43 |
virtual bool deserialize( Util::Cmd::IISDeserialize& de ); |
---|
44 |
|
---|
45 |
virtual const char* getCmdName() const |
---|
46 |
{ return "SubUnitInfoCmd"; } |
---|
47 |
|
---|
48 |
bool clear(); |
---|
49 |
|
---|
50 |
page_t m_page; |
---|
51 |
extension_code_t m_extension_code; |
---|
52 |
|
---|
53 |
|
---|
54 |
|
---|
55 |
enum { |
---|
56 |
eMaxSubunitsPerPage = 4, |
---|
57 |
eMaxSubunitsPerUnit = 32, |
---|
58 |
}; |
---|
59 |
|
---|
60 |
struct TableEntry { |
---|
61 |
subunit_type_t m_subunit_type; |
---|
62 |
max_subunit_id_t m_max_subunit_id; |
---|
63 |
}; |
---|
64 |
|
---|
65 |
struct TableEntry m_table[eMaxSubunitsPerPage]; |
---|
66 |
|
---|
67 |
short getMaxNoOfPages() |
---|
68 |
{ return eMaxSubunitsPerUnit / eMaxSubunitsPerPage; } |
---|
69 |
|
---|
70 |
|
---|
71 |
short m_nrOfValidEntries; |
---|
72 |
short getNrOfValidEntries() |
---|
73 |
{ return m_nrOfValidEntries; } |
---|
74 |
|
---|
75 |
}; |
---|
76 |
|
---|
77 |
} |
---|
78 |
|
---|
79 |
#endif // AVCSUBUNITINFO_H |
---|