source: trunk/src/testing/include/sageAppAudio.h @ 4

Revision 4, 2.8 KB checked in by ajaworski, 13 years ago (diff)

Added modified SAGE sources

Line 
1/******************************************************************************
2 * SAGE - Scalable Adaptive Graphics Environment
3 *
4 * Module: sageAppAudio.h
5 * Author : Byungil Jeong
6 *
7 * Copyright (C) 2004 Electronic Visualization Laboratory,
8 * University of Illinois at Chicago
9 *
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions are met:
14 *
15 *  * Redistributions of source code must retain the above copyright
16 *    notice, this list of conditions and the following disclaimer.
17 *  * Redistributions in binary form must reproduce the above
18 *    copyright notice, this list of conditions and the following disclaimer
19 *    in the documentation and/or other materials provided with the distribution.
20 *  * Neither the name of the University of Illinois at Chicago nor
21 *    the names of its contributors may be used to endorse or promote
22 *    products derived from this software without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
28 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 *
36 * Direct questions, comments etc about SAGE to sage_users@listserv.uic.edu or
37 * http://www.evl.uic.edu/cavern/forum/
38 *
39 *****************************************************************************/
40
41#ifndef _SAGE_APP_AUDIO_H
42#define _SAGE_APP_AUDIO_H
43
44#include "sageBase.h"
45
46class sageAudioCircBuf;
47
48class sageAppAudio {
49public:   
50   sageAppAudio(sageAudioCircBuf* audioBuffer, int maxsize);
51   virtual ~sageAppAudio();
52
53public:   
54   //int pushAudioData(int size, void *buf);
55   int swapBuffer(int size, void *buf);
56   int start(void);
57   
58protected:
59   static void* audioThread(void *args);
60
61   int processData();
62
63protected:
64   pthread_mutex_t *queueLock;
65   pthread_cond_t *notFull;
66   pthread_cond_t *notEmpty;
67
68   sageAudioCircBuf* buffer;
69
70   int readIndex;
71   int writeIndex;
72   bool initialized;
73
74   bool full;
75   bool empty;
76   int maxAudioBuffSize;
77   
78   void * audioAppRawBuffer[2];
79   int audiobufSize[2];
80
81   int remainBufSize;
82   void * remainBuf;
83   
84   pthread_t thAppId;
85   
86};
87
88#endif
Note: See TracBrowser for help on using the repository browser.