Beispiel #1
0
        private static MixerControl GetControl(Mixer mx, MixerLine ml, MIXERCONTROL mc)
        {
            MixerControl result = new MixerControl(mx, ml, mc);

            if (result.Class == MixerControlClass.FADER && ((uint)result.ControlType & MIXERCONTROL_CT_UNITS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_UNITS_UNSIGNED)
            {
                result = new FaderMixerControl(mx, ml, mc);
            }
            else if (result.Class == MixerControlClass.SWITCH && ((uint)result.ControlType & MIXERCONTROL_CT_SUBCLASS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_SC_SWITCH_BOOLEAN && ((uint)result.ControlType & MIXERCONTROL_CT_UNITS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_UNITS_BOOLEAN)
            {
                result = new BooleanMixerControl(mx, ml, mc);
            }
            else if (result.Class == MixerControlClass.LIST && ((uint)result.ControlType & MIXERCONTROL_CT_SUBCLASS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_SC_SWITCH_BOOLEAN && ((uint)result.ControlType & MIXERCONTROL_CT_UNITS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_UNITS_BOOLEAN)
            {
                result = new ListMixerControl(mx, ml, mc);
            }
            return(result);
        }
Beispiel #2
0
 private static MixerControl GetControl(Mixer mx, MixerLine ml, MIXERCONTROL mc)
 {
     MixerControl result = new MixerControl(mx, ml, mc);
     if (result.Class == MixerControlClass.FADER && ((uint)result.ControlType & MIXERCONTROL_CT_UNITS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_UNITS_UNSIGNED)
     {
         result = new FaderMixerControl(mx, ml, mc);
     }
     else if (result.Class == MixerControlClass.SWITCH && ((uint)result.ControlType & MIXERCONTROL_CT_SUBCLASS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_SC_SWITCH_BOOLEAN && ((uint)result.ControlType & MIXERCONTROL_CT_UNITS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_UNITS_BOOLEAN)
     {
         result = new BooleanMixerControl(mx, ml, mc);
     }
     else if (result.Class == MixerControlClass.LIST && ((uint)result.ControlType & MIXERCONTROL_CT_SUBCLASS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_SC_SWITCH_BOOLEAN && ((uint)result.ControlType & MIXERCONTROL_CT_UNITS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_UNITS_BOOLEAN)
     {
         result = new ListMixerControl(mx, ml, mc);
     }
     return result;
 }
Beispiel #3
0
 private void UpdateMux()
 {
     if (mux != null)
     {
         mux.Changed -= mux_Changed;
     }
     mux = null;
     muxSelect.Items.Clear();
     muxSelect.Items.Add("No MUX found.");
     muxSelect.SelectedIndex = 0;
     muxSelect.Enabled = false;
     if (dline != null)
     {
         foreach (MixerControl ctrl in dline.Controls)
         {
             if (ctrl.ControlType == MixerControlType.MIXERCONTROL_CONTROLTYPE_MUX && ctrl is ListMixerControl)
             {
                 muxSelect.Items.Clear();
                 ListMixerControl listCtrl = (ListMixerControl)ctrl;
                 foreach (string label in listCtrl.ListTexts)
                 {
                     muxSelect.Items.Add(label);
                 }
                 Boolean[] values = listCtrl.Values;
                 for (int i = 0; i < values.Length; i++)
                 {
                     if (values[i])
                         muxSelect.SelectedIndex = i;
                 }
                 muxSelect.Enabled = true;
                 mux = listCtrl;
                 mux.Changed += mux_Changed;
             }
         }
     }
 }