c2e7772ebe
This patch adds library callbacks for adding a new path and for updating tracks in a path. Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
63 lines
1.5 KiB
Python
63 lines
1.5 KiB
Python
#!/usr/bin/python
|
|
Import("env", "CONFIG")
|
|
|
|
class Module:
|
|
def __init__(self, source = None, package = "", depends = []):
|
|
self.depends = depends
|
|
self.package = package
|
|
self.source = source
|
|
|
|
|
|
modules = {
|
|
###########################
|
|
# #
|
|
# Define new modules here #
|
|
# #
|
|
###########################
|
|
|
|
"AUDIO" : Module("audio.cpp", package = "gstreamer-1.0", depends = [ "DECK" ]),
|
|
"CALLBACK" : Module("callback.cpp"),
|
|
"DATABASE" : Module("database.cpp", depends = [ "FILE" ]),
|
|
"DECK" : Module("deck.cpp", depends = [ "PLAYQUEUE" ]),
|
|
"FILE" : Module("file.cpp", package = "glib-2.0"),
|
|
"FILTER" : Module("filter.cpp", depends = [ "DATABASE" ]),
|
|
"IDLE" : Module("idle.cpp"),
|
|
"LIBRARY" : Module("library.cpp", package = "taglib", depends = [ "CALLBACK", "DATABASE", "FILTER", "IDLE" ]),
|
|
"PLAYLIST" : Module("playlist.cpp", depends = [ "DATABASE" ]),
|
|
"PLAYQUEUE" : Module("playqueue.cpp", depends = [ "LIBRARY" ]),
|
|
|
|
###########################
|
|
###########################
|
|
}
|
|
|
|
|
|
build = []
|
|
enabled = []
|
|
|
|
def resolve(name):
|
|
CONFIG.__dict__[name] = True
|
|
mod = modules[name]
|
|
|
|
if mod.package != "":
|
|
CONFIG.package(mod.package)
|
|
|
|
res = [ env.Object(mod.source) ]
|
|
|
|
for dep in mod.depends:
|
|
if CONFIG.__dict__.get(dep) == False:
|
|
res += resolve(dep)
|
|
|
|
return res
|
|
|
|
|
|
|
|
for key in modules.keys():
|
|
if CONFIG.__dict__[key] == True:
|
|
enabled += [key]
|
|
|
|
for mod in enabled:
|
|
build += resolve(mod)
|
|
|
|
|
|
Return("build")
|