root/trunk/libfreebob/src/avdevice.h

Revision 183, 3.5 kB (checked in by wagi, 18 years ago)

2006-03-30 Daniel Wagner <wagi@monom.org>

  • configure.ac: Version bump to 0.6.0
  • src/*: Verbose bool turned int verbose level.
  • src/libfreebobavc/*: Moved fire implementation to
    base class (AVCCommand).
  • libfreebob/freebob.h: freebob_sleep_after_avc_command
    workaround added.
  • tests/test-freebob.c: Verbose bool turned into verbose level.
    Workaround: sleep after avc command added.
  • tests/streaming/Makefile.am (*_SOURCES): Added libavc1394 to LDADD.
  • tests/Makefile.am (*_SOURCES): Likewise.
  • tests/streaming/teststreaming2.c (fid_in): compiler warning fixed.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* avdevice.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 AVDEVICE_H
22 #define AVDEVICE_H
23
24 #include "debugmodule/debugmodule.h"
25 #include "libfreebobavc/avc_definitions.h"
26 #include "libfreebobavc/avc_extended_cmd_generic.h"
27 #include "libfreebob/xmlparser.h"
28
29 #include "avplug.h"
30 #include "avdevicesubunit.h"
31
32 class ConfigRom;
33 class Ieee1394Service;
34 class SubunitPlugSpecificDataPlugAddress;
35
36 class AvDevice {
37 public:
38     // takes ownership of config rom
39     AvDevice( Ieee1394Service* ieee1394Service,
40               ConfigRom* configRom,
41               int nodeId,
42               int verboseLevel );
43     virtual ~AvDevice();
44
45     bool discover();
46
47     std::string getVendorName();
48     std::string getModelName();
49
50     uint64_t getGuid();
51
52     bool addXmlDescription( xmlNodePtr deviceNode );
53     int getNodeId()
54         { return m_nodeId; }
55
56     bool setSamplingFrequency( ESamplingFrequency samplingFrequency );
57
58     Ieee1394Service* get1394Service()
59         { return m_1394Service; }
60
61     AvPlugManager& getPlugManager()
62         { return m_plugManager; }
63
64     void showDevice();
65
66 protected:
67     bool enumerateSubUnits();
68
69     bool discoverPlugs();
70     bool discoverPlugsPCR( AvPlug::EAvPlugDirection plugDirection,
71                            plug_id_t plugMaxId );
72     bool discoverPlugsExternal( AvPlug::EAvPlugDirection plugDirection,
73                                 plug_id_t plugMaxId );
74     bool discoverPlugConnections();
75     bool discoverSyncModes();
76     bool discoverSubUnitsPlugConnections();
77
78     AvDeviceSubunit* getSubunit( subunit_type_t subunitType,
79                                  subunit_id_t subunitId ) const;
80
81     unsigned int getNrOfSubunits( subunit_type_t subunitType ) const;
82     AvPlugConnection* getPlugConnection( AvPlug& srcPlug ) const;
83
84     AvPlug* getSyncPlug( int maxPlugId, AvPlug::EAvPlugDirection );
85
86     AvPlug* getPlugById( AvPlugVector& plugs,
87                          AvPlug::EAvPlugDirection plugDireciton,
88                          int id );
89     AvPlugVector getPlugsByType( AvPlugVector& plugs,
90                                  AvPlug::EAvPlugDirection plugDirection,
91                                  AvPlug::EAvPlugType type);
92
93     bool setSamplingFrequencyPlug( AvPlug& plug,
94                                    AvPlug::EAvPlugDirection direction,
95                                    ESamplingFrequency samplingFrequency );
96
97     void showAvPlugs( AvPlugVector& plugs ) const;
98
99     bool checkSyncConnections( AvPlugVector& plhs, AvPlugVector& prhs );
100 protected:
101     Ieee1394Service* m_1394Service;
102     ConfigRom*       m_configRom;
103     int              m_nodeId;
104     int              m_verboseLevel;
105
106     AvPlugVector     m_pcrPlugs;
107     AvPlugVector     m_externalPlugs;
108
109     AvPlugConnectionVector m_plugConnections;
110
111     AvDeviceSubunitVector  m_subunits;
112
113     AvPlugManager    m_plugManager;
114
115     DECLARE_DEBUG_MODULE;
116 };
117
118 #endif
Note: See TracBrowser for help on using the browser.