def setup_plugins(self): """ discover all plugins and populate the plugin combo boxes setup signals so that selecting a plugin has some effect """ self.prevAttentionPluginIndex = 0 self.prevMeditationPluginIndex = 0 self.prevEyeBlinkPluginIndex = 0 #enable the following 2 lines of code to debug yapsy discovery #import logging #logging.basicConfig(level=logging.DEBUG) from yapsy.PluginManager import PluginManagerSingleton manager = PluginManagerSingleton.get() from getinstallpath import getInstallPath import os.path places = [ os.path.join(getInstallPath(), "midicontroller/plugins/scoregenerators") ] manager.setPluginPlaces(places) manager.locatePlugins() manager.loadPlugins() print "Discovered the following plugins:" for plugin in manager.getAllPlugins(): n = plugin.plugin_object.name print n self.attentionPluginComboBox.addItem(n) self.meditationPluginComboBox.addItem(n) self.eyeBlinkPluginComboBox.addItem(n) self.attentionPluginComboBox.currentIndexChanged.connect(self.attentionPluginSelected) self.meditationPluginComboBox.currentIndexChanged.connect(self.meditationPluginSelected) self.eyeBlinkPluginComboBox.currentIndexChanged.connect(self.eyeBlinkPluginSelected) self.attentionPluginSelected(0) self.meditationPluginSelected(0) self.eyeBlinkPluginSelected(0)
def setup_plugins(self): """ discover all plugins and populate the plugin combo boxes setup signals so that selecting a plugin has some effect """ self.prevAttentionPluginIndex = 0 self.prevMeditationPluginIndex = 0 self.prevEyeBlinkPluginIndex = 0 #enable the following 2 lines of code to debug yapsy discovery #import logging #logging.basicConfig(level=logging.DEBUG) from yapsy.PluginManager import PluginManagerSingleton manager = PluginManagerSingleton.get() from getinstallpath import getInstallPath import os.path places = [ os.path.join(getInstallPath(), "midicontroller/plugins/scoregenerators") ] manager.setPluginPlaces(places) manager.locatePlugins() manager.loadPlugins() print "Discovered the following plugins:" for plugin in manager.getAllPlugins(): n = plugin.plugin_object.name print n self.attentionPluginComboBox.addItem(n) self.meditationPluginComboBox.addItem(n) self.eyeBlinkPluginComboBox.addItem(n) self.attentionPluginComboBox.currentIndexChanged.connect( self.attentionPluginSelected) self.meditationPluginComboBox.currentIndexChanged.connect( self.meditationPluginSelected) self.eyeBlinkPluginComboBox.currentIndexChanged.connect( self.eyeBlinkPluginSelected) self.attentionPluginSelected(0) self.meditationPluginSelected(0) self.eyeBlinkPluginSelected(0)
################################################################################## # This file is part of mindwave-python. # # # # mindwave-python 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. # # # # mindwave-python 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 mindwave-python. If not, see <http://www.gnu.org/licenses/>. # ################################################################################## from getinstallpath import getInstallPath if __name__ == "__main__": print "INSTALLATION PATH: getInstallPath()" print "{0}/synthconfig/linuxsampler.lscp".format(getInstallPath()) with open("{0}/synthconfig/linuxsampler.lscp.template".format(getInstallPath()), "r") as f: lines = f.readlines() with open("{0}/synthconfig/linuxsampler.lscp".format(getInstallPath()), "w") as f: for l in lines: l = l.replace("#####", getInstallPath() + "/sonatina") f.write(l)
# mindwave-python 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. # # # # mindwave-python 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 mindwave-python. If not, see <http://www.gnu.org/licenses/>. # ################################################################################## from getinstallpath import getInstallPath if __name__ == "__main__": print "INSTALLATION PATH: getInstallPath()" print "{0}/synthconfig/linuxsampler.lscp".format(getInstallPath()) with open( "{0}/synthconfig/linuxsampler.lscp.template".format( getInstallPath()), "r") as f: lines = f.readlines() with open("{0}/synthconfig/linuxsampler.lscp".format(getInstallPath()), "w") as f: for l in lines: l = l.replace("#####", getInstallPath() + "/sonatina") f.write(l)