EffectInfo.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * EffectInfo.h
  3. * ------------
  4. * Purpose: Provide information about effect names, parameter interpretation to the tracker interface.
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "openmpt/all/BuildSettings.hpp"
  11. #include "modcommand.h"
  12. OPENMPT_NAMESPACE_BEGIN
  13. class CSoundFile;
  14. class EffectInfo
  15. {
  16. protected:
  17. const CSoundFile &sndFile;
  18. public:
  19. EffectInfo(const CSoundFile &sf) : sndFile(sf) {};
  20. // Effects Description
  21. bool GetEffectName(CString &pszDescription, ModCommand::COMMAND command, UINT param, bool bXX = false) const; // bXX: Nxx: ...
  22. // Get size of list of known effect commands
  23. UINT GetNumEffects() const;
  24. // Get range information, effect name, etc... from a given effect.
  25. bool GetEffectInfo(UINT ndx, CString *s, bool bXX = false, ModCommand::PARAM *prangeMin = nullptr, ModCommand::PARAM *prangeMax = nullptr) const;
  26. // Get effect index in effect list from effect command + param
  27. LONG GetIndexFromEffect(ModCommand::COMMAND command, ModCommand::PARAM param) const;
  28. // Get effect command + param from effect index
  29. EffectCommand GetEffectFromIndex(UINT ndx, ModCommand::PARAM &refParam) const;
  30. EffectCommand GetEffectFromIndex(UINT ndx) const;
  31. // Get parameter mask from effect (for extended effects)
  32. UINT GetEffectMaskFromIndex(UINT ndx) const;
  33. // Get precise effect name, also with explanation of effect parameter
  34. bool GetEffectNameEx(CString &pszName, const ModCommand &m, uint32 param, CHANNELINDEX chn) const;
  35. // Check whether an effect is extended (with parameter nibbles)
  36. bool IsExtendedEffect(UINT ndx) const;
  37. // Map an effect value to slider position
  38. UINT MapValueToPos(UINT ndx, UINT param) const;
  39. // Map slider position to an effect value
  40. UINT MapPosToValue(UINT ndx, UINT pos) const;
  41. // Volume column effects description
  42. // Get size of list of known volume commands
  43. UINT GetNumVolCmds() const;
  44. // Get effect index in effect list from volume command
  45. LONG GetIndexFromVolCmd(ModCommand::VOLCMD volcmd) const;
  46. // Get volume command from effect index
  47. VolumeCommand GetVolCmdFromIndex(UINT ndx) const;
  48. // Get range information, effect name, etc... from a given effect.
  49. bool GetVolCmdInfo(UINT ndx, CString *s, ModCommand::VOL *prangeMin = nullptr, ModCommand::VOL *prangeMax = nullptr) const;
  50. // Get effect name and parameter description
  51. bool GetVolCmdParamInfo(const ModCommand &m, CString *s) const;
  52. };
  53. OPENMPT_NAMESPACE_END