예제 #1
0
파일: Form1.cs 프로젝트: d3x0r/xperdex
        private void button2_Click(object sender, System.EventArgs e)
        {
            int    hr;
            MPData o;

            hr = m_param.GetParam(0, out o);
            DMOError.ThrowExceptionForHR(hr);

            o.vInt ^= 2;

            hr = m_param.SetParam(0, o);
            DMOError.ThrowExceptionForHR(hr);
        }
예제 #2
0
        public DMOEnumParam(string[] sEnum, IMediaParams param, int paramNum, ParamInfo pInfo)
        {
            DropDownStyle = ComboBoxStyle.DropDownList;
            Dock          = DockStyle.Fill;
            _param        = param;
            _paramNum     = paramNum;
            _pInfo        = pInfo;

            for (int i = 0; i < sEnum.Length; i++)
            {
                Items.Add(sEnum[i]);
            }
            MPData val;

            param.GetParam(_paramNum, out val);
            if (_pInfo.mopCaps == MPCaps.Jump)
            {
                SelectedIndex = val.vInt;
            }
            else
            {
                SelectedIndex = (int)((float)(Items.Count - 1) * val.vFloat);
            }
            SelectedIndexChanged += new EventHandler(DMOEnumParam_SelectedIndexChanged);
        }
예제 #3
0
        private void TestParam()
        {
            int    hr;
            MPData pData = new MPData();

            pData.vFloat = 51;

            hr = m_imp.SetParam(0, pData);
            DMOError.ThrowExceptionForHR(hr);

            hr = m_imp.GetParam(0, out pData);
            DMOError.ThrowExceptionForHR(hr);

            Debug.Assert(pData.vFloat == 51, "GetParam");
        }
예제 #4
0
        public DMONumericalParam(IMediaParams param, int paramNum, ParamInfo pInfo)
        {
            InitializeComponent();
            Dock = DockStyle.Fill;

            _param    = param;
            _paramNum = paramNum;
            _pInfo    = pInfo;

            MPData val;

            param.GetParam(_paramNum, out val);

            if (pInfo.mpType == MPType.FLOAT)
            {
                numericUpDown1.DecimalPlaces = 3;
                numericUpDown1.Increment     = 0.001M;
            }

            if (pInfo.mpType == MPType.INT && pInfo.mopCaps == MPCaps.Jump)
            {
                // a regular int control
                numericUpDown1.Minimum = _pInfo.mpdMinValue.vInt;
                numericUpDown1.Maximum = _pInfo.mpdMaxValue.vInt;
                numericUpDown1.Value   = val.vInt;
            }
            else
            {
                // float
                numericUpDown1.Minimum = (decimal)_pInfo.mpdMinValue.vFloat;
                numericUpDown1.Maximum = (decimal)_pInfo.mpdMaxValue.vFloat;
                numericUpDown1.Value   = (decimal)val.vFloat;
            }

            numericUpDown1.ValueChanged += new EventHandler(numericUpDown1_ValueChanged);
            colorTrackBar1.ValueChanged += new ColorTrackBar.ValueChangedEventHandler(colorTrackBar1_ValueChanged);

            // force the colorTrackbar to update it's value and caption
            numericUpDown1_ValueChanged(null, null);
            _initialzed = true;
        }
예제 #5
0
        public DMOBoolParam(IMediaParams param, int paramNum, ParamInfo pInfo)
        {
            _param    = param;
            _paramNum = paramNum;
            _pInfo    = pInfo;

            Text   = "";
            Size   = new System.Drawing.Size(15, 19);
            Anchor = AnchorStyles.Top | AnchorStyles.Bottom;

            MPData val;

            param.GetParam(_paramNum, out val);
            if (_pInfo.mopCaps == MPCaps.Jump)
            {
                Checked = val.vBool;
            }
            else
            {
                Checked = (val.vFloat == 0) ? false : true;
            }

            CheckedChanged += new EventHandler(DMOBoolParam_CheckedChanged);
        }