filetype.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. /** WARNING **
  22. *
  23. * If new filetypes are added..
  24. * FUNCTIONS in filetype.c must be upgraded to take account of these!!
  25. */
  26. /***************************** NEW FILE HEADER VALUES, ALSO USEFUL FOR FLAGGING IN GUI *************
  27. TPNdU LNSSMFS|
  28. rioBn iunyilp|
  29. atr r nmdnxoe|
  30. ncm n eb c ac|
  31. shl g r t |
  32. d */
  33. #define BRKFILE (8192) /* 0010000000000000 */
  34. #define DB_BRKFILE (4096) /* 0001000000000000 */
  35. #define UNRANGED_BRKFILE (2048) /* 0000100000000000 */
  36. #define NUMLIST (256) /* 0000000100000000 */
  37. #define SNDLIST (128) /* 0000000010000000 */
  38. #define SYNCLIST (64) /* 0000000001000000 */
  39. #define MIXFILE (32) /* 0000000000100000 */
  40. #define LINELIST (512) /* 0000001000000000 */
  41. #define SNDFILE (1) /* 0000000000000001 */
  42. #define FLT_SNDFILE (17) /* 0000000000010001 */
  43. #define ANALFILE (24) /* 0000000000011000 */
  44. #define PITCHFILE (25) /* 0000000000011001 */
  45. #define TRANSPOSFILE (26) /* 0000000000011010 */
  46. #define FORMANTFILE (27) /* 0000000000011011 */
  47. #define ENVFILE (16) /* 0000000000010000 */
  48. #define TRANSPOS_OR_NORMD_BRKFILE_OR_NUMLIST_OR_LINELIST_OR_WORDLIST (41728) /* 1010001100000000 */
  49. #define TRANSPOS_OR_NORMD_BRKFILE_OR_NUMLIST_OR_WORDLIST (41216) /* 1010000100000000 */
  50. #define TRANSPOS_OR_PITCH_BRKFILE_OR_NUMLIST_OR_LINELIST_OR_WORDLIST (49920) /* 1100001100000000 */
  51. #define TRANSPOS_OR_PITCH_BRKFILE_OR_NUMLIST_OR_WORDLIST (49408) /* 1100000100000000 */
  52. #define TRANSPOS_OR_UNRANGED_BRKFILE_OR_NUMLIST_OR_LINELIST_OR_WORDLIST (35584) /* 1000101100000000 */
  53. #define TRANSPOS_OR_UNRANGED_BRKFILE_OR_NUMLIST_OR_WORDLIST (35072) /* 1000100100000000 */
  54. #define NORMD_BRKFILE_OR_NUMLIST_OR_LINELIST_OR_WORDLIST (8960) /* 0010001100000000 */
  55. #define NORMD_BRKFILE_OR_NUMLIST_OR_WORDLIST (8448) /* 0010000100000000 */
  56. #define DB_BRKFILE_OR_NUMLIST_OR_LINELIST_OR_WORDLIST (4864) /* 0001001100000000 */
  57. #define DB_BRKFILE_OR_NUMLIST_OR_WORDLIST (4352) /* 0001000100000000 */
  58. #define PITCH_BRKFILE_OR_NUMLIST_OR_LINELIST_OR_WORDLIST (17152) /* 0100001100000000 */
  59. #define PITCH_BRKFILE_OR_NUMLIST_OR_WORDLIST (16640) /* 0100000100000000 */
  60. #define PITCH_POSITIVE_BRKFILE_OR_NUMLIST_OR_LINELIST_OR_WORDLIST (18176) /* 0100011100000000 */
  61. #define PITCH_POSITIVE_BRKFILE_OR_NUMLIST_OR_WORDLIST (17664) /* 0100010100000000 */
  62. #define UNRANGED_BRKFILE_OR_NUMLIST_OR_LINELIST_OR_WORDLIST (2816) /* 0000101100000000 */
  63. #define UNRANGED_BRKFILE_OR_NUMLIST_OR_WORDLIST (2304) /* 0000100100000000 */
  64. #define NUMLIST_OR_LINELIST_OR_WORDLIST (768) /* 0000001100000000 */
  65. #define NUMLIST_OR_WORDLIST (256) /* 0000000100000000 */
  66. #define SNDLIST_OR_SYNCLIST_LINELIST_OR_WORDLIST (704) /* 0000001011000000 */
  67. #define SNDLIST_OR_SYNCLIST_OR_WORDLIST (192) /* 0000000011000000 */
  68. #define SNDLIST_OR_LINELIST_OR_WORDLIST (640) /* 0000001010000000 */
  69. #define SNDLIST_OR_WORDLIST (128) /* 0000000010000000 */
  70. #define MIXLIST_OR_LINELIST_OR_WORDLIST (544) /* 0000001000100000 */
  71. #define MIXLIST_OR_WORDLIST (32) /* 0000000000100000 */
  72. #define SYNCLIST_OR_LINELIST_OR_WORDLIST (576) /* 0000001001000000 */
  73. #define SYNCLIST_OR_WORDLIST (64) /* 0000000001000000 */
  74. #define LINELIST_OR_WORDLIST (512) /* 0000001000000000 */
  75. #define WORDLIST (288) /* 0000000100100000 */
  76. #define POSITIVE_BRKFILE (1024) /* 0000010000000000 */
  77. #define POSITIVE_BRKFILE_OR_NUMLIST_OR_LINELIST_OR_WORDLIST (1792) /* 0000011100000000 */
  78. #define POSITIVE_BRKFILE_OR_NUMLIST_OR_WORDLIST (1280) /* 0000010100000000 */
  79. /**** VALUES ONLY USED AFTER redefine_textfile_type... *********/
  80. #define ANYFILE (65535) /* 1111111111111111 (probably redundant)*/
  81. #define TEXTFILE (96) /* 0000000001100000 */
  82. /*********** NEW FLAG RECOGNITION CONSTANTS **************/
  83. /* Operation
  84. with program's
  85. filetype flag */
  86. #define IS_A_PITCH_BRKFILE (16384) /* &= TRUE */ /* 0100000000000000 */
  87. #define IS_A_TRANSPOS_BRKFILE (32768) /* &= TRUE */ /* 1000000000000000 */
  88. #define IS_A_POSITIVE_BRKFILE POSITIVE_BRKFILE /* &= TRUE */ /* 1000000000000000 */
  89. #define IS_A_NORMD_BRKFILE BRKFILE /* &= TRUE */
  90. #define IS_A_DB_BRKFILE DB_BRKFILE /* &= TRUE */
  91. #define IS_AN_UNRANGED_BRKFILE (3072) /* &= TRUE */ /* 0000110000000000 */
  92. #define IS_A_NUMLIST NUMLIST /* &= TRUE */
  93. #define IS_A_SNDLIST SNDLIST /* &= TRUE */
  94. #define IS_A_SYNCLIST SYNCLIST /* &= TRUE */
  95. #define IS_A_MIXFILE MIXFILE /* &= TRUE && !WORDLIST */
  96. #define IS_A_LINELIST LINELIST /* &= TRUE */
  97. #define IS_A_SNDFILE SNDFILE /* == */
  98. #define IS_A_FLT_SNDFILE FLT_SNDFILE /* == */
  99. #define IS_AN_ANALFILE ANALFILE /* == */
  100. #define IS_A_PITCHFILE PITCHFILE /* == */
  101. #define IS_A_TRANSPOSFILE TRANSPOSFILE /* == */
  102. #define IS_A_FORMANTFILE FORMANTFILE /* == */
  103. #define IS_AN_ENVFILE ENVFILE /* == */
  104. #define IS_A_SNDSYSTEM_FILE (31) /* &= TRUE 0000000000011111 */
  105. #define IS_A_PTF_BINFILE (27) /* &= > ANALFILE 0000000000011011 */
  106. #define IS_A_TEXTFILE (65504) /* &= TRUE 1111111111100000 */
  107. #define IS_A_SNDLIST_FIXEDSR (192) /* &= IS_A_SNDLIST_FIXEDSR 0000000011000000 */
  108. #define IS_A_NUMBER_LINELIST (768) /* &= IS_A_NUMBER_LINELIST 0000001100000000 */
  109. #define IS_MIX_OR_SNDLST_FIXSR (224) /* &= MIXFILE||IS_A_SNDLIST_FIXEDSR 0000000011100000 */
  110. #define IS_A_BRKFILE (64512) /* &= TRUE 1111110000000000 */
  111. #define IS_A_P_OR_T_BRK (39152) /* &= TRUE 1100000000000000 */
  112. /* NOT USED, IF USED, CHANGE BIT 6 (counting from 1 at LEFT, to 1 */
  113. #define IS_AN_ENV_OR_DB_BRK (12288) /* &= TRUE 0011000000000000 */
  114. #define POSSIBLY_FILENAMES (928) /* &= TRUE 0000001110100000 */
  115. /* ANYFILE NO TEST */
  116. #define IS_ANYFILE (65535) /* &= TRUE 1111111111111111 */
  117. #define IS_NOT_PURE_NUMS_TEXT (65248) /* &= TRUE 1111111011100000 */
  118. #define IS_NOT_PURENUMS_OR_MIX_TEXT (65216) /* &= TRUE 1111111011000000 */
  119. #define IS_NOT_MIX_TEXT (65472) /* &= TRUE 1111111111000000 */
  120. #define IS_ANALDERIVED (8) /* &= TRUE 0000000000001000 */
  121. #define DEFAULT_FILENAME "#test"
  122. #define ONE_NONSND_FILE (-100) /* flag */