Total Complexity | 0 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from time import sleep |
||
2 | |||
3 | from timed_events import get_timed_events |
||
4 | |||
5 | from PyDMXControl.controllers import uDMXController as Controller |
||
6 | |||
7 | # Create controller and events |
||
8 | dmx = Controller(suppress_dmx_value_warnings=True) |
||
9 | |||
10 | # Load some fixtures from JSON |
||
11 | dmx.json.load_config('json/home.json') |
||
12 | |||
13 | # Pause/play testing |
||
14 | """ |
||
15 | from time import sleep |
||
16 | |||
17 | player.set_volume(0) |
||
18 | player.set_volume(1, 5000) |
||
19 | player.play("you-will-be-found.mp3") |
||
20 | print("playing") |
||
21 | sleep(10) |
||
22 | player.pause() |
||
23 | print("paused") |
||
24 | sleep(3) |
||
25 | player.unpause() |
||
26 | print("unpaused") |
||
27 | sleep(5) |
||
28 | player.stop() |
||
29 | print("stopped") |
||
30 | sleep(5) |
||
31 | """ |
||
32 | |||
33 | # Get the timed events (contains the audio) |
||
34 | events = get_timed_events(dmx) |
||
35 | |||
36 | # Play a light show using events to dear evan hansen - you will be found |
||
37 | events.run() |
||
38 | sleep(15) |
||
39 | print(events.data) |
||
40 | |||
41 | dmx.sleep_till_enter() |
||
42 | |||
43 | # Close |
||
44 | dmx.close() |
||
45 |