class_samplelibrary.rst 5.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_SampleLibrary:
  4. SampleLibrary
  5. =============
  6. **Inherits:** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Library that contains a collection of samples.
  11. Member Functions
  12. ----------------
  13. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`add_sample<class_SampleLibrary_add_sample>` **(** :ref:`String<class_string>` name, :ref:`Sample<class_sample>` sample **)** |
  15. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`Sample<class_sample>` | :ref:`get_sample<class_SampleLibrary_get_sample>` **(** :ref:`String<class_string>` name **)** const |
  17. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`has_sample<class_SampleLibrary_has_sample>` **(** :ref:`String<class_string>` name **)** const |
  19. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`remove_sample<class_SampleLibrary_remove_sample>` **(** :ref:`String<class_string>` name **)** |
  21. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`sample_set_volume_db<class_SampleLibrary_sample_set_volume_db>` **(** :ref:`String<class_string>` name, :ref:`float<class_float>` db **)** |
  23. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`sample_get_volume_db<class_SampleLibrary_sample_get_volume_db>` **(** :ref:`String<class_string>` name **)** const |
  25. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`sample_set_pitch_scale<class_SampleLibrary_sample_set_pitch_scale>` **(** :ref:`String<class_string>` name, :ref:`float<class_float>` pitch **)** |
  27. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`sample_get_pitch_scale<class_SampleLibrary_sample_get_pitch_scale>` **(** :ref:`String<class_string>` name **)** const |
  29. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. Description
  31. -----------
  32. Library that contains a collection of :ref:`Sample<class_sample>`, each identified by a text ID. This is used as a data container for the majority of the SamplePlayer classes and derivatives.
  33. Member Function Description
  34. ---------------------------
  35. .. _class_SampleLibrary_add_sample:
  36. - void **add_sample** **(** :ref:`String<class_string>` name, :ref:`Sample<class_sample>` sample **)**
  37. Add a sample to the library, with a given text ID.
  38. .. _class_SampleLibrary_get_sample:
  39. - :ref:`Sample<class_sample>` **get_sample** **(** :ref:`String<class_string>` name **)** const
  40. Return the sample from the library matching the given text ID. Return null if the sample is not found.
  41. .. _class_SampleLibrary_has_sample:
  42. - :ref:`bool<class_bool>` **has_sample** **(** :ref:`String<class_string>` name **)** const
  43. Return true if the sample text ID exists in the library.
  44. .. _class_SampleLibrary_remove_sample:
  45. - void **remove_sample** **(** :ref:`String<class_string>` name **)**
  46. Remove the sample matching the given text ID.
  47. .. _class_SampleLibrary_sample_set_volume_db:
  48. - void **sample_set_volume_db** **(** :ref:`String<class_string>` name, :ref:`float<class_float>` db **)**
  49. Set the volume (in dB) for the given sample.
  50. .. _class_SampleLibrary_sample_get_volume_db:
  51. - :ref:`float<class_float>` **sample_get_volume_db** **(** :ref:`String<class_string>` name **)** const
  52. Return the volume (in dB) for the given sample.
  53. .. _class_SampleLibrary_sample_set_pitch_scale:
  54. - void **sample_set_pitch_scale** **(** :ref:`String<class_string>` name, :ref:`float<class_float>` pitch **)**
  55. Set the pitch scale for the given sample.
  56. .. _class_SampleLibrary_sample_get_pitch_scale:
  57. - :ref:`float<class_float>` **sample_get_pitch_scale** **(** :ref:`String<class_string>` name **)** const
  58. Return the pitch scale for the given sample.