private static void SetVideoFormat(MPlaylistClass mplaylist, string formatName) { int count = 0; mplaylist.FormatVideoGetCount(eMFormatType.eMFT_Convert, out count); int index = -1; MPLATFORMLib.M_VID_PROPS vidProps = new MPLATFORMLib.M_VID_PROPS(); string name; for (int i = 0; i < count; i++) { mplaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, i, out vidProps, out name); if (string.Equals(name, formatName, StringComparison.OrdinalIgnoreCase)) { index = i; break; } } if (index >= 0) { mplaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps); } }
/// <summary> /// Fill video formats list /// </summary> private void FillVideoFormats() { int nCount = 0; int nIndex; string strFormat; M_VID_PROPS vidProps; comboBoxVF.Items.Clear(); //Get video format count m_objPlaylist.FormatVideoGetCount(eMFormatType.eMFT_Convert, out nCount); comboBoxVF.Enabled = nCount > 0; if (nCount > 0) { for (int i = 0; i < nCount; i++) { //Get format by index m_objPlaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, i, out vidProps, out strFormat); if (vidProps.eVideoFormat == eMVideoFormat.eMVF_HD1080_5994i) { startVideoFormat = i; } comboBoxVF.Items.Add(strFormat); } //Check if there is selected format m_objPlaylist.FormatVideoGet(eMFormatType.eMFT_Convert, out vidProps, out nIndex, out strFormat); if (nIndex > 0) { comboBoxVF.SelectedIndex = nIndex; } else { comboBoxVF.SelectedIndex = 0; } } }
private void Form1_Load(object sender, EventArgs e) { timer1.Start(); //Set and enable a preview,bunları her projede yaz myPlaylist.PreviewWindowSet("", panel1.Handle.ToInt32()); myPlaylist.PreviewEnable("", 1, 1); myPlaylist.PropsSet("loop", "false"); //Start mFile object myPlaylist.ObjectStart(new object()); //Fill video formats int nCount; int nIndex; string strFormat; M_VID_PROPS vidProps; comboBox1.Items.Clear(); //Get video format count myPlaylist.FormatVideoGetCount(eMFormatType.eMFT_Convert, out nCount); comboBox1.Enabled = nCount > 0; if (nCount <= 0) { return; } for (int i = 0; i < nCount; i++) { //Get format by index myPlaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, i, out vidProps, out strFormat); comboBox1.Items.Add(strFormat); } //Check if there is selected format myPlaylist.FormatVideoGet(eMFormatType.eMFT_Convert, out vidProps, out nIndex, out strFormat); comboBox1.SelectedIndex = nIndex > 0 ? nIndex : 0; //Fill audio formats M_AUD_PROPS audProps; comboBox2.Items.Clear(); //Get video format count myPlaylist.FormatAudioGetCount(eMFormatType.eMFT_Convert, out nCount); comboBox2.Enabled = nCount > 0; if (nCount <= 0) { return; } for (int i = 0; i < nCount; i++) { //Get format by index myPlaylist.FormatAudioGetByIndex(eMFormatType.eMFT_Convert, i, out audProps, out strFormat); comboBox2.Items.Add(strFormat); } //Check if there is selected format myPlaylist.FormatAudioGet(eMFormatType.eMFT_Convert, out audProps, out nIndex, out strFormat); comboBox2.SelectedIndex = nIndex > 0 ? nIndex : 0; //set audio volume trackBar1.Value = 50; double dblPos = (double)trackBar1.Value / trackBar1.Maximum; myPlaylist.PreviewAudioVolumeSet("", -1, -30 * (1 - dblPos)); }
private static void SetVideoFormat(MPlaylistClass mplaylist, string formatName) { int count = 0; mplaylist.FormatVideoGetCount(eMFormatType.eMFT_Convert, out count); int index = -1; MPLATFORMLib.M_VID_PROPS vidProps = new MPLATFORMLib.M_VID_PROPS(); string name; for (int i = 0; i < count; i++) { mplaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, i, out vidProps, out name); if (string.Equals(name, formatName, StringComparison.OrdinalIgnoreCase)) { index = i; break; } } if (index >= 0) { mplaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps); } //MPLATFORMLib.M_VID_PROPS m_VID_PROPS = default(MPLATFORMLib.M_VID_PROPS); //m_VID_PROPS.dblRate = info.FPS; //m_VID_PROPS.e3DFormat = MPLATFORMLib.eM3DFormat.eM3D_None; //m_VID_PROPS.eVideoFormat = info.VideoFormat; // info.VideoFormat.GetMPVideoFormat(); //m_VID_PROPS.eScaleType = EnumUtils.ToMPScaleType(info.StretchMode); ////this._logger.AddLog(ENUM_LogType.INFO, "Video format: " + info.VideoFormat.ToString()); ////this._logger.AddLog(ENUM_LogType.INFO, "ML Video format: " + m_VID_PROPS.eVideoFormat.ToString()); //if (info.ExternalKeyMode) //{ // m_VID_PROPS.fccType = MPLATFORMLib.eMFCC.eMFCC_ARGB32; //} //if (/*info.VideoFormat.DisplayMode == ENUM_VIDEO_DISPLAY_MODE.PROGRESSIVE*/info.Progressive) //{ // m_VID_PROPS.eInterlace = MPLATFORMLib.eMInterlace.eMI_Progressive; //} //else //{ // m_VID_PROPS.eInterlace = MPLATFORMLib.eMInterlace.eMI_Default; //} //mplaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref m_VID_PROPS); }