Skip to content

Commit

Permalink
Feature/cast pending event (#9)
Browse files Browse the repository at this point in the history
* add new item playing event, update casting logic

* demo app - disable cast buttons while cast is pending
  • Loading branch information
BryanChrisBrown authored Jul 7, 2023
1 parent b7ac1ef commit 01beafd
Show file tree
Hide file tree
Showing 15 changed files with 212 additions and 14 deletions.
18 changes: 18 additions & 0 deletions docs/classes/client.BridgeClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
### Properties

- [currentPlaylistIndex](client.BridgeClient.md#currentplaylistindex)
- [currentPlaylistItemIndex](client.BridgeClient.md#currentplaylistitemindex)
- [isCastPending](client.BridgeClient.md#iscastpending)
- [isConnected](client.BridgeClient.md#isconnected)
- [isDisconnecting](client.BridgeClient.md#isdisconnecting)
- [manualDisconnect](client.BridgeClient.md#manualdisconnect)
Expand Down Expand Up @@ -69,6 +71,22 @@ The index of playlists that is currently active

___

### currentPlaylistItemIndex

**currentPlaylistItemIndex**: `number`

The index of the playlist Item that is currently active

___

### isCastPending

**isCastPending**: `boolean` = `false`

store if we're currently in the middle of a cast

___

### isConnected

**isConnected**: `boolean`
Expand Down
2 changes: 2 additions & 0 deletions docs/classes/components_messageHandler.MessageHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

[`SyncPlayPlaylistCancelledMessageHandler`](components_messageHandler.SyncPlayPlaylistCancelledMessageHandler.md)

[`NewItemPlayingMessageHandler`](components_messageHandler.NewItemPlayingMessageHandler.md)

## Table of contents

### Constructors
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[@lookingglass/bridge](../README.md) / [components/messageHandler](../modules/components_messageHandler.md) / NewItemPlayingMessageHandler

# Class: NewItemPlayingMessageHandler

[components/messageHandler](../modules/components_messageHandler.md).NewItemPlayingMessageHandler

## Hierarchy

- [`MessageHandler`](components_messageHandler.MessageHandler.md)<``"New Item Playing"``\>

**`NewItemPlayingMessageHandler`**

## Table of contents

### Constructors

- [constructor](components_messageHandler.NewItemPlayingMessageHandler.md#constructor)

### Properties

- [bridgeEventName](components_messageHandler.NewItemPlayingMessageHandler.md#bridgeeventname)
- [client](components_messageHandler.NewItemPlayingMessageHandler.md#client)

### Methods

- [handle](components_messageHandler.NewItemPlayingMessageHandler.md#handle)

## Constructors

### constructor

**new NewItemPlayingMessageHandler**(`args`)

#### Parameters

| Name | Type |
| :------ | :------ |
| `args` | `Object` |
| `args.client` | [`BridgeClient`](client.BridgeClient.md) |

#### Overrides

[MessageHandler](components_messageHandler.MessageHandler.md).[constructor](components_messageHandler.MessageHandler.md#constructor)

## Properties

### bridgeEventName

**bridgeEventName**: ``"New Item Playing"``

#### Inherited from

[MessageHandler](components_messageHandler.MessageHandler.md).[bridgeEventName](components_messageHandler.MessageHandler.md#bridgeeventname)

___

### client

**client**: [`BridgeClient`](client.BridgeClient.md)

#### Inherited from

[MessageHandler](components_messageHandler.MessageHandler.md).[client](components_messageHandler.MessageHandler.md#client)

## Methods

### handle

**handle**(`message`): `void`

#### Parameters

| Name | Type | Default value |
| :------ | :------ | :------ |
| `message` | `Object` | `undefined` |
| `message.name` | `string` | `schema.name` |
| `message.orchestration` | { value: string; type: "WSTRING"; name: string; } | `undefined` |
| `message.payload` | { value: { playlist\_name: { value: string; type: "WSTRING"; name: string; }; index: { value: number; type: "UNSIGNED\_INT"; name: string; }; event: { value: "Monitor Connect" \| "Monitor Disconnect" \| ... 9 more ... \| "Transport Control Pause"; type: "WSTRING"; name: string; }; }; type: "VARIANT\_MAP"; name: string; } | `undefined` |
| `message.status` | { value: "Completion" \| "Pending" \| "Failure" \| "UnknownOrchestration"; type: "WSTRING"; name: string; } | `schema.status` |

#### Returns

`void`

#### Overrides

[MessageHandler](components_messageHandler.MessageHandler.md).[handle](components_messageHandler.MessageHandler.md#handle)
2 changes: 1 addition & 1 deletion docs/interfaces/schemas_defaults.defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ ___

### type

**type**: `NumberType`
**type**: [`NumberType`](../modules/schemas_defaults.md#numbertype)
1 change: 1 addition & 0 deletions docs/modules/components_messageHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [MessageHandler](../classes/components_messageHandler.MessageHandler.md)
- [MonitorConnectedMessageHandler](../classes/components_messageHandler.MonitorConnectedMessageHandler.md)
- [MonitorDisconnectedMessageHandler](../classes/components_messageHandler.MonitorDisconnectedMessageHandler.md)
- [NewItemPlayingMessageHandler](../classes/components_messageHandler.NewItemPlayingMessageHandler.md)
- [PlaylistDeleteMessageHandler](../classes/components_messageHandler.PlaylistDeleteMessageHandler.md)
- [PlaylistInsertMessageHandler](../classes/components_messageHandler.PlaylistInsertMessageHandler.md)
- [PlaylistInstanceMessageHandler](../classes/components_messageHandler.PlaylistInstanceMessageHandler.md)
Expand Down
7 changes: 7 additions & 0 deletions docs/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [MessageHandler](index.md#messagehandler)
- [MonitorConnectedMessageHandler](index.md#monitorconnectedmessagehandler)
- [MonitorDisconnectedMessageHandler](index.md#monitordisconnectedmessagehandler)
- [NewItemPlayingMessageHandler](index.md#newitemplayingmessagehandler)
- [Playlist](index.md#playlist)
- [PlaylistArgs](index.md#playlistargs)
- [PlaylistDeleteMessageHandler](index.md#playlistdeletemessagehandler)
Expand Down Expand Up @@ -93,6 +94,12 @@ Re-exports [MonitorDisconnectedMessageHandler](../classes/components_messageHand

___

### NewItemPlayingMessageHandler

Re-exports [NewItemPlayingMessageHandler](../classes/components_messageHandler.NewItemPlayingMessageHandler.md)

___

### Playlist

Re-exports [Playlist](../classes/playlists_playlist.Playlist.md)
Expand Down
13 changes: 13 additions & 0 deletions docs/modules/schemas_defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

- [defaults](../interfaces/schemas_defaults.defaults.md)

### Type Aliases

- [NumberType](schemas_defaults.md#numbertype)

### Variables

- [ASPECT](schemas_defaults.md#aspect)
Expand All @@ -20,6 +24,15 @@
- [QUILT\_VIEW\_COUNT](schemas_defaults.md#quilt_view_count)
- [ZOOM](schemas_defaults.md#zoom)

## Type Aliases

### NumberType

Ƭ **NumberType**: ``"int"`` \| ``"float"``

for certain values we need defaults in order to define our type schemas and also clamp values.
This helps prevent sending bridge values that are out of range.

## Variables

### ASPECT
Expand Down
Loading

0 comments on commit 01beafd

Please sign in to comment.