AminetAminet
Search:
82050 packages online
About
Recent
Browse
Search
Upload
Setup
Services

util/cli/AFSwitch.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:AFS - switch for audio filter/power LED
Author:Patrick Düren
Uploader:pintcat googlemail com (Patrick Düren)
Type:util/cli
Version:1.4
Architecture:m68k amigaos >= 1.1
Kurz:Umschalter für Audiofilter/Power LED
Date:2012-10-15
Download:http://aminet.net/util/cli/AFSwitch.lha - View contents
Readme:http://aminet.net/util/cli/AFSwitch.readme
Downloads:1109
AFS is an audio filter switch - yet another one. Why? I wrote this for
educational purposes in the first place. Just wanted to learn how to pass cli
arguments to a program and also how to put text information to a console, in
a way: how to make it possible to communicate between user and application.
The other good reason is that there's only one tool on aminet which offers
all these options and it's a huge one (~5kb)! This here uses pure asm code
and I spend a lot of time optimizing the code to make it smaller. It's
probably still far from being optimal, but now it's small enough to fit on a
single data block and that's ok for me.

This is how it works... On a command line you can use one of these
arguments:

D ........ Disable audio filter/LED
E ........ Enable audio filter/LED
S ........ simply Switch the current state of audio filter/LED
H or ? ... small help text

And that's it. In any case (even if no argument is used) it will put a return
code 5 if the filter/LED is off and 0 if it's on. This way you can check the
state of the audio filter in a shell script using "If WARN".

AFSwitch was written and assembled with ASM-One (PhxAss should work too). It
was testet on an A1200, but should work on all Amiga platforms which support
filter switching since it uses plain 68k code. Big thanx to David Sjölin for
his nice AMW which gave me a clue how cli interaction actually works.

Source is included (with German comments only, sorry).

Changes since 1.0:

1.1
 * More optimizations to make it even smaller
 * Almost all data and address registers are now saved/restored (I'm not sure
   if this is necessary, but they are changed during the process)
 * The source code now contains an example script for return code handling

1.2
 * Added the ?-option (besides H) to call the help text to make it more
   AmigaDOS conform
 * Checks library version now to prevent crash with KickStarts older than 1.1

1.3
 * Minor bug fixed in text output routine

1.4
 * Library version is now checked by peeking directly into the exec base
   instead of using OpenLibrary (which would be pointless since this function
   did not exist before Kick 1.1)

Hopefully the last update :) Note that the only library used by AFS is the
dos.library for text output. The remaining code (the actual filter handling)
should work with all KickStarts.


Contents of util/cli/AFSwitch.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[unknown]                  304     364  83.5% -lh6- f725 Oct 13 02:38 afs
[unknown]                 1357    2578  52.6% -lh6- f04c Oct 14 05:37 afs.readme
[unknown]                  957    2034  47.1% -lh6- a8c6 Oct 13 02:38 afswitch.s
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total         3 files    2618    4976  52.6%            Oct 15 20:51

Aminet © 1992-2017 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>