root/branches/streaming-rework/tests/SytMonitor.h

Revision 419, 2.2 kB (checked in by pieterpalmers, 17 years ago)

namespace simplification

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_SYTMONITOR__
29 #define __FREEBOB_SYTMONITOR__
30 #include "src/libstreaming/IsoStream.h"
31 #include "src/libstreaming/cip.h"
32 #include "src/libstreaming/cycletimer.h"
33 #include "src/libutil/ringbuffer.h"
34
35 using namespace Streaming;
36
37 struct cycle_info {
38     unsigned int cycle;
39     unsigned int seconds;
40     unsigned int syt;
41     unsigned int full_syt;
42     unsigned int pres_seconds;
43     unsigned int pres_cycle;
44     unsigned int pres_offset;
45     uint64_t     pres_ticks;
46 };
47
48 class SytMonitor
49     : public IsoStream
50 {
51
52     public:
53         SytMonitor(int port);
54         virtual ~SytMonitor();
55        
56                 virtual enum raw1394_iso_disposition
57                         putPacket(unsigned char *data, unsigned int length,
58                               unsigned char channel, unsigned char tag, unsigned char sy,
59                                   unsigned int cycle, unsigned int dropped);
60                                  
61                 void dumpInfo();
62                 unsigned int getMaxPacketSize() {return 4096;};
63                 unsigned int getPacketsPerPeriod() {return 1;};
64                
65         bool readNextCycleInfo(struct cycle_info *cif);
66         bool consumeNextCycleInfo();
67        
68         bool putCycleInfo(struct cycle_info *cif);
69        
70         IsoHandler * getHandler() {return m_handler;};
71        
72         protected:
73            freebob_ringbuffer_t * m_cinfo_buffer;
74        
75        
76                 DECLARE_DEBUG_MODULE;
77                
78            
79
80 };
81
82
83 #endif /* __FREEBOB_SYTMONITOR__ */
84
85
Note: See TracBrowser for help on using the browser.