in reply to Yet another music-related queue question

err... are you really expecting us to debug your code?

language is a virus from outer space.
  • Comment on Re: Yet another music-related queue question

Replies are listed 'Best First'.
Re^2: Yet another music-related queue question
by dabreegster (Beadle) on Jun 11, 2005 at 18:04 UTC
    No, preferably provide some sort of clue as to why a while loop would stop if the player stops in a way other that naturally. I have a guess. Underneath, poll() is talking to mpg321 using IO::Open2 and stuff like that. If you close a program that has a IO::Handle object and stuff, could that make the while loop freeze? I'll test it out in a minute. Sorry, again. I didn't mean to sound like I was expecting somebody to just debug it for me. I was just looking for some clues. Besides, the program is usable (I run it all the time) and I thought somebody might be intersted.
      dabreegster,
      I have rewritten your code to hopefully make it more digestible. There is just too much there for someone to look at and guess what the problem might be. You don't check the return code of any of your open commands nor do you provide comments of how the external files interact with your code. IOW, even giving you "just a pointer" requires having a basic understanding of how the code works. As it stands - that would require a signficant investment of personal time. I have no idea if it will even run, but it might help someone else help you.

      Cheers - L~R

      I'm a big music head myself, and one thing you could do to get my interest in this module is to add more documentation. Aside from the title blocks, the only comment I see in there is '# Dunno'. Start by adding a Plain Old Documentation so I can perldoc this code. Give me a no-brainer description of what this does, and how to use it so I don't have to guess at it's function from reading the code.
      I fixed it. For some reason, making mpg321 exit in the middle of reading or something was making everything freeze. So I changed Stop() to set a global variable to 1 and in the until loop, I added 'last if $Stop'. Right outside that, I tested for a true $Stop value and set it to false and forced the player to exit there. I'll post the code later.