
Originally Posted by
jryan15
Tags are good, and I agree, mp3tag is a great program!
Before I move on to the nuts and bolts, I would like to query everyone on how best to proceed. Should I begin working off of winamp's data files and playlist files, or should I attempt to make an independent audio file table? Also do people tend to create playlists using external apps? I've only used winamp and itunes to create playlists.
With regard to winamp filed:
I did some digging and found the main database file (main.dat), the playlist files (*.m3u8), as well as the playlist.xml file (links the playlist names to the .m3u8 file)... Is there an ideal command string for converting the main.dat file into a workable table?
Don't know about the Winamp data files, but .pls or .m3u playlist files should be easy to work with. You can either leave playlist files as they are and pass them to Winamp via command line parameters, or read the contents of the playlist file and pass the contents to Winamp, again via command line parameters.
Another method is to import music files directly into a Lua table
Code:
local Path = 'D:\\discman'
local fs = luacom.CreateObject("Scripting.FileSystemObject")
music_files_table = {}
local function GetFiles(sPath)
local dir = fs:GetFolder(sPath)
local folders = luacom.GetEnumerator(dir.SubFolders)
local folder = folders:Next()
while folder do
GetFiles(sPath..'\\'..folder.Name)
folder = folders:Next()
end
local files = luacom.GetEnumerator(dir.Files)
local file = files:Next()
while file do
if string.find(file.Name, '.mp3') or string.find(file.Name, '.flac') then
table.insert(music_files_table, sPath..'\\'..file.Name)
print('added: \"'..sPath..'\\'..file.Name..'\"')
end
file = files:Next()
end
end
print ('Getting files in '..Path)
GetFiles(Path)
print ('List of files complete')
fs = nil
collectgarbage()
This will create a table called 'music_files_table' and fill it with '.mp3' and '.flac' files found in 'D:\\discman' using a recursive function.
btw: thanks to Harleydude for helping me with this one 
I would recommend using an actual database (like the SQLite2 Meedio option mentioned before) with all it's sort and filter functionality by filename or tags, as it will get you a very flexible and powerfull solution pretty quickly.