From mailserv@gaia.ucs.orst.edu Fri Apr 22 03:17:11 1994
Precedence: Bulk
Date: Thu Apr 21 15:57:29 PDT 1994
From: gus-sdk-request@gaia.ucs.orst.edu (GUS Programmer's Server)
Reply-To: gus-sdk@gaia.ucs.orst.edu (GUS Programmer's Digest)
Subject: GUS Programmer's Digest V10 #14

GUS Programmer's Digest     Thu, 21 Apr 94 15:57 PST     Volume 10: Issue  14 

Today's Topics:
                    no subject (file transmission)

Standard Info:
	- Meta-info about the GUS can be found at the end of the Digest.
	- Before you ask a question, please READ THE FAQ.

----------------------------------------------------------------------

Date: Thu, 21 Apr 1994 15:06:42 +0100 (BST)
From: a3_clark@csd.uwe-bristol.ac.uk (A Clark)
Subject: no subject (file transmission)

 Hiyah everyone. It's the man with no project again! This time I have a problem
with adjusting the Mic input status. It just refuses to enable. I'm using code
supplied in the SDK and I've even tried recompiling the source, but still to no
avail! Anyway, attached to this mail (just down there, see?) is the C-code I've
used to do this. The code uses cursor UP/DOWN keys to select which input to 
change the state of (highlighting it on the way) while the space-bar toggles
the state of the selected input/output. ESCape finally exits from the routine.
I've checked and checked and checked, but the code seems solidly predictable,
but it isn't. The SDK I'm using is V2.10 and the board is a revision 3.4.

 I also have another enquiry which I may have posed before but here goes:
Is there anyone out there who could give me some information/code on
differential PCM or ADPCM. The reason for requiring this code is that I'll
have to store approximately 1Mb-16Mb sample files once recorded in XMS
memory, and I do not savour the idea of files of this size populating my
precious hard-disk space (plus the idea of this final-year product is to
produce something that's commercially viable). As I'm recording, first to XMS
memory, I won't need an 'on-the-fly' compression routine, but merely a 
routine that can compress the samples on it's way between the XMS memory
routine and the file-handling routine.

 As a final note, has anyone had problems setting up a repeating record
using the SDK. I'm on my 5th revision of a routine to record and I still 
cannot get it to record continuously. It appears to lock-up the machine
while a routine serving the timer1 interrupt displays the elapsed time.
My guess is that the record process isn't repeating and only going through
my record loop once (my record routine waits for a record interrupt to
occur - signalled through a global variable).

 Anyway, here's the code for mixer handling in my program. Characters 250
& 251 represent radio buttons (as I've managed to change the DOS font), thus
250 is an unactivated radio button, and 251 is an activated one.




#include	<conio   .h>
#include	<forte   .h>
#include	<extern  .h>
#include	<gf1proto.h>
#include	<ultraerr.h>

#define	NOBUTTON	(char)250
#define	BUTTON	(char)251
#define	ESC		(char) 27
#define	SPECIAL	(char)  0
#define	SPACE	(char) 32
#define	CURSEUP	(char) 72
#define	CURSEDN	(char) 80

#define	LINEIP	0
#define	MICIP	1
#define	OUTPUT	2

void	main /*MixerState*/ (void)
{
char			EntryChar=0;
int			Position=0;

	while(1)
	{
		textbackground	(GREEN);
		textcolor		(YELLOW);

		gotoxy(4,14);

		if(Position==LINEIP)
		{
			textcolor		(WHITE);
		}

		if(UltraGetLineIn()==TRUE)
			cprintf("%c INPUT ON ",BUTTON);
		else
			cprintf("%c INPUT OFF",NOBUTTON);

		textcolor		(YELLOW);

		gotoxy(4,16);

		if(Position==MICIP)
		{
			textcolor		(WHITE);
		}

		if(UltraGetMicIn()==TRUE)
			cprintf("%c MIC ON ",BUTTON);
		else
			cprintf("%c MIC OFF",NOBUTTON);

		textcolor		(YELLOW);

		gotoxy(4,18);

		if(Position==OUTPUT)
		{
			textcolor		(WHITE);
		}

		if(UltraGetOutput()==TRUE)
			cprintf("%c OUTPUT ON ",BUTTON);
		else
			cprintf("%c OUTPUT OFF",NOBUTTON);

		textcolor		(YELLOW);

		gotoxy(4,(14+(Position*2)));

		EntryChar=getch();

		if(EntryChar==ESC)
			return;

		switch(Position)

		case LINEIP:	switch(EntryChar)
					{
					case SPACE:	if(UltraGetLineIn()==TRUE)
									UltraDisableLineIn();
								else
									UltraEnableLineIn();
								break;
					case SPECIAL:	EntryChar=getch();
								switch(EntryChar)
								{
								case CURSEUP:	Position=OUTPUT;
											break;
								case CURSEDN:	Position=MICIP;
											break;
								}
								break;
					}
					break;
		case MICIP:	switch(EntryChar)
					{
					case SPACE:	if(UltraGetMicIn()==FALSE)
									UltraDisableMicIn();
								else
									UltraEnableMicIn();
								gotoxy(1,2);
								cprintf("MIC STATUS = %d",UltraGetMicIn());
								break;
					case SPECIAL:	EntryChar=getch();
								switch(EntryChar)
								{
								case CURSEUP:	Position=LINEIP;
											break;
								case CURSEDN:	Position=OUTPUT;
											break;
								}
								break;
					}
		case OUTPUT:	switch(EntryChar)
					{
					case SPACE:	if(UltraGetOutput()==TRUE)
									UltraDisableOutput();
								else
									UltraEnableOutput();
								break;
					case SPECIAL:	EntryChar=getch();
								switch(EntryChar)
								{
								case CURSEUP:	Position=MICIP;
											break;
								case CURSEDN:	Position=LINEIP;
											break;
								}
								break;
					}

		}
		gotoxy(1,1);
		cprintf("Position = %d",Position);
	}
}

 Anyway, that's it! Thanks in advance for any help.


			a3_clark@uk.ac.uwe.pat

	p.s.	 Can the person who asked me for the XMS code please
		re-mail me as I've lost your e-mail address!

------------------------------

End of GUS Programmer's Digest V10 #14
**************************************

To post to tomorrow's digest:                    <gus-sdk@mail.orst.edu>
To (un)subscribe or get help:            <gus-sdk-request@mail.orst.edu>
To contact a human (last resort):          <gus-sdk-owner@mail.orst.edu>

FTP Sites              Archive                       Directories
---------              -------                       -----------
Main N.American Site:  archive.orst.edu              pub/packages/gravis
                       wuarchive.wustl.edu           systems/ibmpc/ultrasound
Main Asian Site:       nctuccca.edu.tw               PC/ultrasound
European Callers ONLY: theoris.rz.uni-konstanz.de    pub/sound/gus
Submissions:           archive.epas.utoronto.ca      pub/pc/ultrasound/submit
Newly Validated Files: archive.epas.utoronto.ca      pub/pc/ultrasound
Mirrors:               garbo.uwasa.fi                mirror/ultrasound
 
MailServer For Archive Access: Email to <mail-server@nike.rz.uni-konstanz.de>

Hints:
      - Get the FAQ from the FTP sites or the request server.
      - Mail to <gus-sdk-request@mail.orst.edu> for info about other GUS
	related mailing lists (general use, musician's, etc.).


