commit 7682dcdcf82b4453600d521401e0b6d33d03b8b0 Author: Logen Kain Date: Thu Jan 9 11:52:51 2025 -0500 Frist commit diff --git a/lib.py b/lib.py new file mode 100644 index 0000000..0e32cf8 --- /dev/null +++ b/lib.py @@ -0,0 +1,51 @@ +import sys + +MEDIAPLAYER = "vlc" + +def mainMenu(): + + print("(S)tream") + print("(W)atch") + print("(Q)uit") + print() + x = input ("s/w/q: ").strip().lower() + + if x in ("s","w","q"): + return x + else: + return 1 + +def quitLKStream(): + #gracefully shut stuff down + #Close holesail + #Close MEDIAPLAYER + #Close mediamtx + sys.exit() + +def startLKStream(): + #start mediamtx server + #start holesail with randomized key + #start ffmpeg streaming to mediamtx + #For the moment, we won't be doing that but using OBS + + print("TODO: Start Streaming") + return "Fake Key" #return holesail key + +def mainMenuHandling(x): + if x == 'q': + quitLKStream() + + elif x == 's': + holesailKey = startLKStream() + return holesailKey + + elif x == 'w': + #Ask for holesail key + #Connect to holesail (subprocess?) + #Connect to stream with MEDIAPLAYER(subprocess?) + # Use a default stream location if streaming with FFMPEG, with OBS it's the default plus stream key + print("TODO Watch Stream") + return 0 + else: + print("invalid option x was: ", x) + return 1 diff --git a/main.py b/main.py new file mode 100644 index 0000000..2bec054 --- /dev/null +++ b/main.py @@ -0,0 +1,11 @@ +from lib import * + +holesailKey = "Holesail has not been started" + +while True: + result = mainMenuHandling(mainMenu()) + + if result != 1 and result != 0: + holesailKey = result + + print("Key: ", holesailKey)