1 | node-applest-atem
|
2 | ========
|
3 | A module to control Blackmagic Design ATEM Switchers.
|
4 |
|
5 | Installation
|
6 | --------
|
7 | Install this module using npm.
|
8 | *Note: this module name is `applest-atem`*
|
9 | ```sh
|
10 | $ npm install applest-atem --save
|
11 | ```
|
12 |
|
13 | Usage
|
14 | --------
|
15 | ```javascript
|
16 | var ATEM = require('applest-atem');
|
17 |
|
18 | var atem = new ATEM();
|
19 | atem.connect('192.168.1.220'); // Replace your ATEM switcher. address.
|
20 |
|
21 | atem.changeProgramInput(1);
|
22 | atem.changePreviewInput(2);
|
23 | atem.autoTransition();
|
24 |
|
25 | atem.on('commandReceive', function(err, state) {
|
26 | console.log(state); // catch the ATEM state.
|
27 | });
|
28 | console.log(atem.state); // or use this.
|
29 | ```
|
30 |
|
31 | Demo
|
32 | --------
|
33 | See atem-web-controller.
|
34 |
|
35 | Debug
|
36 | --------
|
37 | Set `ATEM_DEBUG=true` environment variable, you can see raw packet.
|
38 | ```sh
|
39 | $ ATEM_DEBUG=true coffee debug.coffee
|
40 | SEND <Buffer 10 14 53 ab 00 00 00 00 00 3a 00 00 01 00 00 00 00 00 00 00>
|
41 | SEND <Buffer 80 0c 53 ab 00 00 00 00 00 03 00 00>
|
42 | SEND <Buffer 80 0c 53 ab 00 00 00 00 00 03 00 00>
|
43 | SEND <Buffer 80 0c 80 0f 00 01 00 00 00 41 00 00>
|
44 | RECV _ver(12) <Buffer 00 0c 90 60 5f 76 65 72 00 02 00 10>...
|
45 | ```
|
46 |
|
47 | Test
|
48 | --------
|
49 | This module run tests by mocha.
|
50 | You can run the test only if you have ATEM switchers.
|
51 | ```sh
|
52 | $ cake test
|
53 | ```
|
54 |
|
55 | Use `ATEM_ADDR` or `ATEM_PORT` environment variables if you want to use specific ip address or port.
|
56 | ```sh
|
57 | $ ATEM_ADDR=192.168.1.220 ATEM_PORT=9910 cake test
|
58 | ```
|
59 |
|
60 | ### Example
|
61 | ![](docs/atem-test.gif)
|
62 |
|
63 | Contributing
|
64 | --------
|
65 | 1. Fork it ( https://github.com/miyukki/applest-atem )
|
66 | 2. Create your feature branch (`git checkout -b my-new-feature`)
|
67 | 3. Add your feature and write a test
|
68 | 4. Commit your changes (`git commit -am 'Add some feature'`)
|
69 | 5. Push to the branch (`git push origin my-new-feature`)
|
70 | 6. Create new Pull Request
|
71 |
|
72 | License
|
73 | --------
|
74 | The MIT License (MIT)
|
75 |
|
76 | Copyright (c) 2015 Yusei Yamanaka (miyukki)
|
77 |
|
78 | Permission is hereby granted, free of charge, to any person obtaining a copy
|
79 | of this software and associated documentation files (the "Software"), to deal
|
80 | in the Software without restriction, including without limitation the rights
|
81 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
82 | copies of the Software, and to permit persons to whom the Software is
|
83 | furnished to do so, subject to the following conditions:
|
84 |
|
85 | The above copyright notice and this permission notice shall be included in
|
86 | all copies or substantial portions of the Software.
|
87 |
|
88 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
89 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
90 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
91 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
92 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
93 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
94 | THE SOFTWARE.
|