[译]MP3播放列表生成器
By robot-v1.0
本文链接 https://www.kyfws.com/applications/mp3-playlist-generator-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 6 分钟阅读 - 2876 个词 阅读量 0[译]MP3播放列表生成器
原文地址:https://www.codeproject.com/Articles/4482/MP3-Playlist-Generator
原文作者:Jon Sagara
译文由本站 robot-v1.0 翻译
前言
This is a free tool for enumerating a specifically-structured MP3 collection and creating .m3u playlist files.
这是一个免费工具,用于枚举特定结构的MP3集合并创建.m3u播放列表文件.
介绍(Introduction)
我之所以写这个工具,是因为我厌倦了每次将专辑添加到专辑时都手动创建播放列表的麻烦.该工具递归硬盘上特定结构的MP3集合的目录.在枚举过程中,将创建几个MP3播放列表文件,使您可以通过网页访问收藏.(I wrote this tool because I grew tired of manually creating playlists each and every time I added an album to my collection. The tool recurses the directories of a specifically-structured MP3 collection on your hard disk. During the enumeration, several MP3 playlist files are created, allowing you to access your collection via a Web page.)
该工具适合您:(This tool is for you if:)
- 您的收藏包含整张CD,并按艺术家和专辑排列(请参见下面的"目录结构").(Your collection contains entire CDs and is arranged by artist and album (see “Directory Structure” below).)
- 您的收藏集驻留在能够作为Web服务器的计算机上.(Your collection resides on a machine capable of being a Web server.) 如果您不满足上述要求,请在此处停止阅读.(If you don’t meet the above requirements, then please stop reading here.)
术语(Terminology)
主机名(Host Name) | 您的Web服务器的主机名(例如,(Your Web server’s host name (e.g.,) server 在网址中(in the URL) http://server/ ).().) |
---|---|
虚拟目录(Virtual Directory) | 网址中指向您的MP3集合的路径(例如,(The path in the URL that points to your MP3 collection (e.g.,) mp3 在网址中(in the URL) http://server/mp3/ ). |
MP3根目录(MP3 Root Directory) | 磁盘上MP3集合的物理路径(例如,(The physical path on disk to your MP3 collection (e.g.,) E:\mp3 ). |
目录结构(Directory Structure)
如果您的收藏集具有以下目录结构,则播放列表生成器将为您工作:(The playlist generator will work for you if your collection has the following directory structure:)
-
<MP3根>()
-
()
-
<专辑0>()
- <歌曲0> .mp3(.mp3)
- .mp3(.mp3) …(…)
- <歌曲> .mp3(.mp3)
-
<专辑1>()
- <歌曲0> .mp3(.mp3)
- .mp3(.mp3) …(…)
- <歌曲> .mp3(.mp3)
-
-
()
-
<专辑0>()
- <歌曲0> .mp3(.mp3)
- .mp3(.mp3) …(…)
- <歌曲> .mp3(.mp3)
-
<专辑1>()
- <歌曲0> .mp3(.mp3)
- .mp3(.mp3) …(…)
- <歌曲> .mp3(.mp3)
-
-
…(…) - ()
- <专辑0>(*<Album0>*)
- <歌曲0> .mp3(*<Song0>.mp3*)
- <Sing1> .mp3(*<Sing1>.mp3*)
…(…) - <歌曲> .mp3(.mp3)
- 专辑1>(*Album1>*)
- <歌曲0> .mp3(*<Song0>.mp3*)
- <Sing1> .mp3(*<Sing1>.mp3*)
…(…) - <歌曲> .mp3(.mp3)
艺术家,专辑和歌曲名称不必采用任何特定格式.但是,我发现如果您希望以与CD上出现的顺序相同的顺序收听曲目,则在曲目名称前加上曲目编号会有所帮助.典型的目录可能如下所示:(The artist, album, and song names do not have to be in any particular format; however, I find that prepending the track number to the song name helps if you like to listen to the tracks in the same order that they appear on the CD. A typical directory might look like the following:)
-
mp3(mp3)
-
古怪的阿尔扬科维奇(Weird Al Yankovic)
-
永久唱片-盒子里的铝-唱片1(Permanent Record - Al In The Box - Disc 1)
- 01我的Bologna.mp3(01 My Bologna.mp3)
- 02另一个骑The Bus.mp3(02 Another One Rides The Bus.mp3) …(…)
- 12绒面革之王.mp3(12 King Of Suede.mp3)
-
-
磁盘上此类目录的物理路径如下所示:(The physical path on disk to such a directory would look like this:) <drive letter>:\mp3\Weird Al Yankovic\Permanent Record - Al In The Box - Disc 1\
.(.)
执行期间创建的文件(.htm和.m3u)(Files Created During Execution (.htm and .m3u))
在执行MP3播放列表生成器期间创建以下文件:(The following files are created during the execution of the MP3 Playlist Generator:)
|索引(index.htm)|该文件位于MP3根目录中,包含所有生成的.m3u文件的链接,这些链接按艺术家和专辑的字母顺序排序.这是您通过Web服务器访问的文件.(Located in the MP3 Root Directory, this file contains links to all of the generated .m3u files, sorted alphabetically by artist and album. This is the file that you access via the Web server.)
(例如.,((e.g.,) <MP3 Root Directory>\index.htm )()) |
|
---|---|
All.m3u | 此播放列表位于MP3根目录中,包含您收藏集中所有歌手的所有歌曲的条目(Located in the MP3 Root Directory, this playlist contains entries for all songs by all artists in your collection) |
(e.g., <MP3 Root Directory>\All.m3u ) |
|
.m3u | 这些播放列表位于歌手的目录中,包含指定歌手的所有专辑中所有歌曲的条目(Located in the artist’s directory, these playlists contain entries for all songs in all albums for the specified artist) |
(e.g., <MP3 Root Directory>\Weird Al Yankovic\Weird Al Yankovic.m3u ) |
|
.m3u | 这些播放列表位于每个专辑的目录中,其中包含特定专辑中所有歌曲的条目.(Located in each album’s directory, these playlists contain entries for all songs in a particular album.) |
(e.g., <MP3 Root Directory>\Weird Al Yankovic\Permanent Record - Al In The Box - Disc 1\Permanent Record - Al In The Box - Disc 1.m3u ) |
如果文件已经存在,其内容将被截断,因此,每次运行该程序时,播放列表和HTML文件都会全部刷新.(If the files already exist, their contents are truncated, so each time the program is run, the playlists and the HTML files are all refreshed.)
设置您的MP3服务器(Setting Up Your MP3 Server)
启用IIS(Enable IIS)
为了访问由MP3播放列表生成器创建的网页,您将需要启用IIS.请参考您操作系统的文档,以了解如何安装和启用IIS.(In order to access the Web page created by the MP3 Playlist Generator, you will need to enable IIS. Please refer to your OS’s documentation on how to install and enable IIS.)
为您的MP3根目录创建一个虚拟目录(Create a Virtual Directory for your MP3 Root Directory)
在IIS MMC管理单元中,为您的MP3根目录创建一个虚拟目录.请参考您操作系统的文档,以了解如何创建虚拟目录.(In the IIS MMC snap-in, create a virtual directory for your MP3 Root Directory. Please refer to your OS’s documentation on how to create a virtual directory.)
为index.htm文件启用默认文档支持(Enable Default Document Support for index.htm files)
如果尚未为您的Web服务器启用,请启用默认文档支持(If not already enabled for your Web server, enable default document support for) index.htm
文件.请参阅您操作系统的文档,以了解如何为特定文件类型启用默认文档支持.(files. Please refer to your OS’s documentation on how to enable default document support for specific file types.)
运行MP3播放列表生成器(Running the MP3 Playlist Generator)
- 将程序复制到硬盘驱动器上的任何位置,然后启动它.(Copy the program to anywhere on your hard drive and launch it.)
- 为主机名,虚拟目录和MP3根目录插入适当的值.(Insert appropriate values for Host Name, Virtual Directory, and MP3 Root Directory.)
- 单击"生成.m3u文件"按钮.(Click the “Generate .m3u Files” button.)
而已!您现在应该能够浏览到(That’s it! You should now be able to browse to)
http://<Host Name>/<Virtual Directory>/
并查看您的MP3收藏列表!(and view a list of your MP3 collection!)
待办事项清单(To-do List)
该工具绝不是抛光的.这是我需要做的一些增强功能的简短列表:(This tool is by no means polished. Here is a short list of enhancements that I need to make:)
- 为生成的HTML文件添加样式表(Add stylesheet for generated HTML file)(在我的家用计算机上,该计算机目前没有Internet连接)((it’s on my home computer, which doesn’t have an Internet connection at the moment))
- 在注册表中保留用户的设置.目前,它们已硬编码到应用程序中.(Persist user’s settings in the registry. Currently, they are hard-coded into the app.)
- 插入浏览对话框,以允许用户浏览其MP3根目录.(Insert a browse dialog to allow users to browse for their MP3 Root Directory.)
- 将"最后生成的"时间戳添加到HTML文件.(Add a “last generated” timestamp to the HTML file.)
- 将统计信息添加到HTML文件(#个艺术家,#个专辑,#个歌曲).(Add statistics to the HTML file (# artists, # albums, # songs).) 如果您有想要看到的功能,请在下面的论坛中发布.(If you have any features you would like to see, please post them in the forum below.)
历史(History)
版(Version) | 评论(Comments) |
---|---|
1.0.02003年7月3日(03 Jul 2003) | 首次公开发行.(Initial public release.) |
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C++ VC6 WinXP Win2003 Windows Win2K MFC Visual-Studio Dev 新闻 翻译