root/branches/streaming-rework/src/bounce/bounce_avdevice.h

Revision 415, 3.0 kB (checked in by pieterpalmers, 16 years ago)

ieee1394service:
- implemented 64bit compare-swap-lock operation (needed for DICE)
- small name change of (un)registerARMhandler to (un)registerARMHandler

iavdevice.h:
- made the stream start/stop functions return bool instead of int
- updated function documentation for consistency and to reflect changes

BeBoB avdevice:
- replaced the 2 fixed streamprocessor pointers with a 2 vectors of streamprocessors
- implemented the 'snoop mode' (cannot be activated yet)

libstreaming:
- removed unused 'type' attribute from AmdtpPortInfo? & children

mh_avdevice, motu_avdevice, rme_avdevice:
- replaced m_1394service with m_p1394service for consistence

maudio_avdevice.cpp:
- removed unused code

Line 
1 /* bounce_avdevice.h
2  * Copyright (C) 2006 by Pieter Palmers
3  * Copyright (C) 2006 by Daniel Wagner
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 #ifndef BOUNCEDEVICE_H
22 #define BOUNCEDEVICE_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 "libstreaming/AmdtpStreamProcessor.h"
30 #include "libstreaming/AmdtpPort.h"
31 #include "libstreaming/AmdtpPortInfo.h"
32
33 #include "iavdevice.h"
34 #include "libfreebob/freebob_bounce.h"
35
36 class ConfigRom;
37 class Ieee1394Service;
38
39 namespace Bounce {
40
41 // struct to define the supported devices
42 struct VendorModelEntry {
43     unsigned int vendor_id;
44     unsigned int model_id;
45     unsigned int unit_specifier_id;
46     char *vendor_name;
47     char *model_name;
48 };
49
50 class BounceDevice : public IAvDevice {
51 public:
52     BounceDevice( std::auto_ptr<ConfigRom>( configRom ),
53                   Ieee1394Service& ieee1394Service,
54                   int nodeId,
55                   int verboseLevel );
56     virtual ~BounceDevice();
57
58     static bool probe( ConfigRom& configRom );
59     virtual bool discover();
60     virtual ConfigRom& getConfigRom() const;
61    
62     virtual bool addXmlDescription( xmlNodePtr deviceNode );
63    
64     virtual bool setSamplingFrequency( ESamplingFrequency samplingFrequency );
65         virtual int getSamplingFrequency( );
66    
67         virtual bool prepare();
68     bool lock();
69     bool unlock();
70        
71         virtual int getStreamCount();
72        
73         virtual FreebobStreaming::StreamProcessor *getStreamProcessorByIndex(int i);
74        
75     bool startStreamByIndex(int i);
76     bool stopStreamByIndex(int i);
77    
78     virtual void showDevice() const;
79     virtual bool setId(unsigned int id);
80
81 protected:
82     std::auto_ptr<ConfigRom>( m_configRom );
83     Ieee1394Service* m_1394Service;
84     int              m_nodeId;
85     int              m_verboseLevel;
86
87 private:
88         std::string xmlDescription;
89
90     unsigned int m_samplerate;
91     struct VendorModelEntry* m_model;
92     unsigned int m_id;
93
94         // streaming stuff
95         FreebobStreaming::AmdtpReceiveStreamProcessor *m_receiveProcessor;
96         int m_receiveProcessorBandwidth;
97        
98         FreebobStreaming::AmdtpTransmitStreamProcessor *m_transmitProcessor;
99         int m_transmitProcessorBandwidth;
100
101     bool addPortsToProcessor(
102            FreebobStreaming::StreamProcessor *processor,
103            FreebobStreaming::AmdtpAudioPort::E_Direction direction);
104
105
106     DECLARE_DEBUG_MODULE;
107 };
108
109 }
110
111 #endif
Note: See TracBrowser for help on using the browser.