Changeset 1748
- Timestamp:
- 12/04/09 14:44:08 (13 years ago)
- Files:
-
- trunk/libffado/support/mixer-qt4 (modified) (1 prop)
- trunk/libffado/support/mixer-qt4/ffado-mixer-profiler.in (copied) (copied from trunk/libffado/support/mixer-qt4/ffado-mixer.in) (4 diffs)
- trunk/libffado/support/mixer-qt4/ffado-mixer.in (modified) (3 diffs)
- trunk/libffado/support/mixer-qt4/ffado/ffadowindow.py (copied) (copied from trunk/libffado/support/mixer-qt4/ffado-mixer.in) (5 diffs)
- trunk/libffado/support/mixer-qt4/SConscript (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/support/mixer-qt4
- Property svn:ignore changed from
*ui.py
*.pyc
ffado-mixer
.*.swp
ffadomixer_config.py
to
*.pyc
ffado-mixer
ffado-mixer-profiler
.*.swp
- Property svn:ignore changed from
trunk/libffado/support/mixer-qt4/ffado-mixer-profiler.in
r1711 r1748 1 1 #!/usr/bin/python 2 2 # 3 # Copyright (C) 2005-200 8by Pieter Palmers4 # 2007-200 8by Arnold Krille3 # Copyright (C) 2005-2009 by Pieter Palmers 4 # 2007-2009 by Arnold Krille 5 5 # 6 6 # This file is part of FFADO … … 11 11 # This program is free software: you can redistribute it and/or modify 12 12 # it under the terms of the GNU General Public License as published by 13 # the Free Software Foundation, either version 3 of the License, or 14 # (at your option) any later version. 13 # the Free Software Foundation, either version 3 of the License. 15 14 # 16 15 # This program is distributed in the hope that it will be useful, … … 23 22 # 24 23 25 # 26 # QT 4 version 27 # 28 29 import sys, os 24 import sys 30 25 31 26 # Add the path of the installed ffado-modules … … 33 28 sys.path.append( "$PYPKGDIR" ) 34 29 35 from ffado. config import * #POLL_SLEEP_TIME_MSEC, FFADO_DBUS_SERVER, FFADO_DBUS_BASEPATH30 from ffado.ffadowindow import * 36 31 37 import os 38 import time 39 40 from PyQt4.QtCore import SIGNAL, SLOT, QObject, QTimer, Qt 41 from PyQt4.QtGui import * #QApplication, QMessageBox, QIcon 42 43 from ffado.dbus_util import * 44 45 from ffado.panelmanager import PanelManager 46 47 from ffado.logginghandler import * 48 49 """Just a small helper to ask the retry-question without a blocking messagebox""" 50 class StartDialog(QWidget): 51 def __init__(self, parent): 52 QWidget.__init__(self, parent) 53 self.setObjectName("Restart Dialog") 54 self.label = QLabel("Somehow the connection to the dbus-service of FFADO couldn't be established.\nShall we take another try?",self) 55 self.button = QPushButton("Retry", self) 56 self.layout = QGridLayout(self) 57 self.layout.addWidget(self.label, 0, 0, Qt.AlignCenter) 58 self.layout.addWidget(self.button, 1, 0, Qt.AlignCenter) 59 60 class FFADOWindow(QMainWindow): 61 def __init__(self, parent): 62 QMainWindow.__init__(self, parent) 63 64 self.textlogger = QTextLogger(self) 65 dock = QDockWidget("Log Messages",self) 66 dock.setWidget(self.textlogger.textedit) 67 logging.getLogger('').addHandler(self.textlogger) 68 self.addDockWidget(Qt.BottomDockWidgetArea, dock) 69 70 self.statuslogger = QStatusLogger(self, self.statusBar(), 20) 71 logging.getLogger('').addHandler(self.statuslogger) 72 73 self.manager = PanelManager(self) 74 75 filemenu = self.menuBar().addMenu("File") 76 quitaction = QAction("Quit", self) 77 quitaction.setShortcut(self.tr("Ctrl+q")) 78 self.connect(quitaction, SIGNAL("triggered()"), self, SLOT("close()")) 79 filemenu.addAction(quitaction) 80 81 editmenu = self.menuBar().addMenu("Edit") 82 self.updateaction = QAction("Update Mixer Panels", self) 83 self.updateaction.setEnabled(False) 84 self.connect(self.updateaction, SIGNAL("triggered()"), self.manager.updatePanels) 85 editmenu.addAction(self.updateaction) 86 87 helpmenu = self.menuBar().addMenu( "Help" ) 88 aboutaction = QAction( "About FFADO", self ) 89 self.connect( aboutaction, SIGNAL( "triggered()" ), self.aboutFFADO ) 90 helpmenu.addAction( aboutaction ) 91 aboutqtaction = QAction( "About Qt", self ) 92 self.connect( aboutqtaction, SIGNAL( "triggered()" ), qApp, SLOT( "aboutQt()" ) ) 93 helpmenu.addAction( aboutqtaction ) 94 95 log.info( "Starting up" ) 96 97 QTimer.singleShot( 1, self.connectToDBUS ) 98 99 def __del__(self): 100 log.info("__del__") 101 del self.manager 102 log.info("__del__ finished") 103 104 def closeEvent(self, event): 105 log.info("closeEvent()") 106 event.accept() 107 108 def connectToDBUS(self): 109 try: 110 self.setupDeviceManager() 111 except dbus.DBusException, ex: 112 log.error("Could not communicate with the FFADO DBus service...") 113 if not hasattr(self,"retry"): 114 self.retry = StartDialog(self) 115 self.setCentralWidget(self.retry) 116 self.connect(self.retry.button, SIGNAL("clicked()"), self.tryStartDBUSServer) 117 self.retry.setEnabled(True) 118 119 def tryStartDBUSServer(self): 120 try: 121 self.setupDeviceManager() 122 except dbus.DBusException, ex: 123 self.retry.setEnabled(False) 124 os.spawnlp( os.P_NOWAIT, "ffado-dbus-server" ) 125 QTimer.singleShot(2000, self.connectToDBUS) 126 127 def setupDeviceManager(self): 128 devmgr = DeviceManagerInterface(FFADO_DBUS_SERVER, FFADO_DBUS_BASEPATH) 129 #nbDevices = devmgr.getNbDevices() 130 self.manager.setManager(devmgr) 131 self.setCentralWidget(self.manager) 132 self.updateaction.setEnabled(True) 133 134 def aboutFFADO(self): 135 QMessageBox.about( self, "About FFADO", """ 136 <h1>ffado.org</h1> 137 138 <p>FFADO is the new approach to have firewire audio on linux.</p> 139 140 <p>© 2006-2008 by the FFADO developers<br />ffado is licensed under the GPLv3, for the full license text see <a href="http://www.gnu.org/licenses/">www.gnu.org/licenses</a> or the LICENSE.* files shipped with ffado.</p> 141 142 <p>FFADO developers are:<ul> 143 <li>Pieter Palmers 144 <li>Daniel Wagner 145 <li>Jonathan Woithe 146 <li>Arnold Krille 147 </ul> 148 """ ) 149 32 import cProfile 150 33 151 34 if __name__ == "__main__": 152 #set up logging 153 import logging 154 logging.basicConfig( datefmt="%H:%M:%S", format="%(asctime)s %(name)-16s %(levelname)-8s %(message)s" ) 155 156 if DEBUG: 157 debug_level = logging.DEBUG 158 else: 159 debug_level = logging.INFO 160 161 # main loggers: 162 logging.getLogger('main').setLevel(debug_level) 163 logging.getLogger('dbus').setLevel(debug_level) 164 logging.getLogger('registration').setLevel(debug_level) 165 logging.getLogger('panelmanager').setLevel(debug_level) 166 logging.getLogger('configparser').setLevel(logging.INFO) 167 168 # widgets: 169 logging.getLogger('matrixmixer').setLevel(debug_level) 170 logging.getLogger('crossbarrouter').setLevel(debug_level) 171 172 # mixers: 173 logging.getLogger('audiofire').setLevel(debug_level) 174 logging.getLogger('bridgeco').setLevel(debug_level) 175 logging.getLogger('edirolfa101').setLevel(debug_level) 176 logging.getLogger('edirolfa66').setLevel(debug_level) 177 logging.getLogger('motu').setLevel(debug_level) 178 logging.getLogger('rme').setLevel(debug_level) 179 logging.getLogger('phase24').setLevel(debug_level) 180 logging.getLogger('phase88').setLevel(debug_level) 181 logging.getLogger('quatafire').setLevel(debug_level) 182 logging.getLogger('saffirebase').setLevel(debug_level) 183 logging.getLogger('saffire').setLevel(debug_level) 184 logging.getLogger('saffirepro').setLevel(debug_level) 185 186 logging.getLogger('global').setLevel(debug_level) 187 188 log = logging.getLogger('main') 189 190 app = QApplication(sys.argv) 191 app.setWindowIcon( QIcon( SHAREDIR + "/icons/hi64-apps-ffado.png" ) ) 192 193 app.setOrganizationName("FFADO") 194 app.setOrganizationDomain("ffado.org") 195 app.setApplicationName("ffado-mixer") 196 197 mainwindow = FFADOWindow(None) 198 199 200 # rock & roll 201 mainwindow.show() 202 #QObject.connect(app,SIGNAL("lastWindowClosed()"),app,SLOT("quit()")) 203 app.exec_() 35 cProfile.run('ffadomain(sys.argv)', sort='time') 204 36 205 37 # trunk/libffado/support/mixer-qt4/ffado-mixer.in
r1711 r1748 2 2 # 3 3 # Copyright (C) 2005-2008 by Pieter Palmers 4 # 2007-200 8by Arnold Krille4 # 2007-2009 by Arnold Krille 5 5 # 6 6 # This file is part of FFADO … … 23 23 # 24 24 25 # 26 # QT 4 version 27 # 28 29 import sys, os 25 import sys 30 26 31 27 # Add the path of the installed ffado-modules … … 33 29 sys.path.append( "$PYPKGDIR" ) 34 30 35 from ffado.config import * #POLL_SLEEP_TIME_MSEC, FFADO_DBUS_SERVER, FFADO_DBUS_BASEPATH 36 37 import os 38 import time 39 40 from PyQt4.QtCore import SIGNAL, SLOT, QObject, QTimer, Qt 41 from PyQt4.QtGui import * #QApplication, QMessageBox, QIcon 42 43 from ffado.dbus_util import * 44 45 from ffado.panelmanager import PanelManager 46 47 from ffado.logginghandler import * 48 49 """Just a small helper to ask the retry-question without a blocking messagebox""" 50 class StartDialog(QWidget): 51 def __init__(self, parent): 52 QWidget.__init__(self, parent) 53 self.setObjectName("Restart Dialog") 54 self.label = QLabel("Somehow the connection to the dbus-service of FFADO couldn't be established.\nShall we take another try?",self) 55 self.button = QPushButton("Retry", self) 56 self.layout = QGridLayout(self) 57 self.layout.addWidget(self.label, 0, 0, Qt.AlignCenter) 58 self.layout.addWidget(self.button, 1, 0, Qt.AlignCenter) 59 60 class FFADOWindow(QMainWindow): 61 def __init__(self, parent): 62 QMainWindow.__init__(self, parent) 63 64 self.textlogger = QTextLogger(self) 65 dock = QDockWidget("Log Messages",self) 66 dock.setWidget(self.textlogger.textedit) 67 logging.getLogger('').addHandler(self.textlogger) 68 self.addDockWidget(Qt.BottomDockWidgetArea, dock) 69 70 self.statuslogger = QStatusLogger(self, self.statusBar(), 20) 71 logging.getLogger('').addHandler(self.statuslogger) 72 73 self.manager = PanelManager(self) 74 75 filemenu = self.menuBar().addMenu("File") 76 quitaction = QAction("Quit", self) 77 quitaction.setShortcut(self.tr("Ctrl+q")) 78 self.connect(quitaction, SIGNAL("triggered()"), self, SLOT("close()")) 79 filemenu.addAction(quitaction) 80 81 editmenu = self.menuBar().addMenu("Edit") 82 self.updateaction = QAction("Update Mixer Panels", self) 83 self.updateaction.setEnabled(False) 84 self.connect(self.updateaction, SIGNAL("triggered()"), self.manager.updatePanels) 85 editmenu.addAction(self.updateaction) 86 87 helpmenu = self.menuBar().addMenu( "Help" ) 88 aboutaction = QAction( "About FFADO", self ) 89 self.connect( aboutaction, SIGNAL( "triggered()" ), self.aboutFFADO ) 90 helpmenu.addAction( aboutaction ) 91 aboutqtaction = QAction( "About Qt", self ) 92 self.connect( aboutqtaction, SIGNAL( "triggered()" ), qApp, SLOT( "aboutQt()" ) ) 93 helpmenu.addAction( aboutqtaction ) 94 95 log.info( "Starting up" ) 96 97 QTimer.singleShot( 1, self.connectToDBUS ) 98 99 def __del__(self): 100 log.info("__del__") 101 del self.manager 102 log.info("__del__ finished") 103 104 def closeEvent(self, event): 105 log.info("closeEvent()") 106 event.accept() 107 108 def connectToDBUS(self): 109 try: 110 self.setupDeviceManager() 111 except dbus.DBusException, ex: 112 log.error("Could not communicate with the FFADO DBus service...") 113 if not hasattr(self,"retry"): 114 self.retry = StartDialog(self) 115 self.setCentralWidget(self.retry) 116 self.connect(self.retry.button, SIGNAL("clicked()"), self.tryStartDBUSServer) 117 self.retry.setEnabled(True) 118 119 def tryStartDBUSServer(self): 120 try: 121 self.setupDeviceManager() 122 except dbus.DBusException, ex: 123 self.retry.setEnabled(False) 124 os.spawnlp( os.P_NOWAIT, "ffado-dbus-server" ) 125 QTimer.singleShot(2000, self.connectToDBUS) 126 127 def setupDeviceManager(self): 128 devmgr = DeviceManagerInterface(FFADO_DBUS_SERVER, FFADO_DBUS_BASEPATH) 129 #nbDevices = devmgr.getNbDevices() 130 self.manager.setManager(devmgr) 131 self.setCentralWidget(self.manager) 132 self.updateaction.setEnabled(True) 133 134 def aboutFFADO(self): 135 QMessageBox.about( self, "About FFADO", """ 136 <h1>ffado.org</h1> 137 138 <p>FFADO is the new approach to have firewire audio on linux.</p> 139 140 <p>© 2006-2008 by the FFADO developers<br />ffado is licensed under the GPLv3, for the full license text see <a href="http://www.gnu.org/licenses/">www.gnu.org/licenses</a> or the LICENSE.* files shipped with ffado.</p> 141 142 <p>FFADO developers are:<ul> 143 <li>Pieter Palmers 144 <li>Daniel Wagner 145 <li>Jonathan Woithe 146 <li>Arnold Krille 147 </ul> 148 """ ) 149 31 from ffado.ffadowindow import * 150 32 151 33 if __name__ == "__main__": 152 #set up logging 153 import logging 154 logging.basicConfig( datefmt="%H:%M:%S", format="%(asctime)s %(name)-16s %(levelname)-8s %(message)s" ) 155 156 if DEBUG: 157 debug_level = logging.DEBUG 158 else: 159 debug_level = logging.INFO 160 161 # main loggers: 162 logging.getLogger('main').setLevel(debug_level) 163 logging.getLogger('dbus').setLevel(debug_level) 164 logging.getLogger('registration').setLevel(debug_level) 165 logging.getLogger('panelmanager').setLevel(debug_level) 166 logging.getLogger('configparser').setLevel(logging.INFO) 167 168 # widgets: 169 logging.getLogger('matrixmixer').setLevel(debug_level) 170 logging.getLogger('crossbarrouter').setLevel(debug_level) 171 172 # mixers: 173 logging.getLogger('audiofire').setLevel(debug_level) 174 logging.getLogger('bridgeco').setLevel(debug_level) 175 logging.getLogger('edirolfa101').setLevel(debug_level) 176 logging.getLogger('edirolfa66').setLevel(debug_level) 177 logging.getLogger('motu').setLevel(debug_level) 178 logging.getLogger('rme').setLevel(debug_level) 179 logging.getLogger('phase24').setLevel(debug_level) 180 logging.getLogger('phase88').setLevel(debug_level) 181 logging.getLogger('quatafire').setLevel(debug_level) 182 logging.getLogger('saffirebase').setLevel(debug_level) 183 logging.getLogger('saffire').setLevel(debug_level) 184 logging.getLogger('saffirepro').setLevel(debug_level) 185 186 logging.getLogger('global').setLevel(debug_level) 187 188 log = logging.getLogger('main') 189 190 app = QApplication(sys.argv) 191 app.setWindowIcon( QIcon( SHAREDIR + "/icons/hi64-apps-ffado.png" ) ) 192 193 app.setOrganizationName("FFADO") 194 app.setOrganizationDomain("ffado.org") 195 app.setApplicationName("ffado-mixer") 196 197 mainwindow = FFADOWindow(None) 198 199 200 # rock & roll 201 mainwindow.show() 202 #QObject.connect(app,SIGNAL("lastWindowClosed()"),app,SLOT("quit()")) 203 app.exec_() 34 sys.exit(ffadomain(sys.argv)) 204 35 205 36 # trunk/libffado/support/mixer-qt4/ffado/ffadowindow.py
r1711 r1748 2 2 # 3 3 # Copyright (C) 2005-2008 by Pieter Palmers 4 # 2007-200 8by Arnold Krille4 # 2007-2009 by Arnold Krille 5 5 # 6 6 # This file is part of FFADO … … 23 23 # 24 24 25 #26 # QT 4 version27 #28 29 import sys, os30 31 # Add the path of the installed ffado-modules32 # for path in sys.path:33 sys.path.append( "$PYPKGDIR" )34 35 from ffado.config import * #POLL_SLEEP_TIME_MSEC, FFADO_DBUS_SERVER, FFADO_DBUS_BASEPATH36 37 25 import os 38 import time 26 27 from ffado.config import * 28 29 import os 39 30 40 31 from PyQt4.QtCore import SIGNAL, SLOT, QObject, QTimer, Qt 41 from PyQt4.QtGui import * #QApplication, QMessageBox, QIcon32 from PyQt4.QtGui import * 42 33 43 34 from ffado.dbus_util import * … … 149 140 150 141 151 if __name__ == "__main__":142 def ffadomain(args): 152 143 #set up logging 153 144 import logging … … 188 179 log = logging.getLogger('main') 189 180 190 app = QApplication( sys.argv)181 app = QApplication(args) 191 182 app.setWindowIcon( QIcon( SHAREDIR + "/icons/hi64-apps-ffado.png" ) ) 192 183 … … 200 191 # rock & roll 201 192 mainwindow.show() 202 #QObject.connect(app,SIGNAL("lastWindowClosed()"),app,SLOT("quit()")) 203 app.exec_() 193 return app.exec_() 194 195 if __name__ == "__main__": 196 import sys 197 sys.exit(ffadomain(sys.argv)) 204 198 205 199 # trunk/libffado/support/mixer-qt4/SConscript
r1640 r1748 51 51 e.Install( "$bindir", "ffado-mixer" ) 52 52 53 e.ScanReplace( "ffado-mixer-profiler.in" ) 54 e.Depends( "ffado-mixer-profiler", "SConscript" ) 55 e.Depends( "ffado-mixer-profiler", "#/SConstruct" ) 56 53 57 e.Install( "$sharedir/icons", "../xdg/hi64-apps-ffado.png" ) 54 58