root/trunk/freebob/src/avdevicepool.h

Revision 42, 1.7 kB (checked in by wagi, 19 years ago)

Register/unregister AvDevice? in AvDevicePool? when detected/disappeared.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* avdevicepool.h
2  * Copyright (C) 2004 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 #ifndef AVDEVICEPOOL_H
21 #define AVDEVICEPOOL_H
22
23 #include "freebob.h"
24 #include <vector>
25 #include <libraw1394/raw1394.h> // octlet_t
26
27 class AvDevice;
28
29 class AvDevicePool {
30  public:
31     static AvDevicePool* instance();
32
33     FBReturnCodes registerAvDevice( AvDevice* pAvDevice );
34     FBReturnCodes unregisterAvDevice( AvDevice* pAvDevice );
35
36     AvDevice* getAvDevice( octlet_t oGuid );
37
38     /**
39      * Remove devices in pool which where (physically) removed
40      * from the bus.
41      *
42      * All devices which have a lower generation count smaller
43      * than iGeneration are removed from the pool
44      *
45      * @param iGeneration Current generation count.
46      * @return see FBReturnCodes.
47      */
48     FBReturnCodes removeObsoleteDevices( unsigned int iGeneration );
49  private:
50     AvDevicePool();
51     ~AvDevicePool();
52
53     static AvDevicePool* m_pInstance;
54
55     typedef std::vector< AvDevice* > AvDeviceVector;
56     AvDeviceVector m_avDevices;
57 };
58
59 #endif
Note: See TracBrowser for help on using the browser.