1 |
// Media File |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
using System.IO; |
8 |
|
9 |
public class MediaFile |
10 |
{ |
11 |
public string path { get { return path_; } } |
12 |
public string artist { get { return artist_; } } |
13 |
public string title { get { return title_; } } |
14 |
public string album { get { return album_; } } |
15 |
public string genre { get { return genre_; } } |
16 |
|
17 |
public MediaFile(FileInfo file) |
18 |
{ |
19 |
path_ = file.Name; |
20 |
|
21 |
Shell32.Shell shell = new Shell32.ShellClass(); |
22 |
Shell32.Folder folder = shell.NameSpace(file.DirectoryName); |
23 |
Shell32.FolderItem item = folder.ParseName(file.Name); |
24 |
|
25 |
artist_ = folder.GetDetailsOf(item, 9); |
26 |
title_ = folder.GetDetailsOf(item, 10); |
27 |
album_ = folder.GetDetailsOf(item, 17); |
28 |
genre_ = folder.GetDetailsOf(item, 12); |
29 |
} |
30 |
|
31 |
private string path_, artist_, title_, album_, genre_; |
32 |
} |