News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Controling mpg321 with murgaLua.
Author Message
dvw86
Junior Member
**


Posts: 39
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
Controling mpg321 with murgaLua.

I would like to build a graphical interface for mpg321 using the remote function.

Code:
mpg321 -R abc

The problem I'm having is to send the comands directly to mpg321. I can monitor the output of mpg321 by starting it with the comand...

Code:
mpg321 -R abc > /tmp/music

and then in murgaLua...

Code:
file="/tmp/music";
out=assert(io.open(file, "r"));
ww = 400;
wh = 60;
window = fltk:Fl_Window(ww, wh, "Monitor mpg321") ;
outputWindow = fltk:Fl_Multiline_Output(60, 5, 335, 50);
outputWindow:textsize(20);
function read()
while(true) do
Fl:check();
result=out:read("*line");
Fl:check();
if result ~= nil then
outputWindow:value(result);
end;
end;
end;
ButtonPlay = fltk:Fl_Button(5, 5, 50, 50, "Watch");
ButtonPlay:labelsize(15);
ButtonPlay:align(fltk.FL_ALIGN_WRAP);
ButtonPlay:callback(read);
window:show();
Fl:run();

This is very basic for now, but I would like to be able to send comands to mpg321 and possibly find a better way of reading them.
Thanks,
Dan

08-15-2007 03:40 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
Controling mpg321 with murgaLua. - dvw86 - 08-15-2007 03:40 PM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: