root/trunk/libfreebob/src/bebob_light/bebob_light_avplug.h

Revision 241, 3.9 kB (checked in by pieterpalmers, 16 years ago)

* configure.ac: Version bump to 1.0.0

* Changed all FreeBob? to FreeBoB
* Removed all .cvsignore
* Added Pieter to AUTHORS
* Updated NEWS and README (release canditate date added)

by Daniel Wagner

Line 
1 /* bebob_light_avplug.h
2  * Copyright (C) 2006 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 BEBOB_LIGHT_AVPLUG_H
22 #define BEBOB_LIGHT_AVPLUG_H
23
24 #include "debugmodule/debugmodule.h"
25 #include "libfreebobavc/avc_definitions.h"
26
27 #include <vector>
28
29 class ExtendedPlugInfoPlugChannelPositionSpecificData;
30
31 namespace BeBoB_Light {
32
33 class AvPlugCluster;
34
35 class AvPlug {
36 public:
37     AvPlug();
38     AvPlug( const AvPlug& rhs );
39     virtual ~AvPlug();
40
41     plug_type_t    getPlugType()
42         { return m_plugType; }
43     plug_id_t      getPlugId()
44         { return m_plugId; }
45     subunit_type_t getSubunitType()
46         { return m_subunitType; }
47     subunit_id_t   getSubunitId()
48         { return m_subunitId; }
49     const char*    getName()
50         { return m_name.c_str(); }
51     plug_direction_t getPlugDirection()
52         { return m_direction; }
53     sampling_frequency_t getSamplingFrequency()
54         { return m_samplingFrequency; }
55     int getSampleRate(); // 22050, 24000, 32000, ...
56     int getNrOfChannels();
57     int getNrOfStreams();
58
59     plug_type_t          m_plugType;
60     plug_id_t            m_plugId;
61     subunit_type_t       m_subunitType;
62     subunit_id_t         m_subunitId;
63     plug_direction_t     m_direction;
64     std::string          m_name;
65     nr_of_channels_t     m_nrOfChannels;
66     sampling_frequency_t m_samplingFrequency;
67
68
69     // ---
70     // Channel & Cluster Info
71     struct ChannelInfo {
72         stream_position_t          m_streamPosition;
73         stream_position_location_t m_location;
74         std::string                m_name;
75     };
76     typedef std::vector<ChannelInfo> ChannelInfoVector;
77
78     struct ClusterInfo {
79         int                      m_index;
80         port_type_t              m_portType;
81         std::string              m_name;
82
83         nr_of_channels_t         m_nrOfChannels;
84         ChannelInfoVector        m_channelInfos;
85         stream_format_t          m_streamFormat;
86     };
87     typedef std::vector<ClusterInfo> ClusterInfoVector;
88
89     ClusterInfoVector        m_clusterInfos;
90
91     // ---
92     // Stream Format
93     struct FormatInfo {
94         FormatInfo()
95             : m_samplingFrequency( eSF_DontCare )
96             , m_isSyncStream( false )
97             , m_audioChannels( 0 )
98             , m_midiChannels( 0 )
99             , m_index( 0xff )
100             {}
101         sampling_frequency_t  m_samplingFrequency;
102         bool                  m_isSyncStream;
103         number_of_channels_t  m_audioChannels;
104         number_of_channels_t  m_midiChannels;
105         byte_t                m_index;
106     };
107     typedef std::vector<FormatInfo> FormatInfoVector;
108
109     FormatInfoVector         m_formatInfos;
110     // ---
111
112     void debugOutputClusterInfos( int debugLevel );
113
114     bool copyClusterInfo(ExtendedPlugInfoPlugChannelPositionSpecificData&
115                          channelPositionData );
116
117     ClusterInfo* getClusterInfoByIndex(int index);
118     ClusterInfoVector& getClusterInfos()
119         { return m_clusterInfos; }
120
121
122     DECLARE_DEBUG_MODULE;
123 };
124
125 typedef std::vector<AvPlug*> AvPlugVector;
126
127 class AvPlugCluster {
128 public:
129     AvPlugCluster();
130     virtual ~AvPlugCluster();
131
132     std::string  m_name;
133
134     AvPlugVector m_avPlugs;
135 };
136
137 class AvPlugConnection {
138 public:
139     AvPlugConnection();
140     ~AvPlugConnection();
141
142     AvPlug* m_srcPlug;
143     AvPlug* m_destPlug;
144 };
145
146 typedef std::vector<AvPlugConnection*> AvPlugConnectionVector;
147
148 }
149
150 #endif
Note: See TracBrowser for help on using the browser.