English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 30 June 2021, 10:50   #1
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
Arexx scipt for ACDB

I use ACDPlay to play music CDs, and ACDB to download the trackdata etc from online. What I would really like to do is if ACDPlay would do this each time an unknown CD is put in, however, in the patch for ACDB that is on Aminet, the author has included a script which should simply run and download the data for whatever cd is in the drive. This sounds great and even better would be to get it to run everytime a music cd is put in (outside of ACDPlay).

I am having difficulties getting this to work. I am not sure if this is because with my new 3.2 setup I have copied and added bits in various different places or not.

I will try and attach the screeshot of the script. I am not clear if it is my arexx setup or the script or something else that is wrong. If I run the script by clicking on it, it just opens ACDB and does nothing. After closing ACDB my amiga hangs completely with an error saying "Error 13 in oine 11: host environment not found." and I need to reboot.

Any suggestions would be very welcome?
Cheers
crazyc is offline  
Old 30 June 2021, 10:52   #2
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
Re the above

I thought (from looking at the ACDB guide) that perhaps the command at the end was wrong, as the script says DOWNLOAD CDID whereas the guide says CDID DOWNLOAD. Changing this had no effect,

Last edited by crazyc; 30 June 2021 at 10:58.
crazyc is offline  
Old 30 June 2021, 12:41   #3
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
"Host environment not found" means just that: the specified ARexx port does not exist. Is there an option for enabling or disabling the ARexx port? Maybe specifying a different name? I don't know ACDB myself, but the readme specifies that it needs easyrexx.library, which is an ARexx GUI builder library but can also be used for adding ARexx functionality to a normal application. Do you have that installed on your 3.2 setup? Without it, ACDB might not be able to create an ARexx port.
Daedalus is offline  
Old 30 June 2021, 13:06   #4
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
Cheers for the reply - I know nothing about Arexx or rexx and so was hoping to find/canibalise something simple.
I didnt have EasyRexx on my system but have now installed it from aminet (but to no avail). Incidentally where in the readme did it specify that as I have looked again and cannot find it (as I was trying to work it out myself befoe I gave up and posted here)
crazyc is offline  
Old 30 June 2021, 13:23   #5
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
It's the very first line here: https://aminet.net/package/disk/cdrom/acdb

Hmmm, so you're still getting the same error about the host environment not being found? It's a pretty fundamental error so it might be a good idea to use something like Scout to list all the ports present and see if ACDB is actually there.

The code itself looks mostly fine... One thing I would be suspicious of though is the waitforport line. The single quote characters are used normally in ARexx but waitforport is an AmigaDOS command, not an ARexx command. Try either without the quotes entirely:

Code:
WaitForPort ACDB
or with the quotes around the whole command:

Code:
'WaitForPort ACDB'
Adding quotes around the entire command tells ARexx to send the line directly to the current address (in this case COMMAND), rather than trying to interpret it as an ARexx command.
Daedalus is offline  
Old 30 June 2021, 13:59   #6
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
D'oh - I read the readme on the Amiga and yes its still there but I clearly missed it.

OK - I have downloaded Scout, and once ACDB is open there is a port listed as ACDB

None of the changes with single quotes seems to make a difference. If I run the script by clicking on it it just opens ACDB but then does nothing. I have tried waiting....
If I then close ACDB it generates that error and locks up.
crazyc is offline  
Old 30 June 2021, 14:12   #7
jPV
Registered User
 
jPV's Avatar
 
Join Date: Feb 2008
Location: RNO
Posts: 1,006
What happens if you start ACDB manually first, and while it's running open a shell window and type: rx path:to/your/script
jPV is offline  
Old 30 June 2021, 14:35   #8
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
You can check existence of a port with "say show(p, <name>)" where <name> is the name of the Port (see script). In this case the name is "ACDB" (case sensitive). If you type
Code:
rx "say show(p, 'ACDB')"
in a Shell it will print 1 if the port exits and 0 if not.
However, do you have acdb installed to "dh0rograms/acdb/"? If not the script just fails.

Do you have set the acdb tooltypes to a valid configuration? If you start acdb does the download work?

If you add "trace i" to the second line in the script and start it from shell it should print some output what can help find the problem.
daxb is offline  
Old 30 June 2021, 14:37   #9
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
Program not found - which suggests my arexx stuff is not setup properly I think.
Where do I need to have stuff?
crazyc is offline  
Old 30 June 2021, 15:01   #10
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
OK - ACDB works properly if open it with the mouse etc from workbench and download the data - there is no issue there.
If I use the say show command from daxb then the port shows up if I have already started ACDB.
Yes that is where I have got acdb saved
I have added the trace i command and will add two screen shots of the output in a moment, it baiscally completes step 6 then waites with ACDB open on screen. it does nothing until I manually close acdb and then it moves on to step 7.
I have tried two commands at the end of the script as the acdb guide says the arexx command is CDID download and the script on aminet says download CDID. I think the issue is earlier.
crazyc is offline  
Old 30 June 2021, 15:02   #11
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Okay, is it "Program not found" or is it still "Host environment not found"?

To check, I've given it a quick test with this script:

Code:
/* */

ADDRESS COMMAND

IF ~SHOW("P", "ACDB") THEN DO
  'WBRUN RAM:ACDB/ACDB'
  'WaitForPort ACDB'
END

ADDRESS ACDB
'CDID DOWNLOAD'
QUIT
And it works as it should both when ACDB is running and when it's not. The download starts instantly, so WaitForPort is finding the port right away. Are you seeing that? You can use the WaitForPort command from the Shell too to see if it does wait (indicating the port does not exist) or returns immediately (indicating it found the port).
Daedalus is offline  
Old 30 June 2021, 16:06   #12
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
I have modified the script to be more like yours except I left wbload rather than wbrun.
Running it hits the same issue, it opens acdb and then sits there doing nothing. Of I close acdb it moves on but then I think that closes the port which breaks the script.
Am I missing a tooltypenor something? I will attach mine as well.
crazyc is offline  
Old 30 June 2021, 16:35   #13
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
Ran a shortened version of the script just with the end bit and with me opening acdb manually and that works.
crazyc is offline  
Old 30 June 2021, 16:35   #14
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Ah, I think I get it now... WBLoad doesn't return when it launches a program - instead it waits for the program to finish, pausing your script until you quit ACDB. Sorry, I haven't really used WBLoad much - WBRun returns as soon as the program is launched. Try changing that line to

Code:
'Run WBLoad Path/to/ACDB'
Daedalus is offline  
Old 30 June 2021, 16:56   #15
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
Brilliant!

Thank you so much -the script now works, which takes me onto my second question - how do I make this run everytime I insert a music cd? When I put in a music CD I currently get two icons, one which is CD3: CDDA (clicking on this plays the CD, although I am not sure how) and the other is just CD3:unintialised I think.
I would also like to change the CDDA icon but cannot find how to.....

There is an option to execute a script from within ACDPlay but the updated data only shows up if you close and reopen ACDPlay.
crazyc is offline  
Old 30 June 2021, 17:13   #16
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Hmmm, not so sure about that end of things. Inserting a CD (or any removable medium) does generate an Intuition event, but I don't know offhand of any commodity that could be used to react to that. It would need to run a script that identifies that the inserted disc is an audio CD and then launch ACDB... It's all doable, but not quite as straightforward as you have so far.

As for the icon, I've no idea where it's stored...
Daedalus is offline  
Old 30 June 2021, 17:34   #17
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
The CDDA icon perhaps is a Deficon. Should be in ENVARC:Sys/

About your second question. You need some event handling for when CD insert. I don't know if OS 3.2 has such a feature that can easily used. There are event programs like Event but whether they provide what you need is the question.
daxb is offline  
Old 30 June 2021, 17:54   #18
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
I did have a look amongst the deficons and couldnt see it. I cannto click on it and get icon info either.

When I run the script (double click) now I get left with an RX output window that should close on its own?
If I run it from the shell then I still have the shell window open.
I am also just tring to make a batch type fil that I can run from the toolsmenu to run the script, whilst I try and work out how to attach it to the CD being entered.
crazyc is offline  
Old 30 June 2021, 21:36   #19
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
Not at a pc now so cannot post the link, but some of my answers are in greg donners 3.9 faq.
If using cachecdfs then putting a cdda.info file in envarc will sort the music icon, and the default player can be set by adding a setting to the control line in the mount list.
crazyc is offline  
Old 01 July 2021, 22:16   #20
crazyc
Registered User
 
Join Date: May 2012
Location: Gravesend - UK
Posts: 927
Just a quick thank you for all the help in this thread - I know have a nice icon when I put a music CD in and double clicking on that quickly opens ACDB, downloads the data, closes ACDB and opens ACDplay - all very quickly.

Last question is how to stop the CD3:Uninitialized icon showing up when I put a music CD in......
crazyc is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Arexx can cause crashdump Greyspirit support.WinUAE 3 21 January 2019 21:20
AREXX Help Zetr0 support.Other 2 26 January 2011 23:09
arexx help jimbobrocks92 Coders. General 4 19 January 2011 12:50
Arexx redblade request.Apps 2 30 August 2006 11:51
Arexx Seti Coders. General 2 05 August 2003 18:59

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:42.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09555 seconds with 13 queries