File:  [NeXTSTEP 3.3 examples] / Examples / SoundAndMusic / SoundLibrary / hosttest.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:25 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3


/*
 * hosttest.c - play a soundfile on one or more named hosts.
 */

#import <sound/sound.h>
#import <stdio.h>

check_error(int err)
{
    if (err) {
	fprintf(stderr,"Error : %s\n",SNDSoundError(err));
	exit(1);
    }
}

main (int argc, char *argv[])
{
    int err, j;
    SNDSoundStruct *s;

    if (argc < 3) {
	fprintf(stderr,"usage : hosttest file hostname ...\n");
	exit(1);
    }
    
    for (j=2; j<argc; j++) {		//check that all hosts are available
	err = SNDSetHost(argv[j]);
	check_error(err);
    }

    err = SNDReadSoundfile(argv[1],&s);
    check_error(err);

    for (j=2; j<argc; j++) {
	err = SNDSetHost(argv[j]);
	check_error(err);
	err = SNDStartPlaying(s,j,0,0,0,0);
	check_error(err);
    }
    SNDWait(0);
    exit(0);
}



unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.