01.
public
partial
class
Form1 : Form
02.
{
03.
public
Form1()
04.
{
05.
InitializeComponent();
06.
axVLCPlugin21.audio.Volume = 10;
07.
}
08.
09.
private
void
Form1_Load(
object
sender, EventArgs e)
10.
{
11.
DirectoryInfo di =
new
DirectoryInfo(
"H:/Movie"
);
12.
FileInfo[] fi = di.GetFiles(
"*.mp4"
);
13.
14.
foreach
(FileInfo curFile
in
fi)
15.
{
16.
listBox1.Items.Add(curFile.Name);
17.
axVLCPlugin21.playlist.add(
"file:///"
+ curFile.FullName);
18.
19.
}
20.
axVLCPlugin21.audio.Volume = 10;
21.
22.
}
23.
24.
private
void
listBox1_SelectedIndexChanged(
object
sender, EventArgs e)
25.
{
26.
int
selIndex = listBox1.SelectedIndex;
27.
axVLCPlugin21.playlist.playItem(selIndex);
28.
axVLCPlugin21.audio.Volume = 10;
29.
}
30.
31.
private
void
axVLCPlugin21_MediaPlayerEndReached(
object
sender, EventArgs e)
32.
{
33.
34.
if
(listBox1.SelectedIndex < (listBox1.Items.Count - 1))
35.
{
36.
37.
axVLCPlugin21.playlist.next();
38.
listBox1.SelectedIndex += 1;
39.
listBox1.Update();
40.
axVLCPlugin21.audio.Volume = 10;
41.
}
42.
else
43.
{
44.
45.
axVLCPlugin21.playlist.playItem(0);
46.
listBox1.SelectedIndex = 0;
47.
listBox1.Update();
48.
axVLCPlugin21.audio.Volume = 10;
49.
}
50.
}
51.
52.
}