1
0

cnv_ds2.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef _CNV_DS2_H
  2. #define _CNV_DS2_H
  3. #include "../studio/wac.h"
  4. #include "../common/rootcomp.h"
  5. #include "../attribs/cfgitemi.h"
  6. #include "../attribs/attrint.h"
  7. #include "../attribs/attrbool.h"
  8. #include "../attribs/attrfloat.h"
  9. #include "../attribs/attrstr.h"
  10. #include "../studio/services/svc_mediaconverter.h"
  11. #include "../studio/services/servicei.h"
  12. #include "../studio/corecb.h"
  13. #include <windows.h>
  14. #include <mmsystem.h>
  15. #include <dsound.h>
  16. #include "ds2.h"
  17. #define WACNAME WACcnv_ds2
  18. class WACNAME : public WAComponentClient {
  19. public:
  20. WACNAME();
  21. virtual ~WACNAME();
  22. virtual const char *getName() { return "DirectSound Output"; };
  23. virtual GUID getGUID();
  24. virtual void onCreate();
  25. virtual void onDestroy();
  26. virtual int getDisplayComponent() { return FALSE; };
  27. virtual CfgItem *getCfgInterface(int n) { return this; }
  28. };
  29. class cnvDS2 : public svc_mediaConverterI {
  30. public:
  31. cnvDS2();
  32. virtual ~cnvDS2();
  33. // service
  34. static const char *getServiceName() { return "DirectSound Output"; }
  35. virtual int canConvertFrom(svc_fileReader *reader, const char *name, const char *chunktype) {
  36. if(chunktype && !STRICMP(chunktype,"pcm")) return 1;
  37. return 0;
  38. }
  39. virtual const char *getConverterTo() { return "OUTPUT:DirectSound"; }
  40. virtual int getInfos(MediaInfo *infos);
  41. virtual int processData(MediaInfo *infos, ChunkList *chunk_list, bool *killswitch);
  42. virtual int getLatency(void);
  43. virtual int isSelectableOutput(void) { return 1; }
  44. // callbacks
  45. virtual int corecb_onSeeked(int newpos);
  46. virtual int sortPlacement(const char *oc);
  47. virtual int corecb_onVolumeChange(int v);
  48. virtual int corecb_onPanChange(int v);
  49. virtual int corecb_onAbortCurrentSong();
  50. virtual int corecb_onPaused();
  51. virtual int corecb_onUnpaused();
  52. virtual int corecb_onEndOfDecode();
  53. private:
  54. DS2 * m_ds2;
  55. UINT sr,nch,bps,chan;
  56. bool ds2_paused;
  57. UINT fadenow;
  58. bool use_vol;
  59. bool use_pitch;
  60. double pitch_set;
  61. };
  62. #endif