Skip to content

Commit

Permalink
Initial code for the ArtNet trigger/timecode parts
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Aug 13, 2021
0 parents commit 99ab9e3
Show file tree
Hide file tree
Showing 14 changed files with 975 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
._*

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include /opt/fpp/src/makefiles/common/setup.mk
include /opt/fpp/src/makefiles/platform/*.mk

all: libfpp-ArtNetAdv.so
debug: all

CFLAGS+=-I.
OBJECTS_fpp_ArtNetAdv_so += src/FPPArtNetAdv.o
LIBS_fpp_ArtNetAdv_so += -L/opt/fpp/src -lfpp
CXXFLAGS_src/FPPArtNetAdv.o += -I/opt/fpp/src


%.o: %.cpp Makefile
$(CCACHE) $(CC) $(CFLAGS) $(CXXFLAGS) $(CXXFLAGS_$@) -c $< -o $@

libfpp-ArtNetAdv.so: $(OBJECTS_fpp_ArtNetAdv_so) /opt/fpp/src/libfpp.so
$(CCACHE) $(CC) -shared $(CFLAGS_$@) $(OBJECTS_fpp_ArtNetAdv_so) $(LIBS_fpp_ArtNetAdv_so) $(LDFLAGS) -o $@

clean:
rm -f libfpp-ArtNetAdv.so $(OBJECTS_fpp_ArtNetAdv_so)

51 changes: 51 additions & 0 deletions callbacks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# DEBUG=1
DEBUG_LOG=${DEBUG_LOG:-${LOGDIR}/fpp-ArtNetAdv.log}

die()
{
echo $1 >&2
exit 1
}

usage()
{
echo "TODO: Fill usage in!"
}

OPTS=$(getopt -n $0 --options lt:d: --longoptions list,type:,data: -- "$@")

if [ -n "$DEBUG" ]; then
echo "Full args: $*" >> $DEBUG_LOG
fi

# Die if they fat finger arguments, this program will be run as root
[ $? = 0 ] || die "Error parsing arguments. Try $PROGRAM_NAME --help"

eval set -- "$OPTS"
while true; do
case $1 in
-l|--list)
echo "c++";
exit 0;
;;
-h|--help)
usage
exit 0
;;
-v|--version)
printf "%s, version %s\n" "$PROGRAM_NAME" "$PROGRAM_VERSION"
exit 0
;;
--)
# no more arguments to parse
break
;;
*)
printf "Unknown option %s\n" "$1"
exit 1
;;
esac
done

3 changes: 3 additions & 0 deletions help/plugin_setup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The FPP ArtNet Advanced Plugin provides additional ArtNet capabilities beyond the simple
ArtNet UDP output that is built into FPP. This include ArtNet Timecode support and ArtNet
Triggers.
10 changes: 10 additions & 0 deletions output_menu.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

//$pages = Array(
// 'name' => "Matrix Tools",
// 'type' => "status",
// 'page' => "plugin_setup.php");
//
?>

<li><a href="<?php echo preg_replace('/.*\/plugins\/(.*)/', 'plugin.php?plugin=$1&page=plugin_setup.php', dirname(__FILE__)); ?>">ArtNet Advanced</a></li>
19 changes: 19 additions & 0 deletions pluginInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"repoName": "fpp-ArtNetAdv",
"name": "ArtNet Advanced Features",
"author": "Daniel Kulp",
"description": "Several Advanced ArtNet features including ArtNet Triggers and ArtNet TimeCodes",
"homeURL": "https://github.com/FalconChristmas/fpp-ArtNetAdv",
"srcURL": "https://github.com/FalconChristmas/fpp-ArtNetAdv.git",
"bugURL": "https://github.com/FalconChristmas/fpp-ArtNetAdv/issues",
"versions": [
{
"minFPPVersion": "5.1",
"maxFPPVersion": "0",
"branch": "master",
"sha": "",
"allowUpdates": 1
}
]
}

11 changes: 11 additions & 0 deletions plugin_setup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@



<div id="global" class="settings">
<?
PrintSettingGroup("ArtNetTimeCode", "", "", 1, "fpp-ArtNetAdv");

PrintSettingGroup("ArtTriggerSupport", "", "", 1, "fpp-ArtNetAdv");
?>


8 changes: 8 additions & 0 deletions scripts/fpp_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# fpp-ArtNetAdv install script

BASEDIR=$(dirname $0)
cd $BASEDIR
cd ..
make
10 changes: 10 additions & 0 deletions scripts/fpp_uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# fpp-ArtNetAdv uninstall script
echo "Running fpp-ArtNetAdv uninstall Script"

BASEDIR=$(dirname $0)
cd $BASEDIR
cd ..
make clean

8 changes: 8 additions & 0 deletions scripts/preStart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

echo "Running fpp-ArtNetAdv PreStart Script"

BASEDIR=$(dirname $0)
cd $BASEDIR
cd ..
make
116 changes: 116 additions & 0 deletions settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"settingGroups": {
"ArtNetTimeCode": {
"description": "ArtNet Timecode Support",
"settings": [
"ArtNetTimeCodeEnabled",
"ArtNetTimeCodeType",
"ArtNetTimeCodeHourIsIndex",
"ArtNetTimeCodeTarget",
"ArtNetSyncPlaylist"
]
},
"ArtTriggerSupport": {
"description": "ArtNet Trigger Support",
"settings": [
"ArtNetTriggerEnabled",
"ArtNetTriggerOEMCode"
]
}
},
"settings": {
"ArtNetTriggerEnabled": {
"name": "ArtNetTriggerEnabled",
"description": "Enable ArtNet Trigger Processing",
"tip": "Enable ArtNet Trigger Processing",
"restart": 1,
"reboot": 0,
"type": "checkbox",
"default": 0,
"children": {
"1": [
"ArtNetTriggerOEMCode"
]
}
},
"ArtNetTriggerOEMCode": {
"name": "ArtNetTriggerOEMCode",
"description": "OEM Code (hex) for Trigger",
"tip": "The OEM Code to look for to process triggers. The payload will be a FPP Command JSON.",
"restart": 1,
"reboot": 0,
"default": "0x21s00",
"type": "text",
"size": 6,
"maxlength": "6"
},
"ArtNetTimeCodeEnabled": {
"name": "ArtNetTimeCodeEnabled",
"description": "Enable ArtNet Timecode",
"tip": "Enable ArtNet Timecode",
"restart": 1,
"reboot": 0,
"type": "checkbox",
"default": 0,
"children": {
"1": [
"ArtNetTimeCodeType",
"ArtNetTimeCodeHourIsIndex",
"ArtNetTimeCodeTarget",
"ArtNetSyncPlaylist"
]
}
},
"ArtNetTimeCodeHourIsIndex": {
"name": "ArtNetTimeCodeHourIsIndex",
"description": "Hour Field Is Playlist Index",
"tip": "If enabled, the hour field of the time code will represent the index into the playlist instead of the actual hour.",
"restart": 1,
"reboot": 0,
"type": "checkbox",
"default": 0
},
"ArtNetTimeCodeType": {
"name": "ArtNetTimeCodeType",
"description": "ArtNet TimeCode Type",
"tip": "The format of the TimeCode",
"restart": 1,
"reboot": 0,
"default": 3,
"type": "select",
"options": {
"24fps": 0,
"25fps": 1,
"29.97fps": 2,
"30fps": 3
},
"fppModes": [
"player"
]
},
"ArtNetTimeCodeTarget": {
"name": "ArtNetTimeCodeTarget",
"description": "Target IP Addresses",
"tip": "Target IP Addresses for ArtNet TimeCode (comma separated)",
"default": "255.255.255.255",
"type": "text",
"size": 37,
"maxlength": 256,
"fppModes": [
"player"
]
},
"ArtNetSyncPlaylist": {
"name": "ArtNetSyncPlaylist",
"description": "Playlist to sync the ArtNet TimeCode",
"type": "select",
"default": "",
"optionsURL": "api/playlists",
"optionCanBeBlank": true,
"fppModes": [
"remote"
]
}

}
}
Loading

0 comments on commit 99ab9e3

Please sign in to comment.