root/trunk/libfreebob/src/avplug.h

Revision 151, 3.8 kB (checked in by wagi, 18 years ago)

2006-01-08 Daniel Wagner <wagi@monom.org>

  • src/avdevice.cpp (getModelName):
    Return model name and not vendor name.
    (getVendorName):
    Return vendor name and not model name.
    (discoverStep10Plug): Implementation added.
    (enumerateSubUnits): max_subunit_id removed.
    (addXmlDescription): Add stream format infos.
  • src/avdevice.h: discoverStep10 added.
    Renaming of addPlugToXmlDescription to addXmlDescriptionPlug.
    ESampleRate to ESamplingFrequency changes.
  • src/avplug.cpp (getSampleRate):
    Use convertESamplingFrequency instead of
    local implementation.
  • src/avplug.h:
    ESampleRate to ESamplingFrequency changes.
    Added FormatInfo? struct.
  • src/devicemanager.cpp (getXmlDescription):
    Print GUID correctly.
  • src/freebob.cpp (parseSampleRate):
    Moved to avc_definitions.cpp
  • src/libfreebobavc/avc_definitions.h
    src/libfreebobavc/avc_definitions.cpp:
    Renamed ESampleRate back to ESamlingFrequency.
    Added connvert functions for ESamplingFrequency.
  • configure.ac: New micro version.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* avplug.h
2  * Copyright (C) 2005 by Daniel Wagner
3  *
4  * This file is part of FreeBob.
5  *
6  * FreeBob is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * FreeBob is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with FreeBob; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18  * MA 02111-1307 USA.
19  */
20
21 #ifndef AVPLUG_H
22 #define AVPLUG_H
23
24 #include "debugmodule/debugmodule.h"
25 #include "libfreebobavc/avc_definitions.h"
26
27 #include <vector>
28
29 class AvPlugCluster;
30 class ExtendedPlugInfoPlugChannelPositionSpecificData;
31
32 class AvPlug {
33 public:
34     AvPlug();
35     AvPlug( const AvPlug& rhs );
36     virtual ~AvPlug();
37
38     plug_type_t    getPlugType()
39         { return m_plugType; }
40     plug_id_t      getPlugId()
41         { return m_plugId; }
42     subunit_type_t getSubunitType()
43         { return m_subunitType; }
44     subunit_id_t   getSubunitId()
45         { return m_subunitId; }
46     const char*    getName()
47         { return m_name.c_str(); }
48     plug_direction_t getPlugDirection()
49         { return m_direction; }
50     sampling_frequency_t getSamplingFrequency()
51         { return m_samplingFrequency; }
52     int getSampleRate(); // 22050, 24000, 32000, ...
53     int getNrOfChannels();
54     int getNrOfStreams();
55
56     plug_type_t          m_plugType;
57     plug_id_t            m_plugId;
58     subunit_type_t       m_subunitType;
59     subunit_id_t         m_subunitId;
60     plug_direction_t     m_direction;
61     std::string          m_name;
62     nr_of_channels_t     m_nrOfChannels;
63     sampling_frequency_t m_samplingFrequency;
64
65
66     // ---
67     // Channel & Cluster Info
68     struct ChannelInfo {
69         stream_position_t          m_streamPosition;
70         stream_position_location_t m_location;
71         std::string                m_name;
72     };
73     typedef std::vector<ChannelInfo> ChannelInfoVector;
74
75     struct ClusterInfo {
76         int                      m_index;
77         port_type_t              m_portType;
78         std::string              m_name;
79
80         nr_of_channels_t         m_nrOfChannels;
81         ChannelInfoVector        m_channelInfos;
82         stream_format_t          m_streamFormat;
83     };
84     typedef std::vector<ClusterInfo> ClusterInfoVector;
85
86     ClusterInfoVector        m_clusterInfos;
87
88     // ---
89     // Stream Format
90     struct FormatInfo {
91         FormatInfo()
92             : m_samplingFrequency( eSF_DontCare )
93             , m_isSyncStream( false )
94             , m_audioChannels( 0 )
95             , m_midiChannels( 0 )
96             , m_index( 0xff )
97             {}
98         sampling_frequency_t  m_samplingFrequency;
99         bool                  m_isSyncStream;
100         number_of_channels_t  m_audioChannels;
101         number_of_channels_t  m_midiChannels;
102         byte_t                m_index;
103     };
104     typedef std::vector<FormatInfo> FormatInfoVector;
105
106     FormatInfoVector         m_formatInfos;
107     // ---
108
109     void debugOutputClusterInfos( int debugLevel );
110
111     bool copyClusterInfo(ExtendedPlugInfoPlugChannelPositionSpecificData&
112                          channelPositionData );
113
114     ClusterInfo* getClusterInfoByIndex(int index);
115     ClusterInfoVector& getClusterInfos()
116         { return m_clusterInfos; }
117
118
119     DECLARE_DEBUG_MODULE;
120 };
121
122 typedef std::vector<AvPlug*> AvPlugVector;
123
124 class AvPlugCluster {
125 public:
126     AvPlugCluster();
127     virtual ~AvPlugCluster();
128
129     std::string  m_name;
130
131     AvPlugVector m_avPlugs;
132 };
133
134 class AvPlugConnection {
135 public:
136     AvPlugConnection();
137     ~AvPlugConnection();
138
139     AvPlug* m_srcPlug;
140     AvPlug* m_destPlug;
141 };
142
143 typedef std::vector<AvPlugConnection*> AvPlugConnectionVector;
144
145 #endif
Note: See TracBrowser for help on using the browser.