sinkwidget: Move format selection options to 'Advanced' expander

There's no reason to present this for all S/PDIF and HDMI cases. The
user can select it when required.
This commit is contained in:
Arun Raghavan 2012-11-20 19:51:41 +05:30
parent c69cffecdc
commit 5132a24b35
2 changed files with 133 additions and 119 deletions

View File

@ -394,91 +394,6 @@
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkTable" id="encodingSelect">
<property name="can_focus">False</property>
<property name="n_rows">2</property>
<property name="n_columns">3</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkCheckButton" id="encodingFormatPCM">
<property name="label" translatable="yes">PCM</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="encodingFormatAC3">
<property name="label" translatable="yes">AC3</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="encodingFormatDTS">
<property name="label" translatable="yes">DTS</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="encodingFormatEAC3">
<property name="label" translatable="yes">EAC3</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="encodingFormatMPEG">
<property name="label" translatable="yes">MPEG</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child> <child>
<object class="GtkVBox" id="channelsVBox"> <object class="GtkVBox" id="channelsVBox">
<property name="visible">True</property> <property name="visible">True</property>
@ -494,7 +409,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">3</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -503,51 +418,147 @@
<property name="sensitive">False</property> <property name="sensitive">False</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<child> <child>
<object class="GtkHBox" id="offsetSelect"> <object class="GtkVBox" id="vbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">6</property>
<child> <child>
<object class="GtkLabel" id="label3"> <object class="GtkTable" id="encodingSelect">
<property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="n_rows">2</property>
<property name="label" translatable="yes">&lt;b&gt;Latency offset:&lt;/b&gt;</property> <property name="n_columns">3</property>
<property name="use_markup">True</property> <child>
<placeholder/>
</child>
<child>
<object class="GtkCheckButton" id="encodingFormatPCM">
<property name="label" translatable="yes">PCM</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="encodingFormatAC3">
<property name="label" translatable="yes">AC3</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="encodingFormatDTS">
<property name="label" translatable="yes">DTS</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="encodingFormatEAC3">
<property name="label" translatable="yes">EAC3</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="encodingFormatMPEG">
<property name="label" translatable="yes">MPEG</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">False</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkSpinButton" id="offsetButton"> <object class="GtkHBox" id="offsetSelect">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">ms</property> <property name="spacing">6</property>
<property name="use_markup">True</property> <child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;b&gt;Latency offset:&lt;/b&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="offsetButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">ms</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">False</property>
<property name="position">2</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>
@ -563,7 +574,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">4</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@ -156,10 +156,13 @@ void SinkWidget::onPortChange() {
void SinkWidget::setDigital(bool digital) { void SinkWidget::setDigital(bool digital) {
#if HAVE_EXT_DEVICE_RESTORE_API #if HAVE_EXT_DEVICE_RESTORE_API
if (digital) if (digital) {
encodingSelect->show(); encodingSelect->show();
else advancedOptions->set_sensitive(true);
} else {
/* advancedOptions has sensitive=false by default */
encodingSelect->hide(); encodingSelect->hide();
}
#endif #endif
} }
@ -191,4 +194,4 @@ void SinkWidget::onEncodingsChange() {
free(formats); free(formats);
pa_operation_unref(o); pa_operation_unref(o);
#endif #endif
} }