libcm is a C development framework with an emphasis on audio signal processing applications.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

cmAudioFileDev.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef cmAudioFileDev_h
  2. #define cmAudioFileDev_h
  3. enum
  4. {
  5. kOkAfdRC = cmOkRC,
  6. kAudioFileFailAfdRC,
  7. kThreadFailAfdRC,
  8. kRestartFailAfdRC
  9. };
  10. typedef unsigned cmAfdRC_t;
  11. typedef cmHandle_t cmAfdH_t;
  12. extern cmAfdH_t cmAfdNullHandle;
  13. /// Initialize an audio file device.
  14. /// Called by cmApPortInitialize().
  15. cmAfdRC_t cmAudioFileDevInitialize(
  16. cmAfdH_t* hp,
  17. const cmChar_t* label,
  18. unsigned devIdx,
  19. const cmChar_t* iFn,
  20. const cmChar_t* oFn,
  21. unsigned oBits,
  22. unsigned oChCnt,
  23. cmRpt_t* rpt );
  24. /// Finalize an audio file device.
  25. /// Called by cmApPortFinalize().
  26. cmAfdRC_t cmAudioFileDevFinalize( cmAfdH_t* hp );
  27. /// Return true if 'h' represents a successfully initialized audio file device.
  28. bool cmAudioFileDevIsValid( cmAfdH_t h );
  29. /// Setup the device. This function must be called prior to cmAudioFileDevStart().
  30. cmAfdRC_t cmAudioFileDevSetup(
  31. cmAfdH_t h,
  32. unsigned baseApDevIdx,
  33. double srate,
  34. unsigned framesPerCycle,
  35. cmApCallbackPtr_t callbackPtr,
  36. void* cbDataPtr );
  37. /// Return a device label.
  38. const char* cmAudioFileDevLabel( cmAfdH_t h );
  39. /// Return a channel count.
  40. unsigned cmAudioFileDevChannelCount( cmAfdH_t h, bool inputFl );
  41. /// Return the sample rate.
  42. double cmAudioFileDevSampleRate( cmAfdH_t h );
  43. /// Return frames per cycle.
  44. unsigned cmAudioFileDevFramesPerCycle( cmAfdH_t h, bool inputFl );
  45. /// Rewind the input file.
  46. cmAfdRC_t cmAudioFileDevRewind( cmAfdH_t h );
  47. /// Start the file device playing/recording.
  48. cmAfdRC_t cmAudioFileDevStart( cmAfdH_t h );
  49. /// Stop the file device playing/recording.
  50. cmAfdRC_t cmAudioFileDevStop( cmAfdH_t h );
  51. /// Return true if the file device is currently started.
  52. bool cmAudioFileDevIsStarted( cmAfdH_t h );
  53. ///
  54. void cmAudioFileDevReport( cmAfdH_t h, cmRpt_t* rpt );
  55. void cmAudioFileDevTest( cmRpt_t* rpt );
  56. #endif