Skip to content

Commit 55b239e

Browse files
'#27 - onDone functionality returned'
1 parent 377f6a3 commit 55b239e

File tree

7 files changed

+27
-4
lines changed

7 files changed

+27
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 5.0.0+14
4+
5+
* #27 - onDone functionality returned
6+
37
## 5.0.0+13
48

59
* scene items

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ In your project add the dependency:
4545
```yml
4646
dependencies:
4747
...
48-
obs_websocket: ^5.0.0+13
48+
obs_websocket: ^5.0.0+14
4949
```
5050
5151
For help getting started with dart, check out these [guides](https://dart.dev/guides).

example/example.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ main() async {
1212
logOptions: LogOptions(LogLevel.debug),
1313
fallbackEventHandler: (Event event) =>
1414
print('type: ${event.eventType} data: ${event.eventData}'),
15+
onDone: () => print('done'),
1516
);
1617

1718
var res = await obs.outputs.toggleReplayBuffer();

lib/meta.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// DO NOT EDIT THIS FILE
2+
/// THIS FILE IS AUTOMATICALLY OVER WRITTEN BY PublishTools
3+
import 'dart:convert' show json;
4+
5+
final pubSpec = json.decode(
6+
'{"name":"obs_websocket","version":"5.0.0+14","homepage":"https://github.com/faithoflifedev/easy_obs_websocket","environment":{"sdk":">=2.17.3 <3.0.0"},"description":"obs_websocket allows dart-based connections to the OBS (Open Broadcaster Software) plugin obs-websocket","dependencies":{"args":"^2.3.1","crypto":"^3.0.2","json_annotation":"^4.7.0","loggy":"^2.0.3","uuid":"^3.0.7","universal_io":"^2.0.4","validators":"^3.0.0","web_socket_channel":"^2.2.0","yaml":"^3.1.1"},"dev_dependencies":{"build_runner":"^2.3.2","grinder":"^0.9.2","http":"^0.13.5","json_serializable":"^6.5.4","lints":"^2.0.1","mustache_template":"^2.0.0","path":"^1.8.2","process_run":"^0.12.3+2","pub_semver":"^2.1.3","pubspec":"^2.3.0","test":"^1.22.0","publish_tools":{"path":"../../publish_tools"}},"executables":{"obs":""},"repository":"https://github.com/faithoflifedev/easy_obs_websocket"}');

lib/src/obs_websocket_base.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class ObsWebSocket with UiLoggy {
1515

1616
final String? password;
1717

18+
final Function? onDone;
19+
1820
final List<Function> fallbackHandlers = [];
1921

2022
final eventHandlers = <String, List<Function>>{};
@@ -94,7 +96,7 @@ class ObsWebSocket with UiLoggy {
9496
ObsWebSocket(
9597
this.websocketChannel, {
9698
this.password,
97-
Function()? onDone,
99+
this.onDone,
98100
Function? fallbackEventHandler,
99101
}) : broadcastStream = websocketChannel.stream.asBroadcastStream() {
100102
_config = request.Config(this);
@@ -344,6 +346,8 @@ class ObsWebSocket with UiLoggy {
344346

345347
///Before execution finished the websocket needs to be closed
346348
Future<void> close() async {
349+
if (onDone != null) onDone!();
350+
347351
await websocketChannel.sink.close(status.normalClosure);
348352
}
349353

pubspec.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: obs_websocket
2-
version: 5.0.0+13
2+
version: 5.0.0+14
33
homepage: https://github.com/faithoflifedev/easy_obs_websocket
44
description: obs_websocket allows dart-based connections to the OBS (Open Broadcaster Software) plugin obs-websocket
55
repository: https://github.com/faithoflifedev/easy_obs_websocket
@@ -28,6 +28,8 @@ dev_dependencies:
2828
pubspec: ^2.3.0
2929
test: ^1.22.0
3030

31-
publish_tools: ^0.1.0+5
31+
# publish_tools: ^0.1.0+9
32+
publish_tools:
33+
path: ../../publish_tools
3234
executables:
3335
obs:

tool/grind.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ main(args) async {
77
grind(args);
88
}
99

10+
@Task('meta')
11+
@Depends('pt-meta')
12+
meta() {
13+
log('meta done');
14+
}
15+
1016
@DefaultTask('Just keeping it real')
1117
@Depends('pt-commit', 'pt-publish', 'pt-homebrew')
1218
done() {

0 commit comments

Comments
 (0)