house.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * Copyright (c) 1983-2013 Trevor Wishart and Composers Desktop Project Ltd
  3. * http://www.trevorwishart.co.uk
  4. * http://www.composersdesktop.com
  5. *
  6. This file is part of the CDP System.
  7. The CDP System is free software; you can redistribute it
  8. and/or modify it under the terms of the GNU Lesser General Public
  9. License as published by the Free Software Foundation; either
  10. version 2.1 of the License, or (at your option) any later version.
  11. The CDP System is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU Lesser General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with the CDP System; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  18. 02111-1307 USA
  19. *
  20. */
  21. #ifndef _CDP_HOUSE_H_INCLUDED
  22. #define _CDP_HOUSE_H_INCLUDED
  23. #define IS_GROUCHO_COMPILE (1)
  24. #define MAXDUPL (999)
  25. #define COPYDEL_OVERMAX (10)
  26. #define SORT_SMALL_DEFAULT (1.0)
  27. #define SORT_LARGE_DEFAULT (16.0)
  28. #define SORT_STEP_DEFAULT (1.0)
  29. #define SORT_LSTEP_DEFAULT (2.0)
  30. #define MIN_SORT_DUR (0.005)
  31. #define MAX_SORT_DUR (120.0)
  32. #define MIN_SORT_STEP (0.005)
  33. #define MAX_SORT_STEP (60.0)
  34. #define MIN_SORT_LSTEP (1.414)
  35. #define MAX_SORT_LSTEP (8.0)
  36. #define CUTGATE_SPLICELEN (15.0)
  37. #define CUTGATE_MINSPLICE (2.0)
  38. #define CUTGATE_MAXSPLICE (200.0)
  39. #define CUTGATE_MAX_SUSTAIN (64)
  40. #define CUTGATE_MAXBAKTRAK (64)
  41. #define CUTGATE_MAXWINDOWS (64)
  42. #define TOPNTAIL_SPLICELEN (2)
  43. #define DUMPFILE_CHANNELS (2)
  44. #define DUMPFILE_SRATE (48000)
  45. #define BLEEP (0)
  46. #define HEADERS (1)
  47. #define SOUND (2)
  48. #define SHORT (3)
  49. #define CYCLECNT (512) /* number of square wave cycles in bleep */
  50. #define HALFCYCLE (50) /* square-wave is 50 * 2 samples long */
  51. #define SQUAREAMP (8000) /* amplitude of square-wave bleep */
  52. #define HEADSIZE (SECSIZE * 2) /* bytesize of sndfile header in dumpfile*/
  53. #define HALFHEADSIZE (SECSIZE) /* half size of sndfile header, in bytes */
  54. #define HEADCOPIES (100) /* number of bakup copies of header */
  55. #define DUMPDATSIZE ((CYCLECNT*HALFCYCLE*2*sizeof(short))+(HEADSIZE*HEADCOPIES))
  56. #define TW_MAGIC (271828182) /* e */
  57. #define FIRST_HALF_SF_MAGIC (30244)
  58. #define SECOND_HALF_SF_MAGIC (5522)
  59. #define FIRST_HALF_TW_MAGIC (-15146)
  60. #define SECOND_HALF_TW_MAGIC (4147)
  61. #define OK_COUNT (.25) /* min fraction header_copies to recover */
  62. #define OK_MARKER (.33) /* frac of a header_marker OK to validate */
  63. #define OK_SAME (.5) /* frac of header to be same, to be a copy */
  64. #define HEADSEARCHSIZE ((HEADSIZE*HEADCOPIES)+SECSIZE)
  65. #define COPY_HEADER_WRITTEN (0)
  66. #define HEADER_SIZE_DEFINED (0)
  67. #define SHSECSIZE (SECSIZE/sizeof(short))
  68. // TW NEW
  69. //#define WHOLESECT(x) (((x)/SHSECSIZE)*SHSECSIZE==(x))
  70. #define WHOLESECT(x) (((x)/(int)SHSECSIZE)*(int)SHSECSIZE==(x))
  71. #define NAMESIZE (64)
  72. #define FILESIZE_SIZE (sizeof(int))
  73. #define MAGIC_SIZE (sizeof(int))
  74. #define CRC_SIZE (sizeof(int))
  75. // TW NEW
  76. //#define SFREC_SHIFT_MIN (-100)
  77. //#define SFREC_SHIFT_MAX (100)
  78. #define SFREC_SHIFT_MIN (-10)
  79. #define SFREC_SHIFT_MAX (10)
  80. typedef unsigned char uchar;
  81. int pconsistency_clean(dataptr dz);
  82. int create_respec_buffers(dataptr dz);
  83. int create_clean_buffers(dataptr dz);
  84. int create_bakup_buffers(dataptr dz);
  85. int create_recover_buffer(dataptr dz);
  86. int sort_preprocess(dataptr dz);
  87. int respec_preprocess(dataptr dz);
  88. int do_duplicates(dataptr dz);
  89. int do_deletes(dataptr dz);
  90. int do_channels(dataptr dz);
  91. int do_bundle(dataptr dz);
  92. int do_file_sorting(dataptr dz);
  93. int do_respecification(dataptr dz);
  94. int process_clean(dataptr dz);
  95. int sfdump(dataptr dz);
  96. int sfrecover(dataptr dz);
  97. int sum32(register int, register uchar *, int);
  98. //TW NEW
  99. int check_available_diskspace(dataptr dz);
  100. int house_bakup(dataptr dz);
  101. int house_gate(dataptr dz);
  102. int batch_expand(dataptr dz);
  103. int house_gate2(dataptr dz);
  104. #define BAKUP_GAP (1.0)
  105. #endif