Hello Monks...

In the last couple of weeks, in my spare time, I wrote an MP3 player/organizer with a Curses interface. I chose Curses because I wanted to get it up and running, and I'm very familiar with Curses.

The layout is something like this:

PLAYER AREA---------------------PLAYLIST --------------------------------TAGS/INFO LIBRARY-------------------------LIBRARY OPTIONS --------------HELP AREA--------------------------

My tags are stored in a MySQL database.

Anyway, you pick songs from the library, hit ENTER, and it drops them into the playlist. When you want to start up the playlist, you hit ENTER on a song. From then on you have various controls like skipping, pausing, prev/next, etc. Playlists can be saved, loaded, and exported to .m3u files.

I'm happy with it, but there's always room for improvement, right?

Here's where my question comes in...

I currently use the MP3::Daemon to play the songs. I've experimented with MPG123, but had trouble with it because it seems that you always have to "poll it" with a loop.

What I would like to do is be able to play songs, and have the program, via a fork or whatever, update the player area with song/artist/time info, while the user can still pick songs in the library, edit tags, etc.

I haven't figured out the best way to do it. I've played around with forking processes, but had difficulty killing it properly when the user hit PAUSE, etc.

Thanks for any help.

Dale

20041101 Edit by ysth: code tags around layout


In reply to Tips for my Perl/Curses MP3 player/organizer by phinsman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.