Mercurial > hg > audiostuff
comparison intercom/cirbuf.h @ 2:13be24d74cd2
import intercom-0.4.1
| author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
|---|---|
| date | Fri, 25 Jun 2010 09:57:52 +0200 |
| parents | |
| children | c6c5a16ce2f2 |
comparison
equal
deleted
inserted
replaced
| 1:9cadc470e3da | 2:13be24d74cd2 |
|---|---|
| 1 /* cirbuf.h | |
| 2 * | |
| 3 * Copyright (C) DFS Deutsche Flugsicherung (2004, 2005). | |
| 4 * All Rights Reserved. | |
| 5 * | |
| 6 * Circular Buffers | |
| 7 * | |
| 8 * Version 0.2 | |
| 9 */ | |
| 10 #ifndef _CIRBUF_H | |
| 11 | |
| 12 // must be multiple of FRAGSIZE and FRAMESIZE | |
| 13 #define CIRBUFSIZE (WIDEB*2*80*8*2) | |
| 14 | |
| 15 /* circular buffer for FRAGSIZE to FRAMESIZE conversion with | |
| 16 * overrun/underrun */ | |
| 17 class CIRBUF { | |
| 18 char buf[CIRBUFSIZE]; // must be multiple of FRAGSIZE and FRAMESIZE | |
| 19 int in; | |
| 20 int out; | |
| 21 int len; | |
| 22 | |
| 23 public: | |
| 24 CIRBUF(); | |
| 25 void CIRBUF::init(); | |
| 26 int CIRBUF::push(char *from, int size); | |
| 27 int CIRBUF::pop(char *to, int size); | |
| 28 int getlen() { | |
| 29 return len; | |
| 30 } | |
| 31 }; | |
| 32 | |
| 33 #define _CIRBUF_H | |
| 34 #endif |
