root/trunk/libffado/support/mixer-qt4/ffado/mixer/motu_mark3.py

Revision 2418, 2.7 kB (checked in by jwoithe, 10 years ago)

motu: add framework to support mark3 mixer GUI interfaces within ffado-mixer.

Line 
1 #
2 # Copyright (C) 2005-2008 by Pieter Palmers
3 # Copyright (C) 2008, 2013 by Jonathan Woithe
4 #
5 # This file is part of FFADO
6 # FFADO = Free Firewire (pro-)audio drivers for linux
7 #
8 # FFADO is based upon FreeBoB.
9 #
10 # This program is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 2 of the License, or
13 # (at your option) version 3 of the License.
14 #
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 #
23
24 from PyQt4.QtCore import SIGNAL, SLOT, QObject, Qt
25 from PyQt4.QtGui import QWidget, QApplication
26 from ffado.config import *
27
28 import logging
29 log = logging.getLogger('motu_mark3')
30
31 # Model defines.  These must agree with what is used in motu_avdevice.h.
32 MOTU_MODEL_NONE             = 0x0000
33 MOTU_MODEL_828mkII          = 0x0001
34 MOTU_MODEL_TRAVELER         = 0x0002
35 MOTU_MODEL_ULTRALITE        = 0x0003
36 MOTU_MODEL_8PRE             = 0x0004
37 MOTU_MODEL_828MkI           = 0x0005
38 MOTU_MODEL_896HD            = 0x0006
39 MOTU_MODEL_828mk3           = 0x0007
40 MOTU_MODEL_ULTRALITEmk3     = 0x0008
41 MOTU_MODEL_ULTRALITEmk3_HYB = 0x0009
42 MOTU_MODEL_TRAVELERmk3      = 0x000a
43 MOTU_MODEL_896HDmk3         = 0x000b
44
45 class Motu_Mark3(QWidget):
46     def __init__(self,parent = None):
47         QWidget.__init__(self,parent)
48         uicLoad("ffado/mixer/motu_mark3", self)
49
50         self.init()
51
52     def init(self):
53         # Initialise any object members as needed
54
55         # Other mixer variables
56         self.is_streaming = 0
57         self.sample_rate = 0
58         self.model = MOTU_MODEL_NONE
59
60     # Hide and disable a control
61     def disable_hide(self,widget):
62         widget.hide()
63         widget.setEnabled(False)
64
65     def initValues_g3(self):
66         # Set up widgets for generation-3 (aka Mark-3) devices
67         return
68
69     def initValues(self):
70         # Is the device streaming?
71         self.is_streaming = self.hw.getDiscrete('/Mixer/Info/IsStreaming')
72         log.debug("device streaming flag: %d" % (self.is_streaming))
73
74         # Retrieve other device settings as needed and customise the UI
75         # based on these options.
76         self.model = self.hw.getDiscrete('/Mixer/Info/Model')
77         log.debug("device model identifier: %d" % (self.model))
78         self.sample_rate = self.hw.getDiscrete('/Mixer/Info/SampleRate')
79         log.debug("device sample rate: %d" % (self.sample_rate))
80
81         self.initValues_g3()
Note: See TracBrowser for help on using the browser.