root/trunk/libffado/src/libavc/general/avc_subunit_info.h

Revision 1498, 1.9 kB (checked in by ppalmers, 12 years ago)

Merge all changes from 2.0 branch into trunk (since r1361). This _should_ contain all forward merges done in the mean time. At this moment in time both branches should be in sync.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
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 #define AVC1394_CMD_SUBUNIT_INFO 0x31
30
31 namespace AVC {
32
33 // No extended subunit queries supported
34
35 class SubUnitInfoCmd: public AVCCommand
36 {
37 public:
38     SubUnitInfoCmd( Ieee1394Service& ieee1349service );
39     virtual ~SubUnitInfoCmd();
40
41     virtual bool serialize( Util::Cmd::IOSSerialize& se );
42     virtual bool deserialize( Util::Cmd::IISDeserialize& de );
43
44     virtual const char* getCmdName() const
45     { return "SubUnitInfoCmd"; }
46
47     bool clear();
48
49     page_t           m_page;
50     extension_code_t m_extension_code;
51
52
53
54     enum {
55     eMaxSubunitsPerPage = 4,
56     eMaxSubunitsPerUnit = 32,
57     };
58
59     struct TableEntry {
60     subunit_type_t   m_subunit_type;
61     max_subunit_id_t m_max_subunit_id;
62     };
63
64     struct TableEntry m_table[eMaxSubunitsPerPage];
65
66     short getMaxNoOfPages()
67     { return eMaxSubunitsPerUnit / eMaxSubunitsPerPage; }
68
69
70     short            m_nrOfValidEntries;
71     short getNrOfValidEntries()
72     { return m_nrOfValidEntries; }
73
74 };
75
76 }
77
78 #endif // AVCSUBUNITINFO_H
Note: See TracBrowser for help on using the browser.