root/branches/streaming-rework/src/devicemanager.h

Revision 436, 2.3 kB (checked in by pieterpalmers, 14 years ago)

- fixed verbose level setting
- debugged DICE code, works with EVM

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* devicemanager.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 FREEBOBDEVICEMANAGER_H
22 #define FREEBOBDEVICEMANAGER_H
23
24 #include "debugmodule/debugmodule.h"
25
26 #include "libieee1394/configrom.h"
27 #include "libieee1394/ieee1394service.h"
28
29 #include "libutil/OptionContainer.h"
30 #include "libosc/OscServer.h"
31 #include "libosc/OscNode.h"
32
33 #include <glibmm/ustring.h>
34
35 #include <vector>
36
37 class Ieee1394Service;
38 class IAvDevice;
39 namespace Streaming {
40     class StreamProcessor;
41 }
42
43 typedef std::vector< IAvDevice* > IAvDeviceVector;
44 typedef std::vector< IAvDevice* >::iterator IAvDeviceVectorIterator;
45
46 class DeviceManager
47     : public Util::OptionContainer,
48       public OSC::OscNode
49 {
50 public:
51     DeviceManager();
52     ~DeviceManager();
53
54     bool initialize( int port );
55     bool deinitialize();
56
57     bool discover( );
58
59     bool isValidNode( int node );
60     int getNbDevices();
61     int getDeviceNodeId( int deviceNr );
62
63     IAvDevice* getAvDevice( int nodeId );
64     IAvDevice* getAvDeviceByIndex( int idx );
65     unsigned int getAvDeviceCount();
66
67     bool saveCache( Glib::ustring fileName );
68     bool loadCache( Glib::ustring fileName );
69
70     Streaming::StreamProcessor *getSyncSource();
71
72 protected:
73     IAvDevice* getDriverForDevice( std::auto_ptr<ConfigRom>( configRom ),
74                                    int id );
75     IAvDevice* getSlaveDriver( std::auto_ptr<ConfigRom>( configRom ) );
76
77 protected:
78     Ieee1394Service* m_1394Service;
79     IAvDeviceVector  m_avDevices;
80    
81     OSC::OscServer*  m_oscServer;
82    
83 // debug stuff
84 public:
85     void setVerboseLevel(int l);
86 private:
87     int m_verboseLevel;
88     DECLARE_DEBUG_MODULE;
89 };
90
91 #endif
Note: See TracBrowser for help on using the browser.