root/branches/streaming-rework/src/rme/rme_avdevice.h

Revision 404, 3.2 kB (checked in by pieterpalmers, 16 years ago)

- introduce support framework for DICE and Metric Halo
- change probe/discovery code to make adding devices easier
- made conditional compilation effectively work.

./configure now has the following switches:

--enable-bebob build BeBoB support (default=yes)
--enable-motu build Motu support (default=no)
--enable-dice build DICE support (default=no)
--enable-metric-halo build Metric Halo support (note: completely useless)

(default=no)

--enable-rme build RME support (note: completely useless)

(default=no)

--enable-bounce build Bounce device support (default=no)
--enable-all-devices build support for all supported devices (default=no)

these now turn on/off compilation effectively.

Line 
1 /* rme_avdevice.h
2  * Copyright (C) 2006 Jonathan Woithe
3  * Copyright (C) 2006,2007 by Pieter Palmers
4  *
5  * This file is part of FreeBob.
6  *
7  * FreeBob is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  * FreeBob is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with FreeBob; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19  * MA 02111-1307 USA.
20  */
21
22 #ifdef ENABLE_RME
23
24 #ifndef RMEDEVICE_H
25 #define RMEDEVICE_H
26
27 #include "iavdevice.h"
28
29 #include "debugmodule/debugmodule.h"
30 #include "libfreebobavc/avc_definitions.h"
31 #include "libfreebob/xmlparser.h"
32
33 // #include "libstreaming/RmeStreamProcessor.h"
34
35 class ConfigRom;
36 class Ieee1394Service;
37
38 namespace Rme {
39
40 // struct to define the supported devices
41 struct VendorModelEntry {
42     unsigned int vendor_id;
43     unsigned int model_id;
44     char *vendor_name;
45     char *model_name;
46 };
47
48 class RmeDevice : public IAvDevice {
49 public:
50
51     RmeDevice( std::auto_ptr<ConfigRom>( configRom ),
52               Ieee1394Service& ieee1394Service,
53                   int nodeId,
54                   int verboseLevel );
55     virtual ~RmeDevice();
56
57     static bool probe( ConfigRom& configRom );
58     virtual bool discover();
59     virtual ConfigRom& getConfigRom() const;
60
61     // obsolete, will be removed soon, unused
62     virtual bool addXmlDescription( xmlNodePtr deviceNode ) {return true;};
63
64     virtual void showDevice() const;
65
66     virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency );
67     virtual int getSamplingFrequency( );
68
69     virtual bool setId(unsigned int id);
70
71     virtual int getStreamCount();
72     virtual FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i);
73
74     virtual bool prepare();
75
76     virtual int startStreamByIndex(int i);
77     virtual int stopStreamByIndex(int i);
78
79     signed int getIsoRecvChannel(void);
80     signed int getIsoSendChannel(void);
81
82     signed int getEventSize(unsigned int dir);
83  
84 protected:
85     std::auto_ptr<ConfigRom>( m_configRom );
86     Ieee1394Service* m_1394Service;
87    
88     struct VendorModelEntry *m_model;
89    
90     int              m_nodeId;
91     int              m_verboseLevel;
92     signed int m_id;
93     signed int m_iso_recv_channel, m_iso_send_channel;
94     signed int m_bandwidth;
95    
96 //      FreebobStreaming::RmeReceiveStreamProcessor *m_receiveProcessor;
97 //      FreebobStreaming::RmeTransmitStreamProcessor *m_transmitProcessor;
98
99 private:
100 //      bool addPort(FreebobStreaming::StreamProcessor *s_processor,
101 //              char *name,
102 //              enum FreebobStreaming::Port::E_Direction direction,
103 //              int position, int size);
104 //      bool addDirPorts(
105 //              enum FreebobStreaming::Port::E_Direction direction,
106 //              unsigned int sample_rate, unsigned int optical_mode);
107        
108         unsigned int ReadRegister(unsigned int reg);
109         signed int WriteRegister(unsigned int reg, quadlet_t data);
110
111     // debug support
112     DECLARE_DEBUG_MODULE;
113 };
114
115 }
116
117 #endif
118
119 #endif //#ifdef ENABLE_RME
Note: See TracBrowser for help on using the browser.