ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/DecentralizedMediaClient/MediaFile.cs
Revision: 518
Committed: 2005-06-21T19:45:48-07:00 (20 years ago) by douglas
File size: 790 byte(s)
Log Message:
Woo! C# and Shell32 are great for getting WMA and MP3 ID3 info.

File Contents

# Content
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 }

Properties

Name Value
svn:eol-style native
svn:keywords Id