From aea69fb4bf615bc7c27f7502ca03a3c6369abbd4 Mon Sep 17 00:00:00 2001 From: Alex Orid Date: Fri, 9 Apr 2021 14:27:47 -0400 Subject: [PATCH 1/2] Chyron Module --- chyron_config.py | 0 chyron_module.py | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 chyron_config.py create mode 100644 chyron_module.py diff --git a/chyron_config.py b/chyron_config.py new file mode 100644 index 0000000..e69de29 diff --git a/chyron_module.py b/chyron_module.py new file mode 100644 index 0000000..0fe5c29 --- /dev/null +++ b/chyron_module.py @@ -0,0 +1,40 @@ +import chyron_config + +class Chyron_Module(): + def __init__(self): + super().__init__() + self.chyron_string = "" + self.chyron_items:list = [] + + def testmain(): + pass + + def chyron_string_updater(self): + pass + + def addItem(self, name, title, content): + newItem = ChyronItem.setupItem(name, title, content) + self.chyron_items.append(newItem) + + def removeItem(self, name): + for c in self.chyron_items: + if c.itemName == name: + self.chyron_items.remove(c) + + +class ChyronItem(): + def __init__(self): + super().__init__() + self.itemName = "" + self.itemTitle = "" + self.itemContent = "" + + def setupItem(self, name, title, content): + self.itemName = name + self.itemTitle = title + self.itemContent = content + + +if __name__ == "__main__": + testModule = Chyron_Module() + testModule.testmain() \ No newline at end of file From ecffe6083b01e72e2f4c835ea6bac90c6dbc2068 Mon Sep 17 00:00:00 2001 From: Alex Orid Date: Fri, 9 Apr 2021 15:00:36 -0400 Subject: [PATCH 2/2] Added Test --- chyron_config.py | 0 chyron_module.py | 62 +++++++++++++++++++++++++++++++++++++++++------- config.py | 22 +++++++++-------- 3 files changed, 65 insertions(+), 19 deletions(-) delete mode 100644 chyron_config.py diff --git a/chyron_config.py b/chyron_config.py deleted file mode 100644 index e69de29..0000000 diff --git a/chyron_module.py b/chyron_module.py index 0fe5c29..9952bfd 100644 --- a/chyron_module.py +++ b/chyron_module.py @@ -1,19 +1,23 @@ -import chyron_config +import config class Chyron_Module(): def __init__(self): super().__init__() - self.chyron_string = "" + self.chyron_computedString = "" self.chyron_items:list = [] - def testmain(): - pass - - def chyron_string_updater(self): - pass + def chyron_stringUpdater(self): + newString = "" + for c in self.chyron_items: + c.item_stringUpdater() + newString = newString + c.itemComputedString + for x in range(config.chyronListSpaceCount): + newString = newString + " " + self.chyron_computedString = newString def addItem(self, name, title, content): - newItem = ChyronItem.setupItem(name, title, content) + newItem:ChyronItem = ChyronItem() + newItem.setupItem(name, title, content) self.chyron_items.append(newItem) def removeItem(self, name): @@ -26,15 +30,55 @@ class ChyronItem(): def __init__(self): super().__init__() self.itemName = "" + + self.includeTitle = True self.itemTitle = "" self.itemContent = "" + self.itemComputedString = "" + def setupItem(self, name, title, content): + print("Setting up Item {", name,"}[", title, content, "]") self.itemName = name self.itemTitle = title self.itemContent = content + def item_stringUpdater(self): + newString = "" + if self.includeTitle == True: + newString = newString + self.itemTitle + newString = newString + self.itemContent + self.itemComputedString = newString + + if __name__ == "__main__": testModule = Chyron_Module() - testModule.testmain() \ No newline at end of file + testModule.addItem( + "test", + "Now: ", + "Coding Stream") + testModule.addItem( + "FriSat", + "► Friday & Saturday: ", + "Coding Stream") + testModule.addItem( + "Commands", + "► Commands: ", + "!animal, !climateclock, !discord, !page, !roll") + testModule.addItem( + "Website", + "► Want to read about my various projects? visit: ", + "TheCuriousNerd.com") + testModule.addItem( + "Follow", + "", + "► If you like what you see, hit that follow button to see more!") + testModule.addItem( + "Discord", + "► Want to join our discord? type \" !d \" in chat to get the link or visit: ", + "discord.io/thecuriousnerd") + testModule.chyron_stringUpdater() + + test = testModule.chyron_computedString + "<<<|" + print(test) \ No newline at end of file diff --git a/config.py b/config.py index db465fd..a0a077a 100644 --- a/config.py +++ b/config.py @@ -41,19 +41,15 @@ blockAll_TTS_URL_Discord = True autoEnabled_Discord_rgbLightControl = False +#Chyron Module Configs +chyronListSpaceCount = 25 - +#General Configs skip_splashScreen = False skip_splashScreenClear = False skip_splashScreenSleep = False - -class Speaker(Enum): - GOOGLE_TEXT_TO_SPEECH = 1 - STREAMLABS_API = 2 - -currentSpeaker = Speaker.GOOGLE_TEXT_TO_SPEECH - +botList = ("Nightbot", "StreamElements", "Moobot", "Praxis Bot", "praxis_bot", "MEE6 +", "Nerdy", "Rythm", "Groovy") class FileNameStrategy(Enum): TIME_BASED = 1 @@ -69,6 +65,13 @@ class DBStrategy(Enum): dbStrategy = DBStrategy.SQLite +#TTS Configs +class Speaker(Enum): + GOOGLE_TEXT_TO_SPEECH = 1 + STREAMLABS_API = 2 + +currentSpeaker = Speaker.GOOGLE_TEXT_TO_SPEECH + class PollyVoices(Enum): Aditi = "Aditi" Amy = "Amy" @@ -134,8 +137,7 @@ class PollyVoices(Enum): PollyVoice = PollyVoices.Justin -botList = ("Nightbot", "StreamElements", "Moobot", "Praxis Bot", "praxis_bot", "MEE6 +", "Nerdy", "Rythm", "Groovy") - +#Misc Configs slurList = badwords.slurList praxisVersion_Alpha = "A.0 "