cirqueue.h

来自「我写的基于2410的音频播放的程序」· C头文件 代码 · 共 40 行

H
40
字号
/*
  Circle Queue Define for 
  CLient  Buffer for Sampling and NetWork Send Operation
  Server Buffer for RePlaying and NetWork Receive Operation
  
  Fu QingYun 2007-05-15
*/
#ifndef _cirqueue_h
#define _cirqueue_h
class CirQueue
{
    //const int QueueSize = 8;
   // const int SampleSize = 1024;
    // Define Queue Size
    enum mDef{QueueSize = 8, SampleSize = 1024};
    // Queue for Stroe Samples
    unsigned char data[QueueSize][SampleSize];
    // Sample Size
    unsigned int  data_size[QueueSize];
    // Queue Head Index
    unsigned char head;
    // Queue Tail Index
    unsigned char tail;
    // Current Number of Sample
    unsigned char cursize;
  public:
    // If Queue is Empty
    bool IsEmpty();
    // If Queue is Full
    bool IsFull();
    // Insert a Sample into Queue
    bool Insert(char * inbuf, int &data_len);
    // Remove a Sample from Queue
    bool Remove(char * inbuf, int &data_len);
    // Constructor
    CirQueue();
  };
#endif    
    

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?