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

Revision 435, 2.9 kB (checked in by pieterpalmers, 15 years ago)

src/devicemanager:
- start OSC server for the device manager

src/devicemanager,
src/iavdevice,
src/libieee1394/configrom:
- inherit from OscNode? to become Osc'able

src/bounce,
src/libstreaming/AmdtpStreamProcessor,
src/libstreaming/AmdtpSlaveStreamProcessor:
- fixed bounce device implementation, now working

src/bebob:
- fixed midi bug

General:
- removed 'intermediate XML'
- removed obsolete tests
- removed obsolete files
- removed obsolete API calls

Line 
1 /* $Id$ */
2
3 /*
4  *   FreeBob Streaming API
5  *   FreeBob = Firewire (pro-)audio for linux
6  *
7  *   http://freebob.sf.net
8  *
9  *   Copyright (C) 2007 Pieter Palmers <pieterpalmers@users.sourceforge.net>
10  *
11  *   This program is free software {} you can redistribute it and/or modify
12  *   it under the terms of the GNU General Public License as published by
13  *   the Free Software Foundation {} either version 2 of the License, or
14  *   (at your option) any later version.
15  *
16  *   This program is distributed in the hope that it will be useful,
17  *   but WITHOUT ANY WARRANTY {} without even the implied warranty of
18  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *   GNU General Public License for more details.
20  *
21  *   You should have received a copy of the GNU General Public License
22  *   along with this program {} if not, write to the Free Software
23  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  *
25  *
26  *
27  */
28 #ifndef __FREEBOB_BOUNCESLAVEDEVICE__
29 #define __FREEBOB_BOUNCESLAVEDEVICE__
30
31 #include "debugmodule/debugmodule.h"
32 #include "bounce_avdevice.h"
33
34 #define FREEBOB_MAX_NAME_LEN 256
35
36 #define FREEBOB_BOUNCE_SERVER_VENDORNAME  "FreeBoB Server"
37 #define FREEBOB_BOUNCE_SERVER_MODELNAME   "freebob-server"
38
39 // NOTE: this is currently free, but it is not really allowed to use
40 #define FREEBOB_BOUNCE_SERVER_VENDORID    0x000B0001
41 #define FREEBOB_BOUNCE_SERVER_MODELID     0x000B0001
42 #define FREEBOB_BOUNCE_SERVER_SPECID      0x000B0001
43
44 namespace Bounce {
45
46 class BounceSlaveDevice : public BounceDevice {
47     class BounceSlaveNotifier;
48 public:
49
50     BounceSlaveDevice( std::auto_ptr<ConfigRom>( configRom ),
51           Ieee1394Service& ieee1394Service );
52     virtual ~BounceSlaveDevice();
53    
54     static bool probe( ConfigRom& configRom );
55     bool discover();
56     bool prepare();
57     bool lock();
58     bool unlock();
59    
60     bool startStreamByIndex(int i);
61     bool stopStreamByIndex(int i);
62
63 private:
64     bool waitForRegisterNotEqualTo(nodeaddr_t offset, fb_quadlet_t v);
65     bool initMemSpace();
66     bool restoreMemSpace();
67    
68 private: // configrom shit
69
70     struct configrom_backup {
71         quadlet_t rom[0x100];
72         size_t rom_size;
73         unsigned char rom_version;
74     };
75     struct configrom_backup m_original_config_rom;
76    
77     struct configrom_backup
78         save_config_rom(raw1394handle_t handle);
79     int restore_config_rom(raw1394handle_t handle, struct configrom_backup old);
80     int init_config_rom(raw1394handle_t handle);
81    
82 private:
83     BounceSlaveNotifier *m_Notifier;
84     /**
85      * this class reacts on the ohter side writing to the
86      * hosts address space
87      */
88     class BounceSlaveNotifier : public ARMHandler
89     {
90     public:
91         BounceSlaveNotifier(BounceSlaveDevice *, nodeaddr_t start);
92         virtual ~BounceSlaveNotifier();
93        
94     private:
95         BounceSlaveDevice *m_bounceslavedevice;
96     };
97 };
98
99 } // end of namespace Bounce
100
101 #endif /* __FREEBOB_BOUNCESLAVEDEVICE__ */
102
103
Note: See TracBrowser for help on using the browser.