- Timestamp:
- 11/23/08 03:25:32 (15 years ago)
- Files:
-
- branches/libffado-2.0/src/ffadodevice.cpp (modified) (1 diff)
- branches/libffado-2.0/src/ffadodevice.h (modified) (1 diff)
- branches/libffado-2.0/src/libcontrol/ClockSelect.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libcontrol/ClockSelect.h (modified) (1 diff)
- branches/libffado-2.0/support/mixer-qt4/ffado_dbus_util.py (modified) (2 diffs)
- branches/libffado-2.0/support/mixer-qt4/ffado_panelmanager.py (modified) (3 diffs)
- branches/libffado-2.0/support/mixer-qt4/mixer_global.py (modified) (1 diff)
- branches/libffado-2.0/support/mixer-qt4/mixer_global.ui (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/src/ffadodevice.cpp
r1406 r1474 73 73 if(!m_genericContainer->addElement(new Control::Nickname(*this))) { 74 74 debugWarning("failed to add Nickname control to container\n"); 75 } 76 // add a generic control for the streaming status 77 if(!m_genericContainer->addElement(new Control::StreamingStatus(*this))) { 78 debugWarning("failed to add StreamingStatus control to container\n"); 75 79 } 76 80 } branches/libffado-2.0/src/ffadodevice.h
r1406 r1474 264 264 */ 265 265 enum eStreamingState { 266 eSS_Idle , ///> not streaming267 eSS_Sending , ///> the device is sending a stream268 eSS_Receiving , ///> the device is receiving a stream269 eSS_Both , ///> the device is sending and receiving a stream266 eSS_Idle = 0, ///> not streaming 267 eSS_Sending = 1, ///> the device is sending a stream 268 eSS_Receiving = 2, ///> the device is receiving a stream 269 eSS_Both = 3, ///> the device is sending and receiving a stream 270 270 }; 271 271 branches/libffado-2.0/src/libcontrol/ClockSelect.cpp
r1385 r1474 260 260 } 261 261 262 // --- stream status feedback selection --- 263 264 StreamingStatus::StreamingStatus(FFADODevice &d) 265 : Enum(&d) 266 , m_Device( d ) 267 { 268 setName("StreamingStatus"); 269 setLabel("Streaming Status"); 270 setDescription("Obtain information of the current streaming status of a device"); 271 } 272 273 bool 274 StreamingStatus::select(int idx) 275 { 276 debugWarning("Cannot change stream status through control interface\n"); 277 return false; 278 } 279 280 int 281 StreamingStatus::selected() 282 { 283 return m_Device.getStreamingState(); 284 } 285 286 int 287 StreamingStatus::count() 288 { 289 // NOTE: this should correspond to the number of enums in FFADODevice::eStreamingState 290 return 4; 291 } 292 293 std::string 294 StreamingStatus::getEnumLabel(int idx) 295 { 296 switch(idx) { 297 case FFADODevice::eSS_Idle: 298 return "Idle"; 299 case FFADODevice::eSS_Sending: 300 return "Sending"; 301 case FFADODevice::eSS_Receiving: 302 return "Receiving"; 303 case FFADODevice::eSS_Both: 304 return "Both"; 305 default: 306 debugError("Invalid enum index specified: %d\n", idx); 307 return "Invalid enum index"; 308 } 309 } 310 311 bool 312 StreamingStatus::canChangeValue() 313 { 314 return false; 315 } 316 317 void 318 StreamingStatus::show() 319 { 320 debugOutput( DEBUG_LEVEL_NORMAL, "StreamingStatus Element %s, current: %d\n", 321 getName().c_str(), m_Device.getStreamingState()); 322 } 323 262 324 263 325 } // namespace Control branches/libffado-2.0/src/libcontrol/ClockSelect.h
r1385 r1474 90 90 }; 91 91 92 /*! 93 * @brief Stream status control element 94 */ 95 class StreamingStatus 96 : public Enum 97 { 98 public: 99 StreamingStatus(FFADODevice &); 100 virtual ~StreamingStatus() {}; 101 102 virtual bool select(int idx); 103 virtual int selected(); 104 virtual int count(); 105 virtual std::string getEnumLabel(int idx); 106 107 virtual bool canChangeValue(); 108 109 virtual void show(); 110 111 protected: 112 FFADODevice &m_Device; 113 }; 114 92 115 }; // namespace Control 93 116 branches/libffado-2.0/support/mixer-qt4/ffado_dbus_util.py
r1406 r1474 313 313 return self.iface_element.canChangeValue() 314 314 315 class SamplerateSelectInterface:316 def __init__(self, servername, devicepath):317 self.basepath =devicepath + '/Generic/SamplerateSelect'318 self.servername =servername319 self.bus =dbus.SessionBus()315 class EnumInterface: 316 def __init__(self, servername, basepath): 317 self.basepath = basepath 318 self.servername = servername 319 self.bus = dbus.SessionBus() 320 320 self.dev = self.bus.get_object(self.servername, self.basepath) 321 321 self.iface = dbus.Interface(self.dev, dbus_interface='org.ffado.Control.Element.Enum') … … 332 332 return self.iface_element.canChangeValue() 333 333 334 class SamplerateSelectInterface(EnumInterface): 335 def __init__(self, servername, devicepath): 336 EnumInterface.__init__(self, servername, devicepath + '/Generic/SamplerateSelect') 337 338 class StreamingStatusInterface(EnumInterface): 339 def __init__(self, servername, devicepath): 340 EnumInterface.__init__(self, servername, devicepath + '/Generic/StreamingStatus') 341 334 342 class TextInterface: 335 343 def __init__(self, servername, basepath): branches/libffado-2.0/support/mixer-qt4/ffado_panelmanager.py
r1436 r1474 298 298 clockselect = ClockSelectInterface( FFADO_DBUS_SERVER, FFADO_DBUS_BASEPATH+"/DeviceManager/"+path ) 299 299 samplerateselect = SamplerateSelectInterface( FFADO_DBUS_SERVER, FFADO_DBUS_BASEPATH+"/DeviceManager/"+path ) 300 streamingstatus = StreamingStatusInterface( FFADO_DBUS_SERVER, FFADO_DBUS_BASEPATH+"/DeviceManager/"+path ) 300 301 nickname = TextInterface( FFADO_DBUS_SERVER, FFADO_DBUS_BASEPATH+"/DeviceManager/"+path+"/Generic/Nickname" ) 301 302 … … 307 308 globalmixer.clockselect = clockselect 308 309 globalmixer.samplerateselect = samplerateselect 310 globalmixer.streamingstatus = streamingstatus 309 311 globalmixer.nickname = nickname 310 312 globalmixer.hw = hw … … 334 336 mixerwidget.clockselect = clockselect 335 337 mixerwidget.samplerateselect = samplerateselect 338 mixerwidget.streamingstatus = streamingstatus 336 339 mixerwidget.nickname = nickname 337 340 mixerwidget.hw = hw branches/libffado-2.0/support/mixer-qt4/mixer_global.py
r1433 r1474 119 119 self.clocksource.setEnabled(self.clockselect.canChangeValue()) 120 120 self.txtNickname.setEnabled(self.nickname.canChangeValue()) 121 ss = self.streamingstatus.selected() 122 ss_txt = self.streamingstatus.getEnumLabel(ss) 123 if ss_txt == 'Idle': 124 self.chkStreamIn.setChecked(False) 125 self.chkStreamOut.setChecked(False) 126 elif ss_txt == 'Sending': 127 self.chkStreamIn.setChecked(False) 128 self.chkStreamOut.setChecked(True) 129 elif ss_txt == 'Receiving': 130 self.chkStreamIn.setChecked(True) 131 self.chkStreamOut.setChecked(False) 132 elif ss_txt == 'Both': 133 self.chkStreamIn.setChecked(True) 134 self.chkStreamOut.setChecked(True) 135 branches/libffado-2.0/support/mixer-qt4/mixer_global.ui
r1433 r1474 23 23 <x>0</x> 24 24 <y>0</y> 25 <width> 444</width>26 <height>8 1</height>25 <width>700</width> 26 <height>80</height> 27 27 </rect> 28 28 </property> … … 36 36 <string>Global Mixer Options</string> 37 37 </property> 38 <layout class="QHBoxLayout" name="horizontalLayout" > 39 <property name="margin" > 40 <number>3</number> 41 </property> 42 <item> 43 <layout class="QGridLayout" name="gridLayout_2" > 38 <layout class="QHBoxLayout" > 39 <property name="leftMargin" > 40 <number>3</number> 41 </property> 42 <property name="topMargin" > 43 <number>3</number> 44 </property> 45 <property name="rightMargin" > 46 <number>3</number> 47 </property> 48 <property name="bottomMargin" > 49 <number>3</number> 50 </property> 51 <item> 52 <layout class="QGridLayout" > 44 53 <property name="horizontalSpacing" > 45 54 <number>9</number> … … 84 93 </item> 85 94 <item> 86 <layout class="QGridLayout" name="gridLayout">95 <layout class="QGridLayout" > 87 96 <property name="horizontalSpacing" > 88 97 <number>9</number> … … 140 149 </item> 141 150 <item> 151 <widget class="QGroupBox" name="grpStatus" > 152 <property name="sizePolicy" > 153 <sizepolicy vsizetype="Preferred" hsizetype="Maximum" > 154 <horstretch>0</horstretch> 155 <verstretch>0</verstretch> 156 </sizepolicy> 157 </property> 158 <property name="title" > 159 <string>Stream Status</string> 160 </property> 161 <layout class="QVBoxLayout" > 162 <item> 163 <widget class="QCheckBox" name="chkStreamOut" > 164 <property name="enabled" > 165 <bool>false</bool> 166 </property> 167 <property name="layoutDirection" > 168 <enum>Qt::RightToLeft</enum> 169 </property> 170 <property name="text" > 171 <string>Outgoing</string> 172 </property> 173 </widget> 174 </item> 175 <item> 176 <widget class="QCheckBox" name="chkStreamIn" > 177 <property name="enabled" > 178 <bool>false</bool> 179 </property> 180 <property name="layoutDirection" > 181 <enum>Qt::RightToLeft</enum> 182 </property> 183 <property name="text" > 184 <string>Incoming</string> 185 </property> 186 </widget> 187 </item> 188 </layout> 189 </widget> 190 </item> 191 <item> 142 192 <spacer> 143 193 <property name="orientation" > … … 147 197 <enum>QSizePolicy::Expanding</enum> 148 198 </property> 149 <property name="sizeHint" stdset="0">199 <property name="sizeHint" > 150 200 <size> 151 201 <width>330</width>