Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef PCM_INTERFACE_H
- #define PCM_INTERFACE_H
- #include <QString>
- #include <QVariant>
- struct Xen_PCM_TransferInfo
- {
- double *buffer; // 64 bit floating point all the way!
- quint64 nframes; // allow to transfer huge buffers
- int numOutChannels; // sources should always find a way to satisfy this in some way
- double outSampleRate; // floating point for pitch bends or whatever
- };
- class IXen_PCM_Source
- {
- public:
- enum SeekMode
- {
- SeekFromStart=0,
- SeekFromEnd,
- SeekFromCurrentPos
- };
- virtual ~IXen_PCM_Source() {};
- virtual IXen_PCM_Source* duplicate()=0;
- virtual bool saveState(QVariantMap &map)=0;
- virtual bool loadState(QVariantMap &map)=0;
- virtual bool isAvailable()=0; // source could be a valid object but in offline state
- virtual void setAvailable(bool b)=0; // force offline/online state
- virtual int seek(quint64 pos=0,SeekMode mode=SeekFromStart)=0;
- virtual quint64 processAudio(Xen_PCM_TransferInfo* transferInfo)=0; // return number of frames succesfully produced
- // for OSC like messages support, eg. setFile "C:/ass.wav", seek 666
- virtual int sendMessage(const QString &msg)=0;
- // for unanticipated future needs
- virtual int extended(int call,void* par1,void* par2,void* par3) { return 0; }
- };
- #endif // PCM_INTERFACE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement