Skip to content

Commit 469aa11

Browse files
committed
Documentation Basics
1 parent 51f5f89 commit 469aa11

File tree

9 files changed

+212
-2
lines changed

9 files changed

+212
-2
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,29 @@
22

33
![pydeohub](https://user-images.githubusercontent.com/37907774/195731748-53e8b78e-fc42-4e33-93c9-64b7ffa5bb33.png)
44

5-
Python interface for Blackmagic Design Smart Videohub SDI routers.
5+
Python interface for ethernet-connected Blackmagic Design Smart Videohub SDI routers.
6+
7+
## Installation
8+
```
9+
pip install pydeohub
10+
```
11+
12+
## Documentation
13+
A full API reference and small walkthrough is available on [Read the Docs](http://pydeohub.readthedocs.io/).
14+
15+
## Example
16+
```python
17+
from pydeohub import Videohub
18+
19+
hub = Videohub('192.168.0.150')
20+
21+
hub.route(0, 0) # Note that input/output identifiers are 0-indexed.
22+
23+
hub.input_label(1, 'Camera 2')
24+
hub.output_label(0, 'Switcher 1')
25+
```
26+
27+
## Additional Information
28+
This is a work in progress and while it implements the vast majority of the Videohub Ethernet Protocol, it does not do everything. The infrastructure around locking inputs and oututs, video processors, and serial controllers is unimplemented.
29+
30+
Questions, comments, and contributions are welcome.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
API Reference
2+
=====================================
3+
4+
Videohub
5+
---------
6+
.. automodule:: pydeohub
7+
:members:

docs/conf.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Path setup --------------------------------------------------------------
7+
8+
# If extensions (or modules to document with autodoc) are in another directory,
9+
# add these directories to sys.path here. If the directory is relative to the
10+
# documentation root, use os.path.abspath to make it absolute, like shown here.
11+
#
12+
import os
13+
import sys
14+
sys.path.insert(0, os.path.abspath('..'))
15+
16+
# -- Project information -----------------------------------------------------
17+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
18+
19+
project = 'pydeohub'
20+
copyright = '2022, Daniel Flanagan'
21+
author = 'Daniel Flanagan'
22+
release = '0.0.1'
23+
24+
# -- General configuration ---------------------------------------------------
25+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
26+
27+
extensions = [
28+
'sphinx.ext.autodoc',
29+
'sphinx.ext.napoleon',
30+
'numpydoc'
31+
]
32+
33+
autodoc_member_order = 'bysource'
34+
numpydoc_show_class_members = False
35+
numpydoc_class_members_toctree = False
36+
37+
templates_path = ['_templates']
38+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
39+
40+
41+
42+
# -- Options for HTML output -------------------------------------------------
43+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
44+
45+
html_theme = 'sphinx_rtd_theme'
46+
html_static_path = ['_static']

docs/index.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. pydeohub documentation master file, created by
2+
sphinx-quickstart on Wed Oct 19 15:49:05 2022.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Pydeohub
7+
====================================
8+
Python interface for Blackmagic Design Smart Videohub SDI routers.
9+
10+
.. toctree::
11+
:maxdepth: 2
12+
:caption: Contents:
13+
14+
intro
15+
api
16+
17+
18+
19+
Indices and tables
20+
==================
21+
22+
* :ref:`genindex`
23+
* :ref:`modindex`
24+
* :ref:`search`

docs/intro.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Introduction
2+
============
3+
4+
Installation
5+
------------
6+
7+
This package is available on ``pip``::
8+
9+
pip install pydeohub
10+
11+
Requirements
12+
------------
13+
Pydeohub was developed with Python 3.9 but contains no external dependencies so should be compatiable with all current versions of Python 3.7+.
14+
15+
The Smart Videohub you're using should be fully updated, this library was developed on a `Smart Videohub 20x20 <https://www.blackmagicdesign.com/products/smartvideohub/techspecs/W-VHS-02>`_ but should be compatiable with all recent Smart Videohub models with an ethernet connection.
16+
17+
Getting Started
18+
----------------
19+
The following code example shows how to initiate a connection with a Videohub::
20+
21+
from pydeohub import Videohub
22+
23+
hub = Videohub('192.168.0.150')
24+
25+
=================
26+
Routing
27+
=================
28+
There are two way to re-route inputs and outputs on the Smart Videohub, individual changes or bulk changes::
29+
30+
hub.route(0, 0) # Routes Input 1 to Output 1
31+
32+
bulk_routes = [
33+
(0, 0),
34+
(1, 1),
35+
(2, 2),
36+
(3, 3),
37+
(4, 4),
38+
(5, 5)
39+
]
40+
hub.bulk_route(bulk_routes) # Routes Inputs 1-6 to Outputs 1-6
41+
42+
.. note:: All input and output identifiers are 0-indexed so 'Input 1' is actually identifier `0`.
43+
44+
=================
45+
Labels
46+
=================
47+
Each input and output has an associated label that is displayed on the Videohub's built-in display and most accompying Blackmagic software integrations. Pydeohub can modify these labels programatically::
48+
49+
hub.input_label(0, 'Camera 1') # Label Input 1 as Camera 1
50+
51+
hub.output_label(19, 'Main TV') # Label Output 20 as Main TV
52+

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

pydeohub/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def bulk_route(self, routes: List[Tuple[int, int]]) -> None:
154154
Parameters
155155
----------
156156
routes : List[Tuple[int, int]]
157-
A list of (destination, source) vido output/input identifiers.
157+
A list of (destination, source) video output/input identifiers.
158158
"""
159159
command = ''
160160
for route in routes:

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ imagesize==1.4.1
99
importlib-metadata==5.0.0
1010
Jinja2==3.1.2
1111
MarkupSafe==2.1.1
12+
numpydoc==1.5.0
1213
packaging==21.3
1314
Pygments==2.13.0
1415
pyparsing==3.0.9

0 commit comments

Comments
 (0)