1. Playing CDs with Euphoria

I am making a concept program for personal use.  Given a time, it would
play the music CD in the CDROM drive.

I think I can get Euphoria in a loop until the time element is what I wan=
t.
 But I play CDs by pushing the button on the CD-ROM.  Is there some sort =
of
interrupt I could use to do that and to jump to the next track?

--Alan
 =

new topic     » topic index » view message » categorize

2. Re: Playing CDs with Euphoria

>I am making a concept program for personal use.  Given a time, it would
>play the music CD in the CDROM drive.

>I think I can get Euphoria in a loop until the time element is what I want.
>But I play CDs by pushing the button on the CD-ROM.  Is there some sort of
>interrupt I could use to do that and to jump to the next track?

Look at RDS site, on ther archive page is a file contributed by Jacques that
let's you control your CDROM (play, stop, next, etc...). Look at the source
code.

Regards,
    Daniel Berstein
    daber at pair.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: Playing CDs with Euphoria

Thanks for the reply.  I've downloaded the library you referred me to, an=
d
there are a few problems.  Does anyone know what happened to sbcard.e, an=
d
when I need this library?  Also, there is a function (actually a few)
involving the parameter word status which Euphoria wants a type (I think =
it
means sequence, atom, integer, or object).  At this point, I just don't
know enough of Euphoria to pull up the sleeves and follow the program all=

the way through, let alone my doubts as to my archive's completeness.  Oh=

well, no free lunch.

--Alan
 =

new topic     » goto parent     » topic index » view message » categorize

4. Re: Playing CDs with Euphoria

I tried this program.  Why doesn't it run in a loop until 20 minutes afte=
r
the hour?

atom t
sequence d
d =3D date()
t =3D 0
while t =3D 0 do
t =3D d[5] =3D 20
end while
system("c:\\cdp\\cdp.exe 2", 0)
 =

new topic     » goto parent     » topic index » view message » categorize

5. Re: Playing CDs with Euphoria

I think you have to keep updating your variable d. See below.

> -----Original Message-----
> Subject: Re: Playing CDs with Euphoria
>
> I tried this program.  Why doesn't it run in a loop until 20
> minutes after
> the hour?
>
> atom t
> sequence d
> d = date()   <-- you can probably remove this line
> t = 0
> while t = 0 do
        d = date()   <-- add this line
> t = d[5] = 20     -- otherwise, d[5] is always what you had read into it
before the loop
> end while
> system("c:\\cdp\\cdp.exe 2", 0)
>

new topic     » goto parent     » topic index » view message » categorize

6. Re: Playing CDs with Euphoria

At 07:40 AM 5/21/98 -0400, you wrote:
>I tried this program.  Why doesn't it run in a loop until 20 minutes after
>the hour?
>
>atom t
>sequence d
>d = date()
>t = 0
>while t = 0 do

-- d[5] never changes?

>t = d[5] = 20
>end while
>system("c:\\cdp\\cdp.exe 2", 0)
>

I don't know, but you might need to continue to check the time within the loop?

 Joe Phillips, Assistant Director
 University Computing and Telecommunications
 Texas Wesleyan University     817-531-4284

new topic     » goto parent     » topic index » view message » categorize

7. Re: Playing CDs with Euphoria

Earlier, C. K. Lester wrote:

I think you have to keep updating your variable d. See below.

> -----Original Message-----
> Subject: Re: Playing CDs with Euphoria
>
> I tried this program.  Why doesn't it run in a loop until 20
> minutes after
> the hour?
>
> atom t
> sequence d
> d =3D date()   <-- you can probably remove this line
> t =3D 0
> while t =3D 0 do
        d =3D date()   <-- add this line
> t =3D d[5] =3D 20     -- otherwise, d[5] is always what you had read in=
to it
before the loop
> end while
> system("c:\\cdp\\cdp.exe 2", 0)
>

Thanks, C. K.  I got it working.  Now I have a mini-alarm clock.  For my
use, I won't bind it because I can just hop in and change the A SINGLE LI=
NE
to reflect the time and another (maybe) to change the track.  Then, I can=

leave the computer on and wake up with my favorite CD.  (Of course, I can=
't
distribute it because I launch the CD externally, but its good enough for=

me right now).

I should have seen the illogic in my buggy program, but I was rushing. =

That's not something a relatively new programmer should do.  But this
brings up a good point.  I wrote that code, buggy as it was, in less than=

five minutes.  Euphoria is fast to write in!  I can't even do my homework=

that fast!

Lastly, as a conceptual issue (explaining how would be way over my head
right now), but can I use Euphoria to write TSRs?

Thanks again.

--Alan
 =

new topic     » goto parent     » topic index » view message » categorize

8. Re: Playing CDs with Euphoria

Alan Tu wrote:

<snip>

>
> Lastly, as a conceptual issue (explaining how would be way over my head
> right now), but can I use Euphoria to write TSRs?
>
> Thanks again.
>
> --Alan
>


 not entirely, the tsr itself has to be compiled to machine code.
however the code for the routine could be in a sequence thats poked to
memory by euphoria witch could then launch it.
        unless of course theres a way to set ex.exe itslef up as a tsr
(with the prog bound into it.), but thats really reaching I think.


                        Kasey

new topic     » goto parent     » topic index » view message » categorize

9. Re: Playing CDs with Euphoria

>> Lastly, as a conceptual issue (explaining how would be way over my head
>> right now), but can I use Euphoria to write TSRs?
>>
>> Thanks again.
>>
>> --Alan
>>
>
>
> not entirely, the tsr itself has to be compiled to machine code.
>however the code for the routine could be in a sequence thats poked to
>memory by euphoria witch could then launch it.
>        unless of course theres a way to set ex.exe itslef up as a tsr
>(with the prog bound into it.), but thats really reaching I think.


Euphoria interpreter (ex.exe, exw.exe) can't be launched as a TSR. If you
need a TSR it doesn't matter if you poke it into memory... it'll never stay
resident after Euphoria terminates. Read the documentation, there it says
that if there's any allocate()-ed memory when your program ends, Euphoria
will free() it automatically, thus terminating the illusion. If you use
exw.exe (under win32) maybe there's a chance you can make something: leave
your Euphoria program running on one shell box (pseudo-TSR). I don't know
how you can interact with other shell boxes... but take a try, maybe it
works!

Regards,
    Daniel Berstein
    daber at pair.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu