:github_url: hide .. _class_AudioStreamPlaylist: AudioStreamPlaylist =================== **繼承:** :ref:`AudioStream` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` 包含子串流並以播放清單方式播放的 :ref:`AudioStream`\ 。 .. rst-class:: classref-reftable-group 屬性 ---- .. table:: :widths: auto +---------------------------+----------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`fade_time` | ``0.3`` | +---------------------------+----------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`loop` | ``true`` | +---------------------------+----------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`shuffle` | ``false`` | +---------------------------+----------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`stream_count` | ``0`` | +---------------------------+----------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group 方法 ---- .. table:: :widths: auto +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_bpm`\ (\ ) |const| | +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`AudioStream` | :ref:`get_list_stream`\ (\ stream_index\: :ref:`int`\ ) |const| | +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_list_stream`\ (\ stream_index\: :ref:`int`, audio_stream\: :ref:`AudioStream`\ ) | +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group 常數 ---- .. _class_AudioStreamPlaylist_constant_MAX_STREAMS: .. rst-class:: classref-constant **MAX_STREAMS** = ``64`` :ref:`🔗` 播放清單可支援的最大串流數量。 .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group 屬性說明 -------- .. _class_AudioStreamPlaylist_property_fade_time: .. rst-class:: classref-property :ref:`float` **fade_time** = ``0.3`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_fade_time**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_fade_time**\ (\ ) 當一個串流結束並轉到下一個時所使用的淡出時間。建議各串流在結尾保留些許額外音訊以利淡出。 .. rst-class:: classref-item-separator ---- .. _class_AudioStreamPlaylist_property_loop: .. rst-class:: classref-property :ref:`bool` **loop** = ``true`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_loop**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **has_loop**\ (\ ) 若為 ``true``\ ,播放清單將循環播放;否則在最後一個串流播放完畢後停止。 .. rst-class:: classref-item-separator ---- .. _class_AudioStreamPlaylist_property_shuffle: .. rst-class:: classref-property :ref:`bool` **shuffle** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_shuffle**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **get_shuffle**\ (\ ) 若為 ``true``\ ,每次開始播放或重新循環時播放清單將重新隨機排序。 .. rst-class:: classref-item-separator ---- .. _class_AudioStreamPlaylist_property_stream_count: .. rst-class:: classref-property :ref:`int` **stream_count** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_stream_count**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_stream_count**\ (\ ) 播放清單中的串流數量。 .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group 方法說明 -------- .. _class_AudioStreamPlaylist_method_get_bpm: .. rst-class:: classref-method :ref:`float` **get_bpm**\ (\ ) |const| :ref:`🔗` 返回播放清單的 BPM,可能隨目前播放的片段而異。 .. rst-class:: classref-item-separator ---- .. _class_AudioStreamPlaylist_method_get_list_stream: .. rst-class:: classref-method :ref:`AudioStream` **get_list_stream**\ (\ stream_index\: :ref:`int`\ ) |const| :ref:`🔗` 返回指定播放位置索引處的串流。 .. rst-class:: classref-item-separator ---- .. _class_AudioStreamPlaylist_method_set_list_stream: .. rst-class:: classref-method |void| **set_list_stream**\ (\ stream_index\: :ref:`int`, audio_stream\: :ref:`AudioStream`\ ) :ref:`🔗` 設定指定播放位置索引處的串流。 .. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)` .. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)` .. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)` .. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)` .. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)` .. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)` .. |void| replace:: :abbr:`void (無回傳值。)`