# Soundboard Engine - customizable soundboard # Copyright (C) 2026 Vidhu Kant Sharma # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import json class Soundboard: def __init__(self, soundboard_path): self.soundboard_path = soundboard_path self.categories = [] def build(self): data = json.load(open(self.soundboard_path)) for _c in data["categories"]: c = SoundboardCategory(_c["name"], _c["image_path"]) for _s in _c["sounds"]: s = SoundboardSound(_s["title"], _s["path"]) c.sounds.append(s) self.categories.append(c) self.soundboard_name = data["soundboard_name"] self.soundboard_id = data["soundboard_id"] self.soundboard_author = data["soundboard_author"] self.soundboard_version = data["soundboard_version"] self.update_url = data["update_url"] class SoundboardCategory: def __init__(self, name, image_path): self.name = name self.image_path = image_path self.sounds = [] class SoundboardSound: def __init__(self, title, path): self.title = title self.path = path