Attempt to have the Play movie dialog preload movies in the Movie directory
This commit is contained in:
parent
12adf89ca1
commit
dc288f4f3b
|
@ -121,7 +121,7 @@
|
|||
//
|
||||
// columnHeader4
|
||||
//
|
||||
this.columnHeader4.Text = "Author";
|
||||
this.columnHeader4.Text = "Length";
|
||||
this.columnHeader4.Width = 97;
|
||||
//
|
||||
// DetailsView
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private void MovieView_QueryItemBkColor(int index, int column, ref Color color)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Cancel_Click(object sender, EventArgs e)
|
||||
|
@ -72,15 +72,26 @@ namespace BizHawk.MultiClient
|
|||
return;
|
||||
else
|
||||
{
|
||||
PreLoadMovieFile(file);
|
||||
MovieView.ItemCount = MovieList.Count;
|
||||
UpdateList();
|
||||
MovieView.SelectedIndices.Clear();
|
||||
MovieView.setSelection(MovieList.Count-1);
|
||||
AddMovieToList(ofd.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AddMovieToList(string filename)
|
||||
{
|
||||
var file = new FileInfo(filename);
|
||||
if (!file.Exists)
|
||||
return;
|
||||
else
|
||||
{
|
||||
PreLoadMovieFile(file);
|
||||
MovieView.ItemCount = MovieList.Count;
|
||||
UpdateList();
|
||||
MovieView.SelectedIndices.Clear();
|
||||
MovieView.setSelection(MovieList.Count - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void PreLoadMovieFile(FileInfo path)
|
||||
{
|
||||
Movie m = new Movie(path.FullName, MOVIEMODE.INACTIVE);
|
||||
|
@ -105,7 +116,13 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private void PlayMovie_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
string d = PathManager.MakeAbsolutePath(Global.Config.MoviesPath, "");
|
||||
if (!Directory.Exists(d))
|
||||
Directory.CreateDirectory(d);
|
||||
foreach (string f in Directory.GetFiles(d, "*.tas"))
|
||||
{
|
||||
AddMovieToList(f);
|
||||
}
|
||||
}
|
||||
|
||||
private void MovieView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
|
|
Loading…
Reference in New Issue