Browse Source

Many changes to support cmtools.

master
kevin 4 years ago
parent
commit
9d5697d9cd
17 changed files with 216 additions and 112 deletions
  1. 18
    5
      app/cmScore.c
  2. 1
    1
      app/cmScore.h
  3. 61
    51
      app/cmScoreProc.c
  4. 4
    3
      app/cmScoreProc.h
  5. 20
    0
      app/cmTimeLine.c
  6. 3
    1
      app/cmTimeLine.h
  7. 15
    12
      app/cmXScore.c
  8. 1
    1
      app/cmXScore.h
  9. 4
    4
      cmApBuf.c
  10. 32
    0
      cmAudioFile.c
  11. 3
    0
      cmAudioFile.h
  12. 22
    5
      cmMidiFile.c
  13. 1
    1
      cmMidiFile.h
  14. 4
    3
      cmPgmOpts.c
  15. 1
    1
      cmProc4.c
  16. 25
    23
      cmSvgWriter.c
  17. 1
    1
      cmSvgWriter.h

+ 18
- 5
app/cmScore.c View File

19
 #include "cmFile.h"
19
 #include "cmFile.h"
20
 #include "cmScore.h"
20
 #include "cmScore.h"
21
 #include "cmVectOpsTemplateMain.h"
21
 #include "cmVectOpsTemplateMain.h"
22
+#include "cmRptFile.h"
22
 
23
 
23
 cmScH_t cmScNullHandle  = cmSTATIC_NULL_HANDLE;
24
 cmScH_t cmScNullHandle  = cmSTATIC_NULL_HANDLE;
24
 
25
 
2441
 
2442
 
2442
 void _cmScorePrintEvent( cmSc_t* p, const cmScoreEvt_t* r, unsigned i, cmRpt_t* rpt )
2443
 void _cmScorePrintEvent( cmSc_t* p, const cmScoreEvt_t* r, unsigned i, cmRpt_t* rpt )
2443
 {
2444
 {
2444
-  bool eolFl = true;
2445
+  //bool eolFl = true;
2445
   switch(r->type)
2446
   switch(r->type)
2446
   {
2447
   {
2447
     case kBarEvtScId:
2448
     case kBarEvtScId:
2469
       break;
2470
       break;
2470
 
2471
 
2471
     default:
2472
     default:
2472
-      eolFl = false;
2473
+      //eolFl = false;
2473
       break;
2474
       break;
2474
   }
2475
   }
2475
 
2476
 
2741
 }
2742
 }
2742
 
2743
 
2743
 
2744
 
2744
-void cmScoreReport( cmCtx_t* ctx, const cmChar_t* fn )
2745
+void cmScoreReport( cmCtx_t* ctx, const cmChar_t* fn, const cmChar_t* outFn )
2745
 {
2746
 {
2746
-  cmScH_t h = cmScNullHandle;
2747
+  cmScH_t      h   = cmScNullHandle;
2748
+  cmRptFileH_t fH  = cmRptFileNullHandle;
2749
+  cmRpt_t*     rpt = &ctx->rpt;
2750
+  
2751
+  if( outFn != NULL )
2752
+    if( cmRptFileCreate( ctx, &fH, outFn, NULL ) == kOkRfRC )
2753
+      rpt =   cmRptFileRpt( fH );
2754
+
2755
+  
2747
   if( cmScoreInitialize(ctx,&h,fn,0,NULL,0,NULL,NULL, cmSymTblNullHandle ) != kOkScRC )
2756
   if( cmScoreInitialize(ctx,&h,fn,0,NULL,0,NULL,NULL, cmSymTblNullHandle ) != kOkScRC )
2748
     return;
2757
     return;
2749
 
2758
 
2750
-  cmScorePrint(h,&ctx->rpt);
2759
+  cmScorePrint(h,rpt);
2751
 
2760
 
2752
   cmScoreFinalize(&h);
2761
   cmScoreFinalize(&h);
2762
+
2763
+  if( cmRptFileIsValid( fH ) )
2764
+    cmRptFileClose( &fH );
2765
+
2753
 }
2766
 }
2754
 
2767
 
2755
 void cmScoreTest( cmCtx_t* ctx, const cmChar_t* fn )
2768
 void cmScoreTest( cmCtx_t* ctx, const cmChar_t* fn )

+ 1
- 1
app/cmScore.h View File

282
 
282
 
283
   // Print open the score file 'fn' and report the contents.  This function
283
   // Print open the score file 'fn' and report the contents.  This function
284
   // simply wraps calls to cmScoreInitialize() and cmScorePrint().
284
   // simply wraps calls to cmScoreInitialize() and cmScorePrint().
285
-  void          cmScoreReport( cmCtx_t* ctx, const cmChar_t* fn );
285
+  void          cmScoreReport( cmCtx_t* ctx, const cmChar_t* fn, const cmChar_t* outFn );
286
 
286
 
287
   void          cmScoreTest( cmCtx_t* ctx, const cmChar_t* fn );
287
   void          cmScoreTest( cmCtx_t* ctx, const cmChar_t* fn );
288
     
288
     

+ 61
- 51
app/cmScoreProc.c View File

339
 unsigned _cmSpMeasSectCount( _cmSpMeasProc_t* m )
339
 unsigned _cmSpMeasSectCount( _cmSpMeasProc_t* m )
340
 {
340
 {
341
   const _cmSpMeas_t* mp = m->list_beg;
341
   const _cmSpMeas_t* mp = m->list_beg;
342
-  unsigned n = 0;
343
-  for(; mp != NULL; mp=mp->link)
342
+  unsigned           n  = 0;
343
+  unsigned           M  = 0;
344
+  
345
+  for(; mp != NULL; mp=mp->link,++M)
344
     n += mp->setPtr->sectCnt;
346
     n += mp->setPtr->sectCnt;
345
-
347
+  
346
   return n;
348
   return n;
347
 }
349
 }
348
 
350
 
359
   cmFileH_t fH = cmFileNullHandle;
361
   cmFileH_t fH = cmFileNullHandle;
360
   cmSpRC_t rc = kOkSpRC;
362
   cmSpRC_t rc = kOkSpRC;
361
   unsigned i,j,k;
363
   unsigned i,j,k;
364
+  unsigned scnt = _cmSpMeasSectCount(m);
365
+  
362
   _cmSpMeas_t* mp = m->list_beg;
366
   _cmSpMeas_t* mp = m->list_beg;
363
 
367
 
364
-  unsigned scnt = _cmSpMeasSectCount(m);
365
   _cmSpMeasSect_t sarray[ scnt ];
368
   _cmSpMeasSect_t sarray[ scnt ];
366
   for(i=0,k=0; k<scnt && mp!=NULL; ++i,mp=mp->link)
369
   for(i=0,k=0; k<scnt && mp!=NULL; ++i,mp=mp->link)
367
   {
370
   {
375
         { assert(0); }
378
         { assert(0); }
376
     }
379
     }
377
 
380
 
381
+
378
     for(j=0; j<mp->setPtr->sectCnt; ++j,++k)
382
     for(j=0; j<mp->setPtr->sectCnt; ++j,++k)
379
     {
383
     {
384
+      assert(k<scnt);
385
+        
380
       _cmSpMeasSect_t* r = sarray + k;
386
       _cmSpMeasSect_t* r = sarray + k;
381
 
387
 
382
-        r->srcSeqId        = mp->markPtr->obj.seqId,
383
-        r->srcMarkNameStr  = cmStringNullGuard(mp->markPtr->obj.name),
384
-        r->srcTypeId       = mp->setPtr->varId,
385
-        r->srcTypeLabelStr = typeLabel,
386
-        r->dstScLocIdx     = mp->setPtr->sectArray[j]->locPtr->index,
387
-        r->dstEvtIdx       = mp->setPtr->sectArray[j]->begEvtIndex,
388
-        r->dstSectLabelStr = cmStringNullGuard(mp->setPtr->sectArray[j]->label),
389
-        r->value           = mp->value,
390
-        r->cost            = mp->cost;
391
-
388
+      r->srcSeqId        = mp->markPtr->obj.seqId;
389
+      r->srcMarkNameStr  = cmStringNullGuard(mp->markPtr->obj.name);
390
+      r->srcTypeId       = mp->setPtr->varId;
391
+      r->srcTypeLabelStr = typeLabel;
392
+      r->dstScLocIdx     = mp->setPtr->sectArray[j]->locPtr->index;
393
+      r->dstEvtIdx       = mp->setPtr->sectArray[j]->begEvtIndex;
394
+      r->dstSectLabelStr = cmStringNullGuard(mp->setPtr->sectArray[j]->label);
395
+      r->value           = mp->value;
396
+      r->cost            = mp->cost;
392
     }
397
     }
393
   }
398
   }
394
 
399
 
395
-  assert(mp==NULL && k==scnt);
400
+  // assert(mp==NULL && k==scnt); if the ending mp->setPtr->sectCnt==0 then this assert will not work correctly even though there would be no data inconsistency
396
 
401
 
397
   qsort(sarray,scnt,sizeof(sarray[0]),_cmSpMeasSectCompare);
402
   qsort(sarray,scnt,sizeof(sarray[0]),_cmSpMeasSectCompare);
398
 
403
 
408
   {
413
   {
409
     _cmSpMeasSect_t* r = sarray + i;
414
     _cmSpMeasSect_t* r = sarray + i;
410
 
415
 
411
-      cmFilePrintf(fH,"[  \"%s\"  \"%s\"  %f %f  %i %i %i \"%s\" %i ]\n",
412
-        r->dstSectLabelStr,
413
-        r->srcTypeLabelStr,
414
-        r->value,
415
-        r->cost,
416
-        r->dstScLocIdx,
417
-        r->dstEvtIdx,
418
-        r->srcSeqId,
419
-        r->srcMarkNameStr,
420
-        r->srcTypeId
421
-                   );
416
+    cmFilePrintf(fH,"[  \"%s\"  \"%s\"  %f %f  %i %i %i \"%s\" %i ]\n",
417
+      r->dstSectLabelStr,
418
+      r->srcTypeLabelStr,
419
+      r->value,
420
+      r->cost,
421
+      r->dstScLocIdx,
422
+      r->dstEvtIdx,
423
+      r->srcSeqId,
424
+      r->srcMarkNameStr,
425
+      r->srcTypeId
426
+                 );
422
 
427
 
423
   }
428
   }
424
 
429
 
425
   /*
430
   /*
426
-  mp = sp->list_beg;
427
-  for(; mp!=NULL; mp=mp->link)
428
-  {
431
+    mp = sp->list_beg;
432
+    for(; mp!=NULL; mp=mp->link)
433
+    {
429
 
434
 
430
     for(i=0; i<mp->setPtr->sectCnt; ++i)
435
     for(i=0; i<mp->setPtr->sectCnt; ++i)
431
     {
436
     {
432
-      cmFilePrintf(fH,"[ %i \"%s\" %i \"%s\" %i %i \"%s\" %f %f ]\n",
433
-        mp->markPtr->obj.seqId,
434
-        cmStringNullGuard(mp->markPtr->obj.name),
435
-        mp->setPtr->varId,
436
-        typeLabel,
437
-        mp->setPtr->sectArray[i]->locPtr->index,
438
-        mp->setPtr->sectArray[i]->begEvtIndex,
439
-        cmStringNullGuard(mp->setPtr->sectArray[i]->label),
440
-        mp->value,
441
-        mp->cost );
437
+    cmFilePrintf(fH,"[ %i \"%s\" %i \"%s\" %i %i \"%s\" %f %f ]\n",
438
+    mp->markPtr->obj.seqId,
439
+    cmStringNullGuard(mp->markPtr->obj.name),
440
+    mp->setPtr->varId,
441
+    typeLabel,
442
+    mp->setPtr->sectArray[i]->locPtr->index,
443
+    mp->setPtr->sectArray[i]->begEvtIndex,
444
+    cmStringNullGuard(mp->setPtr->sectArray[i]->label),
445
+    mp->value,
446
+    mp->cost );
442
     } 
447
     } 
443
-  }
448
+    }
444
   */
449
   */
445
 
450
 
446
   cmFilePrintf(fH,"\n]\n}\n");
451
   cmFilePrintf(fH,"\n]\n}\n");
516
 }
521
 }
517
 
522
 
518
 
523
 
519
-cmSpRC_t _cmScoreProcGenAllMeasurementsMain(cmCtx_t* ctx)
524
+cmSpRC_t _cmScoreProcGenAllMeasurementsMain(cmCtx_t* ctx, const cmChar_t* pgmRsrcFn, const cmChar_t* outFn)
520
 {
525
 {
521
-  const cmChar_t*  rsrcFn = "/home/kevin/.kc/time_line.js";
522
-  const cmChar_t*  outFn  = "/home/kevin/src/cmkc/src/kc/data/meas0.js";
526
+  //const cmChar_t*  rsrcFn = "/home/kevin/.kc/time_line.js";
527
+  //const cmChar_t*  outFn  = "/home/kevin/src/cmkc/src/kc/data/meas0.js";
523
 
528
 
524
   cmSpRC_t         rc = kOkSpRC;
529
   cmSpRC_t         rc = kOkSpRC;
525
   _cmSpMeasProc_t* m  = cmMemAllocZ(_cmSpMeasProc_t,1);
530
   _cmSpMeasProc_t* m  = cmMemAllocZ(_cmSpMeasProc_t,1);
531
   cmRptPrintf(&ctx->rpt,"Score Performance Evaluation Start\n");
536
   cmRptPrintf(&ctx->rpt,"Score Performance Evaluation Start\n");
532
 
537
 
533
   // initialize the score processor
538
   // initialize the score processor
534
-  if((rc = _cmScoreProcInit(ctx,sp,rsrcFn,_cmSpProcMeasCb,_cmSpMatchMeasCb,m)) != kOkSpRC )
539
+  if((rc = _cmScoreProcInit(ctx,sp,pgmRsrcFn,_cmSpProcMeasCb,_cmSpMatchMeasCb,m)) != kOkSpRC )
535
     goto errLabel;
540
     goto errLabel;
536
 
541
 
537
   // allocate the performance evaluation measurement object
542
   // allocate the performance evaluation measurement object
719
   return rc;
724
   return rc;
720
 }
725
 }
721
 
726
 
722
-cmSpRC_t _cmScoreProcGenAssocMain(cmCtx_t* ctx)
727
+cmSpRC_t _cmScoreProcGenAssocMain(cmCtx_t* ctx, const cmChar_t* pgmRsrcFn, const cmChar_t* outFn )
723
 {
728
 {
724
-  const cmChar_t*  rsrcFn = "/home/kevin/.kc/time_line.js";
725
-  const cmChar_t*  outFn  = "/home/kevin/src/cmkc/src/kc/data/takeSeqBldr0.js";
729
+  //const cmChar_t*  pgmRsrcFn = "/home/kevin/.kc/time_line.js";
730
+  //const cmChar_t*  outFn  = "/home/kevin/src/cmkc/src/kc/data/takeSeqBldr0.js";
726
   cmSpRC_t         rc     = kOkSpRC;
731
   cmSpRC_t         rc     = kOkSpRC;
727
   cmSpAssocProc_t* m      = cmMemAllocZ(cmSpAssocProc_t,1);
732
   cmSpAssocProc_t* m      = cmMemAllocZ(cmSpAssocProc_t,1);
728
   cmSp_t           s;
733
   cmSp_t           s;
749
   }
754
   }
750
 
755
 
751
   // initialize the score processor
756
   // initialize the score processor
752
-  if((rc = _cmScoreProcInit(ctx,sp,rsrcFn,_cmSpProcAssocCb,_cmSpMatchAssocCb, m)) != kOkSpRC )
757
+  if((rc = _cmScoreProcInit(ctx,sp,pgmRsrcFn,_cmSpProcAssocCb,_cmSpMatchAssocCb, m)) != kOkSpRC )
753
     goto errLabel;
758
     goto errLabel;
754
 
759
 
755
   m->sp = sp;
760
   m->sp = sp;
804
 
809
 
805
 //==================================================================================================
810
 //==================================================================================================
806
 
811
 
807
-cmSpRC_t cmScoreProc(cmCtx_t* ctx)
812
+cmSpRC_t cmScoreProc(cmCtx_t* ctx, const cmChar_t* sel, const cmChar_t* pgmRsrcFn, const cmChar_t* outFn)
808
 {
813
 {
809
   cmSpRC_t rc = kOkSpRC;
814
   cmSpRC_t rc = kOkSpRC;
810
 
815
 
811
-  //_cmScoreProcGenAllMeasurementsMain(ctx);
812
-  _cmScoreProcGenAssocMain(ctx);
816
+  if( strcmp(sel,"meas") == 0 )
817
+    _cmScoreProcGenAllMeasurementsMain(ctx,pgmRsrcFn,outFn);
818
+  else
819
+    if( strcmp(sel,"assoc") == 0 )
820
+      _cmScoreProcGenAssocMain(ctx,pgmRsrcFn,outFn);
821
+    else
822
+      cmErrMsg(&ctx->err,kSelectorFailSpRC,"Unknown selector %s.", cmStringNullGuard(sel));
813
 
823
 
814
   return rc;
824
   return rc;
815
   
825
   

+ 4
- 3
app/cmScoreProc.h View File

17
     kTimeLineFailSpRC,
17
     kTimeLineFailSpRC,
18
     kScoreMatchFailSpRC,
18
     kScoreMatchFailSpRC,
19
     kFileFailSpRC,
19
     kFileFailSpRC,
20
-    kProcFailSpRC
20
+    kProcFailSpRC,
21
+    kSelectorFailSpRC
21
   };
22
   };
22
 
23
 
23
 
24
 
24
-  cmSpRC_t  cmScoreProc(cmCtx_t* ctx );
25
-
25
+  cmSpRC_t  cmScoreProc(cmCtx_t* ctx, const cmChar_t* sel, const cmChar_t* pgmRsrcFn, const cmChar_t* outFn);
26
+  
26
   //)
27
   //)
27
   
28
   
28
 #ifdef __cplusplus
29
 #ifdef __cplusplus

+ 20
- 0
app/cmTimeLine.c View File

15
 #include "cmFileSys.h"
15
 #include "cmFileSys.h"
16
 #include "cmTimeLine.h"
16
 #include "cmTimeLine.h"
17
 #include "cmOnset.h"
17
 #include "cmOnset.h"
18
+#include "cmRptFile.h"
18
 
19
 
19
 // id's used to track the type of a serialized object
20
 // id's used to track the type of a serialized object
20
 enum
21
 enum
1802
   return cmTimeLineFinalize(&h);
1803
   return cmTimeLineFinalize(&h);
1803
 }
1804
 }
1804
 
1805
 
1806
+cmTlRC_t cmTimeLineReport( cmCtx_t* ctx, const cmChar_t* tlFn, const cmChar_t* tlPrefixPath, const cmChar_t* rptFn )
1807
+{
1808
+  cmTlRC_t rc;
1809
+  cmRptFileH_t  rptH = cmRptFileNullHandle;
1810
+  
1811
+  if(( rc = cmRptFileCreate(ctx, &rptH, rptFn, NULL )) != kOkRfRC )
1812
+  {
1813
+    rc = cmErrMsg(&ctx->err,kRptFileFailTlRC,"Unable to open the report file: %s\n",cmStringNullGuard(rptFn));
1814
+    goto errLabel;    
1815
+  }
1816
+
1817
+  rc = cmTimeLinePrintFn(ctx, tlFn, tlPrefixPath, cmRptFileRpt(rptH) );
1818
+
1819
+ errLabel:
1820
+  cmRptFileClose(&rptH);
1821
+
1822
+  return rc;  
1823
+}
1824
+
1805
 
1825
 
1806
 cmTlRC_t     cmTimeLineTest( cmCtx_t* ctx, const cmChar_t* jsFn, const cmChar_t* prefixPath )
1826
 cmTlRC_t     cmTimeLineTest( cmCtx_t* ctx, const cmChar_t* jsFn, const cmChar_t* prefixPath )
1807
 {
1827
 {

+ 3
- 1
app/cmTimeLine.h View File

27
     kFinalizeFailTlRC,
27
     kFinalizeFailTlRC,
28
     kInvalidSeqIdTlRC,
28
     kInvalidSeqIdTlRC,
29
     kOnsetFailTlRC,
29
     kOnsetFailTlRC,
30
-    kAssertFailTlRC
30
+    kAssertFailTlRC,
31
+    kRptFileFailTlRC
31
   };
32
   };
32
 
33
 
33
   typedef enum
34
   typedef enum
217
 
218
 
218
   cmTlRC_t cmTimeLinePrint( cmTlH_t h, cmRpt_t* rpt );
219
   cmTlRC_t cmTimeLinePrint( cmTlH_t h, cmRpt_t* rpt );
219
   cmTlRC_t cmTimeLinePrintFn( cmCtx_t* ctx, const cmChar_t* tlFn, const cmChar_t* prefixPath, cmRpt_t* rpt );
220
   cmTlRC_t cmTimeLinePrintFn( cmCtx_t* ctx, const cmChar_t* tlFn, const cmChar_t* prefixPath, cmRpt_t* rpt );
221
+  cmTlRC_t cmTimeLineReport( cmCtx_t* ctx, const cmChar_t* tlFn, const cmChar_t* prefixPath, const cmChar_t* rptFn );
220
 
222
 
221
   cmTlRC_t cmTimeLineTest( cmCtx_t* ctx, const cmChar_t* tlFn, const cmChar_t* prefixPath  );
223
   cmTlRC_t cmTimeLineTest( cmCtx_t* ctx, const cmChar_t* tlFn, const cmChar_t* prefixPath  );
222
 
224
 

+ 15
- 12
app/cmXScore.c View File

3856
 
3856
 
3857
 }
3857
 }
3858
 
3858
 
3859
-cmXsRC_t _cmXsWriteMidiSvg( cmCtx_t* ctx, cmXScore_t* p, cmXsMidiFile_t* mf, const cmChar_t* dir, const cmChar_t* fn )
3859
+cmXsRC_t _cmXsWriteMidiSvg( cmCtx_t* ctx, cmXScore_t* p, cmXsMidiFile_t* mf, const cmChar_t* svgFn, bool standAloneFl, bool panZoomFl )
3860
 {
3860
 {
3861
   cmXsRC_t        rc         = kOkXsRC;
3861
   cmXsRC_t        rc         = kOkXsRC;
3862
   cmSvgH_t        svgH       = cmSvgNullHandle;
3862
   cmSvgH_t        svgH       = cmSvgNullHandle;
3863
   cmXsSvgEvt_t*   e          = mf->elist;
3863
   cmXsSvgEvt_t*   e          = mf->elist;
3864
   unsigned        noteHeight = 10;
3864
   unsigned        noteHeight = 10;
3865
-  cmChar_t*       fn0        = cmMemAllocStr( fn );  
3866
-  const cmChar_t* svgFn      = cmFsMakeFn(dir,fn0 = cmTextAppendSS(fn0,"_midi_svg"),"html",NULL);
3865
+  //cmChar_t*       fn0        = cmMemAllocStr( fn );  
3866
+  //const cmChar_t* svgFn      = cmFsMakeFn(dir,fn0 = cmTextAppendSS(fn0,"_midi_svg"),"html",NULL);
3867
   const cmChar_t* cssFn      = cmFsMakeFn(NULL,"score_midi_svg","css",NULL);
3867
   const cmChar_t* cssFn      = cmFsMakeFn(NULL,"score_midi_svg","css",NULL);
3868
   cmChar_t*       t0         = NULL;  // temporary dynamic string
3868
   cmChar_t*       t0         = NULL;  // temporary dynamic string
3869
   unsigned        i          = 0;
3869
   unsigned        i          = 0;
3870
   const cmXsSvgEvt_t* e0 = NULL;
3870
   const cmXsSvgEvt_t* e0 = NULL;
3871
-  cmMemFree(fn0);
3871
+  //cmMemFree(fn0);
3872
   
3872
   
3873
   // create the SVG writer
3873
   // create the SVG writer
3874
   if( cmSvgWriterAlloc(ctx,&svgH) != kOkSvgRC )
3874
   if( cmSvgWriterAlloc(ctx,&svgH) != kOkSvgRC )
3960
     cmErrMsg(&p->err,kSvgFailXsRC,"SVG element insert failed.");
3960
     cmErrMsg(&p->err,kSvgFailXsRC,"SVG element insert failed.");
3961
 
3961
 
3962
   if( rc == kOkXsRC )
3962
   if( rc == kOkXsRC )
3963
-    if( cmSvgWriterWrite(svgH,cssFn,svgFn) != kOkSvgRC )
3963
+    if( cmSvgWriterWrite(svgH,cssFn,svgFn,standAloneFl, panZoomFl) != kOkSvgRC )
3964
       rc = cmErrMsg(&p->err,kSvgFailXsRC,"SVG file write to '%s' failed.",cmStringNullGuard(svgFn));
3964
       rc = cmErrMsg(&p->err,kSvgFailXsRC,"SVG file write to '%s' failed.",cmStringNullGuard(svgFn));
3965
   
3965
   
3966
  errLabel:
3966
  errLabel:
3967
   cmSvgWriterFree(&svgH);
3967
   cmSvgWriterFree(&svgH);
3968
-  cmFsFreeFn(svgFn);
3968
+  //cmFsFreeFn(svgFn);
3969
   cmFsFreeFn(cssFn);
3969
   cmFsFreeFn(cssFn);
3970
   cmMemFree(t0);
3970
   cmMemFree(t0);
3971
   
3971
   
4001
   mf->eol = e;
4001
   mf->eol = e;
4002
 }
4002
 }
4003
 
4003
 
4004
-cmXsRC_t _cmXScoreGenSvg( cmCtx_t* ctx, cmXsH_t h, int beginMeasNumb, const cmChar_t* dir, const cmChar_t* fn )
4004
+cmXsRC_t _cmXScoreGenSvg( cmCtx_t* ctx, cmXsH_t h, int beginMeasNumb, const cmChar_t* svgFn, bool standAloneFl, bool panZoomFl )
4005
 {
4005
 {
4006
   cmXScore_t* p  = _cmXScoreHandleToPtr(h);
4006
   cmXScore_t* p  = _cmXScoreHandleToPtr(h);
4007
   cmXsPart_t* pp = p->partL;
4007
   cmXsPart_t* pp = p->partL;
4058
           _cmXsPushSvgEvent(p,&mf,note->flags,note->tick,note->duration,0,d0,127,NULL);
4058
           _cmXsPushSvgEvent(p,&mf,note->flags,note->tick,note->duration,0,d0,127,NULL);
4059
           continue;
4059
           continue;
4060
         }
4060
         }
4061
-        
4062
       }
4061
       }
4063
     }
4062
     }
4064
   }
4063
   }
4065
   
4064
   
4066
-  return _cmXsWriteMidiSvg( ctx, p, &mf, dir, fn );
4065
+  return _cmXsWriteMidiSvg( ctx, p, &mf, svgFn, standAloneFl, panZoomFl );
4067
 }
4066
 }
4068
 
4067
 
4069
 
4068
 
4073
   const cmChar_t* editFn,
4072
   const cmChar_t* editFn,
4074
   const cmChar_t* csvOutFn,
4073
   const cmChar_t* csvOutFn,
4075
   const cmChar_t* midiOutFn,
4074
   const cmChar_t* midiOutFn,
4075
+  const cmChar_t* svgOutFn,
4076
   bool            reportFl,
4076
   bool            reportFl,
4077
   int             beginMeasNumb,
4077
   int             beginMeasNumb,
4078
-  int             beginBPM )
4078
+  int             beginBPM,
4079
+  bool            standAloneFl,
4080
+  bool            panZoomFl )
4079
 {
4081
 {
4080
   cmXsRC_t rc;
4082
   cmXsRC_t rc;
4081
   cmXsH_t h = cmXsNullHandle;
4083
   cmXsH_t h = cmXsNullHandle;
4113
     
4115
     
4114
     _cmXsIsMidiFileValid(ctx, h, pp->dirStr, pp->fnStr );
4116
     _cmXsIsMidiFileValid(ctx, h, pp->dirStr, pp->fnStr );
4115
     
4117
     
4116
-    _cmXScoreGenSvg( ctx, h, beginMeasNumb, pp->dirStr, pp->fnStr );
4117
-
4118
     cmFsFreePathParts(pp);
4118
     cmFsFreePathParts(pp);
4119
     
4119
     
4120
   }
4120
   }
4121
 
4121
 
4122
+  if( svgOutFn != NULL )
4123
+    _cmXScoreGenSvg( ctx, h, beginMeasNumb, svgOutFn, standAloneFl, panZoomFl );
4124
+
4122
   if(reportFl)
4125
   if(reportFl)
4123
     cmXScoreReport(h,&ctx->rpt,true);
4126
     cmXScoreReport(h,&ctx->rpt,true);
4124
 
4127
 

+ 1
- 1
app/cmXScore.h View File

72
   // Set reportFl to true to print a report of the score following processing.
72
   // Set reportFl to true to print a report of the score following processing.
73
   // Set begMeasNumb to the first measure the to be written to the output csv, MIDI and SVG files.
73
   // Set begMeasNumb to the first measure the to be written to the output csv, MIDI and SVG files.
74
   // Set begBPM to 0 to use the tempo from the score otherwise set it to the tempo at begMeasNumb.
74
   // Set begBPM to 0 to use the tempo from the score otherwise set it to the tempo at begMeasNumb.
75
-  cmXsRC_t cmXScoreTest( cmCtx_t* ctx, const cmChar_t* xmlFn, const cmChar_t* reorderFn, const cmChar_t* csvOutFn, const cmChar_t* midiOutFn, bool reportFl, int begMeasNumb, int begBPM );
75
+  cmXsRC_t cmXScoreTest( cmCtx_t* ctx, const cmChar_t* xmlFn, const cmChar_t* reorderFn, const cmChar_t* csvOutFn, const cmChar_t* midiOutFn, const cmChar_t* svgOutFn, bool reportFl, int begMeasNumb, int begBPM, bool svgStandAloneFl, bool svgPanZoomFl );
76
   
76
   
77
 #ifdef __cplusplus
77
 #ifdef __cplusplus
78
 }
78
 }

+ 4
- 4
cmApBuf.c View File

610
           n0 = pp->audioFramesCnt;
610
           n0 = pp->audioFramesCnt;
611
 
611
 
612
         cmApSample_t* bpp   = ((cmApSample_t*)pp->audioBytesPtr) + j;
612
         cmApSample_t* bpp   = ((cmApSample_t*)pp->audioBytesPtr) + j;
613
-        cmApSample_t* dp    = bpp;
613
+        //cmApSample_t* dp    = bpp;
614
         bool          enaFl = cmIsFlag(cp->fl,kChApFl) && cmIsFlag(cp->fl,kMuteApFl)==false;
614
         bool          enaFl = cmIsFlag(cp->fl,kChApFl) && cmIsFlag(cp->fl,kMuteApFl)==false;
615
 
615
 
616
         unsigned decrSmpN = 0;
616
         unsigned decrSmpN = 0;
625
         else                    // otherwise copy samples from the output buffer to the packet
625
         else                    // otherwise copy samples from the output buffer to the packet
626
         {
626
         {
627
           const cmApSample_t* sp = enaFl ? cp->b + cp->oi : _cmApBuf.zeroBuf;
627
           const cmApSample_t* sp = enaFl ? cp->b + cp->oi : _cmApBuf.zeroBuf;
628
-          const cmApSample_t* ep = sp + n0;
628
+          //const cmApSample_t* ep = sp + n0;
629
 
629
 
630
           unsigned pi = cp->oi;
630
           unsigned pi = cp->oi;
631
           cp->oi = _cmApCopyOutSamples( enaFl ? cp->b : _cmApBuf.zeroBuf, op->n, cp->oi, (cmApSample_t*)pp->audioBytesPtr, pp->audioFramesCnt, pp->chCnt, j, op->srateMult, cp->gain, &cp->s0 );
631
           cp->oi = _cmApCopyOutSamples( enaFl ? cp->b : _cmApBuf.zeroBuf, op->n, cp->oi, (cmApSample_t*)pp->audioBytesPtr, pp->audioFramesCnt, pp->chCnt, j, op->srateMult, cp->gain, &cp->s0 );
1061
       }
1061
       }
1062
 
1062
 
1063
       cmRptPrintf(rpt,"%s - i:%7i o:%7i f:%7i n:%7i err %s:%7i  mtr:%5.4f ",
1063
       cmRptPrintf(rpt,"%s - i:%7i o:%7i f:%7i n:%7i err %s:%7i  mtr:%5.4f ",
1064
-        j==0?"IN":"OUT",
1065
-        ii,oi,fn,ip->n, (j==0?"over":"under"), ip->faultCnt, mtr);
1064
+        j==0?"IN ":"OUT",
1065
+        ii,oi,fn,ip->n, (j==0?"over ":"under"), ip->faultCnt, mtr);
1066
       
1066
       
1067
     }
1067
     }
1068
 
1068
 

+ 32
- 0
cmAudioFile.c View File

9
 #include "cmAudioFile.h"
9
 #include "cmAudioFile.h"
10
 #include "cmMath.h"
10
 #include "cmMath.h"
11
 #include "cmFileSys.h"
11
 #include "cmFileSys.h"
12
+#include "cmRptFile.h"
12
 
13
 
13
 
14
 
14
 // #define _24to32_aif( p ) ((int)( ((p[0]>127?255:0) << 24) + (((int)p[0]) << 16) +  (((int)p[1]) <<8) + p[2]))  // no-swap equivalent
15
 // #define _24to32_aif( p ) ((int)( ((p[0]>127?255:0) << 24) + (((int)p[0]) << 16) +  (((int)p[1]) <<8) + p[2]))  // no-swap equivalent
1804
   return cmAudioFileDelete(&h);
1805
   return cmAudioFileDelete(&h);
1805
 }
1806
 }
1806
 
1807
 
1808
+cmRC_t       cmAudioFileReportInfo( cmCtx_t* ctx, const cmChar_t* audioFn, const cmChar_t* rptFn )
1809
+{
1810
+  cmRC_t            rc   = kOkAfRC;
1811
+  cmRptFileH_t      rptH = cmRptFileNullHandle;
1812
+  cmAudioFileInfo_t afInfo;
1813
+  memset(&afInfo,0,sizeof(afInfo));
1814
+  cmAudioFileH_t    afH  = cmAudioFileNewOpen( audioFn, &afInfo, &rc, &ctx->rpt );
1815
+
1816
+  
1817
+  if( rc != kOkAfRC )
1818
+  {
1819
+    rc = cmErrMsg(&ctx->err,rc,"Audio file '%s' open failed.",cmStringNullGuard(audioFn));
1820
+    goto errLabel;
1821
+  }
1822
+  
1823
+  if(( rc = cmRptFileCreate(ctx, &rptH, rptFn, NULL )) != kOkRfRC )
1824
+  {
1825
+    rc = cmErrMsg(&ctx->err,kRptFileFailAfRC,"Unable to open the report file: %s\n",cmStringNullGuard(rptFn));
1826
+    goto errLabel;    
1827
+  }
1828
+  
1829
+  cmAudioFilePrintInfo(&afInfo,cmRptFileRpt(rptH));
1830
+  
1831
+ errLabel:
1832
+  cmRptFileClose(&rptH);
1833
+  cmAudioFileDelete(&afH);
1834
+
1835
+ return rc;
1836
+}
1837
+
1838
+
1807
 cmRC_t     cmAudioFileSetSrate( const cmChar_t* fn, unsigned srate )
1839
 cmRC_t     cmAudioFileSetSrate( const cmChar_t* fn, unsigned srate )
1808
 {
1840
 {
1809
   cmRC_t  rc = kOkAfRC;
1841
   cmRC_t  rc = kOkAfRC;

+ 3
- 0
cmAudioFile.h View File

36
     kInvalidFileModeAfRC,
36
     kInvalidFileModeAfRC,
37
     kInvalidHandleAfRC,
37
     kInvalidHandleAfRC,
38
     kInvalidChCountAfRC,
38
     kInvalidChCountAfRC,
39
+    kRptFileFailAfRC,
39
     kUnknownErrAfRC
40
     kUnknownErrAfRC
40
   };
41
   };
41
 
42
 
271
   // Print the cmAudioFileInfo_t to a file.
272
   // Print the cmAudioFileInfo_t to a file.
272
   void       cmAudioFilePrintInfo( const cmAudioFileInfo_t* infoPtr, cmRpt_t* );
273
   void       cmAudioFilePrintInfo( const cmAudioFileInfo_t* infoPtr, cmRpt_t* );
273
 
274
 
275
+  cmRC_t     cmAudioFileReportInfo( cmCtx_t* ctx, const cmChar_t* audioFn, const cmChar_t* rptFn );
276
+
274
   // Print the file header information and frmCnt sample values beginning at frame index frmIdx.
277
   // Print the file header information and frmCnt sample values beginning at frame index frmIdx.
275
   cmRC_t     cmAudioFileReport(   cmAudioFileH_t h,  cmRpt_t* rpt, unsigned frmIdx, unsigned frmCnt );
278
   cmRC_t     cmAudioFileReport(   cmAudioFileH_t h,  cmRpt_t* rpt, unsigned frmIdx, unsigned frmCnt );
276
 
279
 

+ 22
- 5
cmMidiFile.c View File

1848
 
1848
 
1849
   if( tmp->status == kMetaStId )
1849
   if( tmp->status == kMetaStId )
1850
   {
1850
   {
1851
-    cmRptPrintf(rpt,"%s ", cmMidiMetaStatusToLabel(tmp->metaId));
1851
+
1852
+    switch( tmp->metaId )
1853
+    {
1854
+      case kTempoMdId:
1855
+        cmRptPrintf(rpt,"%s bpm %i", cmMidiMetaStatusToLabel(tmp->metaId),60000000 / tmp->u.iVal);        
1856
+        break;
1857
+
1858
+      case kTimeSigMdId:
1859
+        cmRptPrintf(rpt,"%s %i %i", cmMidiMetaStatusToLabel(tmp->metaId), tmp->u.timeSigPtr->num,tmp->u.timeSigPtr->den);        
1860
+        break;
1861
+        
1862
+        
1863
+      default:
1864
+        cmRptPrintf(rpt,"%s ", cmMidiMetaStatusToLabel(tmp->metaId));
1865
+
1866
+    }
1852
   }
1867
   }
1853
   else
1868
   else
1854
   {
1869
   {
1923
     {
1938
     {
1924
       dV[k].uid    = msgs[i]->uid;
1939
       dV[k].uid    = msgs[i]->uid;
1925
       dV[k].amicro = msgs[i]->amicro;
1940
       dV[k].amicro = msgs[i]->amicro;
1926
-      
1941
+
1942
+      // count the number of notes occuring in the time window
1943
+      // between this note and one second prior to this note.
1927
       for(j=i; j>=0; --j)
1944
       for(j=i; j>=0; --j)
1928
-      {
1945
+      {        
1929
         if( msgs[i]->amicro - msgs[j]->amicro > 1000000 )
1946
         if( msgs[i]->amicro - msgs[j]->amicro > 1000000 )
1930
           break;
1947
           break;
1931
 
1948
 
1979
   return rc;
1996
   return rc;
1980
 }
1997
 }
1981
 
1998
 
1982
-cmMfRC_t cmMidiFileGenSvgFile( cmCtx_t* ctx, const cmChar_t* midiFn, const cmChar_t* outSvgFn, const cmChar_t* cssFn )
1999
+cmMfRC_t cmMidiFileGenSvgFile( cmCtx_t* ctx, const cmChar_t* midiFn, const cmChar_t* outSvgFn, const cmChar_t* cssFn, bool standAloneFl, bool panZoomFl )
1983
 {
2000
 {
1984
   cmMfRC_t                 rc   = kOkMfRC;
2001
   cmMfRC_t                 rc   = kOkMfRC;
1985
   cmSvgH_t                 svgH = cmSvgNullHandle;
2002
   cmSvgH_t                 svgH = cmSvgNullHandle;
2061
   cmMemFree(tx);
2078
   cmMemFree(tx);
2062
   
2079
   
2063
   if( rc == kOkMfRC )
2080
   if( rc == kOkMfRC )
2064
-    if( cmSvgWriterWrite(svgH,cssFn,outSvgFn) != kOkSvgRC )
2081
+    if( cmSvgWriterWrite(svgH,cssFn,outSvgFn, standAloneFl, panZoomFl) != kOkSvgRC )
2065
       rc = cmErrMsg(&ctx->err,kSvgFailMfRC,"SVG file write to '%s' failed.",cmStringNullGuard(outSvgFn));
2082
       rc = cmErrMsg(&ctx->err,kSvgFailMfRC,"SVG file write to '%s' failed.",cmStringNullGuard(outSvgFn));
2066
 
2083
 
2067
 
2084
 

+ 1
- 1
cmMidiFile.h View File

229
   // Generate a piano-roll plot description file which can be displayed with cmXScore.m
229
   // Generate a piano-roll plot description file which can be displayed with cmXScore.m
230
   cmMfRC_t             cmMidiFileGenPlotFile( cmCtx_t* ctx, const cmChar_t* midiFn, const cmChar_t* outFn );
230
   cmMfRC_t             cmMidiFileGenPlotFile( cmCtx_t* ctx, const cmChar_t* midiFn, const cmChar_t* outFn );
231
 
231
 
232
-  cmMfRC_t             cmMidiFileGenSvgFile( cmCtx_t* ctx, const cmChar_t* midiFn, const cmChar_t* outSvgFn, const cmChar_t* cssFn );
232
+  cmMfRC_t             cmMidiFileGenSvgFile( cmCtx_t* ctx, const cmChar_t* midiFn, const cmChar_t* outSvgFn, const cmChar_t* cssFn, bool standAloneFl, bool panZoomFl );
233
 
233
 
234
   // Generate a text file reportusing cmMIdiFilePrintMsgs()
234
   // Generate a text file reportusing cmMIdiFilePrintMsgs()
235
   cmMfRC_t             cmMidiFileReport(     cmCtx_t* ctx, const cmChar_t* midiFn, const cmChar_t* outTextFn );
235
   cmMfRC_t             cmMidiFileReport(     cmCtx_t* ctx, const cmChar_t* midiFn, const cmChar_t* outTextFn );

+ 4
- 3
cmPgmOpts.c View File

242
 
242
 
243
 
243
 
244
 cmPoRC_t _cmPgmOptInstall( _cmPo_t* p, unsigned numId, const cmChar_t charId, const cmChar_t* wordId, unsigned cflags, unsigned sflags, unsigned enumId, unsigned cnt, const cmChar_t* helpStr, _cmPoOpt_t** rpp )
244
 cmPoRC_t _cmPgmOptInstall( _cmPo_t* p, unsigned numId, const cmChar_t charId, const cmChar_t* wordId, unsigned cflags, unsigned sflags, unsigned enumId, unsigned cnt, const cmChar_t* helpStr, _cmPoOpt_t** rpp )
245
-{
245
+{  
246
   // validate the num. id
246
   // validate the num. id
247
-  if( cmIsNotFlag(sflags,kEnumPoFl) && _cmPgmOptNumIdToOptRecd(p,numId) != NULL )
247
+  if( cmIsNotFlag(sflags,kEnumPoFl) &&  _cmPgmOptNumIdToOptRecd(p,numId) != NULL )
248
     return cmErrMsg(&p->err,kDuplicateIdPoRC,"The numeric id '%i' was already used by another parameter.",numId);
248
     return cmErrMsg(&p->err,kDuplicateIdPoRC,"The numeric id '%i' was already used by another parameter.",numId);
249
 
249
 
250
+  
250
   // validate the char. id
251
   // validate the char. id
251
-  if( _cmPgmOptCharIdToOptRecd(p,charId) != NULL )
252
+  if(_cmPgmOptCharIdToOptRecd(p,charId) != NULL )
252
     return cmErrMsg(&p->err,kDuplicateIdPoRC,"The character id -'%c' was already used by another parameter.",charId);
253
     return cmErrMsg(&p->err,kDuplicateIdPoRC,"The character id -'%c' was already used by another parameter.",charId);
253
 
254
 
254
   // validate the word. id
255
   // validate the word. id

+ 1
- 1
cmProc4.c View File

3909
       return rc;
3909
       return rc;
3910
     }
3910
     }
3911
 
3911
 
3912
-    return  cmCtxRtCondition( &p->obj, cmInvalidArgRC, "The fragment label symbol id '%i' not found for 'begin record'.",labelSymId);    
3912
+  return  cmCtxRtCondition( &p->obj, cmInvalidArgRC, "The fragment label symbol id '%i' not found for 'begin record'.",labelSymId);    
3913
 }
3913
 }
3914
 
3914
 
3915
 
3915
 

+ 25
- 23
cmSvgWriter.c View File

185
   }
185
   }
186
 }
186
 }
187
 
187
 
188
-/*
189
-   "<script type=\"text/javascript\" src=\"svg-pan-zoom.min.js\"></script>\n"
190
-    "<script>\n"
191
-    " var panZoom = null;\n"
192
-    "  function doOnLoad() { panZoom = svgPanZoom(document.querySelector('#mysvg'), { controlIconsEnabled:true } ) }\n"
193
-    "</script>\n"
194
- 
195
- */
196
-
197
-cmSvgRC_t cmSvgWriterWrite( cmSvgH_t h,  const cmChar_t* cssFn, const cmChar_t* outFn )
188
+cmSvgRC_t cmSvgWriterWrite( cmSvgH_t h,  const cmChar_t* cssFn, const cmChar_t* outFn, bool standAloneFl, bool panZoomFl )
198
 {
189
 {
199
   cmSvgRC_t   rc        = kOkSvgRC;
190
   cmSvgRC_t   rc        = kOkSvgRC;
200
   cmSvg_t*    p         = _cmSvgHandleToPtr(h);
191
   cmSvg_t*    p         = _cmSvgHandleToPtr(h);
205
   cmChar_t*   s0        = NULL;
196
   cmChar_t*   s0        = NULL;
206
   cmChar_t*   s1        = NULL;
197
   cmChar_t*   s1        = NULL;
207
 
198
 
208
-  cmChar_t hdr[] =
199
+  cmChar_t panZoomHdr[] = 
200
+    "<script type=\"text/javascript\" src=\"svg-pan-zoom/dist/svg-pan-zoom.js\"></script>\n"
201
+    "<script>\n"
202
+    " var panZoom = null;\n"
203
+    "  function doOnLoad() { panZoom = svgPanZoom(document.querySelector('#mysvg'), { controlIconsEnabled:true } ) }\n"
204
+    "</script>\n";
205
+
206
+  
207
+  cmChar_t standAloneFmt[] =
209
     "<!DOCTYPE html>\n"
208
     "<!DOCTYPE html>\n"
210
     "<html>\n"
209
     "<html>\n"
211
     "<head>\n"
210
     "<head>\n"
212
     "<meta charset=\"utf-8\">\n"    
211
     "<meta charset=\"utf-8\">\n"    
213
     "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">\n"
212
     "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\">\n"
213
+    "%s\n"
214
     "</head>\n"
214
     "</head>\n"
215
-    "<body onload=\"doOnLoad()\">\n"
216
-    "<svg id=\"mysvg\" width=\"%f\" height=\"%f\">\n";
215
+    "<body onload=\"doOnLoad()\">\n";
216
+
217
+  cmChar_t svgFmt[] = "<svg id=\"mysvg\" width=\"%f\" height=\"%f\">\n";
217
 
218
 
218
- 
219
-  
220
   _cmSvgSize(p, &svgWidth, &svgHeight );
219
   _cmSvgSize(p, &svgWidth, &svgHeight );
221
 
220
 
222
   _cmSvgWriterFlipY( p, svgHeight );
221
   _cmSvgWriterFlipY( p, svgHeight );
223
 
222
 
224
-  // print the file header
225
-  if( (s0 = cmTsPrintfP(s0,hdr,cssFn,svgWidth,svgHeight)) == NULL )
226
-  {
227
-    rc = cmErrMsg(&p->err,kPrintFailSvgRC,"File prefix write failed.");
228
-    goto errLabel;
229
-  }
223
+  s0 = cmTsPrintfP(s0, standAloneFmt, cssFn, panZoomFl ? panZoomHdr : "");
224
+  
225
+  s1 = cmTsPrintfP(s1,"%s%s", standAloneFl ? s0 : "", svgFmt);
230
 
226
 
227
+  s0 = cmTsPrintfP(s0,s1,svgWidth,svgHeight);
228
+  
231
   for(; e!=NULL; e=e->link)
229
   for(; e!=NULL; e=e->link)
232
   {
230
   {
233
     switch( e->id )
231
     switch( e->id )
262
     
260
     
263
   }
261
   }
264
   
262
   
265
-  if( (s1 = cmTsPrintfP(s1,"</svg>\n</body>\n</html>\n")) == NULL )
263
+  if( (s1 = cmTsPrintfP(s1,"</svg>\n")) == NULL )
266
   {
264
   {
267
     rc = cmErrMsg(&p->err,kPrintFailSvgRC,"File suffix write failed.");
265
     rc = cmErrMsg(&p->err,kPrintFailSvgRC,"File suffix write failed.");
268
     goto errLabel;
266
     goto errLabel;
269
   }
267
   }
270
-
268
+  
269
+  if( standAloneFl )
270
+    s1 = cmTextAppendSS(s1,"</body>\n</html>\n");
271
+  
271
   if( cmFileOpen(&fH,outFn,kWriteFileFl,p->err.rpt) != kOkFileRC )
272
   if( cmFileOpen(&fH,outFn,kWriteFileFl,p->err.rpt) != kOkFileRC )
272
   {
273
   {
273
     rc = cmErrMsg(&p->err,kFileFailSvgRC,"SVG file create failed for '%s'.",cmStringNullGuard(outFn));
274
     rc = cmErrMsg(&p->err,kFileFailSvgRC,"SVG file create failed for '%s'.",cmStringNullGuard(outFn));
280
     goto errLabel;
281
     goto errLabel;
281
   }
282
   }
282
 
283
 
284
+
283
  errLabel:
285
  errLabel:
284
   cmFileClose(&fH);
286
   cmFileClose(&fH);
285
 
287
 

+ 1
- 1
cmSvgWriter.h View File

30
   // and the Javascript file svg-pan-zoom.min.js from https://github.com/ariutta/svg-pan-zoom.
30
   // and the Javascript file svg-pan-zoom.min.js from https://github.com/ariutta/svg-pan-zoom.
31
   // Both the CSS file and svg-pan-zoom.min.js should therefore be in the same directory
31
   // Both the CSS file and svg-pan-zoom.min.js should therefore be in the same directory
32
   // as the output HTML file.
32
   // as the output HTML file.
33
-  cmSvgRC_t cmSvgWriterWrite( cmSvgH_t h, const cmChar_t* cssFn, const cmChar_t* outFn );
33
+  cmSvgRC_t cmSvgWriterWrite( cmSvgH_t h, const cmChar_t* cssFn, const cmChar_t* outFn, bool standaloneFl, bool panZoomFl );
34
   
34
   
35
 #ifdef __cplusplus
35
 #ifdef __cplusplus
36
 }
36
 }

Loading…
Cancel
Save