bassmix.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. BASSmix 2.4 C/C++ header file
  3. Copyright (c) 2005-2022 Un4seen Developments Ltd.
  4. See the BASSMIX.CHM file for more detailed documentation
  5. */
  6. #ifndef BASSMIX_H
  7. #define BASSMIX_H
  8. #include "bass.h"
  9. #if BASSVERSION!=0x204
  10. #error conflicting BASS and BASSmix versions
  11. #endif
  12. #ifdef __OBJC__
  13. typedef int BOOL32;
  14. #define BOOL BOOL32 // override objc's BOOL
  15. #endif
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #ifndef BASSMIXDEF
  20. #define BASSMIXDEF(f) WINAPI f
  21. #endif
  22. // Additional BASS_SetConfig options
  23. #define BASS_CONFIG_MIXER_BUFFER 0x10601
  24. #define BASS_CONFIG_MIXER_POSEX 0x10602
  25. #define BASS_CONFIG_SPLIT_BUFFER 0x10610
  26. // BASS_Mixer_StreamCreate flags
  27. #define BASS_MIXER_RESUME 0x1000 // resume stalled immediately upon new/unpaused source
  28. #define BASS_MIXER_POSEX 0x2000 // enable BASS_Mixer_ChannelGetPositionEx support
  29. #define BASS_MIXER_NOSPEAKER 0x4000 // ignore speaker arrangement
  30. #define BASS_MIXER_QUEUE 0x8000 // queue sources
  31. #define BASS_MIXER_END 0x10000 // end the stream when there are no sources
  32. #define BASS_MIXER_NONSTOP 0x20000 // don't stall when there are no sources
  33. // BASS_Mixer_StreamAddChannel/Ex flags
  34. #define BASS_MIXER_CHAN_ABSOLUTE 0x1000 // start is an absolute position
  35. #define BASS_MIXER_CHAN_BUFFER 0x2000 // buffer data for BASS_Mixer_ChannelGetData/Level
  36. #define BASS_MIXER_CHAN_LIMIT 0x4000 // limit mixer processing to the amount available from this source
  37. #define BASS_MIXER_CHAN_MATRIX 0x10000 // matrix mixing
  38. #define BASS_MIXER_CHAN_PAUSE 0x20000 // don't process the source
  39. #define BASS_MIXER_CHAN_DOWNMIX 0x400000 // downmix to stereo/mono
  40. #define BASS_MIXER_CHAN_NORAMPIN 0x800000 // don't ramp-in the start
  41. #define BASS_MIXER_BUFFER BASS_MIXER_CHAN_BUFFER
  42. #define BASS_MIXER_LIMIT BASS_MIXER_CHAN_LIMIT
  43. #define BASS_MIXER_MATRIX BASS_MIXER_CHAN_MATRIX
  44. #define BASS_MIXER_PAUSE BASS_MIXER_CHAN_PAUSE
  45. #define BASS_MIXER_DOWNMIX BASS_MIXER_CHAN_DOWNMIX
  46. #define BASS_MIXER_NORAMPIN BASS_MIXER_CHAN_NORAMPIN
  47. // Mixer attributes
  48. #define BASS_ATTRIB_MIXER_LATENCY 0x15000
  49. #define BASS_ATTRIB_MIXER_THREADS 0x15001
  50. #define BASS_ATTRIB_MIXER_VOL 0x15002
  51. // Additional BASS_Mixer_ChannelIsActive return values
  52. #define BASS_ACTIVE_WAITING 5
  53. #define BASS_ACTIVE_QUEUED 6
  54. // BASS_Split_StreamCreate flags
  55. #define BASS_SPLIT_SLAVE 0x1000 // only read buffered data
  56. #define BASS_SPLIT_POS 0x2000
  57. // Splitter attributes
  58. #define BASS_ATTRIB_SPLIT_ASYNCBUFFER 0x15010
  59. #define BASS_ATTRIB_SPLIT_ASYNCPERIOD 0x15011
  60. // Envelope node
  61. typedef struct {
  62. QWORD pos;
  63. float value;
  64. } BASS_MIXER_NODE;
  65. // Envelope types
  66. #define BASS_MIXER_ENV_FREQ 1
  67. #define BASS_MIXER_ENV_VOL 2
  68. #define BASS_MIXER_ENV_PAN 3
  69. #define BASS_MIXER_ENV_LOOP 0x10000 // flag: loop
  70. #define BASS_MIXER_ENV_REMOVE 0x20000 // flag: remove at end
  71. // Additional sync types
  72. #define BASS_SYNC_MIXER_ENVELOPE 0x10200
  73. #define BASS_SYNC_MIXER_ENVELOPE_NODE 0x10201
  74. #define BASS_SYNC_MIXER_QUEUE 0x10202
  75. // Additional BASS_Mixer_ChannelSetPosition flag
  76. #define BASS_POS_MIXER_RESET 0x10000 // flag: clear mixer's playback buffer
  77. // Additional BASS_Mixer_ChannelGetPosition mode
  78. #define BASS_POS_MIXER_DELAY 5
  79. // BASS_CHANNELINFO types
  80. #define BASS_CTYPE_STREAM_MIXER 0x10800
  81. #define BASS_CTYPE_STREAM_SPLIT 0x10801
  82. DWORD BASSMIXDEF(BASS_Mixer_GetVersion)(void);
  83. HSTREAM BASSMIXDEF(BASS_Mixer_StreamCreate)(DWORD freq, DWORD chans, DWORD flags);
  84. BOOL BASSMIXDEF(BASS_Mixer_StreamAddChannel)(HSTREAM handle, DWORD channel, DWORD flags);
  85. BOOL BASSMIXDEF(BASS_Mixer_StreamAddChannelEx)(HSTREAM handle, DWORD channel, DWORD flags, QWORD start, QWORD length);
  86. DWORD BASSMIXDEF(BASS_Mixer_StreamGetChannels)(HSTREAM handle, DWORD *channels, DWORD count);
  87. HSTREAM BASSMIXDEF(BASS_Mixer_ChannelGetMixer)(DWORD handle);
  88. DWORD BASSMIXDEF(BASS_Mixer_ChannelIsActive)(DWORD handle);
  89. DWORD BASSMIXDEF(BASS_Mixer_ChannelFlags)(DWORD handle, DWORD flags, DWORD mask);
  90. BOOL BASSMIXDEF(BASS_Mixer_ChannelRemove)(DWORD handle);
  91. BOOL BASSMIXDEF(BASS_Mixer_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mode);
  92. QWORD BASSMIXDEF(BASS_Mixer_ChannelGetPosition)(DWORD handle, DWORD mode);
  93. QWORD BASSMIXDEF(BASS_Mixer_ChannelGetPositionEx)(DWORD channel, DWORD mode, DWORD delay);
  94. DWORD BASSMIXDEF(BASS_Mixer_ChannelGetLevel)(DWORD handle);
  95. BOOL BASSMIXDEF(BASS_Mixer_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags);
  96. DWORD BASSMIXDEF(BASS_Mixer_ChannelGetData)(DWORD handle, void *buffer, DWORD length);
  97. HSYNC BASSMIXDEF(BASS_Mixer_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user);
  98. BOOL BASSMIXDEF(BASS_Mixer_ChannelRemoveSync)(DWORD channel, HSYNC sync);
  99. BOOL BASSMIXDEF(BASS_Mixer_ChannelSetMatrix)(DWORD handle, const void *matrix);
  100. BOOL BASSMIXDEF(BASS_Mixer_ChannelSetMatrixEx)(DWORD handle, const void *matrix, float time);
  101. BOOL BASSMIXDEF(BASS_Mixer_ChannelGetMatrix)(DWORD handle, void *matrix);
  102. BOOL BASSMIXDEF(BASS_Mixer_ChannelSetEnvelope)(DWORD handle, DWORD type, const BASS_MIXER_NODE *nodes, DWORD count);
  103. BOOL BASSMIXDEF(BASS_Mixer_ChannelSetEnvelopePos)(DWORD handle, DWORD type, QWORD pos);
  104. QWORD BASSMIXDEF(BASS_Mixer_ChannelGetEnvelopePos)(DWORD handle, DWORD type, float *value);
  105. HSTREAM BASSMIXDEF(BASS_Split_StreamCreate)(DWORD channel, DWORD flags, const int *chanmap);
  106. DWORD BASSMIXDEF(BASS_Split_StreamGetSource)(HSTREAM handle);
  107. DWORD BASSMIXDEF(BASS_Split_StreamGetSplits)(DWORD handle, HSTREAM *splits, DWORD count);
  108. BOOL BASSMIXDEF(BASS_Split_StreamReset)(DWORD handle);
  109. BOOL BASSMIXDEF(BASS_Split_StreamResetEx)(DWORD handle, DWORD offset);
  110. DWORD BASSMIXDEF(BASS_Split_StreamGetAvailable)(DWORD handle);
  111. #ifdef __cplusplus
  112. }
  113. #endif
  114. #ifdef __OBJC__
  115. #undef BOOL
  116. #endif
  117. #endif