root/branches/streaming-rework/src/metrichalo/mh_avdevice.h

Revision 416, 2.5 kB (checked in by pieterpalmers, 16 years ago)

- Introduced a generic option mechanism. AvDevices? now automatically

inherit from OptionContainer? (via IAvDevice) and can specify options
(e.g. at construction). These can then be get/set using the container
functions from the outside.

- Modified the bebob, bounce, motu, mh, rme AvDevices? to make use of the

option system for their Id value and the 'snoopMode' option.

- Made M-Audio avdevice a subclass of the BeBoB avdevice to avoid code

duplication.

- Extended the bounce device

Line 
1 /* mh_avdevice.h
2  * Copyright (C) 2007 by Pieter Palmers
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 MHDEVICE_H
22 #define MHDEVICE_H
23
24 #include "iavdevice.h"
25
26 #include "debugmodule/debugmodule.h"
27 #include "libfreebobavc/avc_definitions.h"
28 #include "libfreebob/xmlparser.h"
29
30 // #include "libstreaming/MHStreamProcessor.h"
31
32 class ConfigRom;
33 class Ieee1394Service;
34
35 namespace MetricHalo {
36
37 // struct to define the supported devices
38 struct VendorModelEntry {
39     unsigned int vendor_id;
40     unsigned int model_id;
41     char *vendor_name;
42     char *model_name;
43 };
44
45 class MHAvDevice : public IAvDevice {
46 public:
47     MHAvDevice( std::auto_ptr<ConfigRom>( configRom ),
48               Ieee1394Service& ieee1394Service,
49                   int nodeId,
50                   int verboseLevel );
51     virtual ~MHAvDevice();
52
53     static bool probe( ConfigRom& configRom );
54     virtual bool discover();
55     virtual ConfigRom& getConfigRom() const;
56
57     // obsolete, will be removed soon, unused
58     virtual bool addXmlDescription( xmlNodePtr deviceNode ) {return true;};
59
60     virtual void showDevice() const;
61
62     virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency );
63     virtual int getSamplingFrequency( );
64
65     virtual bool setId(unsigned int id);
66
67     virtual int getStreamCount();
68     virtual FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i);
69
70     virtual bool prepare();
71     bool lock();
72     bool unlock();
73
74     bool startStreamByIndex(int i);
75     bool stopStreamByIndex(int i);
76
77     signed int getIsoRecvChannel(void);
78     signed int getIsoSendChannel(void);
79  
80 protected:
81     std::auto_ptr<ConfigRom>( m_configRom );
82     Ieee1394Service* m_p1394Service;
83    
84     struct VendorModelEntry *m_model;
85    
86     int              m_nodeId;
87     int              m_verboseLevel;
88
89 private:
90     // debug support
91     DECLARE_DEBUG_MODULE;
92 };
93
94 }
95
96 #endif
Note: See TracBrowser for help on using the browser.