root/branches/libfreebob-downloader/src/bebob/bebob_avdevice.h

Revision 276, 3.6 kB (checked in by wagi, 16 years ago)

2006-06-27 Daniel Wagner <wagi@monom.org>

  • configure.ac: Version bump to 1.1.0
  • remove bebob_light code
  • downloader various improvements
  • ConfigRom::isAvcDevice() removed. Device probe code added.
    Each device driver class can check if it supports a device.
Line 
1 /* bebob_avdevice.h
2  * Copyright (C) 2005,06 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_AVDEVICE_H
22 #define BEBOB_AVDEVICE_H
23
24 #include <stdint.h>
25
26 #include "debugmodule/debugmodule.h"
27 #include "libfreebobavc/avc_definitions.h"
28 #include "libfreebobavc/avc_extended_cmd_generic.h"
29 #include "libfreebob/xmlparser.h"
30
31 #include "bebob/bebob_avplug.h"
32 #include "bebob/bebob_avdevice_subunit.h"
33
34 #include "iavdevice.h"
35
36 class ConfigRom;
37 class Ieee1394Service;
38 class SubunitPlugSpecificDataPlugAddress;
39
40 namespace BeBoB {
41
42 class AvDevice : public IAvDevice {
43 public:
44     AvDevice( std::auto_ptr<ConfigRom>( configRom ),
45               Ieee1394Service& ieee1394Service,
46               int nodeId,
47               int verboseLevel );
48     virtual ~AvDevice();
49
50     static bool probe( ConfigRom& configRom );
51     virtual bool discover();
52     virtual ConfigRom& getConfigRom() const;
53     virtual bool addXmlDescription( xmlNodePtr deviceNode );
54     virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency );
55     virtual void showDevice() const;
56     virtual bool setId(unsigned int id);
57
58     Ieee1394Service* get1394Service()
59         { return m_1394Service; }
60
61     AvPlugManager& getPlugManager()
62         { return m_plugManager; }
63
64 protected:
65     bool enumerateSubUnits();
66
67     bool discoverPlugs();
68     bool discoverPlugsPCR( AvPlug::EAvPlugDirection plugDirection,
69                            plug_id_t plugMaxId );
70     bool discoverPlugsExternal( AvPlug::EAvPlugDirection plugDirection,
71                                 plug_id_t plugMaxId );
72     bool discoverPlugConnections();
73     bool discoverSyncModes();
74     bool discoverSubUnitsPlugConnections();
75
76     AvDeviceSubunit* getSubunit( subunit_type_t subunitType,
77                                  subunit_id_t subunitId ) const;
78
79     unsigned int getNrOfSubunits( subunit_type_t subunitType ) const;
80     AvPlugConnection* getPlugConnection( AvPlug& srcPlug ) const;
81
82     AvPlug* getSyncPlug( int maxPlugId, AvPlug::EAvPlugDirection );
83
84     AvPlug* getPlugById( AvPlugVector& plugs,
85                          AvPlug::EAvPlugDirection plugDireciton,
86                          int id );
87     AvPlugVector getPlugsByType( AvPlugVector& plugs,
88                                  AvPlug::EAvPlugDirection plugDirection,
89                                  AvPlug::EAvPlugType type);
90
91     bool setSamplingFrequencyPlug( AvPlug& plug,
92                                    AvPlug::EAvPlugDirection direction,
93                                    ESamplingFrequency samplingFrequency );
94
95     void showAvPlugs( AvPlugVector& plugs ) const;
96
97     bool checkSyncConnections( AvPlugVector& plhs, AvPlugVector& prhs );
98 protected:
99     std::auto_ptr<ConfigRom>( m_configRom );
100     Ieee1394Service* m_1394Service;
101     int              m_nodeId;
102     int              m_verboseLevel;
103
104     AvPlugVector     m_pcrPlugs;
105     AvPlugVector     m_externalPlugs;
106
107     AvPlugConnectionVector m_plugConnections;
108
109     AvDeviceSubunitVector  m_subunits;
110
111     AvPlugManager    m_plugManager;
112
113     DECLARE_DEBUG_MODULE;
114 };
115
116 }
117
118 #endif
Note: See TracBrowser for help on using the browser.