Skip to content

Commit

Permalink
Adds further queue docs for 6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
JujuAdams committed Dec 18, 2024
1 parent 5c5319d commit 071c319
Showing 1 changed file with 110 additions and 30 deletions.
140 changes: 110 additions & 30 deletions docs/6.2/Functions-Queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
|`loopQueue` |boolean |Whether to loop the queue by pushing stopping sounds to the bottom of the queue|
|`[gain]` |number |Local gain to set for the queue |
|`[emitter]` |GameMaker emitter |GameMaker emitter to play sounds on |
|`[fadeInRate]`|number |Rate of change for the gain during the fade in of the queue as a whole. Defaults to `infinity`, playing the audio without a fade in|
|`[fadeInRate]`|number |Rate of change for the gain during the fade in of the queue as a whole. Defaults to `infinity`, playing the queue without a fade in|

Create a new sound queue. A sound queue is used to play audio in a particular sequence which is useful to set up dynamic soundtracks, in-game radio stations etc. This function returns a queue index which can be used like the voice index returned by `VinylPlay()`. This means you can call `VinylFadeOut()`, `VinylPause()`, `VinylSetGain()` etc. targeting a queue and the queue will behave appropriately.

Expand Down Expand Up @@ -61,7 +61,7 @@ No example provided.
|`queueTemplateName`|string |Name of the template to use |
|`[gain]` |number |Local gain to set for the queue |
|`[emitter]` |GameMaker emitter|GameMaker emitter to play sounds on |
|`[fadeInRate]` |number |Rate of change for the gain during the fade in of the queue as a whole. Defaults to `infinity`, playing the audio without a fade in|
|`[fadeInRate]` |number |Rate of change for the gain during the fade in of the queue as a whole. Defaults to `infinity`, playing the queue without a fade in|

Create a new sound queue using parameters previously defined by a queue template, either in the [Config JSON](Config-JSON?id=queue-template) or by using the `VinylSetupQueueTemplate()` function. The `emitter` parameter for this function, if specified, will override the emitter defined in the queue template.

Expand All @@ -75,6 +75,32 @@ No example provided.

 

## `VinylQueueDestroy`

`VinylQueueDestroy(voice)`

<!-- tabs:start -->

#### **Description**

*Returns:* N/A (`undefined`)

|Name |Datatype|Purpose |
|-------|--------|---------------------|
|`voice`|voice |Queue voice to target|

Destroys a Vinyl queue. This stops any currently playing audio and renders the queue inoperable. This function is provided for convenience and you don't have to call this function to manage memory.

#### **Example**

```gml
No example provided.
```

<!-- tabs:end -->

&nbsp;

## `VinylQueueSetBehaviour`

`VinylQueueSetBehaviour(voice, behaviour, [setForPlaying=true])`
Expand Down Expand Up @@ -160,7 +186,7 @@ No example provided.

## `VinylQueueGetLoop`

`VinylQueueSetLoop(voice)`
`VinylQueueGetLoop(voice)`

<!-- tabs:start -->

Expand All @@ -186,6 +212,59 @@ No example provided.

&nbsp;

## `VinylQueueSetFadeIn`

`VinylQueueSetFadeIn(voice, fadeInRate)`

<!-- tabs:start -->

#### **Description**

*Returns:* N/A (`undefined`)

|Name |Datatype|Purpose |
|------------|--------|-------------------------|
|`voice` |voice |Queue voice to target |
|`fadeInRate`|number |Rate of change for the gain during the fade in of the queue as a whole. Defaults to `infinity`, playing the queue without a fade in|

Sets the fade in rate for the queue as a whole. A value of `infinity` will cause the queue to be played without fading in.

#### **Example**

```gml
No example provided.
```

<!-- tabs:end -->

&nbsp;

## `VinylQueueGetFadeIn`

`VinylQueueGetFadeIn(voice)`

<!-- tabs:start -->

#### **Description**

*Returns:* Number

|Name |Datatype|Purpose |
|-------|--------|-------------------------|
|`voice`|voice |Queue voice to target |

Returns the fade-in rate for the queue.

#### **Example**

```gml
No example provided.
```

<!-- tabs:end -->

&nbsp;

## `VinylQueueSetArray`

`VinylQueueSetArray(voice, soundArray)`
Expand Down Expand Up @@ -239,9 +318,9 @@ No example provided.

&nbsp;

## `VinylQueuePushBottom`
## `VinylQueueSetBottom`

`VinylQueuePushBottom(voice, sound)`
`VinylQueueSetBottom(voice, sound)`

<!-- tabs:start -->

Expand All @@ -254,7 +333,7 @@ No example provided.
|`voice`|voice |Queue voice to target |
|`sound`|sound |Sound to push to the bottom of the queue|

Pushes a sound to the bottom of a queue's array of sounds. If the queue is empty then the next sound will be played at the start of the next frame.
Sets the sound that's on the bottom of a queue's array of sounds, overwriting the sound that was already there (if any). If the queue is empty then this sound will be played at the start of the next frame.

#### **Example**

Expand All @@ -266,22 +345,22 @@ No example provided.

&nbsp;

## `VinylQueuePushTop`
## `VinylQueuePushBottom`

`VinylQueuePushTop(voice, sound)`
`VinylQueuePushBottom(voice, sound)`

<!-- tabs:start -->

#### **Description**

*Returns:* N/A (`undefined`)

|Name |Datatype|Purpose |
|-------|--------|-------------------------------------|
|`voice`|voice |Queue voice to target |
|`sound`|sound |Sound to push to the top of the queue|
|Name |Datatype|Purpose |
|-------|--------|----------------------------------------|
|`voice`|voice |Queue voice to target |
|`sound`|sound |Sound to push to the bottom of the queue|

Pushes a sound to the top of a queue's array of sounds. Once the currently playing sound has stopped, the sound pushed by this function will play. If the queue is empty then the next sound will be played at the start of the next frame.
Pushes a sound to the bottom of a queue's array of sounds. If the queue is empty then this sound will be played at the start of the next frame.

#### **Example**

Expand All @@ -293,22 +372,22 @@ No example provided.

&nbsp;

## `VinylQueueContains`
## `VinylQueuePushTop`

`VinylQueueContains(voice, sound)`
`VinylQueuePushTop(voice, sound)`

<!-- tabs:start -->

#### **Description**

*Returns:* Boolean
*Returns:* N/A (`undefined`)

|Name |Datatype|Purpose |
|-------|--------|---------------------|
|`voice`|voice |Queue voice to target|
|`sound`|sound |Sound to check for |
|Name |Datatype|Purpose |
|-------|--------|-------------------------------------|
|`voice`|voice |Queue voice to target |
|`sound`|sound |Sound to push to the top of the queue|

Returns whether a queue's array of sounds contains the specified target sound. This function will return `true` if the currently playing sound also matches the target sound.
Pushes a sound to the top of a queue's array of sounds. Once the currently playing sound has stopped, the sound pushed by this function will play. If the queue is empty then the next sound will be played at the start of the next frame.

#### **Example**

Expand All @@ -320,23 +399,22 @@ No example provided.

&nbsp;

## `VinylQueueClear`
## `VinylQueueContains`

`VinylQueueClear(voice)`
`VinylQueueContains(voice, sound)`

<!-- tabs:start -->

#### **Description**

*Returns:* N/A (`undefined`)
*Returns:* Boolean

|Name |Datatype|Purpose |
|-------|--------|---------------------|
|`voice`|voice |Queue voice to target|
|`sound`|sound |Sound to check for |

Clears all sounds in a queue's array of sounds.

!> This function won't stop the currently playing sound. Use `VinylStop()` to stop the currently playing sound in a queue.
Returns whether a queue's array of sounds contains the specified target sound. This function will return `true` if the currently playing sound also matches the target sound.

#### **Example**

Expand All @@ -348,9 +426,9 @@ No example provided.

&nbsp;

## `VinylQueueDestroy`
## `VinylQueueClear`

`VinylQueueDestroy(voice)`
`VinylQueueClear(voice)`

<!-- tabs:start -->

Expand All @@ -362,7 +440,9 @@ No example provided.
|-------|--------|---------------------|
|`voice`|voice |Queue voice to target|

Destroys a Vinyl queue. This stops any currently playing audio and renders the queue inoperable. This function is provided for convenience and you don't have to call this function to manage memory.
Clears all sounds in a queue's array of sounds.

!> This function won't stop the currently playing sound. Use `VinylStop()` to stop the currently playing sound in a queue.

#### **Example**

Expand Down

0 comments on commit 071c319

Please sign in to comment.