Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.33 KB | None | 0 0
  1. #ifndef PCM_INTERFACE_H
  2. #define PCM_INTERFACE_H
  3. #include <QString>
  4. #include <QVariant>
  5.  
  6. struct Xen_PCM_TransferInfo
  7. {
  8.     double *buffer; // 64 bit floating point all the way!
  9.     quint64 nframes; // allow to transfer huge buffers
  10.     int numOutChannels; // sources should always find a way to satisfy this in some way
  11.     double outSampleRate; // floating point for pitch bends or whatever
  12. };
  13.  
  14. class IXen_PCM_Source
  15. {
  16. public:
  17.     enum SeekMode
  18.     {
  19.         SeekFromStart=0,
  20.         SeekFromEnd,
  21.         SeekFromCurrentPos
  22.     };
  23.     virtual ~IXen_PCM_Source() {};
  24.     virtual IXen_PCM_Source* duplicate()=0;
  25.     virtual bool saveState(QVariantMap &map)=0;
  26.     virtual bool loadState(QVariantMap &map)=0;
  27.     virtual bool isAvailable()=0; // source could be a valid object but in offline state
  28.     virtual void setAvailable(bool b)=0; // force offline/online state
  29.     virtual int seek(quint64 pos=0,SeekMode mode=SeekFromStart)=0;
  30.     virtual quint64 processAudio(Xen_PCM_TransferInfo* transferInfo)=0; // return number of frames succesfully produced
  31.     // for OSC like messages support, eg. setFile "C:/ass.wav", seek 666
  32.     virtual int sendMessage(const QString &msg)=0;
  33.     // for unanticipated future needs
  34.     virtual int extended(int call,void* par1,void* par2,void* par3) { return 0; }
  35.  
  36. };
  37.  
  38. #endif // PCM_INTERFACE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement