class_samplelibrary.rst 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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:`Array<class_array>` | :ref:`get_sample_list<class_SampleLibrary_get_sample_list>` **(** **)** const |
  19. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`bool<class_bool>` | :ref:`has_sample<class_SampleLibrary_has_sample>` **(** :ref:`String<class_string>` name **)** const |
  21. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`remove_sample<class_SampleLibrary_remove_sample>` **(** :ref:`String<class_string>` name **)** |
  23. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`sample_get_pitch_scale<class_SampleLibrary_sample_get_pitch_scale>` **(** :ref:`String<class_string>` name **)** const |
  25. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`sample_get_priority<class_SampleLibrary_sample_get_priority>` **(** :ref:`String<class_string>` name **)** const |
  27. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`sample_get_volume_db<class_SampleLibrary_sample_get_volume_db>` **(** :ref:`String<class_string>` name **)** const |
  29. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`sample_set_pitch_scale<class_SampleLibrary_sample_set_pitch_scale>` **(** :ref:`String<class_string>` name, :ref:`float<class_float>` pitch **)** |
  31. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`sample_set_priority<class_SampleLibrary_sample_set_priority>` **(** :ref:`String<class_string>` name, :ref:`int<class_int>` priority **)** |
  33. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`sample_set_volume_db<class_SampleLibrary_sample_set_volume_db>` **(** :ref:`String<class_string>` name, :ref:`float<class_float>` db **)** |
  35. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. Description
  37. -----------
  38. 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.
  39. Sample players will never yield an active (currently playing) voice for a new playback request when there are no inactive voices available if the priority of the sample requested to be played is lower than that of every currently played samples.
  40. Member Function Description
  41. ---------------------------
  42. .. _class_SampleLibrary_add_sample:
  43. - void **add_sample** **(** :ref:`String<class_string>` name, :ref:`Sample<class_sample>` sample **)**
  44. Add a sample to the library, with a given text ID.
  45. .. _class_SampleLibrary_get_sample:
  46. - :ref:`Sample<class_sample>` **get_sample** **(** :ref:`String<class_string>` name **)** const
  47. Return the sample from the library matching the given text ID. Return null if the sample is not found.
  48. .. _class_SampleLibrary_get_sample_list:
  49. - :ref:`Array<class_array>` **get_sample_list** **(** **)** const
  50. .. _class_SampleLibrary_has_sample:
  51. - :ref:`bool<class_bool>` **has_sample** **(** :ref:`String<class_string>` name **)** const
  52. Return true if the sample text ID exists in the library.
  53. .. _class_SampleLibrary_remove_sample:
  54. - void **remove_sample** **(** :ref:`String<class_string>` name **)**
  55. Remove the sample matching the given text ID.
  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.
  59. .. _class_SampleLibrary_sample_get_priority:
  60. - :ref:`int<class_int>` **sample_get_priority** **(** :ref:`String<class_string>` name **)** const
  61. Return the priority for the given sample.
  62. .. _class_SampleLibrary_sample_get_volume_db:
  63. - :ref:`float<class_float>` **sample_get_volume_db** **(** :ref:`String<class_string>` name **)** const
  64. Return the volume (in dB) for the given sample.
  65. .. _class_SampleLibrary_sample_set_pitch_scale:
  66. - void **sample_set_pitch_scale** **(** :ref:`String<class_string>` name, :ref:`float<class_float>` pitch **)**
  67. Set the pitch scale for the given sample.
  68. .. _class_SampleLibrary_sample_set_priority:
  69. - void **sample_set_priority** **(** :ref:`String<class_string>` name, :ref:`int<class_int>` priority **)**
  70. Set the priority for the given sample.
  71. .. _class_SampleLibrary_sample_set_volume_db:
  72. - void **sample_set_volume_db** **(** :ref:`String<class_string>` name, :ref:`float<class_float>` db **)**
  73. Set the volume (in dB) for the given sample.