Changeset 12:78dfd1b91bcc in roaraudio


Ignore:
Timestamp:
06/18/08 20:37:48 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added playback code

Location:
roarfish
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • roarfish/Makefile

    r11 r12  
    11TARGETS=roarfish 
    22 
    3 OBJ=roarfish.o 
     3OBJ=roarfish.o play.o 
    44 
    55#DEFINES        = -DDEBUG 
    66INCLUDE = -I../include -I./include 
    77CFLAGS  = -g -Wall -O2 $(DEFINES) $(INCLUDE) 
    8 LDFLAGS = -g -L../lib/ -lroar -lfishsound 
     8LDFLAGS = -g -L../lib/ -lroar -lfishsound -loggz 
    99 
    1010all: ${TARGETS} 
  • roarfish/include/roarfish.h

    r11 r12  
    44#define _RAORFISH_H_ 
    55 
     6#define __USE_XOPEN 
     7 
    68#include <roaraudio.h> 
     9 
     10#include <stdio.h> 
     11#include <string.h> 
     12#include <stdlib.h> 
     13 
     14#include <limits.h> 
     15#include <math.h> 
     16 
     17#include <oggz/oggz.h> 
     18#include <fishsound/fishsound.h> 
     19#include <sndfile.h> 
     20 
     21int play (char * file, char ** opts); 
     22 
     23#ifdef __USE_SVID 
     24#define MAXFLOAT HUGE 
     25#endif 
    726 
    827#endif 
  • roarfish/roarfish.c

    r11 r12  
    33#include "roarfish.h" 
    44 
     5void usage (void) { 
     6 printf("Usage: roarfish COMMAND FILE [OPTIONS]\n"); 
     7 printf("\nCOMMANDS:\n"); 
     8 printf("play          - plays a file\n" 
     9       ); 
     10} 
     11 
    512int main (int argc, char * argv[]) { 
     13// int i; 
     14 char * command, * file; 
     15 
     16 if ( argc < 3 ) { 
     17  usage(); 
     18  return 1; 
     19 } 
     20 
     21 command = argv[1]; 
     22 file    = argv[2]; 
     23 
     24 if ( !strcmp(command, "play") ) { 
     25  play(file, NULL); 
     26 } else { 
     27  usage(); 
     28  return 1; 
     29 } 
     30 
    631 return 0; 
    732} 
Note: See TracChangeset for help on using the changeset viewer.