You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(22) |
Aug
(270) |
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(8) |
Feb
(24) |
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
(25) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(3) |
Nov
(1) |
Dec
(14) |
| 2008 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
(31) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
(90) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|
From: Martin R. <ru...@us...> - 2005-01-26 23:20:01
|
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20459/src Modified Files: snd.m soundfile.m Log Message: pedrezuela edition: finally removed comment support. will always cause problems. better implement a sndfile-medadata-base in scheme. Index: soundfile.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/soundfile.m,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** soundfile.m 30 Aug 2004 15:58:59 -0000 1.6 --- soundfile.m 26 Jan 2005 23:19:51 -0000 1.7 *************** *** 50,54 **** ! enum { SND_LENGTH, SND_FORMAT, SND_CHANNELS, SND_SRATE, SND_FILETYPE, SND_COMMENT, SND_COMMENT_SIZE, SND_SET_COMMENT }; --- 50,54 ---- ! enum { SND_LENGTH, SND_FORMAT, SND_CHANNELS, SND_SRATE, SND_FILETYPE }; *************** *** 60,64 **** SNDFILE *sfd; SchemeObject name = General_File_Operation(argv[0], 0); - char *comment = NULL; char buffer[PATH_MAX + 1], *n; int filetype, sampleformat; --- 60,63 ---- *************** *** 66,70 **** int dmode = 0755; /* fd, l, m; */ struct stat st; - // double sr = [GlobalsManager getDefaultSamplingRate]; s.format = 0; --- 65,68 ---- *************** *** 185,194 **** } - /* comment string */ - if (argc > 5) - { - comment = Get_String(argv[5]); - } - /* creating a soundfile with header using libsndfile: * simply open a file for write with an appropriate SF_INFO struct --- 183,186 ---- *************** *** 199,211 **** } - /* write comment */ - if (comment) - { - if (sf_set_string(sfd, SF_STR_COMMENT, comment)) - { - [FOOGlobalsManager schemeOutput: @"WARNING: writing the comment failed. maybe not supported by filetype\n"]; - } - } - if (sf_close(sfd)) { --- 191,194 ---- *************** *** 342,370 **** } break; - case SND_SET_COMMENT: - { - NSString *comment = [NSString stringWithCString: Get_String(params[0])]; - ret = Make_String([[snd getFileComment] cString], - [[snd getFileComment] length]); - - if ([snd reopenWithMode: SND_WRITE] == NO) - { - RELEASE(snd); - Primitive_Error("reopening sndfile for writing comment failed."); - } - if ([snd setFileCommentFromString: comment]) - { - RELEASE(snd); - Primitive_Error("setting the comment failed. maybe not supported by file format."); - } - } - break; - case SND_COMMENT: - ret = Make_String([[snd getFileComment] cString], - [[snd getFileComment] length]); - break; - case SND_COMMENT_SIZE: - ret = Make_Integer([[snd getFileComment] length]); - break; default: RELEASE(snd); --- 325,328 ---- *************** *** 388,401 **** SND_FUNC(P_Soundfile_Length, SND_LENGTH) SND_FUNC(P_Soundfile_Channels, SND_CHANNELS) - SND_FUNC(P_Soundfile_Comment, SND_COMMENT) - SND_FUNC(P_Soundfile_Comment_Size, SND_COMMENT_SIZE) - - - static SchemeObject - P_Set_Soundfile_Comment (SchemeObject soundfile, - SchemeObject comment) - { - return General_Soundfile_Operation(soundfile, SND_SET_COMMENT, &comment); - } --- 346,349 ---- *************** *** 524,530 **** DP(P_Soundfile_Channels, "foo:soundfile-channels", 1, 1, EVAL); DP(P_Soundfile_Filetype, "foo:soundfile-filetype", 1, 1, EVAL); - DP(P_Set_Soundfile_Comment, "foo:set-soundfile-comment!", 2, 2, EVAL); - DP(P_Soundfile_Comment, "foo:soundfile-comment", 1, 1, EVAL); - DP(P_Soundfile_Comment_Size,"foo:soundfile-comment-size", 1, 1, EVAL); DP(P_Soundfile_Play, "foo:soundfile-play", 1, 5, VARARGS); --- 472,475 ---- Index: snd.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/snd.m,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** snd.m 30 Aug 2004 15:58:59 -0000 1.4 --- snd.m 26 Jan 2005 23:19:51 -0000 1.5 *************** *** 115,119 **** SND_T(snd)->filetype = Null; SND_T(snd)->format = Null; - SND_T(snd)->comment = Null; SND_T(snd)->type = Null; GC_Link(snd); --- 115,118 ---- *************** *** 139,143 **** int incr; NSString *filename; - NSString *comment; GC_Node2; --- 138,141 ---- *************** *** 183,188 **** SND_T(s)->name = Make_String(STRING(n)->data, STRING(n)->size); - comment = [IdOf(s) getFileComment]; - SND_T(s)->comment = Make_String([comment cString], [comment length]); GC_Unlink; --- 181,184 ---- *************** *** 351,365 **** static SchemeObject - P_Snd_Comment (SchemeObject snd) - { - SchemeObject comment; - - Check_Type(snd, T_Snd); - comment = SND_T(snd)->comment; - return Make_String (STRING(comment)->data, STRING(comment)->size); - } - - - static SchemeObject P_Snd_Reversedp (SchemeObject snd) { --- 347,350 ---- *************** *** 474,478 **** [IdOf(region) initWithSubstrate:p offset:o size:l rev:NO]; SND_T(region)->name = SND_T(snd)->name; - SND_T(region)->comment = SND_T(snd)->comment; SND_T(region)->filetype = SND_T(snd)->filetype; SND_T(region)->format = SND_T(snd)->format; --- 459,462 ---- *************** *** 505,509 **** [IdOf(region) initWithSubstrate:p offset:0. size:l rev:YES]; SND_T(region)->name = SND_T(snd)->name; - SND_T(region)->comment = SND_T(snd)->comment; SND_T(region)->filetype = SND_T(snd)->filetype; SND_T(region)->format = SND_T(snd)->format; --- 489,492 ---- *************** *** 543,547 **** [IdOf(region) initWithSubstrate:p channel:c]; SND_T(region)->name = SND_T(snd)->name; - SND_T(region)->comment = SND_T(snd)->comment; SND_T(region)->filetype = SND_T(snd)->filetype; SND_T(region)->format = SND_T(snd)->format; --- 526,529 ---- *************** *** 668,672 **** (*f)(&(SND_T(*x)->type)); (*f)(&(SND_T(*x)->name)); - (*f)(&(SND_T(*x)->comment)); (*f)(&(SND_T(*x)->filetype)); (*f)(&(SND_T(*x)->format)); --- 650,653 ---- *************** *** 694,698 **** DP(P_Snd_Offset, "foo:snd-offset", 1, 1, EVAL); DP(P_Snd_Length, "foo:snd-length", 1, 1, EVAL); - DP(P_Snd_Comment, "foo:snd-comment", 1, 1, EVAL); DP(P_Snd_Reversedp, "foo:snd-reversed?", 1, 1, EVAL); DP(P_Snd_Type, "foo:snd-type", 1, 1, EVAL); --- 675,678 ---- |
|
From: Martin R. <ru...@us...> - 2005-01-26 23:20:01
|
Update of /cvsroot/foo/foo/elkfoo/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20459/include Modified Files: elkfoo.h Log Message: pedrezuela edition: finally removed comment support. will always cause problems. better implement a sndfile-medadata-base in scheme. Index: elkfoo.h =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/include/elkfoo.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** elkfoo.h 30 Aug 2004 15:58:01 -0000 1.7 --- elkfoo.h 26 Jan 2005 23:19:50 -0000 1.8 *************** *** 197,201 **** SchemeObject filetype; SchemeObject format; - SchemeObject comment; int channels; int channel; --- 197,200 ---- |
|
From: Martin R. <ru...@us...> - 2005-01-26 23:19:59
|
Update of /cvsroot/foo/foo/elkfoo/scm/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20459/scm/kernel Modified Files: elkfoo.scm Log Message: pedrezuela edition: finally removed comment support. will always cause problems. better implement a sndfile-medadata-base in scheme. Index: elkfoo.scm =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/kernel/elkfoo.scm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** elkfoo.scm 30 Aug 2004 18:12:52 -0000 1.6 --- elkfoo.scm 26 Jan 2005 23:19:51 -0000 1.7 *************** *** 181,185 **** (define snd-offset foo:snd-offset) (define snd-length foo:snd-length) - (define snd-comment foo:snd-comment) (define snd-reversed? foo:snd-reversed?) (define snd-type foo:snd-type) --- 181,184 ---- *************** *** 219,225 **** (define soundfile-format foo:soundfile-format) (define soundfile-channels foo:soundfile-channels) - (define soundfile-comment foo:soundfile-comment) - (define soundfile-comment-size foo:soundfile-comment-size) - (define set-soundfile-comment! foo:set-soundfile-comment!) (define soundfile-srate foo:soundfile-srate) (define soundfile-length foo:soundfile-length) --- 218,221 ---- *************** *** 228,244 **** ! (define (make-soundfile name filetype sampleformat samplingrate channels . comment) (set! name (tilde-expand name)) ! (if (null? comment) ! (foo:make-soundfile name filetype sampleformat samplingrate channels) ! (foo:make-soundfile name filetype sampleformat samplingrate channels (car comment)))) ! (define (create-soundfile name filetype sampleformat samplingrate channels . comment) (set! name (tilde-expand name)) (if (file-exists? name) (system (string-append "rm -rf " name))) ! (if (null? comment) ! (foo:make-soundfile name filetype sampleformat samplingrate channels) ! (foo:make-soundfile name filetype sampleformat samplingrate channels (car comment)))) --- 224,237 ---- ! (define (make-soundfile name filetype sampleformat samplingrate channels) (set! name (tilde-expand name)) ! (foo:make-soundfile name filetype sampleformat samplingrate channels)) ! ! (define (create-soundfile name filetype sampleformat samplingrate channels) (set! name (tilde-expand name)) (if (file-exists? name) (system (string-append "rm -rf " name))) ! (foo:make-soundfile name filetype sampleformat samplingrate channels)) |
|
From: Martin R. <ru...@us...> - 2005-01-26 23:19:59
|
Update of /cvsroot/foo/foo/elkfoo/scm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20459/scm Modified Files: next-compat.foo Log Message: pedrezuela edition: finally removed comment support. will always cause problems. better implement a sndfile-medadata-base in scheme. Index: next-compat.foo =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/next-compat.foo,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** next-compat.foo 30 Aug 2004 18:06:21 -0000 1.2 --- next-compat.foo 26 Jan 2005 23:19:50 -0000 1.3 *************** *** 1,3 **** ! ;; foo-2.1 (NeXTStep) compatability for foo (set! foo-default-soundfile-format 'short) --- 1,3 ---- ! ;; foo-2.1 (NeXTStep) compatibility for foo (set! foo-default-soundfile-format 'short) *************** *** 9,22 **** (if (file-exists? name) (system (string-append "rm -rf " name))) ! (if (null? comment) ! (foo:make-soundfile name foo-default-soundfile-filetype sampleformat samplingrate channels) ! (foo:make-soundfile name foo-default-soundfile-filetype sampleformat samplingrate channels (car comment))))) (set! make-soundfile (lambda (name sampleformat channels samplingrate . comment) (set! name (tilde-expand name)) ! (if (null? comment) ! (foo:make-soundfile name foo-default-soundfile-filetype sampleformat samplingrate channels) ! (foo:make-soundfile name foo-default-soundfile-filetype sampleformat samplingrate channels (car comment))))) (set! foo:synthesize --- 9,20 ---- (if (file-exists? name) (system (string-append "rm -rf " name))) ! ;; note: comment is ignored (not supported anymore) ! (foo:make-soundfile name foo-default-soundfile-filetype sampleformat samplingrate channels))) (set! make-soundfile (lambda (name sampleformat channels samplingrate . comment) (set! name (tilde-expand name)) ! ;; note: comment is ignored (not supported anymore) ! (foo:make-soundfile name foo-default-soundfile-filetype sampleformat samplingrate channels))) (set! foo:synthesize |
|
From: Martin R. <ru...@us...> - 2005-01-26 23:19:22
|
Update of /cvsroot/foo/foo/libfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20304/src Modified Files: FOOSoundFile.m Log Message: pedrezuela edition: finally removed comment support. will always cause problems. better implement a sndfile-medadata-base in scheme. Index: FOOSoundFile.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOSoundFile.m,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FOOSoundFile.m 30 Aug 2004 14:35:04 -0000 1.6 --- FOOSoundFile.m 26 Jan 2005 23:19:12 -0000 1.7 *************** *** 63,67 **** _file = NULL; _fileName = nil; - _fileComment = nil; _dynamics = NULL; _cache.ptr = NULL; --- 63,66 ---- *************** *** 78,82 **** _file = NULL; _fileName = nil; - _fileComment = nil; _dynamics = NULL; _cache.ptr = NULL; --- 77,80 ---- *************** *** 111,115 **** { int mode; - const char *comment; if ([self isOpen] == YES && [self close] == NO) --- 109,112 ---- *************** *** 156,165 **** // } - if (! (comment = sf_get_string(_file, SF_STR_COMMENT))) - { - comment = ""; - } - _fileComment = [[NSString alloc] initWithCString: comment]; - _fileMode = sndmode; _fileFrames = _fileInfo.frames; --- 153,156 ---- *************** *** 231,239 **** _fileName = nil; } - if (_fileComment != nil) - { - RELEASE(_fileComment); - _fileComment = nil; - } return YES; --- 222,225 ---- *************** *** 527,564 **** - - (NSString *) getFileComment - { - return _fileComment; - } // getFileComment - - - - (int) setFileCommentFromString: (NSString *)fileComment - { - int result; - - if ([self isOpen] == NO) - { - FOO_ERROR(YES, -98); - } - if (_fileMode == SND_READ) - { - FOO_ERROR(YES, -99); - } - - result = sf_set_string(_file, SF_STR_COMMENT, [fileComment cString]); - - if (! result) - { // succeeded, update _fileComment - if (_fileComment != nil) - { - RELEASE(_fileComment); - } - _fileComment = RETAIN(fileComment); - } - - return result; - } // setFileCommentFromString - - - validateDynamics { --- 513,516 ---- |
|
From: Martin R. <ru...@us...> - 2005-01-26 23:19:21
|
Update of /cvsroot/foo/foo/libfoo/FOO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20304/FOO Modified Files: FOOSoundFile.h Log Message: pedrezuela edition: finally removed comment support. will always cause problems. better implement a sndfile-medadata-base in scheme. Index: FOOSoundFile.h =================================================================== RCS file: /cvsroot/foo/foo/libfoo/FOO/FOOSoundFile.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FOOSoundFile.h 30 Aug 2004 14:35:18 -0000 1.4 --- FOOSoundFile.h 26 Jan 2005 23:19:12 -0000 1.5 *************** *** 74,78 **** { NSString *_fileName; - NSString *_fileComment; SNDFILE *_file; SF_INFO _fileInfo; --- 74,77 ---- *************** *** 114,120 **** - (long) size; - - (NSString *) getFileComment; - - (int) setFileCommentFromString: (NSString *)fileComment; - - setCacheCapacity: (sf_count_t)frames; - prepareCache: (sf_count_t)fromFrame; --- 113,116 ---- |
|
From: Martin R. <ru...@us...> - 2005-01-23 15:02:43
|
Update of /cvsroot/foo/fooelk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6661 Modified Files: configure.ac Log Message: set default heapsize to 16M. added --with-motif switch for disabling motif extensions. switched --with-x and --with-motif defaults to no (speeds up build process) Index: configure.ac =================================================================== RCS file: /cvsroot/foo/fooelk/configure.ac,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** configure.ac 25 Aug 2004 23:12:51 -0000 1.8 --- configure.ac 23 Jan 2005 15:02:33 -0000 1.9 *************** *** 519,524 **** # stop-and-copy garbage collector is used). AC_ARG_WITH(default-heapsize, ! AC_HELP_STRING([--with-default-heapsize=SIZE], [default heapsize of the interpreter for stop-and-copy garbage collector (4096k)]),, ! [with_default_heapsize=4096]) AC_DEFINE_UNQUOTED(HEAP_SIZE, ${with_default_heapsize}, [default heap size of the interpreter for stop-and-copy garbage collector]) --- 519,524 ---- # stop-and-copy garbage collector is used). AC_ARG_WITH(default-heapsize, ! AC_HELP_STRING([--with-default-heapsize=SIZE], [default heapsize of the interpreter for stop-and-copy garbage collector (16384k)]),, ! [with_default_heapsize=16384]) AC_DEFINE_UNQUOTED(HEAP_SIZE, ${with_default_heapsize}, [default heap size of the interpreter for stop-and-copy garbage collector]) *************** *** 575,578 **** --- 575,583 ---- AM_CONDITIONAL(HAVE_GDBM, test "${ac_cv_my_have_gdbm}" = "yes") + # in fooelk, we don't use x by default + if test "${with_x}" != yes; then + with_x=no + fi + AC_PATH_X *************** *** 619,632 **** AC_SUBST(XAW_LIBS) ! if test "${cross_compiling}" = "no"; then ! AC_CHECK_LIB(Xm, XmStringConcat, ! [ac_cv_my_have_motif=yes ! MOTIF_CFLAGS="-I${x_includes} -I/usr/include/Xm" ! MOTIF_LIBS="-L${x_libraries} -lXm ${XT_LIBS}"], ! [ac_cv_my_have_motif=no], ! [[${XT_LIBS}]]) else ! ac_cv_my_have_motif="no (cross-compiling)" fi AM_CONDITIONAL(HAVE_MOTIF, test "${ac_cv_my_have_motif}" = "yes") AC_SUBST(MOTIF_CFLAGS) --- 624,648 ---- AC_SUBST(XAW_LIBS) ! # should we check for motif? ! AC_ARG_WITH(motif, ! AC_HELP_STRING([--with-motif], [build motif extensions (no)]), ! , ! [with_motif=no]) ! ! if test "${with_motif}" = "yes"; then ! if test "${cross_compiling}" = "no"; then ! AC_CHECK_LIB(Xm, XmStringConcat, ! [ac_cv_my_have_motif=yes ! MOTIF_CFLAGS="-I${x_includes} -I/usr/include/Xm" ! MOTIF_LIBS="-L${x_libraries} -lXm ${XT_LIBS}"], ! [ac_cv_my_have_motif=no], ! [[${XT_LIBS}]]) ! else ! ac_cv_my_have_motif="no (cross-compiling)" ! fi else ! ac_cv_my_have_motif="no" fi + AM_CONDITIONAL(HAVE_MOTIF, test "${ac_cv_my_have_motif}" = "yes") AC_SUBST(MOTIF_CFLAGS) |
|
From: Martin R. <ru...@us...> - 2005-01-23 14:47:27
|
Update of /cvsroot/foo/fooelk/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3928 Modified Files: heap-sc.c Log Message: switched from sbrk() to malloc() in order to avoid heap size maximum on mac Index: heap-sc.c =================================================================== RCS file: /cvsroot/foo/fooelk/src/heap-sc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** heap-sc.c 6 Aug 2004 20:56:42 -0000 1.1.1.1 --- heap-sc.c 23 Jan 2005 14:47:18 -0000 1.2 *************** *** 33,37 **** extern void Uncatchable_Error (char *); extern unsigned int Stack_Size (); ! extern void *sbrk(); #define Recursive_Visit(p) {\ --- 33,38 ---- extern void Uncatchable_Error (char *); extern unsigned int Stack_Size (); ! /* extern void *sbrk(); */ ! extern void *malloc(); #define Recursive_Visit(p) {\ *************** *** 54,58 **** register unsigned int s = 2 * k; ! if ((Hp = Heap_Start = (char *)sbrk (s)) == (char *)-1) Fatal_Error ("cannot allocate heap (%u KBytes)", 2*size); Heap_End = Heap_Start + k; --- 55,63 ---- register unsigned int s = 2 * k; ! /* we use malloc() instead of sbrk() in the hope that it's working ! * sbrk caused problems on mac related to RLIMIT_DATA being too small ! */ ! /* if ((Hp = Heap_Start = (char *)sbrk (s)) == (char *)-1) */ ! if ((Hp = Heap_Start = (char *)malloc (s)) == NULL) Fatal_Error ("cannot allocate heap (%u KBytes)", 2*size); Heap_End = Heap_Start + k; |
|
From: Martin R. <ru...@us...> - 2004-08-30 18:13:02
|
Update of /cvsroot/foo/foo/elkfoo/scm/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21801/kernel Modified Files: elkfoo.scm Log Message: use (foo:dirname) in (foo:synthesize) instead of manual implementation (== doubles code) Index: elkfoo.scm =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/kernel/elkfoo.scm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** elkfoo.scm 30 Aug 2004 18:05:15 -0000 1.5 --- elkfoo.scm 30 Aug 2004 18:12:52 -0000 1.6 *************** *** 305,309 **** (define (foo:synthesize channels duration filename filetype sampleformat srate thunk) (let ((c (make-context channels)) ! (d (substring filename 0 (1+ (foo:string-rindex filename #\/))))) (if (> (string-length d) 0) (if (not (file-exists? d)) --- 305,309 ---- (define (foo:synthesize channels duration filename filetype sampleformat srate thunk) (let ((c (make-context channels)) ! (d (foo:dirname filename))) (if (> (string-length d) 0) (if (not (file-exists? d)) |
|
From: Martin R. <ru...@us...> - 2004-08-30 18:06:30
|
Update of /cvsroot/foo/foo/elkfoo/scm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20344 Modified Files: next-compat.foo Log Message: fixed overlay compat functions in order to work with new foo:make-soundfile interface Index: next-compat.foo =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/next-compat.foo,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** next-compat.foo 7 Aug 2004 22:53:00 -0000 1.1 --- next-compat.foo 30 Aug 2004 18:06:21 -0000 1.2 *************** *** 1,20 **** ;; foo-2.1 (NeXTStep) compatability for foo ! (define foo-default-soundfile-format 'short) ! (define foo-default-soundfile-filetype 'snd) ! (define foo-default-soundfile-extension ".snd") ! (define (create-soundfile name format channels samplingrate . commentary) ! (set! name (tilde-expand name)) ! (if (file-exists? name) ! (system (string-append "rm -rf " name))) ! (foo:make-soundfile name format channels samplingrate foo-default-soundfile-filetype)) ! ! (define (make-soundfile name format channels samplingrate . commentary) ! (set! name (tilde-expand name)) ! (foo:make-soundfile name format channels samplingrate foo-default-soundfile-filetype)) (define-macro (synt c d s n f . e) ! `(foo:synthesize ,c ,d ,s ,n ,f foo-default-soundfile-filetype (lambda () ,@e))) (provide 'next-compat) --- 1,56 ---- ;; foo-2.1 (NeXTStep) compatability for foo ! (set! foo-default-soundfile-format 'short) ! (set! foo-default-soundfile-filetype 'snd) ! (set! create-soundfile ! (lambda (name sampleformat channels samplingrate . comment) ! (set! name (tilde-expand name)) ! (if (file-exists? name) ! (system (string-append "rm -rf " name))) ! (if (null? comment) ! (foo:make-soundfile name foo-default-soundfile-filetype sampleformat samplingrate channels) ! (foo:make-soundfile name foo-default-soundfile-filetype sampleformat samplingrate channels (car comment))))) ! ! (set! make-soundfile ! (lambda (name sampleformat channels samplingrate . comment) ! (set! name (tilde-expand name)) ! (if (null? comment) ! (foo:make-soundfile name foo-default-soundfile-filetype sampleformat samplingrate channels) ! (foo:make-soundfile name foo-default-soundfile-filetype sampleformat samplingrate channels (car comment))))) ! ! (set! foo:synthesize ! (lambda (channels duration srate filename sampleformat thunk) ! (let ((c (make-context channels)) ! (d (substring filename 0 (1+ (foo:string-rindex filename #\/))))) ! (if (> (string-length d) 0) ! (if (not (file-exists? d)) ! (system (string-append "mkdir -p " d)))) ! (create-soundfile filename sampleformat channels srate) ! (with-context c thunk) ! (let ((start 0) (finish 0) (done 0)) ! (define (pf f n) ! (let ((s (number->string f))) ! (substring s 0 (min (string-length s) n)))) ! (set! start (seconds)) ! (set! done (run-task (make-task 0 0 filename c 'punch srate) duration)) ! (set! finish (seconds)) ! (format #t ! "len: ~as, tim: ~as, rtf: ~a, sr: ~aHz~%fil: ~a, fmt: ~a" ! (pf done 7) ! (pf (- finish start) 7) ! (pf (/ (- finish start) done) 7) ! (pf srate 7) filename sampleformat))) #v)) ! ! (define-macro (syn c d . e) ! `(foo:synthesize ,c ! ,d ! (foo-default-srate) ! (foo:test-file-name) ! foo-default-soundfile-format ! (lambda () ,@e))) (define-macro (synt c d s n f . e) ! `(foo:synthesize ,c ,d ,s ,n ,f (lambda () ,@e))) (provide 'next-compat) |
|
From: Martin R. <ru...@us...> - 2004-08-30 18:05:25
|
Update of /cvsroot/foo/foo/elkfoo/scm/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19134 Modified Files: elkfoo.scm Log Message: - removed foo-default-soundfile-extension - changed param order in (foo:synthesize) in order to reflect params of (create|make-soundfile) - adopted (syn) and (synt) to changes in (foo:synthesize) - changed (foo:string-(r)index) in order to return -1 if char not found instead of #f, cause this led to an error in synt when using local path without '/'. however, (foo:dirname) returns strings with trailing '/' now, but (foo:dirname "test.aiff") now returns "" correctly instead of yielding an error Index: elkfoo.scm =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/kernel/elkfoo.scm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** elkfoo.scm 30 Aug 2004 15:59:48 -0000 1.4 --- elkfoo.scm 30 Aug 2004 18:05:15 -0000 1.5 *************** *** 72,76 **** (define foo-default-soundfile-format 'short) (define foo-default-soundfile-filetype 'aiff) - (define foo-default-soundfile-extension ".aiff") (define foo-default-play-command "sndfile-play") --- 72,75 ---- *************** *** 259,263 **** "/foo" (number->string (getpid)) ! foo-default-soundfile-extension)) (define (foo:cleanup) --- 258,262 ---- "/foo" (number->string (getpid)) ! (foo:soundfile-type-extension foo-default-soundfile-filetype))) (define (foo:cleanup) *************** *** 282,286 **** (define (loop n) (if (>= n len) ! #f (if (eq? (string-ref aString n) aCharacter) n --- 281,285 ---- (define (loop n) (if (>= n len) ! -1 (if (eq? (string-ref aString n) aCharacter) n *************** *** 292,296 **** (define (loop n) (if (< n 0) ! #f (if (eq? (string-ref aString n) aCharacter) n --- 291,295 ---- (define (loop n) (if (< n 0) ! -1 (if (eq? (string-ref aString n) aCharacter) n *************** *** 299,329 **** (define (foo:basename path) ! (substring path (+ (foo:string-rindex path #\/) 1) (string-length path))) (define (foo:dirname path) ! (substring path 0 (foo:string-rindex path #\/))) ! (define (foo:synthesize channels duration srate filename fileformat filetype thunk) (let ((c (make-context channels)) ! (d (substring filename 0 (foo:string-rindex filename #\/)))) ! (if (not (file-exists? d)) ! (system (string-append "mkdir -p " d))) ! (if (file-exists? filename) ! (system (string-append "rm " filename))) ! (make-soundfile filename fileformat channels srate filetype) ! (with-context c thunk) ! (let ((start 0) (finish 0) (done 0)) ! (define (pf filename n) ! (let ((s (number->string filename))) ! (substring s 0 (min (string-length s) n)))) ! (set! start (seconds)) ! (set! done (run-task (make-task 0 0 filename c 'punch srate) duration)) ! (set! finish (seconds)) ! (format #t ! "len: ~as, tim: ~as, rtf: ~a, sr: ~aHz~%fil: ~a, fmt: ~a, typ: ~a" (pf done 7) (pf (- finish start) 7) (pf (/ (- finish start) done) 7) ! (pf srate 7) filename fileformat filetype))) #v) --- 298,327 ---- (define (foo:basename path) ! (substring path (1+ (foo:string-rindex path #\/)) (string-length path))) (define (foo:dirname path) ! (substring path 0 (1+ (foo:string-rindex path #\/)))) ! (define (foo:synthesize channels duration filename filetype sampleformat srate thunk) (let ((c (make-context channels)) ! (d (substring filename 0 (1+ (foo:string-rindex filename #\/))))) ! (if (> (string-length d) 0) ! (if (not (file-exists? d)) ! (system (string-append "mkdir -p " d)))) ! (create-soundfile filename filetype sampleformat srate channels) ! (with-context c thunk) ! (let ((start 0) (finish 0) (done 0)) ! (define (pf f n) ! (let ((s (number->string f))) ! (substring s 0 (min (string-length s) n)))) ! (set! start (seconds)) ! (set! done (run-task (make-task 0 0 filename c 'punch srate) duration)) ! (set! finish (seconds)) ! (format #t ! "len: ~as, tim: ~as, rtf: ~a, sr: ~aHz~%fil: ~a, typ: ~a, fmt: ~a" (pf done 7) (pf (- finish start) 7) (pf (/ (- finish start) done) 7) ! (pf srate 7) filename filetype sampleformat))) #v) *************** *** 331,342 **** `(foo:synthesize ,c ,d - (foo-default-srate) (foo:test-file-name) - foo-default-soundfile-format foo-default-soundfile-filetype (lambda () ,@e))) ! (define-macro (synt c d s n f t . e) ! `(foo:synthesize ,c ,d ,s ,n ,f ,t (lambda () ,@e))) (define (play . name) --- 329,340 ---- `(foo:synthesize ,c ,d (foo:test-file-name) foo-default-soundfile-filetype + foo-default-soundfile-format + (foo-default-srate) (lambda () ,@e))) ! (define-macro (synt c d n t f s . e) ! `(foo:synthesize ,c ,d ,n ,t ,f ,s (lambda () ,@e))) (define (play . name) |
|
From: Martin R. <ru...@us...> - 2004-08-30 17:59:25
|
Update of /cvsroot/foo/foo/elkfoo/scm/control/tools/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19006 Modified Files: soundfile-funs.foo Log Message: removed foo-default-soundfile-extension Index: soundfile-funs.foo =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/control/tools/util/soundfile-funs.foo,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** soundfile-funs.foo 30 Aug 2004 13:35:13 -0000 1.1 --- soundfile-funs.foo 30 Aug 2004 17:59:16 -0000 1.2 *************** *** 60,64 **** ; ;;default type (probably to be changed). Leaning on the definition in elkfoo.scm - ;; foo-default-soundfile-extension TO BE REMOVED ; (define (foo:default-soundfile-type) foo-default-soundfile-filetype) --- 60,63 ---- |
|
From: Martin R. <ru...@us...> - 2004-08-30 16:04:04
|
Update of /cvsroot/foo/foo/elkfoo/scm/tools/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27429/util Removed Files: Makefile.am misc-funs.foo sound-funs.foo Log Message: removed tool file --- sound-funs.foo DELETED --- --- Makefile.am DELETED --- --- misc-funs.foo DELETED --- |
|
From: Martin R. <ru...@us...> - 2004-08-30 16:04:03
|
Update of /cvsroot/foo/foo/elkfoo/scm/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27429 Removed Files: Makefile.am init-tools.foo pitch.foo Log Message: removed tool file --- pitch.foo DELETED --- --- Makefile.am DELETED --- --- init-tools.foo DELETED --- |
|
From: Martin R. <ru...@us...> - 2004-08-30 16:04:03
|
Update of /cvsroot/foo/foo/elkfoo/scm/tools/mixsnd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27429/mixsnd Removed Files: Makefile.am mix-auxfun.foo mixsnd.foo Log Message: removed tool file --- mixsnd.foo DELETED --- --- Makefile.am DELETED --- --- mix-auxfun.foo DELETED --- |
|
From: Martin R. <ru...@us...> - 2004-08-30 16:01:31
|
Update of /cvsroot/foo/foo/elkfoo/scm/control/tools/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26921/control/tools/util Modified Files: Makefile.am Log Message: changed comments in files (due to over-perfectionist typical-german attitude) Index: Makefile.am =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/control/tools/util/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 30 Aug 2004 13:39:54 -0000 1.1 --- Makefile.am 30 Aug 2004 16:01:20 -0000 1.2 *************** *** 1,3 **** ! # foo/elkfoo/scm/tools/util/Makefile.am # 2004 rumori --- 1,3 ---- ! # foo/elkfoo/scm/control/tools/util/Makefile.am # 2004 rumori |
|
From: Martin R. <ru...@us...> - 2004-08-30 16:01:31
|
Update of /cvsroot/foo/foo/elkfoo/scm/control/tools/mixsnd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26921/control/tools/mixsnd Modified Files: Makefile.am Log Message: changed comments in files (due to over-perfectionist typical-german attitude) Index: Makefile.am =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/control/tools/mixsnd/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 30 Aug 2004 13:40:57 -0000 1.1 --- Makefile.am 30 Aug 2004 16:01:20 -0000 1.2 *************** *** 1,3 **** ! # foo/elkfoo/scm/tools/mixsnd/Makefile.am # 2004 rumori --- 1,3 ---- ! # foo/elkfoo/scm/control/tools/mixsnd/Makefile.am # 2004 rumori |
|
From: Martin R. <ru...@us...> - 2004-08-30 16:01:29
|
Update of /cvsroot/foo/foo/elkfoo/scm/control/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26921/control/tools Modified Files: Makefile.am Log Message: changed comments in files (due to over-perfectionist typical-german attitude) Index: Makefile.am =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/control/tools/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 30 Aug 2004 13:41:32 -0000 1.1 --- Makefile.am 30 Aug 2004 16:01:19 -0000 1.2 *************** *** 1,3 **** ! # foo/elkfoo/scm/tools/Makefile.am # 2004 rumori --- 1,3 ---- ! # foo/elkfoo/scm/control/tools/Makefile.am # 2004 rumori |
|
From: Martin R. <ru...@us...> - 2004-08-30 16:00:03
|
Update of /cvsroot/foo/foo/elkfoo/scm/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26537 Modified Files: elkfoo.scm Log Message: changed (create-soundfile)/(make-soundfile) according to new foo:make-soundfile Index: elkfoo.scm =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/scm/kernel/elkfoo.scm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** elkfoo.scm 25 Aug 2004 23:16:33 -0000 1.3 --- elkfoo.scm 30 Aug 2004 15:59:48 -0000 1.4 *************** *** 182,185 **** --- 182,186 ---- (define snd-offset foo:snd-offset) (define snd-length foo:snd-length) + (define snd-comment foo:snd-comment) (define snd-reversed? foo:snd-reversed?) (define snd-type foo:snd-type) *************** *** 219,222 **** --- 220,226 ---- (define soundfile-format foo:soundfile-format) (define soundfile-channels foo:soundfile-channels) + (define soundfile-comment foo:soundfile-comment) + (define soundfile-comment-size foo:soundfile-comment-size) + (define set-soundfile-comment! foo:set-soundfile-comment!) (define soundfile-srate foo:soundfile-srate) (define soundfile-length foo:soundfile-length) *************** *** 225,244 **** ! (define (make-soundfile name format channels samplingrate . filetype) (set! name (tilde-expand name)) ! (if (null? filetype) ! (set! filetype foo-default-soundfile-filetype) ! (set! filetype (car filetype))) ! (foo:make-soundfile name format channels samplingrate filetype)) ! ! (define (create-soundfile name format channels samplingrate . filetype) (set! name (tilde-expand name)) (if (file-exists? name) (system (string-append "rm -rf " name))) ! (if (null? filetype) ! (set! filetype foo-default-soundfile-filetype) ! (set! filetype (car filetype))) ! (foo:make-soundfile name format channels samplingrate filetype)) --- 229,245 ---- ! (define (make-soundfile name filetype sampleformat samplingrate channels . comment) (set! name (tilde-expand name)) ! (if (null? comment) ! (foo:make-soundfile name filetype sampleformat samplingrate channels) ! (foo:make-soundfile name filetype sampleformat samplingrate channels (car comment)))) ! (define (create-soundfile name filetype sampleformat samplingrate channels . comment) (set! name (tilde-expand name)) (if (file-exists? name) (system (string-append "rm -rf " name))) ! (if (null? comment) ! (foo:make-soundfile name filetype sampleformat samplingrate channels) ! (foo:make-soundfile name filetype sampleformat samplingrate channels (car comment)))) |
|
From: Martin R. <ru...@us...> - 2004-08-30 15:59:09
|
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26424 Modified Files: pointer.m snd.m soundfile.m tell.m types.m Log Message: reordered (foo:make-soundfile) parameters. added comment support again. minor changes in order to avoid warnings Index: snd.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/snd.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** snd.m 13 Aug 2004 21:34:39 -0000 1.3 --- snd.m 30 Aug 2004 15:58:59 -0000 1.4 *************** *** 50,62 **** #define IdOf(snd) (SND_T(snd)->pointer) ! struct symbol sndTypes[] = { {"char", SND_CHAR}, {"short", SND_SHORT}, {"long", SND_LONG}, {"float", SND_FLOAT}, {"double", SND_DOUBLE}, - {"incremental", SND_INCREMENTAL}, {0, 0} }; ! struct symbol sndFileTypes[] = { {"wav", SND_FILETYPE_WAV}, {"aiff", SND_FILETYPE_AIFF}, {"snd", SND_FILETYPE_SND}, --- 50,63 ---- #define IdOf(snd) (SND_T(snd)->pointer) ! struct symbol sndTypes[] = { {"auto", SND_AUTO}, ! {"char", SND_CHAR}, {"short", SND_SHORT}, {"long", SND_LONG}, {"float", SND_FLOAT}, {"double", SND_DOUBLE}, {0, 0} }; ! struct symbol sndFileTypes[] = { {"incremental", SND_FILETYPE_INCREMENTAL}, ! {"wav", SND_FILETYPE_WAV}, {"aiff", SND_FILETYPE_AIFF}, {"snd", SND_FILETYPE_SND}, *************** *** 82,87 **** char *s; - // Alloca_Begin; - Check_Type (sym, T_Symbol); name = SYMBOL (sym)->name; --- 83,86 ---- *************** *** 96,100 **** Primitive_Error ("unrecognized keyword: ~s", sym); } - // Alloca_End; return p->val; --- 95,98 ---- *************** *** 115,120 **** SND_T(snd)->context = Get_Context(); SND_T(snd)->name = Null; - SND_T(snd)->format = Null; SND_T(snd)->filetype = Null; SND_T(snd)->type = Null; GC_Link(snd); --- 113,119 ---- SND_T(snd)->context = Get_Context(); SND_T(snd)->name = Null; SND_T(snd)->filetype = Null; + SND_T(snd)->format = Null; + SND_T(snd)->comment = Null; SND_T(snd)->type = Null; GC_Link(snd); *************** *** 140,146 **** int incr; NSString *filename; GC_Node2; - // Alloca_Begin; if (! Truep(General_File_Operation(n, 1))) --- 139,145 ---- int incr; NSString *filename; + NSString *comment; GC_Node2; if (! Truep(General_File_Operation(n, 1))) *************** *** 184,188 **** SND_T(s)->name = Make_String(STRING(n)->data, STRING(n)->size); ! GC_Unlink; --- 183,188 ---- SND_T(s)->name = Make_String(STRING(n)->data, STRING(n)->size); ! comment = [IdOf(s) getFileComment]; ! SND_T(s)->comment = Make_String([comment cString], [comment length]); GC_Unlink; *************** *** 199,284 **** } ! if (incr == 1) { t = sndTypes[5].name; } else { ! switch ([IdOf(s) getDataFormat]) { ! case SF_FORMAT_PCM_S8: ! t = sndTypes[0].name; break; ! case SF_FORMAT_PCM_16: ! t = sndTypes[1].name; break; ! case SF_FORMAT_PCM_32: ! t = sndTypes[2].name; break; ! case SF_FORMAT_FLOAT: ! t = sndTypes[3].name; break; ! case SF_FORMAT_DOUBLE: ! t = sndTypes[4].name; break; default: ! Primitive_Error("unknown sound file format: ~a", ! ! Make_Integer(([IdOf(s) getDataFormat]))); } } - switch ([IdOf(s) getFileType]) - { - case SF_FORMAT_WAV: - t = sndFileTypes[0].name; - break; - case SF_FORMAT_AIFF: - t = sndFileTypes[1].name; - break; - case SF_FORMAT_AU: - t = sndFileTypes[2].name; - break; - case SF_FORMAT_PAF: - t = sndFileTypes[3].name; - break; - case SF_FORMAT_SVX: - t = sndFileTypes[4].name; - break; - case SF_FORMAT_NIST: - t = sndFileTypes[5].name; - break; - case SF_FORMAT_VOC: - t = sndFileTypes[6].name; - break; - case SF_FORMAT_IRCAM: - t = sndFileTypes[7].name; - break; - case SF_FORMAT_W64: - t = sndFileTypes[8].name; - break; - case SF_FORMAT_MAT4: - t = sndFileTypes[9].name; - break; - case SF_FORMAT_MAT5: - t = sndFileTypes[10].name; - break; - case SF_FORMAT_PVF: - t = sndFileTypes[11].name; - break; - case SF_FORMAT_XI: - t = sndFileTypes[12].name; - break; - default: - Primitive_Error("unknown sound file filetype: ~a", - Make_Integer(([IdOf(s) getFileType]))); - } - SND_T(s)->filetype = Intern(t); - SND_T(s)->offset = 0; SND_T(s)->length = [IdOf(s) size] / SND_T(s)->samplerate; SND_T(s)->reversed = 0; - // Alloca_End; return s; --- 199,281 ---- } ! switch ([IdOf(s) getDataFormat]) { + case SF_FORMAT_PCM_S8: + t = sndTypes[1].name; + break; + case SF_FORMAT_PCM_16: + t = sndTypes[2].name; + break; + case SF_FORMAT_PCM_32: + t = sndTypes[3].name; + break; + case SF_FORMAT_FLOAT: + t = sndTypes[4].name; + break; + case SF_FORMAT_DOUBLE: t = sndTypes[5].name; + break; + default: + Primitive_Error("unknown sound file format: ~a", + Make_Integer(([IdOf(s) getDataFormat]))); + } + + if (incr == 1) + { + t = sndFileTypes[0].name; } else { ! switch ([IdOf(s) getFileType]) { ! case SF_FORMAT_WAV: ! t = sndFileTypes[1].name; break; ! case SF_FORMAT_AIFF: ! t = sndFileTypes[2].name; break; ! case SF_FORMAT_AU: ! t = sndFileTypes[3].name; break; ! case SF_FORMAT_PAF: ! t = sndFileTypes[4].name; break; ! case SF_FORMAT_SVX: ! t = sndFileTypes[5].name; ! break; ! case SF_FORMAT_NIST: ! t = sndFileTypes[6].name; ! break; ! case SF_FORMAT_VOC: ! t = sndFileTypes[7].name; ! break; ! case SF_FORMAT_IRCAM: ! t = sndFileTypes[8].name; ! break; ! case SF_FORMAT_W64: ! t = sndFileTypes[9].name; ! break; ! case SF_FORMAT_MAT4: ! t = sndFileTypes[10].name; ! break; ! case SF_FORMAT_MAT5: ! t = sndFileTypes[11].name; ! break; ! case SF_FORMAT_PVF: ! t = sndFileTypes[12].name; ! break; ! case SF_FORMAT_XI: ! t = sndFileTypes[13].name; break; default: ! Primitive_Error("unknown sound file filetype: ~a", ! Make_Integer(([IdOf(s) getFileType]))); } } SND_T(s)->filetype = Intern(t); SND_T(s)->offset = 0; SND_T(s)->length = [IdOf(s) size] / SND_T(s)->samplerate; SND_T(s)->reversed = 0; return s; *************** *** 354,357 **** --- 351,365 ---- static SchemeObject + P_Snd_Comment (SchemeObject snd) + { + SchemeObject comment; + + Check_Type(snd, T_Snd); + comment = SND_T(snd)->comment; + return Make_String (STRING(comment)->data, STRING(comment)->size); + } + + + static SchemeObject P_Snd_Reversedp (SchemeObject snd) { *************** *** 466,471 **** [IdOf(region) initWithSubstrate:p offset:o size:l rev:NO]; SND_T(region)->name = SND_T(snd)->name; ! SND_T(region)->format = SND_T(snd)->format; SND_T(region)->filetype = SND_T(snd)->filetype; SND_T(region)->channels = SND_T(snd)->channels; SND_T(region)->channel = SND_T(snd)->channel; --- 474,480 ---- [IdOf(region) initWithSubstrate:p offset:o size:l rev:NO]; SND_T(region)->name = SND_T(snd)->name; ! SND_T(region)->comment = SND_T(snd)->comment; SND_T(region)->filetype = SND_T(snd)->filetype; + SND_T(region)->format = SND_T(snd)->format; SND_T(region)->channels = SND_T(snd)->channels; SND_T(region)->channel = SND_T(snd)->channel; *************** *** 496,501 **** [IdOf(region) initWithSubstrate:p offset:0. size:l rev:YES]; SND_T(region)->name = SND_T(snd)->name; ! SND_T(region)->format = SND_T(snd)->format; SND_T(region)->filetype = SND_T(snd)->filetype; SND_T(region)->channels = SND_T(snd)->channels; SND_T(region)->channel = SND_T(snd)->channel; --- 505,511 ---- [IdOf(region) initWithSubstrate:p offset:0. size:l rev:YES]; SND_T(region)->name = SND_T(snd)->name; ! SND_T(region)->comment = SND_T(snd)->comment; SND_T(region)->filetype = SND_T(snd)->filetype; + SND_T(region)->format = SND_T(snd)->format; SND_T(region)->channels = SND_T(snd)->channels; SND_T(region)->channel = SND_T(snd)->channel; *************** *** 533,538 **** [IdOf(region) initWithSubstrate:p channel:c]; SND_T(region)->name = SND_T(snd)->name; ! SND_T(region)->format = SND_T(snd)->format; SND_T(region)->filetype = SND_T(snd)->filetype; SND_T(region)->channels = SND_T(snd)->channels; SND_T(region)->channel = c; --- 543,549 ---- [IdOf(region) initWithSubstrate:p channel:c]; SND_T(region)->name = SND_T(snd)->name; ! SND_T(region)->comment = SND_T(snd)->comment; SND_T(region)->filetype = SND_T(snd)->filetype; + SND_T(region)->format = SND_T(snd)->format; SND_T(region)->channels = SND_T(snd)->channels; SND_T(region)->channel = c; *************** *** 657,662 **** (*f)(&(SND_T(*x)->type)); (*f)(&(SND_T(*x)->name)); ! (*f)(&(SND_T(*x)->format)); (*f)(&(SND_T(*x)->filetype)); return 0; --- 668,674 ---- (*f)(&(SND_T(*x)->type)); (*f)(&(SND_T(*x)->name)); ! (*f)(&(SND_T(*x)->comment)); (*f)(&(SND_T(*x)->filetype)); + (*f)(&(SND_T(*x)->format)); return 0; *************** *** 682,685 **** --- 694,698 ---- DP(P_Snd_Offset, "foo:snd-offset", 1, 1, EVAL); DP(P_Snd_Length, "foo:snd-length", 1, 1, EVAL); + DP(P_Snd_Comment, "foo:snd-comment", 1, 1, EVAL); DP(P_Snd_Reversedp, "foo:snd-reversed?", 1, 1, EVAL); DP(P_Snd_Type, "foo:snd-type", 1, 1, EVAL); Index: pointer.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/pointer.m,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pointer.m 13 Aug 2004 21:34:39 -0000 1.9 --- pointer.m 30 Aug 2004 15:58:59 -0000 1.10 *************** *** 43,46 **** --- 43,81 ---- #endif + /* type names */ + static char *elkfoo_type_names[] = + { /* corresponds to enum above */ + "DUMMY", /* 0 */ + "char", /* 1 */ + "short", /* 2 */ + "int", /* 3 */ + "long", /* 4 */ + "uchar", /* 5 */ + "ushort", /* 6 */ + "uint", /* 7 */ + "ulong", /* 8 */ + "float", /* 9 */ + "double", /* 10 */ + "void*", /* 11 */ + "char*", /* 12 */ + "short*", /* 13 */ + "int*", /* 14 */ + "long*", /* 15 */ + "uchar*", /* 16 */ + "ushort*", /* 17 */ + "uint*", /* 18 */ + "ulong*", /* 19 */ + "float*", /* 20 */ + "double*", /* 21 */ + "id", /* 22 */ + "class", /* 23 */ + "sel", /* 24 */ + "struct*", /* 25 */ + "union*", /* 26 */ + "array*", /* 27 */ + "undefined", /* 28 */ + "char**", /* 29 */ + "undefined*", /* 30 */ + }; int T_Pointer; Index: soundfile.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/soundfile.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** soundfile.m 16 Aug 2004 04:36:29 -0000 1.5 --- soundfile.m 30 Aug 2004 15:58:59 -0000 1.6 *************** *** 50,54 **** ! enum { SND_LENGTH, SND_FORMAT, SND_CHANNELS, SND_SRATE, SND_FILETYPE }; --- 50,54 ---- ! enum { SND_LENGTH, SND_FORMAT, SND_CHANNELS, SND_SRATE, SND_FILETYPE, SND_COMMENT, SND_COMMENT_SIZE, SND_SET_COMMENT }; *************** *** 60,75 **** SNDFILE *sfd; SchemeObject name = General_File_Operation(argv[0], 0); char buffer[PATH_MAX + 1], *n; ! int type, fmode = 0644, dmode = 0755; /* fd, l, m; */ struct stat st; // double sr = [GlobalsManager getDefaultSamplingRate]; - // Alloca_Begin; - s.format = 0; // set soundfile filetype ! switch (type = Scheme_To_C_Symbol(argv[4], sndFileTypes)) { case SND_FILETYPE_WAV: s.format |= SF_FORMAT_WAV; --- 60,79 ---- SNDFILE *sfd; SchemeObject name = General_File_Operation(argv[0], 0); + char *comment = NULL; char buffer[PATH_MAX + 1], *n; ! int filetype, sampleformat; ! // int fmode = 0644; // currently not used ! int dmode = 0755; /* fd, l, m; */ struct stat st; // double sr = [GlobalsManager getDefaultSamplingRate]; s.format = 0; // set soundfile filetype ! switch (filetype = Scheme_To_C_Symbol(argv[1], sndFileTypes)) { + case SND_FILETYPE_INCREMENTAL: + s.format |= SF_FORMAT_AU; + break; case SND_FILETYPE_WAV: s.format |= SF_FORMAT_WAV; *************** *** 116,121 **** // set soundfile data format ! switch (type = Scheme_To_C_Symbol(argv[1], sndTypes)) { case SND_CHAR: s.format |= SF_FORMAT_PCM_S8; --- 120,129 ---- // set soundfile data format ! switch (sampleformat = Scheme_To_C_Symbol(argv[2], sndTypes)) { + case SND_AUTO: + s.format |= SF_FORMAT_FLOAT; + s.format |= SF_ENDIAN_CPU; + break; case SND_CHAR: s.format |= SF_FORMAT_PCM_S8; *************** *** 133,139 **** s.format |= SF_FORMAT_DOUBLE; break; - case SND_INCREMENTAL: - s.format |= SF_FORMAT_FLOAT; - break; default: Primitive_Error("soundfile.m: internal inconsistency (format)"); --- 141,144 ---- *************** *** 141,149 **** // set soundfile channels ! s.channels = Get_Integer(argv[2]); if (s.channels <= 0) { ! Primitive_Error("illegal channel count: ~a", argv[2]); } --- 146,154 ---- // set soundfile channels ! s.channels = Get_Integer(argv[4]); if (s.channels <= 0) { ! Primitive_Error("illegal channel count: ~a", argv[4]); } *************** *** 164,168 **** } ! if (type == SND_INCREMENTAL) { if (mkdir(buffer, dmode) == -1) --- 169,173 ---- } ! if (filetype == SND_FILETYPE_INCREMENTAL) { if (mkdir(buffer, dmode) == -1) *************** *** 180,183 **** --- 185,194 ---- } + /* comment string */ + if (argc > 5) + { + comment = Get_String(argv[5]); + } + /* creating a soundfile with header using libsndfile: * simply open a file for write with an appropriate SF_INFO struct *************** *** 188,191 **** --- 199,211 ---- } + /* write comment */ + if (comment) + { + if (sf_set_string(sfd, SF_STR_COMMENT, comment)) + { + [FOOGlobalsManager schemeOutput: @"WARNING: writing the comment failed. maybe not supported by filetype\n"]; + } + } + if (sf_close(sfd)) { *************** *** 193,198 **** } - // Alloca_End; - return True; } --- 213,216 ---- *************** *** 201,205 **** static SchemeObject General_Soundfile_Operation (SchemeObject soundfile, ! int operation) { SchemeObject name = P_Tilde_Expand(Get_File_Name(soundfile)), ret; --- 219,224 ---- static SchemeObject General_Soundfile_Operation (SchemeObject soundfile, ! int operation, ! SchemeObject *params) { SchemeObject name = P_Tilde_Expand(Get_File_Name(soundfile)), ret; *************** *** 210,215 **** NSString *filename; - // Alloca_Begin; - cname = Get_String(name); if (stat(cname, &st) == -1) --- 229,232 ---- *************** *** 259,264 **** break; default: ! Primitive_Error("unsupported format ~a", ! Make_Integer([snd getDataFormat])); } } --- 276,285 ---- break; default: ! { ! int result = [snd getDataFormat]; ! RELEASE(snd); ! Primitive_Error("unsupported format ~a", ! Make_Integer(result)); ! } } } *************** *** 313,325 **** break; default: ! Primitive_Error("unsupported filetype ~a", ! Make_Integer([snd getFileType])); } break; default: ! Primitive_Error("internal inconsistency"); } RELEASE(snd); - // Alloca_End; return ret; --- 334,375 ---- break; default: ! { ! int result = [snd getFileType]; ! RELEASE(snd); ! Primitive_Error("unsupported filetype ~a", ! Make_Integer(result)); ! } } break; + case SND_SET_COMMENT: + { + NSString *comment = [NSString stringWithCString: Get_String(params[0])]; + ret = Make_String([[snd getFileComment] cString], + [[snd getFileComment] length]); + + if ([snd reopenWithMode: SND_WRITE] == NO) + { + RELEASE(snd); + Primitive_Error("reopening sndfile for writing comment failed."); + } + if ([snd setFileCommentFromString: comment]) + { + RELEASE(snd); + Primitive_Error("setting the comment failed. maybe not supported by file format."); + } + } + break; + case SND_COMMENT: + ret = Make_String([[snd getFileComment] cString], + [[snd getFileComment] length]); + break; + case SND_COMMENT_SIZE: + ret = Make_Integer([[snd getFileComment] length]); + break; default: ! RELEASE(snd); ! Primitive_Error("General_Soundfile_Operation: internal inconsistency"); } RELEASE(snd); return ret; *************** *** 327,339 **** ! #define SND_FUNC(name, type) \ ! static SchemeObject name(soundfile) SchemeObject soundfile; { \ ! return General_Soundfile_Operation(soundfile, type); } ! SND_FUNC(P_Soundfile_Srate, SND_SRATE) ! SND_FUNC(P_Soundfile_Format, SND_FORMAT) ! SND_FUNC(P_Soundfile_Length, SND_LENGTH) ! SND_FUNC(P_Soundfile_Channels, SND_CHANNELS) ! SND_FUNC(P_Soundfile_Filetype, SND_FILETYPE) --- 377,401 ---- ! #define SND_FUNC(name, type) \ ! static SchemeObject name(SchemeObject soundfile) \ ! { \ ! return General_Soundfile_Operation(soundfile, type, NULL); \ ! } ! SND_FUNC(P_Soundfile_Srate, SND_SRATE) ! SND_FUNC(P_Soundfile_Filetype, SND_FILETYPE) ! SND_FUNC(P_Soundfile_Format, SND_FORMAT) ! SND_FUNC(P_Soundfile_Length, SND_LENGTH) ! SND_FUNC(P_Soundfile_Channels, SND_CHANNELS) ! SND_FUNC(P_Soundfile_Comment, SND_COMMENT) ! SND_FUNC(P_Soundfile_Comment_Size, SND_COMMENT_SIZE) ! ! ! static SchemeObject ! P_Set_Soundfile_Comment (SchemeObject soundfile, ! SchemeObject comment) ! { ! return General_Soundfile_Operation(soundfile, SND_SET_COMMENT, &comment); ! } *************** *** 456,460 **** elk_init_soundfile () { ! DP(P_Make_Soundfile, "foo:make-soundfile", 3, 5, VARARGS); DP(P_Soundfile_Format, "foo:soundfile-format", 1, 1, EVAL); DP(P_Soundfile_Length, "foo:soundfile-length", 1, 1, EVAL); --- 518,522 ---- elk_init_soundfile () { ! DP(P_Make_Soundfile, "foo:make-soundfile", 5, 6, VARARGS); DP(P_Soundfile_Format, "foo:soundfile-format", 1, 1, EVAL); DP(P_Soundfile_Length, "foo:soundfile-length", 1, 1, EVAL); *************** *** 462,465 **** --- 524,530 ---- DP(P_Soundfile_Channels, "foo:soundfile-channels", 1, 1, EVAL); DP(P_Soundfile_Filetype, "foo:soundfile-filetype", 1, 1, EVAL); + DP(P_Set_Soundfile_Comment, "foo:set-soundfile-comment!", 2, 2, EVAL); + DP(P_Soundfile_Comment, "foo:soundfile-comment", 1, 1, EVAL); + DP(P_Soundfile_Comment_Size,"foo:soundfile-comment-size", 1, 1, EVAL); DP(P_Soundfile_Play, "foo:soundfile-play", 1, 5, VARARGS); Index: tell.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/tell.m,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tell.m 16 Aug 2004 04:42:26 -0000 1.16 --- tell.m 30 Aug 2004 15:58:59 -0000 1.17 *************** *** 283,287 **** NSString *name; SEL sel; - SchemeObject result; switch (TYPE(selector)) --- 283,286 ---- Index: types.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/types.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** types.m 13 Aug 2004 21:34:39 -0000 1.2 --- types.m 30 Aug 2004 15:58:59 -0000 1.3 *************** *** 154,159 **** elkfoo_type_t etype) { - void *ret; - switch (etype) { --- 154,157 ---- |
|
From: Martin R. <ru...@us...> - 2004-08-30 15:58:11
|
Update of /cvsroot/foo/foo/elkfoo/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26207 Modified Files: elkfoo.h Log Message: some minor changes in order to avoid warnings Index: elkfoo.h =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/include/elkfoo.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** elkfoo.h 15 Aug 2004 20:30:48 -0000 1.6 --- elkfoo.h 30 Aug 2004 15:58:01 -0000 1.7 *************** *** 125,129 **** typedef enum { - C_base = 0, C_char = 1, C_short = 2, --- 125,128 ---- *************** *** 159,201 **** } elkfoo_type_t; #define C_pointers C_VOID #define C_last C_UNDEF - /* type names */ - static char *elkfoo_type_names[] = - { /* corresponds to enum above */ - "DUMMY", /* 0 */ - "char", /* 1 */ - "short", /* 2 */ - "int", /* 3 */ - "long", /* 4 */ - "uchar", /* 5 */ - "ushort", /* 6 */ - "uint", /* 7 */ - "ulong", /* 8 */ - "float", /* 9 */ - "double", /* 10 */ - "void*", /* 11 */ - "char*", /* 12 */ - "short*", /* 13 */ - "int*", /* 14 */ - "long*", /* 15 */ - "uchar*", /* 16 */ - "ushort*", /* 17 */ - "uint*", /* 18 */ - "ulong*", /* 19 */ - "float*", /* 20 */ - "double*", /* 21 */ - "id", /* 22 */ - "class", /* 23 */ - "sel", /* 24 */ - "struct*", /* 25 */ - "union*", /* 26 */ - "array*", /* 27 */ - "undefined", /* 28 */ - "char**", /* 29 */ - "undefined*", /* 30 */ - }; - extern elkfoo_type_t A_Map_ObjC_Type (const char *); extern int A_Get_Buffer_From_Object (void *, SchemeObject, elkfoo_type_t); --- 158,165 ---- } elkfoo_type_t; + #define C_base 0 #define C_pointers C_VOID #define C_last C_UNDEF extern elkfoo_type_t A_Map_ObjC_Type (const char *); extern int A_Get_Buffer_From_Object (void *, SchemeObject, elkfoo_type_t); *************** *** 231,236 **** SchemeObject type; SchemeObject name; - SchemeObject format; SchemeObject filetype; int channels; int channel; --- 195,201 ---- SchemeObject type; SchemeObject name; SchemeObject filetype; + SchemeObject format; + SchemeObject comment; int channels; int channel; *************** *** 255,265 **** }; ! enum { SND_CHAR, SND_SHORT, SND_LONG, SND_FLOAT, SND_DOUBLE, SND_INCREMENTAL }; ! enum { SND_FILETYPE_WAV, SND_FILETYPE_AIFF, SND_FILETYPE_SND, ! SND_FILETYPE_PAF, SND_FILETYPE_SVX, SND_FILETYPE_NIST, ! SND_FILETYPE_VOC, SND_FILETYPE_IRCAM, SND_FILETYPE_WAV64, ! SND_FILETYPE_MAT4, SND_FILETYPE_MAT5, SND_FILETYPE_PVF, ! SND_FILETYPE_XI }; extern struct symbol sndTypes[]; --- 220,232 ---- }; ! int Scheme_To_C_Symbol (SchemeObject sym, struct symbol *p); ! enum { SND_AUTO, SND_CHAR, SND_SHORT, SND_LONG, SND_FLOAT, SND_DOUBLE }; ! ! enum { SND_FILETYPE_INCREMENTAL, SND_FILETYPE_WAV, SND_FILETYPE_AIFF, ! SND_FILETYPE_SND, SND_FILETYPE_PAF, SND_FILETYPE_SVX, ! SND_FILETYPE_NIST, SND_FILETYPE_VOC, SND_FILETYPE_IRCAM, ! SND_FILETYPE_WAV64, SND_FILETYPE_MAT4, SND_FILETYPE_MAT5, ! SND_FILETYPE_PVF, SND_FILETYPE_XI }; extern struct symbol sndTypes[]; |
|
From: Martin R. <ru...@us...> - 2004-08-30 15:50:10
|
Update of /cvsroot/foo/foo/libfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24729 Modified Files: FOOSineXoverXTable.m Log Message: include stdio.h for printf/stderr Index: FOOSineXoverXTable.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOSineXoverXTable.m,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FOOSineXoverXTable.m 27 Aug 2004 17:02:01 -0000 1.6 --- FOOSineXoverXTable.m 30 Aug 2004 15:50:00 -0000 1.7 *************** *** 36,39 **** --- 36,41 ---- #include <math.h> + #include <stdio.h> + #include "FOO/FOOSineXoverXTable.h" |
|
From: Ramon Gonzalez-A. <rg...@us...> - 2004-08-30 15:22:59
|
Update of /cvsroot/foo/foo/elkfoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20570 Modified Files: configure.ac Log Message: to include the new tree changes Index: configure.ac =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/configure.ac,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** configure.ac 26 Aug 2004 09:52:38 -0000 1.13 --- configure.ac 30 Aug 2004 15:22:50 -0000 1.14 *************** *** 289,295 **** scm/control/node/Makefile scm/control/processes/Makefile ! scm/tools/Makefile ! scm/tools/mixsnd/Makefile ! scm/tools/util/Makefile examples/Makefile examples/kernel/Makefile --- 289,295 ---- scm/control/node/Makefile scm/control/processes/Makefile ! scm/control/tools/Makefile ! scm/control/tools/mixsnd/Makefile ! scm/control/tools/util/Makefile examples/Makefile examples/kernel/Makefile |
|
From: Martin R. <ru...@us...> - 2004-08-30 14:35:30
|
Update of /cvsroot/foo/foo/libfoo/FOO In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11248 Modified Files: FOOSoundFile.h Log Message: added reopen method, comment support Index: FOOSoundFile.h =================================================================== RCS file: /cvsroot/foo/foo/libfoo/FOO/FOOSoundFile.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FOOSoundFile.h 13 Aug 2004 21:36:50 -0000 1.3 --- FOOSoundFile.h 30 Aug 2004 14:35:18 -0000 1.4 *************** *** 74,77 **** --- 74,78 ---- { NSString *_fileName; + NSString *_fileComment; SNDFILE *_file; SF_INFO _fileInfo; *************** *** 87,90 **** --- 88,92 ---- - (FOOSoundFile *) initWithFile: (NSString *)name; - (BOOL) open: (NSString *)name mode: (int)sndmode; + - (BOOL) reopenWithMode: (int)sndmode; - (BOOL) isOpen; - (BOOL) close; *************** *** 112,115 **** --- 114,120 ---- - (long) size; + - (NSString *) getFileComment; + - (int) setFileCommentFromString: (NSString *)fileComment; + - setCacheCapacity: (sf_count_t)frames; - prepareCache: (sf_count_t)fromFrame; |
|
From: Martin R. <ru...@us...> - 2004-08-30 14:35:13
|
Update of /cvsroot/foo/foo/libfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11202 Modified Files: FOOSoundFile.m Log Message: added reopen method, comment support Index: FOOSoundFile.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOSoundFile.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FOOSoundFile.m 16 Aug 2004 04:48:27 -0000 1.5 --- FOOSoundFile.m 30 Aug 2004 14:35:04 -0000 1.6 *************** *** 63,66 **** --- 63,67 ---- _file = NULL; _fileName = nil; + _fileComment = nil; _dynamics = NULL; _cache.ptr = NULL; *************** *** 77,80 **** --- 78,82 ---- _file = NULL; _fileName = nil; + _fileComment = nil; _dynamics = NULL; _cache.ptr = NULL; *************** *** 109,113 **** --- 111,121 ---- { int mode; + const char *comment; + if ([self isOpen] == YES && [self close] == NO) + { + return NO; + } + switch (sndmode) { *************** *** 148,151 **** --- 156,165 ---- // } + if (! (comment = sf_get_string(_file, SF_STR_COMMENT))) + { + comment = ""; + } + _fileComment = [[NSString alloc] initWithCString: comment]; + _fileMode = sndmode; _fileFrames = _fileInfo.frames; *************** *** 161,164 **** --- 175,189 ---- + - (BOOL) reopenWithMode: (int)sndmode + { + if (sndmode == _fileMode) + { + return YES; + } + + return [self open: [NSString stringWithString: _fileName] mode: sndmode]; + } // reopenWithMode: + + - (BOOL) isOpen { *************** *** 206,209 **** --- 231,239 ---- _fileName = nil; } + if (_fileComment != nil) + { + RELEASE(_fileComment); + _fileComment = nil; + } return YES; *************** *** 497,500 **** --- 527,564 ---- + - (NSString *) getFileComment + { + return _fileComment; + } // getFileComment + + + - (int) setFileCommentFromString: (NSString *)fileComment + { + int result; + + if ([self isOpen] == NO) + { + FOO_ERROR(YES, -98); + } + if (_fileMode == SND_READ) + { + FOO_ERROR(YES, -99); + } + + result = sf_set_string(_file, SF_STR_COMMENT, [fileComment cString]); + + if (! result) + { // succeeded, update _fileComment + if (_fileComment != nil) + { + RELEASE(_fileComment); + } + _fileComment = RETAIN(fileComment); + } + + return result; + } // setFileCommentFromString + + - validateDynamics { |