Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
so not working... urgently need help
private void menuItem6_Click(object sender, EventArgs e)
{
CleanUp();
listBox1.Items.Clear();
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Multiselect = true;
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
files = openFileDialog.SafeFileNames;
paths = openFileDialog.FileNames;

for (int i = 0; i < files.Length; i++)
listBox1.Items.Add(files[i]);
}
for (int i = 0; i < openFileDialog.FileNames.Length; i++)
{
m_objFilterGraph = new FilgraphManager();
m_objFilterGraph.RenderFile(paths[i]);

m_objBasicAudio = m_objFilterGraph as IBasicAudio;

// Построение интерфейса(разделение аудио и видео)
try
{
m_objVideoWindow = m_objFilterGraph as IVideoWindow;
m_objVideoWindow.Owner = (int)panel1.Handle;
m_objVideoWindow.WindowStyle = WS_CHILD | WS_CLIPCHILDREN;
m_objVideoWindow.SetWindowPosition(panel1.ClientRectangle.Left,
panel1.ClientRectangle.Top,
panel1.ClientRectangle.Width,
panel1.ClientRectangle.Height);
}
catch (Exception)
{
m_objVideoWindow = null;
}

m_objMediaEvent = m_objFilterGraph as IMediaEvent;

m_objMediaEventEx = m_objFilterGraph as IMediaEventEx;
m_objMediaEventEx.SetNotifyWindow((int)this.Handle, WM_GRAPHNOTIFY, 0);

m_objMediaPosition = m_objFilterGraph as IMediaPosition;

m_objMediaControl = m_objFilterGraph as IMediaControl;

this.Text = "DirectShow - [" + openFileDialog.FileName + "]";

m_objMediaControl.Run();
m_CurrentStatus = MediaStatus.Running;

UpdateStatusBar();
UpdateToolBar();
}
}
Posted
Comments
Sergey Alexandrovich Kryukov 29-Dec-14 18:26pm    
"Not working" is not informative. What did you try to achieve and how, what did you expect and what did you get instead, why do you feel it's wrong?..
—SA

1 solution

In this code I am just trying to play files in a loop, sending the log file path from listbox1. But they play not sequentially, and simultaneously, the question is how to do that, they played consistently? so clear?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900