Allow to show all apps (debug mode)
[klaudia.git] / src / w_klaudia.py
blob60e29ec1bd56670e4dff119d733c527200921fa9
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 # Imports
5 from commands import getoutput
6 from random import randint
7 from PyQt4.QtCore import Qt, QString, SIGNAL
8 from PyQt4.QtGui import QFileDialog, QIcon, QMainWindow, QMessageBox, QTableWidgetItem
9 from xicon import XIcon
10 import dbus, os, sys
11 import database, ui_klaudia
13 # Debug Mode
14 SHOW_ALL = False
16 # DBus connections
17 class DBus(object):
18 __slots__ = [
19 'loopBus',
20 'jackBus',
21 'controlBus',
22 'studioBus',
23 'appBus',
25 DBus = DBus()
27 # QLineEdit and QPushButtom combo
28 def getAndSetPath(parent, current_path, lineEdit):
29 new_path = QFileDialog.getExistingDirectory(parent, parent.tr("Set Path"), current_path, QFileDialog.ShowDirsOnly)
30 if not new_path.isEmpty():
31 lineEdit.setText(new_path)
33 return new_path
35 # Main Window
36 class KlaudiaMainW(QMainWindow, ui_klaudia.Ui_KlaudiaMainW):
37 def __init__(self, *args):
38 QMainWindow.__init__(self, *args)
39 self.setupUi(self)
41 # Check for Jack first of all
42 if not bool(DBus.jackBus.IsStarted()):
43 try:
44 DBus.jackBus.StartServer()
45 except:
46 QMessageBox.critical(self, self.tr("Error"), self.tr("Jack is not started!\n"
47 "Please start it first, then run Klaudia again"))
48 exit(-1)
50 # For the custom icons
51 self.MyIcons = XIcon()
52 self.MyIcons.addIconPath("/usr/share/klaudia/icons/")
53 self.MyIcons.addThemeName(str(unicode(QIcon.themeName()).encode('utf-8')))
54 self.MyIcons.addThemeName("oxygen") #Just in case...
56 # Set-up GUI
57 self.b_start.setIcon(QIcon.fromTheme("go-next", QIcon(self.MyIcons.getIconPath("go-next"))))
58 self.b_add.setIcon(QIcon.fromTheme("list-add", QIcon(self.MyIcons.getIconPath("list-add"))))
59 self.b_refresh.setIcon(QIcon.fromTheme("view-refresh", QIcon(self.MyIcons.getIconPath("view-refresh"))))
60 self.b_open.setIcon(QIcon.fromTheme("document-open", QIcon(self.MyIcons.getIconPath("document-open"))))
61 self.b_start.setEnabled(False)
62 self.b_add.setEnabled(False)
64 self.listDAW.setColumnWidth(0, 22)
65 self.listDAW.setColumnWidth(1, 150)
66 self.listDAW.setColumnWidth(2, 125)
68 self.listHost.setColumnWidth(0, 22)
69 self.listHost.setColumnWidth(1, 125)
71 self.listInstrument.setColumnWidth(0, 22)
72 self.listInstrument.setColumnWidth(1, 125)
73 self.listInstrument.setColumnWidth(2, 125)
75 self.listBristol.setColumnWidth(0, 22)
76 self.listBristol.setColumnWidth(1, 100)
78 self.listEffect.setColumnWidth(0, 22)
79 self.listEffect.setColumnWidth(1, 200)
80 self.listEffect.setColumnWidth(2, 100)
82 self.listTool.setColumnWidth(0, 22)
83 self.listTool.setColumnWidth(1, 175)
84 self.listTool.setColumnWidth(2, 125)
86 self.listDAW.setContextMenuPolicy(Qt.CustomContextMenu)
87 self.listHost.setContextMenuPolicy(Qt.CustomContextMenu)
88 self.listInstrument.setContextMenuPolicy(Qt.CustomContextMenu)
89 self.listBristol.setContextMenuPolicy(Qt.CustomContextMenu)
90 self.listEffect.setContextMenuPolicy(Qt.CustomContextMenu)
91 self.listTool.setContextMenuPolicy(Qt.CustomContextMenu)
93 self.co_sample_rate.addItem(str(DBus.jackBus.GetSampleRate()))
94 self.b_refresh.setText("")
96 self.studio_root_folder = QString(os.getenv("HOME"))
97 self.le_url.setText(self.studio_root_folder)
98 self.test_url = True
99 self.test_selected = False
101 self.clearInfo_DAW()
102 self.clearInfo_Host()
103 self.clearInfo_Intrument()
104 self.clearInfo_Bristol()
105 self.clearInfo_Effect()
106 self.clearInfo_Tool()
108 self.refreshAll()
109 self.refreshStudioList()
111 self.connect(self.b_start, SIGNAL("clicked()"), self.startApp)
112 self.connect(self.b_add, SIGNAL("clicked()"), self.addApp)
113 self.connect(self.b_refresh, SIGNAL("clicked()"), self.refreshStudioList)
115 self.connect(self.co_ladi_room, SIGNAL("currentIndexChanged(int)"), self.checkSelectedRoom)
117 self.connect(self.le_url, SIGNAL("textChanged(QString)"), self.checkFolderUrl)
118 self.connect(self.tabWidget, SIGNAL("currentChanged(int)"), self.checkSelectedTab)
120 self.connect(self.listDAW, SIGNAL("currentCellChanged(int, int, int, int)"), self.checkSelectedDAW)
121 self.connect(self.listHost, SIGNAL("currentCellChanged(int, int, int, int)"), self.checkSelectedHost)
122 self.connect(self.listInstrument, SIGNAL("currentCellChanged(int, int, int, int)"), self.checkSelectedInstrument)
123 self.connect(self.listBristol, SIGNAL("currentCellChanged(int, int, int, int)"), self.checkSelectedBristol)
124 self.connect(self.listEffect, SIGNAL("currentCellChanged(int, int, int, int)"), self.checkSelectedEffect)
125 self.connect(self.listTool, SIGNAL("currentCellChanged(int, int, int, int)"), self.checkSelectedTool)
126 self.connect(self.listDAW, SIGNAL("cellDoubleClicked(int, int)"), self.doubleClickedListDAW)
127 self.connect(self.listHost, SIGNAL("cellDoubleClicked(int, int)"), self.doubleClickedListHost)
128 self.connect(self.listInstrument, SIGNAL("cellDoubleClicked(int, int)"), self.doubleClickedListInstrument)
129 self.connect(self.listBristol, SIGNAL("cellDoubleClicked(int, int)"), self.doubleClickedListBristol)
130 self.connect(self.listEffect, SIGNAL("cellDoubleClicked(int, int)"), self.doubleClickedListEffect)
131 self.connect(self.listTool, SIGNAL("cellDoubleClicked(int, int)"), self.doubleClickedListTool)
133 self.connect(self.url_documentation_daw, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
134 self.connect(self.url_website_daw, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
135 self.connect(self.url_documentation_host, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
136 self.connect(self.url_website_host, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
137 self.connect(self.url_documentation_ins, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
138 self.connect(self.url_website_ins, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
139 self.connect(self.url_documentation_bristol, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
140 self.connect(self.url_website_bristol, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
141 self.connect(self.url_documentation_effect, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
142 self.connect(self.url_website_effect, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
143 self.connect(self.url_documentation_tool, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
144 self.connect(self.url_website_tool, SIGNAL("leftClickedUrl(QString)"), self.openUrl)
146 self.connect(self.b_open, SIGNAL("clicked()"), lambda parent=self, current_path=self.le_url.text(),
147 lineEdit=self.le_url: getAndSetPath(parent, current_path, lineEdit))
149 def refreshStudioList(self):
150 self.co_ladi_room.clear()
151 self.co_ladi_room.addItem("<Studio Root>")
152 studio_bus = DBus.loopBus.get_object("org.ladish", "/org/ladish/Studio")
153 studio_list_dump = studio_bus.GetRoomList()
154 for i in range(len(studio_list_dump)):
155 self.co_ladi_room.addItem(str(studio_list_dump[i][0]).replace("/org/ladish/Room","")+" - "+studio_list_dump[i][1]['name'])
157 def checkSelectedRoom(self, co_n):
158 if (co_n == -1):
159 print "going -1"
160 elif (co_n == 0):
161 print "selected studio room"
162 DBus.studioBus = DBus.loopBus.get_object("org.ladish", "/org/ladish/Studio")
163 DBus.appBus = dbus.Interface(DBus.studioBus, 'org.ladish.AppSupervisor')
164 self.b_open.setEnabled(True)
165 self.le_url.setEnabled(True)
166 self.le_url.setText(self.studio_root_folder)
167 else:
168 print "selected a room", co_n
169 room_name = "/org/ladish/Room"+unicode(self.co_ladi_room.currentText()).split()[0]
170 DBus.studioBus = DBus.loopBus.get_object("org.ladish", room_name)
171 DBus.appBus = dbus.Interface(DBus.studioBus, 'org.ladish.AppSupervisor')
172 room_properties = DBus.studioBus.GetProjectProperties()
173 if (len(room_properties[1])):
174 self.b_open.setEnabled(False)
175 self.le_url.setEnabled(False)
176 self.le_url.setText(QString(room_properties[1]['dir']))
177 else:
178 self.b_open.setEnabled(True)
179 self.le_url.setEnabled(True)
180 self.studio_root_folder = self.le_url.text()
182 def getSelectedApp(self):
183 tab = self.tabWidget.currentIndex()
184 if (tab == 0):
185 listSel = self.listDAW
186 elif (tab == 1):
187 listSel = self.listHost
188 elif (tab == 2):
189 listSel = self.listInstrument
190 elif (tab == 3):
191 listSel = self.listBristol
192 elif (tab == 4):
193 listSel = self.listEffect
194 elif (tab == 5):
195 listSel = self.listTool
196 else:
197 return ""
199 return listSel.item(listSel.currentRow(), 1 if (tab != 3) else 2).text()
201 def getBinaryFromAppName(self, appname):
202 list_DAW = database.list_DAW
203 for i in range(len(list_DAW)):
204 if (appname == list_DAW[i][1]):
205 binary = list_DAW[i][3]
206 break
208 list_Host = database.list_Host
209 for i in range(len(list_Host)):
210 if (appname == list_Host[i][1]):
211 binary = list_Host[i][4]
212 break
214 list_Instrument = database.list_Instrument
215 for i in range(len(list_Instrument)):
216 if (appname == list_Instrument[i][1]):
217 binary = list_Instrument[i][3]
218 break
220 list_Bristol = database.list_Bristol
221 for i in range(len(list_Bristol)):
222 if (appname == list_Bristol[i][1]):
223 binary = "startBristol -audio jack -midi jack -"+list_Bristol[i][3]
224 break
226 list_Effect = database.list_Effect
227 for i in range(len(list_Effect)):
228 if (appname == list_Effect[i][1]):
229 binary = list_Effect[i][3]
230 break
232 list_Tool = database.list_Tool
233 for i in range(len(list_Tool)):
234 if (appname == list_Tool[i][1]):
235 binary = list_Tool[i][3]
236 break
238 if (binary):
239 return binary
240 else:
241 print "Error here, cod.002"
242 return ""
244 def doubleClickedListDAW(self, row, column):
245 app = self.listDAW.item(row, 1).text()
246 self.startApp(app)
248 def doubleClickedListHost(self, row, column):
249 app = self.listHost.item(row, 1).text()
250 self.startApp(app)
252 def doubleClickedListInstrument(self, row, column):
253 app = self.listInstrument.item(row, 1).text()
254 self.startApp(app)
256 def doubleClickedListBristol(self, row, column):
257 app = self.listBristol.item(row, 2).text()
258 self.startApp(app)
260 def doubleClickedListEffect(self, row, column):
261 app = self.listEffect.item(row, 1).text()
262 self.startApp(app)
264 def doubleClickedListTool(self, row, column):
265 app = self.listTool.item(row, 1).text()
266 self.startApp(app)
268 def startApp(self, app=None):
269 if (not app):
270 app = self.getSelectedApp()
271 binary = self.getBinaryFromAppName(app)
272 os.system("cd "+unicode(self.le_url.text())+" && "+binary+" &")
274 def addApp(self):
275 app = self.getSelectedApp()
276 binary = self.getBinaryFromAppName(app)
278 ran_check = str(randint(1, 99999))
279 sample_rate = str(self.co_sample_rate.currentText())
280 url_folder = str(unicode(self.le_url.text()).encode('utf-8'))
281 proj_bpm = str(self.sb_bpm.text())
283 if (url_folder[-1] != "/"):
284 url_folder += "/"
286 if (binary.split(" ")[0] == "startBristol"):
287 synth = binary.split("-audio jack -midi jack -")[1]
288 proj_folder = url_folder+"bristol_"+synth+"_"+ran_check
289 os.mkdir(proj_folder)
290 if (not self.le_url.isEnabled()): proj_folder = proj_folder.replace(url_folder,"")
291 cmd = binary+" -emulate "+synth+" -cache "+proj_folder+" -memdump "+proj_folder+" -import "+proj_folder+"/memory -exec"
292 DBus.appBus.RunCustom(False, cmd, str(app), 1)
294 elif (app == "Ardour" or app == "ArdourVST" or app == "ArdourVST (32bit)"):
295 proj_folder = url_folder+"Ardour2_"+ran_check
296 os.mkdir(proj_folder)
297 os.system("cp "+sys.path[0]+"/../templates/Ardour2/* '"+proj_folder+"'")
298 os.system('sed -i "s/X_BPM_X-KLAUDIA-X_BPM_X/'+proj_bpm+'/" "'+proj_folder+'/Ardour2.ardour"')
299 os.system('sed -i "s/X_SR_X-KLAUDIA-X_SR_X/'+sample_rate+'/" "'+proj_folder+'/Ardour2.ardour"')
300 os.system("cd '"+proj_folder+"' && mv Ardour2.ardour Ardour2_"+ran_check+".ardour")
301 os.mkdir(proj_folder+"/analysis")
302 os.mkdir(proj_folder+"/dead_sounds")
303 os.mkdir(proj_folder+"/export")
304 os.mkdir(proj_folder+"/interchange")
305 os.mkdir(proj_folder+"/interchange/Ardour")
306 os.mkdir(proj_folder+"/interchange/Ardour/audiofiles")
307 os.mkdir(proj_folder+"/peaks")
308 if (not self.le_url.isEnabled()): proj_folder = proj_folder.replace(url_folder,"")
309 DBus.appBus.RunCustom(False, binary+" '"+proj_folder+"'", str(app), 1)
310 elif (app == "Hydrogen" or app == "Hydrogen (SVN)"):
311 if (app == "Hydrogen (SVN)"):
312 level = 1
313 else:
314 level = 0
315 proj_file = url_folder+"Hydrogen_"+ran_check+".h2song"
316 os.system("cp "+sys.path[0]+"/../templates/Hydrogen.h2song '"+proj_file+"'")
317 os.system('sed -i "s/X_BPM_X-KLAUDIA-X_BPM_X/'+proj_bpm+'/" "'+proj_file+'"')
318 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
319 DBus.appBus.RunCustom(False, "hydrogen -s '"+proj_file+"'", str(app), level)
320 elif (app == "MusE" or app == "MusE (SVN)"):
321 proj_file = url_folder+"MusE_"+ran_check+".med"
322 os.system("cp "+sys.path[0]+"/../templates/MusE.med '"+proj_file+"'")
323 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
324 DBus.appBus.RunCustom(False, "muse '"+proj_file+"'", str(app), 0)
325 elif (app == "Non-DAW"):
326 proj_file = url_folder+"Non-DAW_"+ran_check
327 os.system("cp -r "+sys.path[0]+"/../templates/Non-DAW '"+proj_file+"'")
328 os.system('sed -i "s/X_BPM_X-KLAUDIA-X_BPM_X/'+proj_bpm+'/" "'+proj_file+'/history"')
329 os.system('sed -i "s/X_SR_X-KLAUDIA-X_SR_X/'+sample_rate+'/" "'+proj_file+'/info"')
330 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
331 DBus.appBus.RunCustom(False, "non-daw '"+proj_file+"'", str(app), 0)
332 elif (app == "Non-Sequencer"):
333 proj_file = url_folder+"Non-Sequencer_"+ran_check+".non"
334 os.system("cp "+sys.path[0]+"/../templates/Non-Sequencer.non '"+proj_file+"'")
335 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
336 DBus.appBus.RunCustom(False, "non-sequencer '"+proj_file+"'", str(app), 0)
337 elif (app == "Qtractor" or app == "QtractorVST" or app == "QtractorVST (32bit)" or app == "Qtractor (SVN)"):
338 proj_file = url_folder+"Qtractor_"+ran_check+".qtr"
339 os.system("cp "+sys.path[0]+"/../templates/Qtractor.qtr '"+proj_file+"'")
340 os.system('sed -i "s/X_BPM_X-KLAUDIA-X_BPM_X/'+proj_bpm+'/" "'+proj_file+'"')
341 os.system('sed -i "s/X_SR_X-KLAUDIA-X_SR_X/'+sample_rate+'/" "'+proj_file+'"')
342 os.system('sed -i "s/X_FOLDER_X-KLAUDIA-X_FOLDER_X/'+url_folder.replace("/","\/")+'/" "'+proj_file+'"')
343 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
344 DBus.appBus.RunCustom(False, binary+" '"+proj_file+"'", str(app), 1)
345 elif (app == "Renoise" or app == "Renoise (64bit)"):
346 os.mkdir(url_folder+"tmp_bu")
347 os.system("cp "+sys.path[0]+"/../templates/Renoise.xml "+url_folder+"/tmp_bu")
348 os.system('sed -i "s/X_BPM_X-KLAUDIA-X_BPM_X/'+proj_bpm+'/" "'+url_folder+'/tmp_bu/Renoise.xml"')
349 os.system("cd '"+url_folder+"tmp_bu' && mv Renoise.xml Song.xml && zip ../Renoise_"+ran_check+".xrns Song.xml")
350 os.system("rm -rf '"+url_folder+"tmp_bu'")
351 if (not self.le_url.isEnabled()): url_folder = ""
352 DBus.appBus.RunCustom(False, binary+" '"+url_folder+"Renoise_"+ran_check+".xrns'", str(app), 0)
353 elif (app == "Rosegarden"):
354 proj_file = url_folder+"Rosegarden_"+ran_check+".rg"
355 os.system("cp "+sys.path[0]+"/../templates/Rosegarden.rg '"+proj_file+"'")
356 os.system('sed -i "s/X_BPM_X-KLAUDIA-X_BPM_X/'+proj_bpm+'/" "'+proj_file+'"')
357 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
358 DBus.appBus.RunCustom(False, "rosegarden '"+proj_file+"'", str(app), 1)
359 elif (app == "Seq24" or app == "Seq24 (BZR)"):
360 proj_file = url_folder+"Seq24_"+ran_check+".midi"
361 os.system("cp "+sys.path[0]+"/../templates/Seq24.midi '"+proj_file+"'")
362 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
363 DBus.appBus.RunCustom(False, "seq24 --file '"+proj_file+"'", str(app), 0)
365 elif (app == "Calf Jack Host" or app == "Calf Jack Host (GIT)"):
366 if (app == "Calf Jack Host (GIT)"):
367 level = 1
368 else:
369 level = 0
370 proj_file = url_folder+"CalfJackHost_"+ran_check
371 os.system("cp "+sys.path[0]+"/../templates/CalfJackHost '"+proj_file+"'")
372 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
373 DBus.appBus.RunCustom(False, "calfjackhost --load '"+proj_file+"'", str(app), level)
374 elif (app == "FeSTige"):
375 room_name = "" if (self.co_ladi_room.currentIndex() <= 0) else "\""+str(self.co_ladi_room.currentText()).split(" - ")[1]+"\""
376 DBus.appBus.RunCustom(False, "festige "+url_folder+" "+room_name, str(app), 0)
377 #elif (app == "Ingen" or app == "Ingen (SVN)"):
378 #if (app == "Ingen (SVN)"):
379 #binary = "ingen-svn"
380 #else:
381 #binary = "ingen"
382 #proj_file = url_folder+"/"+"ingen_"+ran_check+".ing.lv2"
383 #os.system("cp -r "+sys.path[0]+"/../templates/ingen.ing.lv2 '"+proj_file+"'")
384 #if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
385 #DBus.appBus.RunCustom(False, binary+" -egl '"+proj_file+"'", str(app), 0)
386 elif (app == "Jack Rack"):
387 proj_file = url_folder+"Jack-Rack_"+ran_check+".xml"
388 os.system("cp "+sys.path[0]+"/../templates/Jack-Rack.xml '"+proj_file+"'")
389 os.system('sed -i "s/X_SR_X-KLAUDIA-X_SR_X/'+sample_rate+'/" "'+proj_file+'"')
390 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
391 DBus.appBus.RunCustom(False, "jack-rack '"+proj_file+"'", str(app), 0)
393 elif (app == "Qsampler" or app == "Qsampler (SVN)"):
394 if (app == "Qsampler (SVN)"):
395 level = 1
396 else:
397 level = 0
398 proj_file = url_folder+"Qsampler_"+ran_check+".lscp"
399 os.system("cp "+sys.path[0]+"/../templates/Qsampler.lscp '"+proj_file+"'")
400 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
401 DBus.appBus.RunCustom(False, "qsampler '"+proj_file+"'", str(app), level)
402 elif (app == "Yoshimi"):
403 proj_file = url_folder+"Yoshimi_"+ran_check+".state"
404 os.system("cp "+sys.path[0]+"/../templates/Yoshimi.state '"+proj_file+"'")
405 os.system('sed -i "s/X_SR_X-KLAUDIA-X_SR_X/'+sample_rate+'/" "'+proj_file+'"')
406 os.system('sed -i "s/X_FILE_X-KLAUDIA-X_FILE_X/'+proj_file.replace("/","\/")+'/" "'+proj_file+'"')
407 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
408 DBus.appBus.RunCustom(False, "yoshimi -j -J --state='"+proj_file+"'", str(app), 1)
410 elif (app == "Jamin"):
411 proj_file = url_folder+"Jamin_"+ran_check+".jam"
412 os.system("cp "+sys.path[0]+"/../templates/Jamin.jam '"+proj_file+"'")
413 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
414 DBus.appBus.RunCustom(False, "jamin -f '"+proj_file+"'", str(app), 0)
416 elif (app == "Jack Mixer"):
417 proj_file = url_folder+"Jack-Mixer_"+ran_check+".xml"
418 os.system("cp "+sys.path[0]+"/../templates/Jack-Mixer.xml '"+proj_file+"'")
419 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
420 DBus.appBus.RunCustom(False, "jack_mixer -c '"+proj_file+"'", str(app), 1)
421 elif (app == "Non-Mixer"):
422 proj_file = url_folder+"Non-Mixer_"+ran_check
423 os.system("cp -r "+sys.path[0]+"/../templates/Non-Mixer '"+proj_file+"'")
424 if (not self.le_url.isEnabled()): proj_file = proj_file.replace(url_folder,"")
425 DBus.appBus.RunCustom(False, "non-mixer '"+proj_file+"'", str(app), 0)
427 else:
428 DBus.appBus.RunCustom(False, binary, str(app), 0)
430 def clearInfo_DAW(self):
431 self.ico_app_daw.setPixmap(QIcon.fromTheme("start-here").pixmap(48, 48))
432 self.label_name_daw.setText("App Name")
433 self.ico_ladspa_daw.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
434 self.ico_dssi_daw.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
435 self.ico_lv2_daw.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
436 self.ico_vst_daw.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
437 self.label_vst_mode_daw.setText("")
438 self.ico_jack_transport_daw.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
439 self.label_midi_mode_daw.setText("---")
440 self.label_ladish_level_daw.setText("0")
441 self.showDoc_DAW(0, 0)
442 self.frame_DAW.setEnabled(False)
444 def clearInfo_Host(self):
445 self.ico_app_host.setPixmap(QIcon.fromTheme("start-here").pixmap(48, 48))
446 self.label_name_host.setText("App Name")
447 self.ico_ladspa_host.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
448 self.ico_dssi_host.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
449 self.ico_lv2_host.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
450 self.ico_vst_host.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
451 self.label_vst_mode_host.setText("")
452 self.label_midi_mode_host.setText("---")
453 self.label_ladish_level_host.setText("0")
454 self.showDoc_Host(0, 0)
455 self.frame_Host.setEnabled(False)
457 def clearInfo_Intrument(self):
458 self.ico_app_ins.setPixmap(QIcon.fromTheme("start-here").pixmap(48, 48))
459 self.label_name_ins.setText("App Name")
460 self.ico_builtin_fx_ins.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
461 self.ico_audio_input_ins.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
462 self.label_midi_mode_ins.setText("---")
463 self.label_ladish_level_ins.setText("0")
464 self.showDoc_Instrument(0, 0)
465 self.frame_Instrument.setEnabled(False)
467 def clearInfo_Bristol(self):
468 self.ico_app_bristol.setPixmap(QIcon.fromTheme("start-here").pixmap(48, 48))
469 self.label_name_bristol.setText("App Name")
470 self.ico_builtin_fx_bristol.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
471 self.ico_audio_input_bristol.setPixmap(QIcon("dialog-cancel").pixmap(16, 16))
472 self.label_midi_mode_bristol.setText("---")
473 self.label_ladish_level_bristol.setText("0")
474 self.showDoc_Bristol(0, 0)
475 self.frame_Bristol.setEnabled(False)
477 def clearInfo_Effect(self):
478 self.ico_app_effect.setPixmap(QIcon.fromTheme("start-here").pixmap(48, 48))
479 self.label_name_effect.setText("App Name")
480 self.ico_stereo_effect.setPixmap(QIcon.fromTheme("dialog-cancel").pixmap(16, 16))
481 self.label_midi_mode_effect.setText("---")
482 self.label_ladish_level_effect.setText("0")
483 self.showDoc_Effect(0, 0)
484 self.frame_Effect.setEnabled(False)
486 def clearInfo_Tool(self):
487 self.ico_app_tool.setPixmap(QIcon.fromTheme("start-here").pixmap(48, 48))
488 self.label_name_tool.setText("App Name")
489 self.label_midi_mode_tool.setText("---")
490 self.label_ladish_level_tool.setText("0")
491 self.showDoc_Tool(0, 0)
492 self.frame_Tool.setEnabled(False)
494 def checkFolderUrl(self, url):
495 if (os.path.exists(unicode(url))):
496 self.test_url = True
497 if (self.le_url.isEnabled()):
498 self.studio_root_folder = url
499 else:
500 self.test_url = False
501 self.checkButtons()
503 def checkSelectedTab(self, tab):
504 self.test_selected = False
505 if (tab == 0): # DAW
506 if (self.listDAW.selectedItems()):
507 self.test_selected = True
508 elif (tab == 1): # Host
509 if (self.listHost.selectedItems()):
510 self.test_selected = True
511 elif (tab == 2): # Instrument
512 if (self.listInstrument.selectedItems()):
513 self.test_selected = True
514 elif (tab == 3): # Bristol
515 if (self.listBristol.selectedItems()):
516 self.test_selected = True
517 elif (tab == 4): # Effect
518 if (self.listEffect.selectedItems()):
519 self.test_selected = True
520 elif (tab == 5): # Tool
521 if (self.listTool.selectedItems()):
522 self.test_selected = True
524 self.checkButtons()
526 def checkSelectedDAW(self, row, column, p_row, p_column):
527 if (row >= 0):
528 self.test_selected = True
530 app_name = self.listDAW.item(row, 1).text()
531 app_info = []
532 list_DAW = database.list_DAW
534 for i in range(len(list_DAW)):
535 if (app_name == list_DAW[i][1]):
536 app_info = list_DAW[i]
537 break
539 if (not app_info):
540 print "Error here, cod.001"
541 return
543 self.frame_DAW.setEnabled(True)
544 self.ico_app_daw.setPixmap(QIcon(self.MyIcons.getIconPath(app_info[4], 48)).pixmap(48, 48))
545 self.ico_ladspa_daw.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][0]), 16)).pixmap(16, 16))
546 self.ico_dssi_daw.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][1]), 16)).pixmap(16, 16))
547 self.ico_lv2_daw.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][2]), 16)).pixmap(16, 16))
548 self.ico_vst_daw.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][3]), 16)).pixmap(16, 16))
549 self.ico_jack_transport_daw.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][5]), 16)).pixmap(16, 16))
550 self.label_name_daw.setText(app_info[1])
551 self.label_vst_mode_daw.setText(app_info[8][4])
552 self.ico_midi_mode_daw.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][6]), 16)).pixmap(16, 16))
553 self.label_midi_mode_daw.setText(app_info[8][7])
554 self.label_ladish_level_daw.setText(str(app_info[6]))
556 doc = app_info[9][0] if (os.path.exists(app_info[9][0].replace("file://",""))) else ""
557 self.showDoc_DAW(doc, app_info[9][1])
558 else:
559 self.test_selected = False
560 self.clearInfo_DAW()
561 self.checkButtons()
563 def checkSelectedHost(self, row, column, p_row, p_column):
564 if (row >= 0):
565 self.test_selected = True
567 app_name = self.listHost.item(row, 1).text()
568 app_info = []
569 list_Host = database.list_Host
571 for i in range(len(list_Host)):
572 if (app_name == list_Host[i][1]):
573 app_info = list_Host[i]
574 break
576 if (not app_info):
577 print "Error here, cod.003"
578 return
580 self.frame_Host.setEnabled(True)
581 self.ico_app_host.setPixmap(QIcon(self.MyIcons.getIconPath(app_info[5], 48)).pixmap(48, 48))
582 self.ico_internal_host.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[9][0]), 16)).pixmap(16, 16))
583 self.ico_ladspa_host.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[9][1]), 16)).pixmap(16, 16))
584 self.ico_dssi_host.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[9][2]), 16)).pixmap(16, 16))
585 self.ico_lv2_host.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[9][3]), 16)).pixmap(16, 16))
586 self.ico_vst_host.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[9][4]), 16)).pixmap(16, 16))
587 self.label_name_host.setText(app_info[1])
588 self.label_vst_mode_host.setText(app_info[9][5])
589 self.label_midi_mode_host.setText(app_info[9][6])
590 self.label_ladish_level_host.setText(str(app_info[7]))
592 doc = app_info[10][0] if (os.path.exists(app_info[10][0].replace("file://",""))) else ""
593 self.showDoc_Host(doc, app_info[10][1])
594 else:
595 self.test_selected = False
596 self.clearInfo_DAW()
597 self.checkButtons()
599 def checkSelectedInstrument(self, row, column, p_row, p_column):
600 if (row >= 0):
601 self.test_selected = True
603 app_name = self.listInstrument.item(row, 1).text()
604 app_info = []
605 list_Instrument = database.list_Instrument
607 for i in range(len(list_Instrument)):
608 if (app_name == list_Instrument[i][1]):
609 app_info = list_Instrument[i]
610 break
612 if (not app_info):
613 print "Error here, cod.004"
614 return
616 self.frame_Instrument.setEnabled(True)
617 self.ico_app_ins.setPixmap(QIcon(self.MyIcons.getIconPath(app_info[4], 48)).pixmap(48, 48))
618 self.ico_builtin_fx_ins.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][0]), 16)).pixmap(16, 16))
619 self.ico_audio_input_ins.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][1]), 16)).pixmap(16, 16))
620 self.label_name_ins.setText(app_info[1])
621 self.label_midi_mode_ins.setText(app_info[8][2])
622 self.label_ladish_level_ins.setText(str(app_info[6]))
624 doc = app_info[9][0] if (os.path.exists(app_info[9][0].replace("file://",""))) else ""
625 self.showDoc_Instrument(doc, app_info[9][1])
626 else:
627 self.test_selected = False
628 self.clearInfo_Intrument()
629 self.checkButtons()
631 def checkSelectedBristol(self, row, column, p_row, p_column):
632 if (row >= 0):
633 self.test_selected = True
635 app_name = self.listBristol.item(row, 2).text()
636 app_info = []
637 list_Bristol = database.list_Bristol
639 for i in range(len(list_Bristol)):
640 if (app_name == list_Bristol[i][1]):
641 app_info = list_Bristol[i]
642 break
644 if (not app_info):
645 print "Error here, cod.007"
646 return
648 self.frame_Bristol.setEnabled(True)
649 self.ico_app_bristol.setPixmap(QIcon(self.MyIcons.getIconPath(app_info[4], 48)).pixmap(48, 48))
650 self.ico_builtin_fx_bristol.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][0]), 16)).pixmap(16, 16))
651 self.ico_audio_input_bristol.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][1]), 16)).pixmap(16, 16))
652 self.label_name_bristol.setText(app_info[1])
653 self.label_midi_mode_bristol.setText(app_info[8][2])
654 self.label_ladish_level_bristol.setText(str(app_info[6]))
656 doc = app_info[9][0] if (os.path.exists(app_info[9][0].replace("file://",""))) else ""
657 self.showDoc_Bristol(doc, app_info[9][1])
658 else:
659 self.test_selected = False
660 self.clearInfo_Bristol()
661 self.checkButtons()
663 def checkSelectedEffect(self, row, column, p_row, p_column):
664 if (row >= 0):
665 self.test_selected = True
667 app_name = self.listEffect.item(row, 1).text()
668 app_info = []
669 list_Effect = database.list_Effect
671 for i in range(len(list_Effect)):
672 if (app_name == list_Effect[i][1]):
673 app_info = list_Effect[i]
674 break
676 if (not app_info):
677 print "Error here, cod.005"
678 return
680 self.frame_Effect.setEnabled(True)
681 self.ico_app_effect.setPixmap(QIcon(self.MyIcons.getIconPath(app_info[4], 48)).pixmap(48, 48))
682 self.ico_stereo_effect.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][0]), 16)).pixmap(16, 16))
683 self.label_name_effect.setText(app_info[1])
684 self.label_midi_mode_effect.setText(app_info[8][1])
685 self.label_ladish_level_effect.setText(str(app_info[6]))
687 doc = app_info[9][0] if (os.path.exists(app_info[9][0].replace("file://",""))) else ""
688 self.showDoc_Effect(doc, app_info[9][1])
689 else:
690 self.test_selected = False
691 self.clearInfo_Effect()
692 self.checkButtons()
694 def checkSelectedTool(self, row, column, p_row, p_column):
695 if (row >= 0):
696 self.test_selected = True
698 app_name = self.listTool.item(row, 1).text()
699 app_info = []
700 list_Tool = database.list_Tool
702 for i in range(len(list_Tool)):
703 if (app_name == list_Tool[i][1]):
704 app_info = list_Tool[i]
705 break
707 if (not app_info):
708 print "Error here, cod.006"
709 return
711 self.frame_Tool.setEnabled(True)
712 self.ico_app_tool.setPixmap(QIcon(self.MyIcons.getIconPath(app_info[4], 48)).pixmap(48, 48))
713 self.label_name_tool.setText(app_info[1])
714 self.label_midi_mode_tool.setText(app_info[8][0])
715 self.ico_jack_transport_tool.setPixmap(QIcon(self.MyIcons.getIconPath(self.getIconForYesNo(app_info[8][1]), 16)).pixmap(16, 16))
716 self.label_ladish_level_tool.setText(str(app_info[6]))
718 doc = app_info[9][0] if (os.path.exists(app_info[9][0].replace("file://",""))) else ""
719 self.showDoc_Tool(doc, app_info[9][1])
720 else:
721 self.test_selected = False
722 self.clearInfo_Tool()
723 self.checkButtons()
725 def showDoc_DAW(self, doc, web):
726 if (doc):
727 self.url_documentation_daw.setVisible(True)
728 self.url_documentation_daw.setUrl(doc)
729 else: self.url_documentation_daw.setVisible(False)
731 if (web):
732 self.url_website_daw.setVisible(True)
733 self.url_website_daw.setUrl(web)
734 else: self.url_website_daw.setVisible(False)
736 if (not doc and not web):
737 self.label_no_help_daw.setVisible(True)
738 else:
739 self.label_no_help_daw.setVisible(False)
741 def showDoc_Host(self, doc, web):
742 if (doc):
743 self.url_documentation_host.setVisible(True)
744 self.url_documentation_host.setUrl(doc)
745 else: self.url_documentation_host.setVisible(False)
747 if (web):
748 self.url_website_host.setVisible(True)
749 self.url_website_host.setUrl(web)
750 else: self.url_website_host.setVisible(False)
752 if (not doc and not web):
753 self.label_no_help_host.setVisible(True)
754 else:
755 self.label_no_help_host.setVisible(False)
757 def showDoc_Instrument(self, doc, web):
758 if (doc):
759 self.url_documentation_ins.setVisible(True)
760 self.url_documentation_ins.setUrl(doc)
761 else: self.url_documentation_ins.setVisible(False)
763 if (web):
764 self.url_website_ins.setVisible(True)
765 self.url_website_ins.setUrl(web)
766 else: self.url_website_ins.setVisible(False)
768 if (not doc and not web):
769 self.label_no_help_ins.setVisible(True)
770 else:
771 self.label_no_help_ins.setVisible(False)
773 def showDoc_Bristol(self, doc, web):
774 if (doc):
775 self.url_documentation_bristol.setVisible(True)
776 self.url_documentation_bristol.setUrl(doc)
777 else: self.url_documentation_bristol.setVisible(False)
779 if (web):
780 self.url_website_bristol.setVisible(True)
781 self.url_website_bristol.setUrl(web)
782 else: self.url_website_bristol.setVisible(False)
784 if (not doc and not web):
785 self.label_no_help_bristol.setVisible(True)
786 else:
787 self.label_no_help_bristol.setVisible(False)
789 def showDoc_Effect(self, doc, web):
790 if (doc):
791 self.url_documentation_effect.setVisible(True)
792 self.url_documentation_effect.setUrl(doc)
793 else: self.url_documentation_effect.setVisible(False)
795 if (web):
796 self.url_website_effect.setVisible(True)
797 self.url_website_effect.setUrl(web)
798 else: self.url_website_effect.setVisible(False)
800 if (not doc and not web):
801 self.label_no_help_effect.setVisible(True)
802 else:
803 self.label_no_help_effect.setVisible(False)
805 def showDoc_Tool(self, doc, web):
806 if (doc):
807 self.url_documentation_tool.setVisible(True)
808 self.url_documentation_tool.setUrl(doc)
809 else: self.url_documentation_tool.setVisible(False)
811 if (web):
812 self.url_website_tool.setVisible(True)
813 self.url_website_tool.setUrl(web)
814 else: self.url_website_tool.setVisible(False)
816 if (not doc and not web):
817 self.label_no_help_tool.setVisible(True)
818 else:
819 self.label_no_help_tool.setVisible(False)
821 def openUrl(self, url):
822 os.system("xdg-open '"+str(url)+"' &")
824 def checkButtons(self):
825 if (self.test_url and self.test_selected):
826 self.b_add.setEnabled(True)
827 self.b_start.setEnabled(True)
828 else:
829 self.b_add.setEnabled(False)
830 self.b_start.setEnabled(False)
832 def clearAll(self):
833 self.listDAW.clearContents()
834 self.listHost.clearContents()
835 self.listInstrument.clearContents()
836 self.listBristol.clearContents()
837 self.listEffect.clearContents()
838 self.listTool.clearContents()
839 for i in range(self.listDAW.rowCount()):
840 self.listDAW.removeRow(0)
841 for i in range(self.listHost.rowCount()):
842 self.listHost.removeRow(0)
843 for i in range(self.listInstrument.rowCount()):
844 self.listInstrument.removeRow(0)
845 for i in range(self.listBristol.rowCount()):
846 self.listBristol.removeRow(0)
847 for i in range(self.listEffect.rowCount()):
848 self.listEffect.removeRow(0)
849 for i in range(self.listTool.rowCount()):
850 self.listTool.removeRow(0)
852 def getIconForYesNo(self, yesno):
853 if (yesno):
854 return "dialog-ok-apply"
855 else:
856 return "dialog-cancel"
858 def refreshAll(self):
859 self.clearAll()
861 if (not SHOW_ALL):
862 pkg_out = getoutput("dpkg -l").split("\n")
863 pkglist = []
864 for i in range(len(pkg_out)):
865 if (pkg_out[i][0] == "i" and pkg_out[i][1] == "i"):
866 package = pkg_out[i].split()[1]
867 pkglist.append(package)
869 last_pos = 0
870 list_DAW = database.list_DAW
871 for i in range(len(list_DAW)):
872 if (SHOW_ALL or list_DAW[i][0] in pkglist):
873 AppName = list_DAW[i][1]
874 Type = list_DAW[i][2]
875 Binary = list_DAW[i][3]
876 Icon = list_DAW[i][4]
877 Save = list_DAW[i][5]
878 Level = list_DAW[i][6]
879 Licence = list_DAW[i][7]
880 Features = list_DAW[i][8]
881 Docs = list_DAW[i][9]
883 w_icon = QTableWidgetItem("")
884 w_icon.setIcon(QIcon(self.MyIcons.getIconPath(Icon, 16)))
885 w_name = QTableWidgetItem(AppName)
886 w_type = QTableWidgetItem(Type)
887 w_save = QTableWidgetItem(Save)
888 w_licc = QTableWidgetItem(Licence)
890 self.listDAW.insertRow(last_pos)
891 self.listDAW.setItem(last_pos, 0, w_icon)
892 self.listDAW.setItem(last_pos, 1, w_name)
893 self.listDAW.setItem(last_pos, 2, w_type)
894 self.listDAW.setItem(last_pos, 3, w_save)
895 self.listDAW.setItem(last_pos, 4, w_licc)
897 last_pos += 1
899 last_pos = 0
900 list_Host = database.list_Host
901 for i in range(len(list_Host)):
902 if (SHOW_ALL or list_Host[i][0] in pkglist):
903 AppName = list_Host[i][1]
904 Has_Ins = list_Host[i][2]
905 Has_Eff = list_Host[i][3]
906 Binary = list_Host[i][4]
907 Icon = list_Host[i][5]
908 Save = list_Host[i][6]
909 Level = list_Host[i][7]
910 Licence = list_Host[i][8]
911 Features = list_Host[i][9]
912 Docs = list_Host[i][10]
914 w_icon = QTableWidgetItem("")
915 w_icon.setIcon(QIcon(self.MyIcons.getIconPath(Icon, 16)))
916 w_name = QTableWidgetItem(AppName)
917 w_h_in = QTableWidgetItem(Has_Ins)
918 w_h_ef = QTableWidgetItem(Has_Eff)
919 w_save = QTableWidgetItem(Save)
920 w_licc = QTableWidgetItem(Licence)
922 self.listHost.insertRow(last_pos)
923 self.listHost.setItem(last_pos, 0, w_icon)
924 self.listHost.setItem(last_pos, 1, w_name)
925 self.listHost.setItem(last_pos, 2, w_h_in)
926 self.listHost.setItem(last_pos, 3, w_h_ef)
927 self.listHost.setItem(last_pos, 4, w_save)
928 self.listHost.setItem(last_pos, 5, w_licc)
930 last_pos += 1
932 last_pos = 0
933 list_Instrument = database.list_Instrument
934 for i in range(len(list_Instrument)):
935 if (SHOW_ALL or list_Instrument[i][0] in pkglist):
936 AppName = list_Instrument[i][1]
937 Type = list_Instrument[i][2]
938 Binary = list_Instrument[i][3]
939 Icon = list_Instrument[i][4]
940 Save = list_Instrument[i][5]
941 Level = list_Instrument[i][6]
942 Licence = list_Instrument[i][7]
943 Features = list_Instrument[i][8]
944 Docs = list_Instrument[i][9]
946 w_icon = QTableWidgetItem("")
947 w_icon.setIcon(QIcon(self.MyIcons.getIconPath(Icon, 16)))
948 w_name = QTableWidgetItem(AppName)
949 w_type = QTableWidgetItem(Type)
950 w_save = QTableWidgetItem(Save)
951 w_licc = QTableWidgetItem(Licence)
953 self.listInstrument.insertRow(last_pos)
954 self.listInstrument.setItem(last_pos, 0, w_icon)
955 self.listInstrument.setItem(last_pos, 1, w_name)
956 self.listInstrument.setItem(last_pos, 2, w_type)
957 self.listInstrument.setItem(last_pos, 3, w_save)
958 self.listInstrument.setItem(last_pos, 4, w_licc)
960 last_pos += 1
962 last_pos = 0
963 list_Bristol = database.list_Bristol
964 for i in range(len(list_Bristol)):
965 if (SHOW_ALL or list_Bristol[i][0] in pkglist):
966 FullName = list_Bristol[i][1]
967 Type = list_Bristol[i][2]
968 ShortName = list_Bristol[i][3]
969 Icon = list_Bristol[i][4]
970 Save = list_Bristol[i][5]
971 Level = list_Bristol[i][6]
972 Licence = list_Bristol[i][7]
973 Features = list_Bristol[i][8]
974 Docs = list_Bristol[i][9]
976 w_icon = QTableWidgetItem("")
977 w_icon.setIcon(QIcon(self.MyIcons.getIconPath(Icon, 16)))
978 w_fullname = QTableWidgetItem(FullName)
979 w_shortname = QTableWidgetItem(ShortName)
981 self.listBristol.insertRow(last_pos)
982 self.listBristol.setItem(last_pos, 0, w_icon)
983 self.listBristol.setItem(last_pos, 1, w_shortname)
984 self.listBristol.setItem(last_pos, 2, w_fullname)
986 last_pos += 1
988 last_pos = 0
989 list_Effect = database.list_Effect
990 for i in range(len(list_Effect)):
991 if (SHOW_ALL or list_Effect[i][0] in pkglist):
992 AppName = list_Effect[i][1]
993 Type = list_Effect[i][2]
994 Binary = list_Effect[i][3]
995 Icon = list_Effect[i][4]
996 Save = list_Effect[i][5]
997 Level = list_Effect[i][6]
998 Licence = list_Effect[i][7]
999 Features = list_Effect[i][8]
1000 Docs = list_Effect[i][9]
1002 w_icon = QTableWidgetItem("")
1003 w_icon.setIcon(QIcon(self.MyIcons.getIconPath(Icon, 16)))
1004 w_name = QTableWidgetItem(AppName)
1005 w_type = QTableWidgetItem(Type)
1006 w_save = QTableWidgetItem(Save)
1007 w_licc = QTableWidgetItem(Licence)
1009 self.listEffect.insertRow(last_pos)
1010 self.listEffect.setItem(last_pos, 0, w_icon)
1011 self.listEffect.setItem(last_pos, 1, w_name)
1012 self.listEffect.setItem(last_pos, 2, w_type)
1013 self.listEffect.setItem(last_pos, 3, w_save)
1014 self.listEffect.setItem(last_pos, 4, w_licc)
1016 last_pos += 1
1018 last_pos = 0
1019 list_Tool = database.list_Tool
1020 for i in range(len(list_Tool)):
1021 if (SHOW_ALL or list_Tool[i][0] in pkglist):
1022 AppName = list_Tool[i][1]
1023 Type = list_Tool[i][2]
1024 Binary = list_Tool[i][3]
1025 Icon = list_Tool[i][4]
1026 Save = list_Tool[i][5]
1027 Level = list_Tool[i][6]
1028 Licence = list_Tool[i][7]
1029 Features = list_Tool[i][8]
1030 Docs = list_Tool[i][9]
1032 w_icon = QTableWidgetItem("")
1033 w_icon.setIcon(QIcon(self.MyIcons.getIconPath(Icon, 16)))
1034 w_name = QTableWidgetItem(AppName)
1035 w_type = QTableWidgetItem(Type)
1036 w_save = QTableWidgetItem(Save)
1037 w_licc = QTableWidgetItem(Licence)
1039 self.listTool.insertRow(last_pos)
1040 self.listTool.setItem(last_pos, 0, w_icon)
1041 self.listTool.setItem(last_pos, 1, w_name)
1042 self.listTool.setItem(last_pos, 2, w_type)
1043 self.listTool.setItem(last_pos, 3, w_save)
1044 self.listTool.setItem(last_pos, 4, w_licc)
1046 last_pos += 1
1049 self.listDAW.setCurrentCell(-1, -1)
1050 self.listHost.setCurrentCell(-1, -1)
1051 self.listInstrument.setCurrentCell(-1, -1)
1052 self.listBristol.setCurrentCell(-1, -1)
1053 self.listEffect.setCurrentCell(-1, -1)
1054 self.listTool.setCurrentCell(-1, -1)
1056 self.listDAW.sortByColumn(1, Qt.AscendingOrder)
1057 self.listHost.sortByColumn(1, Qt.AscendingOrder)
1058 self.listInstrument.sortByColumn(1, Qt.AscendingOrder)
1059 self.listBristol.sortByColumn(2, Qt.AscendingOrder)
1060 self.listEffect.sortByColumn(1, Qt.AscendingOrder)
1061 self.listTool.sortByColumn(1, Qt.AscendingOrder)