PDA

View Full Version : Advanced control of audio zones without display.



jryan15
July 11th, 2010, 02:59 PM
I would like to be able to take control of my mp3 library using only a russound keypad. From all of the support on this site, I've been able to control multiple winamp zones independently, but using the "next" command through a library of several thousands of songs is getting tiresome. I have a vision of menu structure using voice feedback, but I have no idea of how best to implement. I've been posting on the winamp forums, but I think my posts are too noob to merit a response. Any advice would be appreciated.

Example:
Zone 1 - Winamp instance opened with all songs in playlist. There are also 5 smart views available and 10 playlists available.

Actions:
Press "Mode" on the Russound keypad.
- Girder responds by announcing "Search for playlist"
Press "Mode" again
- Girder responds by announcing "Search for smart list"
Press "Mode" again
- Girder responds by announcing "Search for artist"
Press "select" and Girder begins naming all available artists alphabetically
- "Abc"
- "Amy Winehouse"
- "Coldplay"
- (pressing the right or left arrows rapidly moves forward or back in the list)
- "Counting Crows"
Press "Select" and all of the artists songs begin playing.

New scenario:
Press "Mode" on the Russound keypad.
- Girder responds by announcing "Search for playlist"
Press "Select" and Girder begins announcing playlists
- "Baily's playlist"
- "Party playlsit"
- "Rock playlist"
Press "Select" and all of the playlist begins playing.


I know that such a menu structure would require a special winamp plugin to handle the populating the lists and maybe even the sequencing through the list while passing the announcement text back to Girder... From my research on winamp, JRMC, SageTV, CQC, etc, I'm not aware of any player or home automation product with a setup to allow blind control of a database. I think that such a control system would be very popular as I'm sure that there are many people who would appreciate a control system that doesn't require touchscreens.

Any advice would be appreciated.

Thanks!

blubberhoofd
July 11th, 2010, 03:40 PM
woa, that will require a lot of lua coding ;)

I would suggest doing all the playlist handeling in Girder, it's fully capable of searching for audio and playlist files or searching within a library, no Winamp plugin is needed for that.

What's your level of experience with lua or any type of programming?

jryan15
July 11th, 2010, 10:38 PM
Thanks for the reply.

My lua programming experience is very limited although it's not from lack of desire. I've done some extensive programming using msexcel vba, and have a couple of semesters of c (pre visual studio) under my belt, but I've not been able to get over the hump and start productively working with lua. Maybe this will get me going though :-).

I wasn't aware that Girder was capable of working at that level with playlists and libraries. When you say libraries, does that mean a generic type of library or does it mean a winamp, jrmc, or mpc library? So if I could extract all audio files of a certain artist, I could push the list or table of files to a player such as winamp?

blubberhoofd
July 12th, 2010, 03:15 AM
Thanks for the reply.

My lua programming experience is very limited although it's not from lack of desire. I've done some extensive programming using msexcel vba, and have a couple of semesters of c (pre visual studio) under my belt, but I've not been able to get over the hump and start productively working with lua. Maybe this will get me going though .
That should be enough to get started


I wasn't aware that Girder was capable of working at that level with playlists and libraries. When you say libraries, does that mean a generic type of library or does it mean a winamp, jrmc, or mpc library? So if I could extract all audio files of a certain artist, I could push the list or table of files to a player such as winamp?playlist:
The most common playlist files are plain text (.pls, .m3u) and can be read and written using Lua, just like a .txt file.

libraries:
Some applications use a database format in one of the many variations on SQL. If those work with either LuaSql or Odbc then you can connect to them via Lua. Other applications may provide export capabilities to an Xml file for example, which can be read just like a .txt file.
It's also possible to create a table of the files within a directory, to create your own library.

Winamp control:
You can use command line parameters to start each instance of Winamp with it's own settings and playlists.

also have a look here: http://www.promixis.com/forums/showthread.php?t=20631 for a multi-zone control example using Winamp and MPC-HC.

jryan15
July 12th, 2010, 09:03 AM
Thanks for the explanations, and I like the idea of handling everything in Girder. I have some minor sql experience, so I'll start doing some reading. It would be great to stumble across some lua code that is already pushing custom libraries or tables or songs to winamp though :wink:.

With regard to control of multiple winamp instances, I've had great success. I've been able to control several zones independently. I used the kx driver package to split one soundcard into several zoned outputs. I even use the Girder voice feature to annouce the song titles (in conjunction with the very cool DVDspy dll for winamp)!

jryan15
July 12th, 2010, 02:38 PM
Ok. Spent a few hours going through the Girder manual, but I still don't know where to start with creating a table of audio files. May someone can give me a hand with lua coding to complete an objective. Any help would be great!

Objective: Play a specific audio file titled "xyz" from a folder full of audio files arranged in subfolders.

Questions:
1. What kind of code would be used to create a table of all audio files in a directory?
2. After a table is formed, and the resultant song titled "xyz" is located in the table, is there a way for me to push the secondary table out to a media player?

blubberhoofd
July 12th, 2010, 02:49 PM
Thanks for the explanations, and I like the idea of handling everything in Girder. I have some minor sql experience, so I'll start doing some reading. It would be great to stumble across some lua code that is already pushing custom libraries or tables or songs to winamp though :wink:.
I have some experience interfacing with a database created by Meedio (Sqlite2) with good results. It does require you to have proper filenaming convention and/or tags, I always use mp3tag (http://www.mp3tag.de/en/) to correct tags and filenames for a batch of files.



With regard to control of multiple winamp instances, I've had great success. I've been able to control several zones independently. I used the kx driver package to split one soundcard into several zoned outputs. I even use the Girder voice feature to annouce the song titles (in conjunction with the very cool DVDspy dll for winamp)!nice setup, I had already forgotten the kx driver package, because I didn't have a compatible soundcard at the time ;)

jryan15
July 12th, 2010, 04:32 PM
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?

blubberhoofd
July 15th, 2010, 12:46 PM
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
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.

jryan15
July 15th, 2010, 01:57 PM
Very cool! Thanks!!! I would love to try the database method. I had checked out the Meedio site before and thought that that was a separate home theater software package. I didn't realize that you could use its database independently. I'll start doing some homework on sqlite too.

jryan15
July 15th, 2010, 05:33 PM
I'm liking the idea using sql, but I have to as a question so excuse me for letting my noob hang out :)

So using winamp's main.dat isn't preferred, and neither is using a girder script to populate and monitor a table... So what method is preferred for creating a music database? The one thing that I liked about separate instances of winamp was that the separate instances could have specialized libraries (me, kids, wife, etc)... I'm going through the sql tut on the http://www.w3schools.com site (very cool), is there any hope of using sqlite to parse the main.dat from winamp (maybe I need an intermediary database program which would be ok if it's not too far out there).

jryan15
July 16th, 2010, 02:00 PM
If I changed directions and decided to go with JRMC, would that help? Would I be able to use JRMC's music library with sql though lua?

jryan15
July 21st, 2010, 06:37 PM
I'm still not sure what would be the best path for using or establishing a music database. Any direction would be appreciated.

blubberhoofd
July 22nd, 2010, 03:06 AM
I can't recomend using JRMC as it has always been buggy on my setups :(

I'm currently looking through the 'WinampReader' part of 'WinampMigrator' that I found on Googlecode, it might provide some insight on how to interface with the Winamp library.

jryan15
July 24th, 2010, 01:58 AM
Ok, I'll check it out... I was struggling trying to figure out the most efficient way to diy databasing all my audio filed now I can struggle to get data from winamp :-)