def initDefaultProject(self): # Initialize default project proj = project.Project("Default project", "This is the default project.", self._createOrReuseOutputDevice()) # Initialize filtergraph # fg = configs.createSpectrumGraph(num_pixels, device) # fg = configs.createMovingLightGraph(num_pixels, device) # fg = configs.createMovingLightsGraph(num_pixels, device) # fg = configs.createVUPeakGraph(num_pixels, device) initial = configs.createSwimmingPoolGraph() second = configs.createDefenceGraph() # fg = configs.createKeyboardGraph(num_pixels, device) proj.setFiltergraphForSlot(12, initial) proj.setFiltergraphForSlot(13, second) proj.activateScene(12) projectUid = uuid.uuid4().hex proj.id = projectUid self._projects[projectUid] = proj self._projectMetadatas[projectUid] = self._metadataForProject( proj, projectUid) self._config[CONFIG_ACTIVE_PROJECT] = projectUid activeProjectUid = projectUid return activeProjectUid
def createFilterGraph(config, num_pixels): print("Creating config {}".format(config)) if config == movingLightConf: return configs.createMovingLightGraph() elif config == movingLightsConf: return configs.createMovingLightsGraph() elif config == spectrumConf: return configs.createSpectrumGraph() elif config == vu_peakConf: return configs.createVUPeakGraph() elif config == swimmingConf: return configs.createSwimmingPoolGraph() elif config == defenceConf: return configs.createDefenceGraph() elif config == keyboardConf: return configs.createKeyboardGraph() elif config == keyboardSpringConf: return configs.createKeyboardSpringGraph() elif config == proxyConf: return configs.createProxyServerGraph() elif config == fallingConf: return configs.createFallingStarsGraph() elif config == breathingConf: return configs.createBreathingGraph() elif config == heartbeatConf: return configs.createHeartbeatGraph() elif config == pendulumConf: return configs.createPendulumGraph() elif config == rpendulumConf: return configs.createRPendulumGraph() elif config == testblobConf: return configs.createTestBlobGraph() elif config == bonfireConf: return configs.createBonfireGraph() elif config == generatewavesConf: return configs.createGenerateWavesGraph() elif config == sortingConf: return configs.createSortingGraph() elif config == gifConf: return configs.createGifPlayerGraph() elif config == panelConf: return configs.createPanelPendulum() elif config == oscilloscopeConf: return configs.createOscilloscope() else: raise NotImplementedError("Config not implemented")
def createFilterGraph(config, num_pixels, device): if config == movingLightConf: return configs.createMovingLightGraph(num_pixels, device) elif config == movingLightsConf: return configs.createMovingLightsGraph(num_pixels, device) elif config == spectrumConf: return configs.createSpectrumGraph(num_pixels, device) elif config == vu_peakConf: return configs.createVUPeakGraph(num_pixels, device) elif config == swimmingConf: return configs.createSwimmingPoolGraph(num_pixels,device) elif config == defenceConf: return configs.createDefenceGraph(num_pixels, device) elif config == keyboardConf: return configs.createKeyboardGraph(num_pixels, device) elif config == proxyConf: return configs.createProxyServerGraph(num_pixels, device) else: raise NotImplementedError("Config not implemented")
elif args.device == deviceCandy: device = devices.FadeCandy(args.device_candy_server) devices.LEDOutput.overrideDevice = device # Initialize Audio device if args.audio_device_index is not None: audio.AudioInput.overrideDeviceIndex = args.audio_device_index # strand test strandTest(device, num_pixels) # print audio information print("The following audio devices are available:") audio.print_audio_devices() # Initialize filtergraph #fg = configs.createSpectrumGraph(num_pixels, device) #fg = configs.createMovingLightGraph(num_pixels, device) #fg = configs.createMovingLightsGraph(num_pixels, device) #fg = configs.createVUPeakGraph(num_pixels, device) fg = configs.createSwimmingPoolGraph(num_pixels, device) # Init defaults default_values[ 'fs'] = 48000 # ToDo: How to provide fs information to downstream effects? default_values['num_pixels'] = num_pixels app = create_app() app.run(debug=False, host="0.0.0.0")