libopenmpt.bi 93 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637
  1. /'
  2. ' libopenmpt.bi
  3. ' -------------
  4. ' Purpose: libopenmpt public interface for FreeBASIC
  5. ' Notes : (currently none)
  6. ' Authors: Johannes Schultz
  7. ' OpenMPT Devs
  8. ' The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  9. '/
  10. #Include Once "crt/stdio.bi"
  11. #Include Once "file.bi"
  12. #Inclib "openmpt"
  13. /'*
  14. \page libopenmpt_freebasic_overview FreeBASIC API
  15. \section libopenmpt_freebasic_error Error Handling
  16. - Functions with no return value in the corresponding C++ API return 0 on
  17. failure and 1 on success.
  18. - Functions that return integer values signal error condition by returning
  19. an invalid value (-1 in most cases, 0 in some cases).
  20. - All functions that work on an openmpt_module object will call an
  21. openmpt_error_func and depending on the value returned by this function log
  22. the error code and/xor/or store it inside the openmpt_module object. Stored
  23. error codes can be accessed with the openmpt_module_error_get_last() and
  24. openmpt_module_error_get_last_message(). Stored errors will not get cleared
  25. automatically and should be reset with openmpt_module_error_clear().
  26. - Some functions not directly related to an openmpt_module object take an
  27. explicit openmpt_error_func error function callback and a pointer to an int
  28. and behave analog to the functions working on an openmpt_module object.
  29. \section libopenmpt_freebasic_strings Strings
  30. - All strings returned from libopenmpt are encoded in UTF-8.
  31. - All strings passed to libopenmpt should also be encoded in UTF-8.
  32. Behaviour in case of invalid UTF-8 is unspecified.
  33. - libopenmpt does not enforce or expect any particular Unicode
  34. normalization form.
  35. - Some libopenmpt functions return strings and are provided in two flavours:
  36. The raw libopenmpt function (with a trailing underscore) and a FreeBASIC
  37. wrapper function that completely takes care of memory handling (recommended).
  38. All strings returned from raw libopenmpt functions are dynamically
  39. allocated and must be freed with openmpt_free_string().
  40. When using the FreeBASIC wrappers (which is the recommended way), FreeBASIC
  41. automatically takes care of this.
  42. - All strings passed to libopenmpt are copied. No ownership is assumed or
  43. transferred.
  44. \section libopenmpt_freebasic_outputformat Output Format
  45. libopenmpt supports a wide range of PCM output formats:
  46. [8000..192000]/[mono|stereo|quad]/[f32|i16].
  47. Unless you have some very specific requirements demanding a particular aspect
  48. of the output format, you should always prefer 48000/stereo/f32 as the
  49. libopenmpt PCM format.
  50. - Please prefer 48000Hz unless the user explicitly demands something else.
  51. Practically all audio equipment and file formats use 48000Hz nowadays.
  52. - Practically all module formats are made for stereo output. Mono will not
  53. give you any measurable speed improvements and can trivially be obtained from
  54. the stereo output anyway. Quad is not expected by almost all modules and even
  55. if they do use surround effects, they expect the effects to be mixed to
  56. stereo.
  57. - Floating point output provides headroom instead of hard clipping if the
  58. module is louder than 0dBFs, will give you a better signal-to-noise ratio
  59. than int16 output, and avoid the need to apply an additional dithering to the
  60. output by libopenmpt. Unless your platform has no floating point unit at all,
  61. floating point will thus also be slightly faster.
  62. \section libopenmpt_freebasic_threads libopenmpt in multi-threaded environments
  63. - libopenmpt is thread-aware.
  64. - Individual libopenmpt objects are not thread-safe.
  65. - libopenmpt itself does not spawn any user-visible threads but may spawn
  66. threads for internal use.
  67. - You must ensure to only ever access a particular libopenmpt object from a
  68. single thread at a time.
  69. - Consecutive accesses can happen from different threads.
  70. - Different objects can be accessed concurrently from different threads.
  71. \section libopenmpt_freebasic_detailed Detailed documentation
  72. \ref libopenmpt_freebasic
  73. '/
  74. Extern "C"
  75. '* API version of this header file
  76. Const OPENMPT_API_VERSION_MAJOR = 0
  77. Const OPENMPT_API_VERSION_MINOR = 3
  78. Const OPENMPT_API_VERSION_PATCH = 0
  79. Const OPENMPT_API_VERSION = (OPENMPT_API_VERSION_MAJOR Shl 24) Or (OPENMPT_API_VERSION_MINOR Shl 16) Or (OPENMPT_API_VERSION_PATCH Shl 0)
  80. #Define OPENMPT_API_VERSION_STRING (OPENMPT_API_VERSION_MAJOR & "." & OPENMPT_API_VERSION_MINOR & "." & OPENMPT_API_VERSION_PATCH)
  81. /'* \brief Get the libopenmpt version number
  82. Returns the libopenmpt version number.
  83. \return The value represents (major Shl 24 + minor Shl 16 + patch Shl 0).
  84. \remarks libopenmpt < 0.3.0-pre used the following scheme: (major Shl 24 + minor Shl 16 + revision).
  85. \remarks Check the HiWord of the return value against OPENMPT_API_VERSION to ensure that the correct library version is loaded.
  86. '/
  87. Declare Function openmpt_get_library_version() As ULong
  88. /'* \brief Get the core version number
  89. Return the OpenMPT core version number.
  90. \return The value represents (majormajor << 24 + major << 16 + minor << 8 + minorminor).
  91. '/
  92. Declare Function openmpt_get_core_version() As ULong
  93. '* Return a verbose library version string from openmpt_get_string(). \deprecated Please use \code "library_version" \endcode directly.
  94. #Define OPENMPT_STRING_LIBRARY_VERSION "library_version"
  95. '* Return a verbose library features string from openmpt_get_string(). \deprecated Please use \code "library_features" \endcode directly.
  96. #Define OPENMPT_STRING_LIBRARY_FEATURES "library_features"
  97. '* Return a verbose OpenMPT core version string from openmpt_get_string(). \deprecated Please use \code "core_version" \endcode directly.
  98. #Define OPENMPT_STRING_CORE_VERSION "core_version"
  99. '* Return information about the current build (e.g. the build date or compiler used) from openmpt_get_string(). \deprecated Please use \code "build" \endcode directly.
  100. #Define OPENMPT_STRING_BUILD "build"
  101. '* Return all contributors from openmpt_get_string(). \deprecated Please use \code "credits" \endcode directly.
  102. #Define OPENMPT_STRING_CREDITS "credits"
  103. '* Return contact information about libopenmpt from openmpt_get_string(). \deprecated Please use \code "contact" \endcode directly.
  104. #Define OPENMPT_STRING_CONTACT "contact"
  105. '* Return the libopenmpt license from openmpt_get_string(). \deprecated Please use \code "license" \endcode directly.
  106. #Define OPENMPT_STRING_LICENSE "license"
  107. /'* \brief Free a string returned by libopenmpt
  108. Frees any string that got returned by libopenmpt.
  109. '/
  110. Declare Sub openmpt_free_string(ByVal Str As Const ZString Ptr)
  111. /'* \brief Get library related metadata.
  112. \param key Key to query.
  113. Possible keys are:
  114. - "library_version": verbose library version string
  115. - "library_version_is_release": "1" if the version is an officially released version
  116. - "library_features": verbose library features string
  117. - "core_version": verbose OpenMPT core version string
  118. - "source_url": original source code URL
  119. - "source_date": original source code date
  120. - "source_revision": original source code revision
  121. - "source_is_modified": "1" if the original source has been modified
  122. - "source_has_mixed_revisions": "1" if the original source has been compiled from different various revision
  123. - "source_is_package": "1" if the original source has been obtained from a source pacakge instead of source code version control
  124. - "build": information about the current build (e.g. the build date or compiler used)
  125. - "build_compiler": information about the compiler used to build libopenmpt
  126. - "credits": all contributors
  127. - "contact": contact information about libopenmpt
  128. - "license": the libopenmpt license
  129. - "url": libopenmpt website URL
  130. - "support_forum_url": libopenmpt support and discussions forum URL
  131. - "bugtracker_url": libopenmpt bug and issue tracker URL
  132. \return A (possibly multi-line) string containing the queried information. If no information is available, the string is empty.
  133. \remarks Use openmpt_get_string to automatically handle the lifetime of the returned pointer.
  134. '/
  135. Declare Function openmpt_get_string_ Alias "openmpt_get_string" (ByVal key As Const ZString Ptr) As Const ZString Ptr
  136. /'* \brief Get a list of supported file extensions
  137. \return The semicolon-separated list of extensions supported by this libopenmpt build. The extensions are returned lower-case without a leading dot.
  138. \remarks Use openmpt_get_supported_extensions to automatically handle the lifetime of the returned pointer.
  139. '/
  140. Declare Function openmpt_get_supported_extensions() As Const ZString Ptr
  141. /'* \brief Query whether a file extension is supported
  142. \param extension file extension to query without a leading dot. The case is ignored.
  143. \return 1 if the extension is supported by libopenmpt, 0 otherwise.
  144. '/
  145. Declare Function openmpt_is_extension_supported(ByVal extension As Const ZString Ptr) As Long
  146. '* Seek to the given offset relative to the beginning of the file.
  147. Const OPENMPT_STREAM_SEEK_SET = 0
  148. '* Seek to the given offset relative to the current position in the file.
  149. Const OPENMPT_STREAM_SEEK_CUR = 1
  150. '* Seek to the given offset relative to the end of the file.
  151. Const OPENMPT_STREAM_SEEK_END = 2
  152. /'* \brief Read bytes from stream
  153. Read bytes data from stream to dst.
  154. \param stream Stream to read data from
  155. \param dst Target where to copy data.
  156. \param bytes Number of bytes to read.
  157. \return Number of bytes actually read and written to dst.
  158. \retval 0 End of stream or error.
  159. \remarks Short reads are allowed as long as they return at least 1 byte if EOF is not reached.
  160. '/
  161. Type openmpt_stream_read_func As Function(ByVal stream As Any Ptr, ByVal dst As Any Ptr, ByVal bytes As UInteger) As UInteger
  162. /'* \brief Seek stream position
  163. Seek to stream position offset at whence.
  164. \param stream Stream to operate on.
  165. \param offset Offset to seek to.
  166. \param whence OPENMPT_STREAM_SEEK_SET, OPENMPT_STREAM_SEEK_CUR, OPENMPT_STREAM_SEEK_END. See C89 documentation.
  167. \return Returns 0 on success.
  168. \retval 0 Success.
  169. \retval -1 Failure. Position does not get updated.
  170. \remarks libopenmpt will not try to seek beyond the file size, thus it is not important whether you allow for virtual positioning after the file end, or return an error in that case. The position equal to the file size needs to be seekable to.
  171. '/
  172. Type openmpt_stream_seek_func As Function(ByVal stream As Any Ptr, ByVal offset As LongInt, ByVal whence As Long) As Long
  173. /'* \brief Tell stream position
  174. Tell position of stream.
  175. \param stream Stream to operate on.
  176. \return Current position in stream.
  177. \retval -1 Failure.
  178. '/
  179. Type openmpt_stream_tell_func As Function(ByVal stream As Any Ptr) As LongInt
  180. /'* \brief Stream callbacks
  181. Stream callbacks used by libopenmpt for stream operations.
  182. '/
  183. Type openmpt_stream_callbacks
  184. /'* \brief Read callback.
  185. \sa openmpt_stream_read_func
  186. '/
  187. read_func As openmpt_stream_read_func
  188. /'* \brief Seek callback.
  189. Seek callback can be NULL if seeking is not supported.
  190. \sa openmpt_stream_seek_func
  191. '/
  192. seek_func As openmpt_stream_seek_func
  193. /'* \brief Tell callback.
  194. Tell callback can be NULL if seeking is not supported.
  195. \sa openmpt_stream_tell_func
  196. '/
  197. tell_func As openmpt_stream_tell_func
  198. End Type
  199. /'* \brief Logging function
  200. \param message UTF-8 encoded log message.
  201. \param user User context that was passed to openmpt_module_create2(), openmpt_module_create_from_memory2() or openmpt_could_open_probability2().
  202. '/
  203. Type openmpt_log_func As Sub(ByVal message As Const ZString Ptr, ByVal user As Any Ptr)
  204. /'* \brief Default logging function
  205. Default logging function that logs anything to stderr.
  206. '/
  207. Declare Sub openmpt_log_func_default(ByVal message As Const ZString Ptr, ByVal user As Any Ptr)
  208. /'* \brief Silent logging function
  209. Silent logging function that throws any log message away.
  210. '/
  211. Declare Sub openmpt_log_func_silent(ByVal message As Const ZString Ptr, ByVal user As Any Ptr)
  212. '* No error. \since 0.3.0
  213. Const OPENMPT_ERROR_OK = 0
  214. '* Lowest value libopenmpt will use for any of its own error codes. \since 0.3.0
  215. Const OPENMPT_ERROR_BASE = 256
  216. '* Unknown internal error. \since 0.3.0
  217. Const OPENMPT_ERROR_UNKNOWN = OPENMPT_ERROR_BASE + 1
  218. '* Unknown internal C++ exception. \since 0.3.0
  219. Const OPENMPT_ERROR_EXCEPTION = OPENMPT_ERROR_BASE + 11
  220. '* Out of memory. \since 0.3.0
  221. Const OPENMPT_ERROR_OUT_OF_MEMORY = OPENMPT_ERROR_BASE + 21
  222. '* Runtime error. \since 0.3.0
  223. Const OPENMPT_ERROR_RUNTIME = OPENMPT_ERROR_BASE + 30
  224. '* Range error. \since 0.3.0
  225. Const OPENMPT_ERROR_RANGE = OPENMPT_ERROR_BASE + 31
  226. '* Arithmetic overflow. \since 0.3.0
  227. Const OPENMPT_ERROR_OVERFLOW = OPENMPT_ERROR_BASE + 32
  228. '* Arithmetic underflow. \since 0.3.0
  229. Const OPENMPT_ERROR_UNDERFLOW = OPENMPT_ERROR_BASE + 33
  230. '* Logic error. \since 0.3.0
  231. Const OPENMPT_ERROR_LOGIC = OPENMPT_ERROR_BASE + 40
  232. '* Value domain error. \since 0.3.0
  233. Const OPENMPT_ERROR_DOMAIN = OPENMPT_ERROR_BASE + 41
  234. '* Maximum supported size exceeded. \since 0.3.0
  235. Const OPENMPT_ERROR_LENGTH = OPENMPT_ERROR_BASE + 42
  236. '* Argument out of range. \since 0.3.0
  237. Const OPENMPT_ERROR_OUT_OF_RANGE = OPENMPT_ERROR_BASE + 43
  238. '* Invalid argument. \since 0.3.0
  239. Const OPENMPT_ERROR_INVALID_ARGUMENT = OPENMPT_ERROR_BASE + 44
  240. '* General libopenmpt error. \since 0.3.0
  241. Const OPENMPT_ERROR_GENERAL = OPENMPT_ERROR_BASE + 101
  242. '* openmpt_module Ptr is invalid. \since 0.3.0
  243. Const OPENMPT_ERROR_INVALID_MODULE_POINTER = OPENMPT_ERROR_BASE + 102
  244. '* NULL pointer argument. \since 0.3.0
  245. Const OPENMPT_ERROR_ARGUMENT_NULL_POINTER = OPENMPT_ERROR_BASE + 103
  246. /'* \brief Check whether the error is transient
  247. Checks whether an error code represents a transient error which may not occur again in a later try if for example memory has been freed up after an out-of-memory error.
  248. \param errorcode Error code.
  249. \retval 0 Error is not transient.
  250. \retval 1 Error is transient.
  251. \sa OPENMPT_ERROR_OUT_OF_MEMORY
  252. \since 0.3.0
  253. '/
  254. Declare Function openmpt_error_is_transient(ByVal errorcode As Long) As Long
  255. /'* \brief Convert error code to text
  256. Converts an error code into a text string describing the error.
  257. \param errorcode Error code.
  258. \return Allocated string describing the error.
  259. \retval NULL Not enough memory to allocate the string.
  260. \since 0.3.0
  261. \remarks Use openmpt_error_string to automatically handle the lifetime of the returned pointer.
  262. '/
  263. Declare Function openmpt_error_string_ Alias "openmpt_error_string" (ByVal errorcode As Long) As Const ZString Ptr
  264. '* Do not log or store the error. \since 0.3.0
  265. Const OPENMPT_ERROR_FUNC_RESULT_NONE = 0
  266. '* Log the error. \since 0.3.0
  267. Const OPENMPT_ERROR_FUNC_RESULT_LOG = 1
  268. '* Store the error. \since 0.3.0
  269. Const OPENMPT_ERROR_FUNC_RESULT_STORE = 2
  270. '* Log and store the error. \since 0.3.0
  271. Const OPENMPT_ERROR_FUNC_RESULT_DEFAULT = OPENMPT_ERROR_FUNC_RESULT_LOG Or OPENMPT_ERROR_FUNC_RESULT_STORE
  272. /'* \brief Error function
  273. \param errorcode Error code.
  274. \param user User context that was passed to openmpt_module_create2(), openmpt_module_create_from_memory2() or openmpt_could_open_probability2().
  275. \return Mask of OPENMPT_ERROR_FUNC_RESULT_LOG and OPENMPT_ERROR_FUNC_RESULT_STORE.
  276. \retval OPENMPT_ERROR_FUNC_RESULT_NONE Do not log or store the error.
  277. \retval OPENMPT_ERROR_FUNC_RESULT_LOG Log the error.
  278. \retval OPENMPT_ERROR_FUNC_RESULT_STORE Store the error.
  279. \retval OPENMPT_ERROR_FUNC_RESULT_DEFAULT Log and store the error.
  280. \sa OPENMPT_ERROR_FUNC_RESULT_NONE
  281. \sa OPENMPT_ERROR_FUNC_RESULT_LOG
  282. \sa OPENMPT_ERROR_FUNC_RESULT_STORE
  283. \sa OPENMPT_ERROR_FUNC_RESULT_DEFAULT
  284. \sa openmpt_error_func_default
  285. \sa openmpt_error_func_log
  286. \sa openmpt_error_func_store
  287. \sa openmpt_error_func_ignore
  288. \sa openmpt_error_func_errno
  289. \since 0.3.0
  290. '/
  291. Type openmpt_error_func As Function(ByVal errorcode As Long, ByVal user As Any Ptr) As Long
  292. /'* \brief Default error function
  293. Causes all errors to be logged and stored.
  294. \param errorcode Error code.
  295. \param user Ignored.
  296. \retval OPENMPT_ERROR_FUNC_RESULT_DEFAULT Always.
  297. \since 0.3.0
  298. '/
  299. Declare Function openmpt_error_func_default(ByVal errorcode As Long, ByVal User As Any Ptr) As Long
  300. /'* \brief Log error function
  301. Causes all errors to be logged.
  302. \param errorcode Error code.
  303. \param user Ignored.
  304. \retval OPENMPT_ERROR_FUNC_RESULT_LOG Always.
  305. \since 0.3.0
  306. '/
  307. Declare Function openmpt_error_func_log(ByVal errorcode As Long, ByVal user As Any Ptr) As Long
  308. /'* \brief Store error function
  309. Causes all errors to be stored.
  310. \param errorcode Error code.
  311. \param user Ignored.
  312. \retval OPENMPT_ERROR_FUNC_RESULT_STORE Always.
  313. \since 0.3.0
  314. '/
  315. Declare Function openmpt_error_func_store(ByVal errorcode As Long, ByVal user As Any Ptr) As Long
  316. /'* \brief Ignore error function
  317. Causes all errors to be neither logged nor stored.
  318. \param errorcode Error code.
  319. \param user Ignored.
  320. \retval OPENMPT_ERROR_FUNC_RESULT_NONE Always.
  321. \since 0.3.0
  322. '/
  323. Declare Function openmpt_error_func_ignore(ByVal errorcode As Long, ByVal user As Any Ptr) As Long
  324. /'* \brief Errno error function
  325. Causes all errors to be stored in the pointer passed in as user.
  326. \param errorcode Error code.
  327. \param user Pointer to an int as generated by openmpt_error_func_errno_userdata.
  328. \retval OPENMPT_ERROR_FUNC_RESULT_NONE user is not NULL.
  329. \retval OPENMPT_ERROR_FUNC_RESULT_DEFAULT user is NULL.
  330. \since 0.3.0
  331. '/
  332. Declare Function openmpt_error_func_errno(ByVal errorcode As Long, ByVal user As Any Ptr) As Long
  333. /'* \brief User pointer for openmpt_error_func_errno
  334. Provides a suitable user pointer argument for openmpt_error_func_errno.
  335. \param errorcode Pointer to an integer value to be used as output by openmpt_error_func_errno.
  336. \retval Cast(Any Ptr, errorcode).
  337. \since 0.3.0
  338. '/
  339. Declare Function openmpt_error_func_errno_userdata(ByVal errorcode As Long Ptr) As Any Ptr
  340. /'* \brief Roughly scan the input stream to find out whether libopenmpt might be able to open it
  341. \param stream_callbacks Input stream callback operations.
  342. \param stream Input stream to scan.
  343. \param effort Effort to make when validating stream. Effort 0.0 does not even look at stream at all and effort 1.0 completely loads the file from stream. A lower effort requires less data to be loaded but only gives a rough estimate answer. Use an effort of 0.25 to only verify the header data of the module file.
  344. \param logfunc Logging function where warning and errors are written. May be NULL.
  345. \param user Logging function user context.
  346. \return Probability between 0.0 and 1.0.
  347. \remarks openmpt_could_open_probability() can return any value between 0.0 and 1.0. Only 0.0 and 1.0 are definitive answers, all values in between are just estimates. In general, any return value >0.0 means that you should try loading the file, and any value below 1.0 means that loading may fail. If you want a threshold above which you can be reasonably sure that libopenmpt will be able to load the file, use >=0.5. If you see the need for a threshold below which you could reasonably outright reject a file, use <0.25 (Note: Such a threshold for rejecting on the lower end is not recommended, but may be required for better integration into some other framework's probe scoring.).
  348. \remarks openmpt_could_open_probability() expects the complete file data to be eventually available to it, even if it is asked to just parse the header. Verification will be unreliable (both false positives and false negatives), if you pretend that the file is just some few bytes of initial data threshold in size. In order to really just access the first bytes of a file, check in your callback functions whether data or seeking is requested beyond your initial data threshold, and in that case, return an error. openmpt_could_open_probability() will treat this as any other I/O error and return 0.0. You must not expect the correct result in this case. You instead must remember that it asked for more data than you currently want to provide to it and treat this situation as if openmpt_could_open_probability() returned 0.5.
  349. \sa openmpt_stream_callbacks
  350. \deprecated Please use openmpt_module_could_open_probability2().
  351. \since 0.3.0
  352. '/
  353. Declare Function openmpt_could_open_probability(ByVal stream_callbacks As openmpt_stream_callbacks, ByVal stream As Any Ptr, ByVal effort As Double, ByVal logfunc As openmpt_log_func, ByVal user As Any Ptr) As Double
  354. /'* \brief Roughly scan the input stream to find out whether libopenmpt might be able to open it
  355. \param stream_callbacks Input stream callback operations.
  356. \param stream Input stream to scan.
  357. \param effort Effort to make when validating stream. Effort 0.0 does not even look at stream at all and effort 1.0 completely loads the file from stream. A lower effort requires less data to be loaded but only gives a rough estimate answer. Use an effort of 0.25 to only verify the header data of the module file.
  358. \param logfunc Logging function where warning and errors are written. May be NULL.
  359. \param loguser Logging function user context.
  360. \param errfunc Error function to define error behaviour. May be NULL.
  361. \param erruser Error function user context.
  362. \param errorcode Pointer to an integer where an error may get stored. May be NULL.
  363. \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
  364. \return Probability between 0.0 and 1.0.
  365. \remarks openmpt_probe_file_header() or openmpt_probe_file_header_without_filesize() provide a simpler and faster interface that fits almost all use cases better. It is recommended to use openmpt_probe_file_header() or openmpt_probe_file_header_without_filesize() instead of openmpt_could_open_probability().
  366. \remarks openmpt_could_open_probability2() can return any value between 0.0 and 1.0. Only 0.0 and 1.0 are definitive answers, all values in between are just estimates. In general, any return value >0.0 means that you should try loading the file, and any value below 1.0 means that loading may fail. If you want a threshold above which you can be reasonably sure that libopenmpt will be able to load the file, use >=0.5. If you see the need for a threshold below which you could reasonably outright reject a file, use <0.25 (Note: Such a threshold for rejecting on the lower end is not recommended, but may be required for better integration into some other framework's probe scoring.).
  367. \remarks openmpt_could_open_probability2() expects the complete file data to be eventually available to it, even if it is asked to just parse the header. Verification will be unreliable (both false positives and false negatives), if you pretend that the file is just some few bytes of initial data threshold in size. In order to really just access the first bytes of a file, check in your callback functions whether data or seeking is requested beyond your initial data threshold, and in that case, return an error. openmpt_could_open_probability() will treat this as any other I/O error and return 0.0. You must not expect the correct result in this case. You instead must remember that it asked for more data than you currently want to provide to it and treat this situation as if openmpt_could_open_probability() returned 0.5.
  368. \sa openmpt_stream_callbacks
  369. \sa openmpt_probe_file_header
  370. \sa openmpt_probe_file_header_without_filesize
  371. \since 0.3.0
  372. '/
  373. Declare Function openmpt_could_open_probability2(ByVal stream_callbacks As openmpt_stream_callbacks, ByVal stream As Any Ptr, ByVal effort As Double, ByVal logfunc As openmpt_log_func, ByVal loguser As Any Ptr, ByVal errfunc As openmpt_error_func, ByVal erruser As Any Ptr, ByVal errorcode As Long Ptr, ByVal error_message As Const ZString Ptr Ptr) As Double
  374. /'* \brief Get recommended header size for successfull format probing
  375. \sa openmpt_probe_file_header()
  376. \sa openmpt_probe_file_header_without_filesize()
  377. \since 0.3.0
  378. '/
  379. Declare Function openmpt_probe_file_header_get_recommended_size() As UInteger
  380. '* Probe for module formats in openmpt_probe_file_header() or openmpt_probe_file_header_without_filesize(). \since 0.3.0
  381. Const OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES = 1
  382. '* Probe for module-specific container formats in openmpt_probe_file_header() or openmpt_probe_file_header_without_filesize(). \since 0.3.0
  383. Const OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS = 2
  384. '* Probe for the default set of formats in openmpt_probe_file_header() or openmpt_probe_file_header_without_filesize(). \since 0.3.0
  385. Const OPENMPT_PROBE_FILE_HEADER_FLAGS_DEFAULT = OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES or OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS
  386. '* Probe for no formats in openmpt_probe_file_header() or openmpt_probe_file_header_without_filesize(). \since 0.3.0
  387. Const OPENMPT_PROBE_FILE_HEADER_FLAGS_NONE = 0
  388. '* Possible return values fo openmpt_probe_file_header() and openmpt_probe_file_header_without_filesize(). \since 0.3.0
  389. Const OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS = 1
  390. '* Possible return values fo openmpt_probe_file_header() and openmpt_probe_file_header_without_filesize(). \since 0.3.0
  391. Const OPENMPT_PROBE_FILE_HEADER_RESULT_FAILURE = 0
  392. '* Possible return values fo openmpt_probe_file_header() and openmpt_probe_file_header_without_filesize(). \since 0.3.0
  393. Const OPENMPT_PROBE_FILE_HEADER_RESULT_WANTMOREDATA = -1
  394. '* Possible return values fo openmpt_probe_file_header() and openmpt_probe_file_header_without_filesize(). \since 0.3.0
  395. Const OPENMPT_PROBE_FILE_HEADER_RESULT_ERROR = -255
  396. /'* \brief Probe the provided bytes from the beginning of a file for supported file format headers to find out whether libopenmpt might be able to open it
  397. \param flags Bit mask of OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES and OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS, or OPENMPT_PROBE_FILE_HEADER_FLAGS_DEFAULT.
  398. \param data Beginning of the file data.
  399. \param size Size of the beginning of the file data.
  400. \param filesize Full size of the file data on disk.
  401. \param logfunc Logging function where warning and errors are written. May be NULL.
  402. \param loguser Logging function user context. Used to pass any user-defined data associated with this module to the logging function.
  403. \param errfunc Error function to define error behaviour. May be NULL.
  404. \param erruser Error function user context. Used to pass any user-defined data associated with this module to the logging function.
  405. \param error Pointer to an integer where an error may get stored. May be NULL.
  406. \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
  407. \remarks It is recommended to provide openmpt_probe_file_header_get_recommended_size() bytes of data for data and size. If the file is smaller, only provide the filesize amount and set size and filesize to the file's size.
  408. \remarks openmpt_could_open_probability2() provides a more elaborate interface that might be required for special use cases. It is recommended to use openmpt_probe_file_header() though, if possible.
  409. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS The file will most likely be supported by libopenmpt.
  410. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_FAILURE The file is not supported by libopenmpt.
  411. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_WANTMOREDATA An answer could not be determined with the amount of data provided.
  412. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_ERROR An internal error occurred.
  413. \sa openmpt_probe_file_header_get_recommended_size()
  414. \sa openmpt_probe_file_header_without_filesize()
  415. \sa openmpt_probe_file_header_from_stream()
  416. \sa openmpt_could_open_probability2()
  417. \since 0.3.0
  418. '/
  419. Declare Function openmpt_probe_file_header(ByVal flags As ULongInt, ByVal Data As Const Any Ptr, ByVal size As UInteger, ByVal filesize As ULongInt, ByVal logfunc As openmpt_log_func, ByVal loguser As Any Ptr, ByVal errfunc As openmpt_error_func, ByVal erruser As Any Ptr, ByVal Error As Long Ptr, ByVal error_message As Const ZString Ptr Ptr) As Long
  420. /'* \brief Probe the provided bytes from the beginning of a file for supported file format headers to find out whether libopenmpt might be able to open it
  421. \param flags Bit mask of OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES and OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS, or OPENMPT_PROBE_FILE_HEADER_FLAGS_DEFAULT.
  422. \param data Beginning of the file data.
  423. \param size Size of the beginning of the file data.
  424. \param logfunc Logging function where warning and errors are written. May be NULL.
  425. \param loguser Logging function user context. Used to pass any user-defined data associated with this module to the logging function.
  426. \param errfunc Error function to define error behaviour. May be NULL.
  427. \param erruser Error function user context. Used to pass any user-defined data associated with this module to the logging function.
  428. \param error Pointer to an integer where an error may get stored. May be NULL.
  429. \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
  430. \remarks It is recommended to use openmpt_probe_file_header() and provide the acutal file's size as a parameter if at all possible. libopenmpt can provide more accurate answers if the filesize is known.
  431. \remarks It is recommended to provide openmpt_probe_file_header_get_recommended_size() bytes of data for data and size. If the file is smaller, only provide the filesize amount and set size to the file's size.
  432. \remarks openmpt_could_open_probability2() provides a more elaborate interface that might be required for special use cases. It is recommended to use openmpt_probe_file_header() though, if possible.
  433. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS The file will most likely be supported by libopenmpt.
  434. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_FAILURE The file is not supported by libopenmpt.
  435. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_WANTMOREDATA An answer could not be determined with the amount of data provided.
  436. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_ERROR An internal error occurred.
  437. \sa openmpt_probe_file_header_get_recommended_size()
  438. \sa openmpt_probe_file_header()
  439. \sa openmpt_probe_file_header_from_stream()
  440. \sa openmpt_could_open_probability2()
  441. \since 0.3.0
  442. '/
  443. Declare Function openmpt_probe_file_header_without_filesize(ByVal flags As ULongInt, ByVal Data As Const Any Ptr, ByVal size As UInteger, ByVal logfunc As openmpt_log_func, ByVal loguser As Any Ptr, ByVal errfunc As openmpt_error_func, ByVal erruser As Any Ptr, ByVal Error As Long Ptr, ByVal error_message As Const ZString Ptr Ptr) As Long
  444. /'* \brief Probe the provided bytes from the beginning of a file for supported file format headers to find out whether libopenmpt might be able to open it
  445. \param flags Bit mask of OPENMPT_PROBE_FILE_HEADER_FLAGS_MODULES and OPENMPT_PROBE_FILE_HEADER_FLAGS_CONTAINERS, or OPENMPT_PROBE_FILE_HEADER_FLAGS_DEFAULT.
  446. \param stream_callbacks Input stream callback operations.
  447. \param stream Input stream to scan.
  448. \param logfunc Logging function where warning and errors are written. May be NULL.
  449. \param loguser Logging function user context. Used to pass any user-defined data associated with this module to the logging function.
  450. \param errfunc Error function to define error behaviour. May be NULL.
  451. \param erruser Error function user context. Used to pass any user-defined data associated with this module to the logging function.
  452. \param error Pointer to an integer where an error may get stored. May be NULL.
  453. \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
  454. \remarks The stream is left in an unspecified state when this function returns.
  455. \remarks It is recommended to provide openmpt_probe_file_header_get_recommended_size() bytes of data for data and size. If the file is smaller, only provide the filesize amount and set size and filesize to the file's size.
  456. \remarks openmpt_could_open_probability2() provides a more elaborate interface that might be required for special use cases. It is recommended to use openmpt_probe_file_header() though, if possible.
  457. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_SUCCESS The file will most likely be supported by libopenmpt.
  458. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_FAILURE The file is not supported by libopenmpt.
  459. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_WANTMOREDATA An answer could not be determined with the amount of data provided.
  460. \retval OPENMPT_PROBE_FILE_HEADER_RESULT_ERROR An internal error occurred.
  461. \sa openmpt_probe_file_header_get_recommended_size()
  462. \sa openmpt_probe_file_header()
  463. \sa openmpt_probe_file_header_without_filesize()
  464. \sa openmpt_could_open_probability2()
  465. \since 0.3.0
  466. '/
  467. Declare Function openmpt_probe_file_header_from_stream(ByVal flags As ULongInt, ByVal stream_callbacks As openmpt_stream_callbacks, ByVal stream As Any Ptr, ByVal logfunc As openmpt_log_func, ByVal loguser As Any Ptr, ByVal errfunc As openmpt_error_func, ByVal erruser As Any Ptr, ByVal Error As Long Ptr, ByVal error_message As Const ZString Ptr Ptr) As Long
  468. '* \brief Opaque type representing a libopenmpt module
  469. Type openmpt_module
  470. opaque As Any Ptr
  471. End Type
  472. Type openmpt_module_initial_ctl
  473. ctl As Const ZString Ptr
  474. value As Const ZString Ptr
  475. End Type
  476. /'* \brief Construct an openmpt_module
  477. \param stream_callbacks Input stream callback operations.
  478. \param stream Input stream to load the module from.
  479. \param logfunc Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module.
  480. \param user User-defined data associated with this module. This value will be passed to the logging callback function (logfunc)
  481. \param ctls A map of initial ctl values. See openmpt_module_get_ctls().
  482. \return A pointer to the constructed openmpt_module, or NULL on failure.
  483. \remarks The input data can be discarded after an openmpt_module has been constructed successfully.
  484. \sa openmpt_stream_callbacks
  485. '/
  486. Declare Function openmpt_module_create(ByVal stream_callbacks As openmpt_stream_callbacks, ByVal stream As Any Ptr, ByVal logfunc As openmpt_log_func = 0, ByVal user As Any Ptr = 0, ByVal ctls As Const openmpt_module_initial_ctl Ptr = 0) As openmpt_module Ptr
  487. /'* \brief Construct an openmpt_module
  488. \param stream_callbacks Input stream callback operations.
  489. \param stream Input stream to load the module from.
  490. \param logfunc Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module. May be NULL.
  491. \param loguser User-defined data associated with this module. This value will be passed to the logging callback function (logfunc)
  492. \param errfunc Error function to define error behaviour. May be NULL.
  493. \param erruser Error function user context.
  494. \param errorcode Pointer to an integer where an error may get stored. May be NULL.
  495. \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
  496. \param ctls A map of initial ctl values. See openmpt_module_get_ctls().
  497. \return A pointer to the constructed openmpt_module, or NULL on failure.
  498. \remarks The input data can be discarded after an openmpt_module has been constructed successfully.
  499. \sa openmpt_stream_callbacks
  500. \since 0.3.0
  501. '/
  502. Declare Function openmpt_module_create2(ByVal stream_callbacks As openmpt_stream_callbacks, ByVal stream As Any Ptr, ByVal logfunc As openmpt_log_func = 0, ByVal loguser As Any Ptr = 0, ByVal errfunc As openmpt_error_func = 0, ByVal erruser As Any Ptr = 0, ByVal errorcode As Long Ptr = 0, ByVal error_message As Const ZString Ptr Ptr = 0, ByVal ctls As Const openmpt_module_initial_ctl Ptr = 0) As openmpt_module Ptr
  503. /'* \brief Construct an openmpt_module
  504. \param filedata Data to load the module from.
  505. \param filesize Amount of data available.
  506. \param logfunc Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module.
  507. \param user User-defined data associated with this module. This value will be passed to the logging callback function (logfunc)
  508. \param ctls A map of initial ctl values. See openmpt_module_get_ctls().
  509. \return A pointer to the constructed openmpt_module, or NULL on failure.
  510. \remarks The input data can be discarded after an openmpt_module has been constructed successfully.
  511. '/
  512. Declare Function openmpt_module_create_from_memory(ByVal filedata As Const Any Ptr, ByVal filesize As UInteger, ByVal logfunc As openmpt_log_func = 0, ByVal user As Any Ptr = 0, ByVal ctls As Const openmpt_module_initial_ctl Ptr = 0) As openmpt_module Ptr
  513. /'* \brief Construct an openmpt_module
  514. \param filedata Data to load the module from.
  515. \param filesize Amount of data available.
  516. \param logfunc Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module.
  517. \param loguser User-defined data associated with this module. This value will be passed to the logging callback function (logfunc)
  518. \param errfunc Error function to define error behaviour. May be NULL.
  519. \param erruser Error function user context.
  520. \param errorcode Pointer to an integer where an error may get stored. May be NULL.
  521. \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
  522. \param ctls A map of initial ctl values. See openmpt_module_get_ctls().
  523. \return A pointer to the constructed openmpt_module, or NULL on failure.
  524. \remarks The input data can be discarded after an openmpt_module has been constructed successfully.
  525. \since 0.3.0
  526. '/
  527. Declare Function openmpt_module_create_from_memory2(ByVal filedata As Const Any Ptr, ByVal filesize As UInteger, ByVal logfunc As openmpt_log_func, ByVal loguser As Any Ptr, ByVal errfunc As openmpt_error_func, ByVal erruser As Any Ptr, ByVal errorcode As Long Ptr, ByVal error_message As Const ZString Ptr Ptr, ByVal ctls As Const openmpt_module_initial_ctl Ptr) As openmpt_module Ptr
  528. /'* \brief Unload a previously created openmpt_module from memory.
  529. \param module The module to unload.
  530. '/
  531. Declare Sub openmpt_module_destroy(ByVal module As openmpt_module Ptr)
  532. /'* \brief Set logging function.
  533. Set the logging function of an already constructed openmpt_module.
  534. \param module The module handle to work on.
  535. \param logfunc Logging function where warning and errors are written. The logging function may be called throughout the lifetime of openmpt_module.
  536. \param loguser User-defined data associated with this module. This value will be passed to the logging callback function (logfunc)
  537. \since 0.3.0
  538. '/
  539. Declare Sub openmpt_module_set_log_func(ByVal module As openmpt_module Ptr, ByVal logfunc As openmpt_log_func, ByVal loguser As Any Ptr)
  540. /'* \brief Set error function.
  541. Set the error function of an already constructed openmpt_module.
  542. \param module The module handle to work on.
  543. \param errfunc Error function to define error behaviour. May be NULL.
  544. \param erruser Error function user context.
  545. \since 0.3.0
  546. '/
  547. Declare Sub openmpt_module_set_error_func(ByVal module As openmpt_module Ptr, ByVal errfunc As openmpt_error_func, ByVal erruser As Any Ptr)
  548. /'* \brief Get last error.
  549. Return the error currently stored in an openmpt_module. The stored error is not cleared.
  550. \param module The module handle to work on.
  551. \return The error currently stored.
  552. \sa openmpt_module_error_get_last_message
  553. \sa openmpt_module_error_set_last
  554. \sa openmpt_module_error_clear
  555. \since 0.3.0
  556. '/
  557. Declare Function openmpt_module_error_get_last(ByVal module As openmpt_module Ptr) As Long
  558. /'* \brief Get last error message.
  559. Return the error message currently stored in an openmpt_module. The stored error is not cleared.
  560. \param module The module handle to work on.
  561. \return The error message currently stored.
  562. \sa openmpt_module_error_set_last
  563. \sa openmpt_module_error_clear
  564. \since 0.3.0
  565. \remarks Use openmpt_module_error_get_last_message to automatically handle the lifetime of the returned pointer.
  566. '/
  567. Declare Function openmpt_module_error_get_last_message_ Alias "openmpt_module_error_get_last_message" (ByVal module As openmpt_module Ptr) As Const ZString Ptr
  568. /'* \brief Set last error.
  569. Set the error currently stored in an openmpt_module.
  570. \param module The module handle to work on.
  571. \param errorcode Error to be stored.
  572. \sa openmpt_module_error_get_last
  573. \sa openmpt_module_error_clear
  574. \since 0.3.0
  575. '/
  576. Declare Sub openmpt_module_error_set_last(ByVal module As openmpt_module Ptr, ByVal errorcode As Long)
  577. /'* \brief Clear last error.
  578. Set the error currently stored in an openmpt_module to OPPENMPT_ERROR_OK.
  579. \param module The module handle to work on.
  580. \sa openmpt_module_error_get_last
  581. \sa openmpt_module_error_set_last
  582. \since 0.3.0
  583. '/
  584. Declare Sub openmpt_module_error_clear(ByVal module As openmpt_module Ptr)
  585. /'*
  586. \defgroup openmpt_module_render_param Render param indices
  587. \brief Parameter index to use with openmpt_module_get_render_param() and openmpt_module_set_render_param()
  588. @{
  589. '/
  590. /'* \brief Master Gain
  591. The related value represents a relative gain in milliBel.\n
  592. The default value is 0.\n
  593. The supported value range is unlimited.\n
  594. '/
  595. Const OPENMPT_MODULE_RENDER_MASTERGAIN_MILLIBEL = 1
  596. /'* \brief Stereo Separation
  597. The related value represents the stereo separation generated by the libopenmpt mixer in percent.\n
  598. The default value is 100.\n
  599. The supported value range is [0,200].\n
  600. '/
  601. Const OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT = 2
  602. /'* \brief Interpolation Filter
  603. The related value represents the interpolation filter length used by the libopenmpt mixer.\n
  604. The default value is 0, which indicates a recommended default value.\n
  605. The supported value range is [0,inf). Values greater than the implementation limit are clamped to the maximum supported value.\n
  606. Currently supported values:
  607. - 0: internal default
  608. - 1: no interpolation (zero order hold)
  609. - 2: linear interpolation
  610. - 4: cubic interpolation
  611. - 8: windowed sinc with 8 taps
  612. '/
  613. Const OPENMPT_MODULE_RENDER_INTERPOLATIONFILTER_LENGTH = 3
  614. /'* \brief Volume Ramping Strength
  615. The related value represents the amount of volume ramping done by the libopenmpt mixer.\n
  616. The default value is -1, which indicates a recommended default value.\n
  617. The meaningful value range is [-1..10].\n
  618. A value of 0 completely disables volume ramping. This might cause clicks in sound output.\n
  619. Higher values imply slower/softer volume ramps.
  620. '/
  621. Const OPENMPT_MODULE_RENDER_VOLUMERAMPING_STRENGTH = 4
  622. '* @}
  623. /'*
  624. \defgroup openmpt_module_command_index Pattern cell indices
  625. \brief Parameter index to use with openmpt_module_get_pattern_row_channel_command(), openmpt_module_format_pattern_row_channel_command() and openmpt_module_highlight_pattern_row_channel_command()
  626. @{
  627. '/
  628. Const OPENMPT_MODULE_COMMAND_NOTE = 0
  629. Const OPENMPT_MODULE_COMMAND_INSTRUMENT = 1
  630. Const OPENMPT_MODULE_COMMAND_VOLUMEEFFECT = 2
  631. Const OPENMPT_MODULE_COMMAND_EFFECT = 3
  632. Const OPENMPT_MODULE_COMMAND_VOLUME = 4
  633. Const OPENMPT_MODULE_COMMAND_PARAMETER = 5
  634. '* @}
  635. /'* \brief Select a sub-song from a multi-song module
  636. \param module The module handle to work on.
  637. \param subsong Index of the sub-song. -1 plays all sub-songs consecutively.
  638. \return 1 on success, 0 on failure.
  639. \sa openmpt_module_get_num_subsongs, openmpt_module_get_selected_subsong, openmpt_module_get_subsong_name
  640. \remarks Whether subsong -1 (all subsongs consecutively), subsong 0 or some other subsong is selected by default, is an implementation detail and subject to change. If you do not want to care about subsongs, it is recommended to just not call openmpt_module_select_subsong() at all.
  641. '/
  642. Declare Function openmpt_module_select_subsong(ByVal module As openmpt_module Ptr, ByVal subsong As Long) As Long
  643. /'* \brief Get currently selected sub-song from a multi-song module
  644. \param module The module handle to work on.
  645. \return Currently selected sub-song. -1 for all subsongs consecutively, 0 or greater for the current sub-song index.
  646. \sa openmpt_module_get_num_subsongs, openmpt_module_select_subsong, openmpt_module_get_subsong_name
  647. \since 0.3.0
  648. '/
  649. Declare Function openmpt_module_get_selected_subsong(ByVal module As openmpt_module Ptr) As Long
  650. /'* \brief Set Repeat Count
  651. \param module The module handle to work on.
  652. \param repeat_count Repeat Count
  653. - -1: repeat forever
  654. - 0: play once, repeat zero times (the default)
  655. - n>0: play once and repeat n times after that
  656. \return 1 on success, 0 on failure.
  657. \sa openmpt_module_get_repeat_count
  658. '/
  659. Declare Function openmpt_module_set_repeat_count(ByVal module As openmpt_module Ptr, ByVal repeat_count As Long) As Long
  660. /'* \brief Get Repeat Count
  661. \param module The module handle to work on.
  662. \return Repeat Count
  663. - -1: repeat forever
  664. - 0: play once, repeat zero times (the default)
  665. - n>0: play once and repeat n times after that
  666. \sa openmpt_module_set_repeat_count
  667. '/
  668. Declare Function openmpt_module_get_repeat_count(ByVal module As openmpt_module Ptr) As Long
  669. /'* \brief approximate song duration
  670. \param module The module handle to work on.
  671. \return Approximate duration of current sub-song in seconds.
  672. \remarks The function may return infinity if the pattern data is too complex to evaluate.
  673. '/
  674. Declare Function openmpt_module_get_duration_seconds(ByVal module As openmpt_module Ptr) As Double
  675. /'* \brief Set approximate current song position
  676. \param module The module handle to work on.
  677. \param seconds Seconds to seek to. If seconds is out of range, the position gets set to song start or end respectively.
  678. \return Approximate new song position in seconds.
  679. \sa openmpt_module_get_position_seconds
  680. '/
  681. Declare Function openmpt_module_set_position_seconds(ByVal module As openmpt_module Ptr, ByVal seconds As Double) As Double
  682. /'* \brief Get current song position
  683. \param module The module handle to work on.
  684. \return Current song position in seconds.
  685. \sa openmpt_module_set_position_seconds
  686. '/
  687. Declare Function openmpt_module_get_position_seconds(ByVal module As openmpt_module Ptr) As Double
  688. /'* \brief Set approximate current song position
  689. If order or row are out of range, to position is not modified and the current position is returned.
  690. \param module The module handle to work on.
  691. \param order Pattern order number to seek to.
  692. \param row Pattern row number to seek to.
  693. \return Approximate new song position in seconds.
  694. \sa openmpt_module_set_position_seconds
  695. \sa openmpt_module_get_position_seconds
  696. '/
  697. Declare Function openmpt_module_set_position_order_row(ByVal module As openmpt_module Ptr, ByVal order As Long, ByVal row As Long) As Double
  698. /'* \brief Get render parameter
  699. \param module The module handle to work on.
  700. \param param Parameter to query. See \ref openmpt_module_render_param
  701. \param value Pointer to the variable that receives the current value of the parameter.
  702. \return 1 on success, 0 on failure (invalid param or value is NULL).
  703. \sa OPENMPT_MODULE_RENDER_MASTERGAIN_MILLIBEL
  704. \sa OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT
  705. \sa OPENMPT_MODULE_RENDER_INTERPOLATIONFILTER_LENGTH
  706. \sa OPENMPT_MODULE_RENDER_VOLUMERAMPING_STRENGTH
  707. \sa openmpt_module_set_render_param
  708. '/
  709. Declare Function openmpt_module_get_render_param(ByVal module As openmpt_module Ptr, ByVal param As Long, ByVal value As Long Ptr) As Long
  710. /'* \brief Set render parameter
  711. \param module The module handle to work on.
  712. \param param Parameter to set. See \ref openmpt_module_render_param
  713. \param value The value to set param to.
  714. \return 1 on success, 0 on failure (invalid param).
  715. \sa OPENMPT_MODULE_RENDER_MASTERGAIN_MILLIBEL
  716. \sa OPENMPT_MODULE_RENDER_STEREOSEPARATION_PERCENT
  717. \sa OPENMPT_MODULE_RENDER_INTERPOLATIONFILTER_LENGTH
  718. \sa OPENMPT_MODULE_RENDER_VOLUMERAMPING_STRENGTH
  719. \sa openmpt_module_get_render_param
  720. '/
  721. Declare Function openmpt_module_set_render_param(ByVal module As openmpt_module Ptr, ByVal param As Long, ByVal value As Long) As Long
  722. '*@{
  723. /'* \brief Render audio data
  724. \param module The module handle to work on.
  725. \param samplerate Sample rate to render output. Should be in [8000,192000], but this is not enforced.
  726. \param count Number of audio frames to render per channel.
  727. \param mono Pointer to a buffer of at least count elements that receives the mono/center output.
  728. \return The number of frames actually rendered.
  729. \retval 0 The end of song has been reached.
  730. \remarks The output buffers are only written to up to the returned number of elements.
  731. \remarks You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
  732. \remarks It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.
  733. \sa \ref libopenmpt_freebasic_outputformat
  734. '/
  735. Declare Function openmpt_module_read_mono(ByVal module As openmpt_module Ptr, ByVal samplerate As Long, ByVal count As UInteger, ByVal mono As Short Ptr) As UInteger
  736. /'* \brief Render audio data
  737. \param module The module handle to work on.
  738. \param samplerate Sample rate to render output. Should be in [8000,192000], but this is not enforced.
  739. \param count Number of audio frames to render per channel.
  740. \param left Pointer to a buffer of at least count elements that receives the left output.
  741. \param right Pointer to a buffer of at least count elements that receives the right output.
  742. \return The number of frames actually rendered.
  743. \retval 0 The end of song has been reached.
  744. \remarks The output buffers are only written to up to the returned number of elements.
  745. \remarks You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
  746. \remarks It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.
  747. \sa \ref libopenmpt_freebasic_outputformat
  748. '/
  749. Declare Function openmpt_module_read_stereo(ByVal module As openmpt_module Ptr, ByVal samplerate As Long, ByVal count As UInteger, ByVal Left As Short Ptr, ByVal Right As Short Ptr) As UInteger
  750. /'* \brief Render audio data
  751. \param module The module handle to work on.
  752. \param samplerate Sample rate to render output. Should be in [8000,192000], but this is not enforced.
  753. \param count Number of audio frames to render per channel.
  754. \param left Pointer to a buffer of at least count elements that receives the left output.
  755. \param right Pointer to a buffer of at least count elements that receives the right output.
  756. \param rear_left Pointer to a buffer of at least count elements that receives the rear left output.
  757. \param rear_right Pointer to a buffer of at least count elements that receives the rear right output.
  758. \return The number of frames actually rendered.
  759. \retval 0 The end of song has been reached.
  760. \remarks The output buffers are only written to up to the returned number of elements.
  761. \remarks You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
  762. \remarks It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.
  763. \sa \ref libopenmpt_freebasic_outputformat
  764. '/
  765. Declare Function openmpt_module_read_quad(ByVal module As openmpt_module Ptr, ByVal samplerate As Long, ByVal count As UInteger, ByVal Left As Short Ptr, ByVal Right As Short Ptr, ByVal rear_left As Short Ptr, ByVal rear_right As Short Ptr) As UInteger
  766. /'* \brief Render audio data
  767. \param module The module handle to work on.
  768. \param samplerate Sample rate to render output. Should be in [8000,192000], but this is not enforced.
  769. \param count Number of audio frames to render per channel.
  770. \param mono Pointer to a buffer of at least count elements that receives the mono/center output.
  771. \return The number of frames actually rendered.
  772. \retval 0 The end of song has been reached.
  773. \remarks The output buffers are only written to up to the returned number of elements.
  774. \remarks You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
  775. \remarks Floating point samples are in the [-1.0..1.0] nominal range. They are not clipped to that range though and thus might overshoot.
  776. \sa \ref libopenmpt_freebasic_outputformat
  777. '/
  778. Declare Function openmpt_module_read_float_mono(ByVal module As openmpt_module Ptr, ByVal samplerate As Long, ByVal count As UInteger, ByVal mono As Single Ptr) As UInteger
  779. /'* \brief Render audio data
  780. \param module The module handle to work on.
  781. \param samplerate Sample rate to render output. Should be in [8000,192000], but this is not enforced.
  782. \param count Number of audio frames to render per channel.
  783. \param left Pointer to a buffer of at least count elements that receives the left output.
  784. \param right Pointer to a buffer of at least count elements that receives the right output.
  785. \return The number of frames actually rendered.
  786. \retval 0 The end of song has been reached.
  787. \remarks The output buffers are only written to up to the returned number of elements.
  788. \remarks You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
  789. \remarks Floating point samples are in the [-1.0..1.0] nominal range. They are not clipped to that range though and thus might overshoot.
  790. \sa \ref libopenmpt_freebasic_outputformat
  791. '/
  792. Declare Function openmpt_module_read_float_stereo(ByVal module As openmpt_module Ptr, ByVal samplerate As Long, ByVal count As UInteger, ByVal Left As Single Ptr, ByVal Right As Single Ptr) As UInteger
  793. /'* \brief Render audio data
  794. \param module The module handle to work on.
  795. \param samplerate Sample rate to render output. Should be in [8000,192000], but this is not enforced.
  796. \param count Number of audio frames to render per channel.
  797. \param left Pointer to a buffer of at least count elements that receives the left output.
  798. \param right Pointer to a buffer of at least count elements that receives the right output.
  799. \param rear_left Pointer to a buffer of at least count elements that receives the rear left output.
  800. \param rear_right Pointer to a buffer of at least count elements that receives the rear right output.
  801. \return The number of frames actually rendered.
  802. \retval 0 The end of song has been reached.
  803. \remarks The output buffers are only written to up to the returned number of elements.
  804. \remarks You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
  805. \remarks Floating point samples are in the [-1.0..1.0] nominal range. They are not clipped to that range though and thus might overshoot.
  806. \sa \ref libopenmpt_freebasic_outputformat
  807. '/
  808. Declare Function openmpt_module_read_float_quad(ByVal module As openmpt_module Ptr, ByVal samplerate As Long, ByVal count As UInteger, ByVal Left As Single Ptr, ByVal Right As Single Ptr, ByVal rear_left As Single Ptr, ByVal rear_right As Single Ptr) As UInteger
  809. /'* \brief Render audio data
  810. \param module The module handle to work on.
  811. \param samplerate Sample rate to render output. Should be in [8000,192000], but this is not enforced.
  812. \param count Number of audio frames to render per channel.
  813. \param interleaved_stereo Pointer to a buffer of at least count*2 elements that receives the interleaved stereo output in the order (L,R).
  814. \return The number of frames actually rendered.
  815. \retval 0 The end of song has been reached.
  816. \remarks The output buffers are only written to up to the returned number of elements.
  817. \remarks You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
  818. \remarks It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.
  819. \sa \ref libopenmpt_freebasic_outputformat
  820. '/
  821. Declare Function openmpt_module_read_interleaved_stereo(ByVal module As openmpt_module Ptr, ByVal samplerate As Long, ByVal count As UInteger, ByVal interleaved_stereo As Short Ptr) As UInteger
  822. /'* \brief Render audio data
  823. \param module The module handle to work on.
  824. \param samplerate Sample rate to render output. Should be in [8000,192000], but this is not enforced.
  825. \param count Number of audio frames to render per channel.
  826. \param interleaved_quad Pointer to a buffer of at least count*4 elements that receives the interleaved quad surround output in the order (L,R,RL,RR).
  827. \return The number of frames actually rendered.
  828. \retval 0 The end of song has been reached.
  829. \remarks The output buffers are only written to up to the returned number of elements.
  830. \remarks You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
  831. \remarks It is recommended to use the floating point API because of the greater dynamic range and no implied clipping.
  832. \sa \ref libopenmpt_freebasic_outputformat
  833. '/
  834. Declare Function openmpt_module_read_interleaved_quad(ByVal module As openmpt_module Ptr, ByVal samplerate As Long, ByVal count As UInteger, ByVal interleaved_quad As Short Ptr) As UInteger
  835. /'* \brief Render audio data
  836. \param module The module handle to work on.
  837. \param samplerate Sample rate to render output. Should be in [8000,192000], but this is not enforced.
  838. \param count Number of audio frames to render per channel.
  839. \param interleaved_stereo Pointer to a buffer of at least count*2 elements that receives the interleaved stereo output in the order (L,R).
  840. \return The number of frames actually rendered.
  841. \retval 0 The end of song has been reached.
  842. \remarks The output buffers are only written to up to the returned number of elements.
  843. \remarks You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
  844. \remarks Floating point samples are in the [-1.0..1.0] nominal range. They are not clipped to that range though and thus might overshoot.
  845. \sa \ref libopenmpt_freebasic_outputformat
  846. '/
  847. Declare Function openmpt_module_read_interleaved_float_stereo(ByVal module As openmpt_module Ptr, ByVal samplerate As Long, ByVal count As UInteger, ByVal interleaved_stereo As Single Ptr) As UInteger
  848. /'* \brief Render audio data
  849. \param module The module handle to work on.
  850. \param samplerate Sample rate to render output. Should be in [8000,192000], but this is not enforced.
  851. \param count Number of audio frames to render per channel.
  852. \param interleaved_quad Pointer to a buffer of at least count*4 elements that receives the interleaved quad surround output in the order (L,R,RL,RR).
  853. \return The number of frames actually rendered.
  854. \retval 0 The end of song has been reached.
  855. \remarks The output buffers are only written to up to the returned number of elements.
  856. \remarks You can freely switch between any of the "openmpt_module_read*" variants if you see a need to do so. libopenmpt tries to introduce as little switching annoyances as possible. Normally, you would only use a single one of these functions for rendering a particular module.
  857. \remarks Floating point samples are in the [-1.0..1.0] nominal range. They are not clipped to that range though and thus might overshoot.
  858. \sa \ref libopenmpt_freebasic_outputformat
  859. '/
  860. Declare Function openmpt_module_read_interleaved_float_quad(ByVal module As openmpt_module Ptr, ByVal samplerate As Long, ByVal count As UInteger, ByVal interleaved_quad As Single Ptr) As UInteger
  861. '*@}
  862. /'* \brief Get the list of supported metadata item keys
  863. \param module The module handle to work on.
  864. \return Metadata item keys supported by openmpt_module_get_metadata, as a semicolon-separated list.
  865. \sa openmpt_module_get_metadata
  866. \remarks Use openmpt_module_get_metadata_keys to automatically handle the lifetime of the returned pointer.
  867. '/
  868. Declare Function openmpt_module_get_metadata_keys_ Alias "openmpt_module_get_metadata_keys" (ByVal module As openmpt_module Ptr) As Const ZString Ptr
  869. /'* \brief Get a metadata item value
  870. \param module The module handle to work on.
  871. \param key Metadata item key to query. Use openmpt_module_get_metadata_keys to check for available keys.
  872. Possible keys are:
  873. - type: Module format extension (e.g. it) or another similar identifier for modules formats that typically do not use a file extension
  874. - type_long: Format name associated with the module format (e.g. Impulse Tracker)
  875. - originaltype: Module format extension (e.g. it) of the original module in case the actual type is a converted format (e.g. mo3 or gdm)
  876. - originaltype_long: Format name associated with the module format (e.g. Impulse Tracker) of the original module in case the actual type is a converted format (e.g. mo3 or gdm)
  877. - container: Container format the module file is embedded in, if any (e.g. umx)
  878. - container_long: Full container name if the module is embedded in a container (e.g. Unreal Music)
  879. - tracker: Tracker that was (most likely) used to save the module file, if known
  880. - artist: Author of the module
  881. - title: Module title
  882. - date: Date the module was last saved, in ISO-8601 format.
  883. - message: Song message. If the song message is empty or the module format does not support song messages, a list of instrument and sample names is returned instead.
  884. - message_raw: Song message. If the song message is empty or the module format does not support song messages, an empty string is returned.
  885. - warnings: A list of warnings that were generated while loading the module.
  886. \return The associated value for key.
  887. \sa openmpt_module_get_metadata_keys
  888. \remarks Use openmpt_module_get_metadata to automatically handle the lifetime of the returned pointer.
  889. '/
  890. Declare Function openmpt_module_get_metadata_ Alias "openmpt_module_get_metadata" (ByVal module As openmpt_module Ptr, ByVal key As Const ZString Ptr) As Const ZString Ptr
  891. /'* \brief Get the current estimated beats per minute (BPM).
  892. \param module The module handle to work on.
  893. \remarks Many module formats lack time signature metadata. It is common that this estimate is off by a factor of two, but other multipliers are also possible.
  894. \remarks Due to the nature of how module tempo works, the estimate may change slightly after switching libopenmpt's output to a different sample rate.
  895. \return The current estimated BPM.
  896. '/
  897. Declare Function openmpt_module_get_current_estimated_bpm(ByVal module As openmpt_module Ptr) As Double
  898. /'* \brief Get the current speed
  899. \param module The module handle to work on.
  900. \return The current speed in ticks per row.
  901. '/
  902. Declare Function openmpt_module_get_current_speed(ByVal module As openmpt_module Ptr) As Long
  903. /'* \brief Get the current tempo
  904. \param module The module handle to work on.
  905. \return The current tempo in tracker units. The exact meaning of this value depends on the tempo mode being used.
  906. '/
  907. Declare Function openmpt_module_get_current_tempo(ByVal module As openmpt_module Ptr) As Long
  908. /'* \brief Get the current order
  909. \param module The module handle to work on.
  910. \return The current order at which the module is being played back.
  911. '/
  912. Declare Function openmpt_module_get_current_order(ByVal module As openmpt_module Ptr) As Long
  913. /'* \brief Get the current pattern
  914. \param module The module handle to work on.
  915. \return The current pattern that is being played.
  916. '/
  917. Declare Function openmpt_module_get_current_pattern(ByVal module As openmpt_module Ptr) As Long
  918. /'* \brief Get the current row
  919. \param module The module handle to work on.
  920. \return The current row at which the current pattern is being played.
  921. '/
  922. Declare Function openmpt_module_get_current_row(ByVal module As openmpt_module Ptr) As Long
  923. /'* \brief Get the current amount of playing channels.
  924. \param module The module handle to work on.
  925. \return The amount of sample channels that are currently being rendered.
  926. '/
  927. Declare Function openmpt_module_get_current_playing_channels(ByVal module As openmpt_module Ptr) As Long
  928. /'* \brief Get an approximate indication of the channel volume.
  929. \param module The module handle to work on.
  930. \param channel The channel whose volume should be retrieved.
  931. \return The approximate channel volume.
  932. \remarks The returned value is solely based on the note velocity and does not take the actual waveform of the playing sample into account.
  933. '/
  934. Declare Function openmpt_module_get_current_channel_vu_mono(ByVal module As openmpt_module Ptr, ByVal channel As Long) As Single
  935. /'* \brief Get an approximate indication of the channel volume on the front-left speaker.
  936. \param module The module handle to work on.
  937. \param channel The channel whose volume should be retrieved.
  938. \return The approximate channel volume.
  939. \remarks The returned value is solely based on the note velocity and does not take the actual waveform of the playing sample into account.
  940. '/
  941. Declare Function openmpt_module_get_current_channel_vu_left(ByVal module As openmpt_module Ptr, ByVal channel As Long) As Single
  942. /'* \brief Get an approximate indication of the channel volume on the front-right speaker.
  943. \param module The module handle to work on.
  944. \param channel The channel whose volume should be retrieved.
  945. \return The approximate channel volume.
  946. \remarks The returned value is solely based on the note velocity and does not take the actual waveform of the playing sample into account.
  947. '/
  948. Declare Function openmpt_module_get_current_channel_vu_right(ByVal module As openmpt_module Ptr, ByVal channel As Long) As Single
  949. /'* \brief Get an approximate indication of the channel volume on the rear-left speaker.
  950. \param module The module handle to work on.
  951. \param channel The channel whose volume should be retrieved.
  952. \return The approximate channel volume.
  953. \remarks The returned value is solely based on the note velocity and does not take the actual waveform of the playing sample into account.
  954. '/
  955. Declare Function openmpt_module_get_current_channel_vu_rear_left(ByVal module As openmpt_module Ptr, ByVal channel As Long) As Single
  956. /'* \brief Get an approximate indication of the channel volume on the rear-right speaker.
  957. \param module The module handle to work on.
  958. \param channel The channel whose volume should be retrieved.
  959. \return The approximate channel volume.
  960. \remarks The returned value is solely based on the note velocity and does not take the actual waveform of the playing sample into account.
  961. '/
  962. Declare Function openmpt_module_get_current_channel_vu_rear_right(ByVal module As openmpt_module Ptr, ByVal channel As Long) As Single
  963. /'* \brief Get the number of sub-songs
  964. \param module The module handle to work on.
  965. \return The number of sub-songs in the module. This includes any "hidden" songs (songs that share the same sequence, but start at different order indices) and "normal" sub-songs or "sequences" (if the format supports them).
  966. \sa openmpt_module_get_subsong_name, openmpt_module_select_subsong, openmpt_module_get_selected_subsong
  967. '/
  968. Declare Function openmpt_module_get_num_subsongs(ByVal module As openmpt_module Ptr) As Long
  969. /'* \brief Get the number of pattern channels
  970. \param module The module handle to work on.
  971. \return The number of pattern channels in the module. Not all channels do necessarily contain data.
  972. \remarks The number of pattern channels is completely independent of the number of output channels. libopenmpt can render modules in mono, stereo or quad surround, but the choice of which of the three modes to use must not be made based on the return value of this function, which may be any positive integer amount. Only use this function for informational purposes.
  973. '/
  974. Declare Function openmpt_module_get_num_channels(ByVal module As openmpt_module Ptr) As Long
  975. /'* \brief Get the number of orders
  976. \param module The module handle to work on.
  977. \return The number of orders in the current sequence of the module.
  978. '/
  979. Declare Function openmpt_module_get_num_orders(ByVal module As openmpt_module Ptr) As Long
  980. /'* \brief Get the number of patterns
  981. \param module The module handle to work on.
  982. \return The number of distinct patterns in the module.
  983. '/
  984. Declare Function openmpt_module_get_num_patterns(ByVal module As openmpt_module Ptr) As Long
  985. /'* \brief Get the number of instruments
  986. \param module The module handle to work on.
  987. \return The number of instrument slots in the module. Instruments are a layer on top of samples, and are not supported by all module formats.
  988. '/
  989. Declare Function openmpt_module_get_num_instruments(ByVal module As openmpt_module Ptr) As Long
  990. /'* \brief Get the number of samples
  991. \param module The module handle to work on.
  992. \return The number of sample slots in the module.
  993. '/
  994. Declare Function openmpt_module_get_num_samples(ByVal module As openmpt_module Ptr) As Long
  995. /'* \brief Get a sub-song name
  996. \param module The module handle to work on.
  997. \param index The sub-song whose name should be retrieved
  998. \return The sub-song name.
  999. \sa openmpt_module_get_num_subsongs, openmpt_module_select_subsong, openmpt_module_get_selected_subsong
  1000. \remarks Use openmpt_module_get_subsong_name to automatically handle the lifetime of the returned pointer.
  1001. '/
  1002. Declare Function openmpt_module_get_subsong_name_ Alias "openmpt_module_get_subsong_name" (ByVal module As openmpt_module Ptr, ByVal index As Long) As Const ZString Ptr
  1003. /'* \brief Get a channel name
  1004. \param module The module handle to work on.
  1005. \param index The channel whose name should be retrieved
  1006. \return The channel name.
  1007. \sa openmpt_module_get_num_channels
  1008. \remarks Use openmpt_module_get_channel_name to automatically handle the lifetime of the returned pointer.
  1009. '/
  1010. Declare Function openmpt_module_get_channel_name_ Alias "openmpt_module_get_channel_name" (ByVal module As openmpt_module Ptr, ByVal index As Long) As Const ZString Ptr
  1011. /'* \brief Get an order name
  1012. \param module The module handle to work on.
  1013. \param index The order whose name should be retrieved
  1014. \return The order name.
  1015. \sa openmpt_module_get_num_orders
  1016. \remarks Use openmpt_module_get_order_name to automatically handle the lifetime of the returned pointer.
  1017. '/
  1018. Declare Function openmpt_module_get_order_name_ Alias "openmpt_module_get_order_name" (ByVal module As openmpt_module Ptr, ByVal index As Long) As Const ZString Ptr
  1019. /'* \brief Get a pattern name
  1020. \param module The module handle to work on.
  1021. \param index The pattern whose name should be retrieved
  1022. \return The pattern name.
  1023. \sa openmpt_module_get_num_patterns
  1024. \remarks Use openmpt_module_get_pattern_name to automatically handle the lifetime of the returned pointer.
  1025. '/
  1026. Declare Function openmpt_module_get_pattern_name_ Alias "openmpt_module_get_pattern_name" (ByVal module As openmpt_module Ptr, ByVal index As Long) As Const ZString Ptr
  1027. /'* \brief Get an instrument name
  1028. \param module The module handle to work on.
  1029. \param index The instrument whose name should be retrieved
  1030. \return The instrument name.
  1031. \sa openmpt_module_get_num_instruments
  1032. \remarks Use openmpt_module_get_instrument_name to automatically handle the lifetime of the returned pointer.
  1033. '/
  1034. Declare Function openmpt_module_get_instrument_name_ Alias "openmpt_module_get_instrument_name" (ByVal module As openmpt_module Ptr, ByVal index As Long) As Const ZString Ptr
  1035. /'* \brief Get a sample name
  1036. \param module The module handle to work on.
  1037. \param index The sample whose name should be retrieved
  1038. \return The sample name.
  1039. \sa openmpt_module_get_num_samples
  1040. \remarks Use openmpt_module_get_sample_name to automatically handle the lifetime of the returned pointer.
  1041. '/
  1042. Declare Function openmpt_module_get_sample_name_ Alias "openmpt_module_get_sample_name" (ByVal module As openmpt_module Ptr, ByVal index As Long) As Const ZString Ptr
  1043. /'* \brief Get pattern at order position
  1044. \param module The module handle to work on.
  1045. \param order The order item whose pattern index should be retrieved.
  1046. \return The pattern index found at the given order position of the current sequence.
  1047. '/
  1048. Declare Function openmpt_module_get_order_pattern(ByVal module As openmpt_module Ptr, ByVal order As Long) As Long
  1049. /'* \brief Get the number of rows in a pattern
  1050. \param module The module handle to work on.
  1051. \param pattern The pattern whose row count should be retrieved.
  1052. \return The number of rows in the given pattern. If the pattern does not exist, 0 is returned.
  1053. '/
  1054. Declare Function openmpt_module_get_pattern_num_rows(ByVal module As openmpt_module Ptr, ByVal pattern As Long) As Long
  1055. /'* \brief Get raw pattern content
  1056. \param module The module handle to work on.
  1057. \param pattern The pattern whose data should be retrieved.
  1058. \param row The row from which the data should be retrieved.
  1059. \param channel The channel from which the data should be retrieved.
  1060. \param command The cell index at which the data should be retrieved. See \ref openmpt_module_command_index
  1061. \return The internal, raw pattern data at the given pattern position.
  1062. '/
  1063. Declare Function openmpt_module_get_pattern_row_channel_command_(ByVal module As openmpt_module Ptr, ByVal pattern As Long, ByVal row As Long, ByVal channel As Long, ByVal command_ As Long) As UByte
  1064. /'* \brief Get formatted (human-readable) pattern content
  1065. \param module The module handle to work on.
  1066. \param pattern The pattern whose data should be retrieved.
  1067. \param row The row from which the data should be retrieved.
  1068. \param channel The channel from which the data should be retrieved.
  1069. \param command The cell index at which the data should be retrieved.
  1070. \return The formatted pattern data at the given pattern position. See \ref openmpt_module_command_index
  1071. \sa openmpt_module_highlight_pattern_row_channel_command
  1072. \remarks Use openmpt_module_format_pattern_row_channel_command to automatically handle the lifetime of the returned pointer.
  1073. '/
  1074. Declare Function openmpt_module_format_pattern_row_channel_command_ Alias "openmpt_module_format_pattern_row_channel_command" (ByVal module As openmpt_module Ptr, ByVal pattern As Long, ByVal row As Long, ByVal channel As Long, ByVal command_ As Long) As Const ZString Ptr
  1075. /'* \brief Get highlighting information for formatted pattern content
  1076. \param module The module handle to work on.
  1077. \param pattern The pattern whose data should be retrieved.
  1078. \param row The row from which the data should be retrieved.
  1079. \param channel The channel from which the data should be retrieved.
  1080. \param command The cell index at which the data should be retrieved. See \ref openmpt_module_command_index
  1081. \return The highlighting string for the formatted pattern data as retrieved by openmpt_module_get_pattern_row_channel_command at the given pattern position.
  1082. \remarks The returned string will map each character position of the string returned by openmpt_module_get_pattern_row_channel_command to a highlighting instruction.
  1083. Possible highlighting characters are:
  1084. - " " : empty/space
  1085. - "." : empty/dot
  1086. - "n" : generic note
  1087. - "m" : special note
  1088. - "i" : generic instrument
  1089. - "u" : generic volume column effect
  1090. - "v" : generic volume column parameter
  1091. - "e" : generic effect column effect
  1092. - "f" : generic effect column parameter
  1093. \sa openmpt_module_get_pattern_row_channel_command
  1094. \remarks Use openmpt_module_highlight_pattern_row_channel_command to automatically handle the lifetime of the returned pointer.
  1095. '/
  1096. Declare Function openmpt_module_highlight_pattern_row_channel_command_ Alias "openmpt_module_highlight_pattern_row_channel_command" (ByVal module As openmpt_module Ptr, ByVal pattern As Long, ByVal row As Long, ByVal channel As Long, ByVal command_ As Long) As Const ZString Ptr
  1097. /'* \brief Get formatted (human-readable) pattern content
  1098. \param module The module handle to work on.
  1099. \param pattern The pattern whose data should be retrieved.
  1100. \param row The row from which the data should be retrieved.
  1101. \param channel The channel from which the data should be retrieved.
  1102. \param width The maximum number of characters the string should contain. 0 means no limit.
  1103. \param pad If true, the string will be resized to the exact length provided in the width parameter.
  1104. \return The formatted pattern data at the given pattern position.
  1105. \sa openmpt_module_highlight_pattern_row_channel
  1106. \remarks Use openmpt_module_format_pattern_row_channel to automatically handle the lifetime of the returned pointer.
  1107. '/
  1108. Declare Function openmpt_module_format_pattern_row_channel_ Alias "openmpt_module_format_pattern_row_channel" (ByVal module As openmpt_module Ptr, ByVal pattern As Long, ByVal row As Long, ByVal channel As Long, ByVal width_ As UInteger, ByVal pad As Long) As Const ZString Ptr
  1109. /'* \brief Get highlighting information for formatted pattern content
  1110. \param module The module handle to work on.
  1111. \param pattern The pattern whose data should be retrieved.
  1112. \param row The row from which the data should be retrieved.
  1113. \param channel The channel from which the data should be retrieved.
  1114. \param width The maximum number of characters the string should contain. 0 means no limit.
  1115. \param pad If true, the string will be resized to the exact length provided in the width parameter.
  1116. \return The highlighting string for the formatted pattern data as retrieved by openmpt_module_format_pattern_row_channel at the given pattern position.
  1117. \sa openmpt_module_format_pattern_row_channel
  1118. \remarks Use openmpt_module_highlight_pattern_row_channel to automatically handle the lifetime of the returned pointer.
  1119. '/
  1120. Declare Function openmpt_module_highlight_pattern_row_channel_ Alias "openmpt_module_highlight_pattern_row_channel" (ByVal module As openmpt_module Ptr, ByVal pattern As Long, ByVal row As Long, ByVal channel As Long, ByVal width_ As UInteger, ByVal pad As Long) As Const ZString Ptr
  1121. /'* \brief Retrieve supported ctl keys
  1122. \param module The module handle to work on.
  1123. \return A semicolon-separated list containing all supported ctl keys.
  1124. \remarks Currently supported ctl values are:
  1125. - load.skip_samples: Set to "1" to avoid loading samples into memory
  1126. - load.skip_patterns: Set to "1" to avoid loading patterns into memory
  1127. - load.skip_plugins: Set to "1" to avoid loading plugins
  1128. - load.skip_subsongs_init: Set to "1" to avoid pre-initializing sub-songs. Skipping results in faster module loading but slower seeking.
  1129. - seek.sync_samples: Set to "1" to sync sample playback when using openmpt_module_set_position_seconds or openmpt_module_set_position_order_row.
  1130. - subsong: The current subsong. Setting it has identical semantics as openmpt_module_select_subsong(), getting it returns the currently selected subsong.
  1131. - play.at_end: Chooses the behaviour when the end of song is reached:
  1132. - "fadeout": Fades the module out for a short while. Subsequent reads after the fadeout will return 0 rendered frames.
  1133. - "continue": Returns 0 rendered frames when the song end is reached. Subsequent reads will continue playing from the song start or loop start.
  1134. - "stop": Returns 0 rendered frames when the song end is reached. Subsequent reads will return 0 rendered frames.
  1135. - play.tempo_factor: Set a floating point tempo factor. "1.0" is the default tempo.
  1136. - play.pitch_factor: Set a floating point pitch factor. "1.0" is the default pitch.
  1137. - render.resampler.emulate_amiga: Set to "1" to enable the Amiga resampler for Amiga modules. This emulates the sound characteristics of the Paula chip and overrides the selected interpolation filter. Non-Amiga module formats are not affected by this setting.
  1138. - render.resampler.emulate_amiga_type: Configures the filter type to use for the Amiga resampler. Supported values are:
  1139. - "auto": Filter type is chosen by the library and might change. This is the default.
  1140. - "a500": Amiga A500 filter.
  1141. - "a1200": Amiga A1200 filter.
  1142. - "unfiltered": BLEP synthesis without model-specific filters. The LED filter is ignored by this setting. This filter mode is considered to be experimental and might change in the future.
  1143. - render.opl.volume_factor: Set volume factor applied to synthesized OPL sounds, relative to the default OPL volume.
  1144. - dither: Set the dither algorithm that is used for the 16 bit versions of openmpt_module_read. Supported values are:
  1145. - 0: No dithering.
  1146. - 1: Default mode. Chosen by OpenMPT code, might change.
  1147. - 2: Rectangular, 0.5 bit depth, no noise shaping (original ModPlug Tracker).
  1148. - 3: Rectangular, 1 bit depth, simple 1st order noise shaping
  1149. \remarks Use openmpt_module_get_ctls to automatically handle the lifetime of the returned pointer.
  1150. '/
  1151. Declare Function openmpt_module_get_ctls_ Alias "openmpt_module_get_ctls" (ByVal module As openmpt_module Ptr) As Const ZString Ptr
  1152. /'* \brief Get current ctl value
  1153. \param module The module handle to work on.
  1154. \param ctl The ctl key whose value should be retrieved.
  1155. \return The associated ctl value, or NULL on failure.
  1156. \sa openmpt_module_get_ctls
  1157. \remarks Use openmpt_module_ctl_get to automatically handle the lifetime of the returned pointer.
  1158. '/
  1159. Declare Function openmpt_module_ctl_get_ Alias "openmpt_module_ctl_get" (ByVal module As openmpt_module Ptr, ByVal ctl As Const ZString Ptr) As Const ZString Ptr
  1160. /'* \brief Set ctl value
  1161. \param module The module handle to work on.
  1162. \param ctl The ctl key whose value should be set.
  1163. \param value The value that should be set.
  1164. \return 1 if successful, 0 in case the value is not sensible (e.g. negative tempo factor) or the ctl is not recognized.
  1165. \sa openmpt_module_get_ctls
  1166. '/
  1167. Declare Function openmpt_module_ctl_set(ByVal module As openmpt_module Ptr, ByVal ctl As Const ZString Ptr, ByVal value As Const ZString Ptr) As Long
  1168. '* Callbacks for CRT FILE* handling
  1169. Function openmpt_stream_read_func(ByVal stream As Any Ptr, ByVal dst As Any Ptr, ByVal bytes As UInteger) As UInteger
  1170. Dim retval As UInteger = 0
  1171. Var f = Cast( FILE Ptr, stream )
  1172. If ( f = 0 ) Then Return 0
  1173. retval = fread( dst, 1, bytes, f )
  1174. If ( retval <= 0 ) Then Return 0
  1175. Return retval
  1176. End Function
  1177. '* Callbacks for CRT FILE* handling
  1178. Function openmpt_stream_seek_func(ByVal stream As Any Ptr, ByVal offset As LongInt, ByVal whence As Long) As Long
  1179. Var f = Cast( FILE Ptr, stream )
  1180. If ( f = 0 ) Then Return -1
  1181. Dim fwhence As Long
  1182. Select Case whence
  1183. Case OPENMPT_STREAM_SEEK_SET
  1184. fwhence = SEEK_SET
  1185. Case OPENMPT_STREAM_SEEK_CUR
  1186. fwhence = SEEK_CUR
  1187. Case OPENMPT_STREAM_SEEK_END
  1188. fwhence = SEEK_END
  1189. Case Else
  1190. Return -1
  1191. End Select
  1192. Return IIf(fseek( f, offset, fwhence ) <> 0, -1, 0)
  1193. End Function
  1194. '* Callbacks for CRT FILE* handling
  1195. Function openmpt_stream_tell_func(ByVal stream As Any Ptr) As LongInt
  1196. Dim retval As LongInt = 0
  1197. Var f = Cast( FILE Ptr, stream )
  1198. If ( f = 0 ) Then
  1199. Return -1
  1200. EndIf
  1201. retval = ftell( f )
  1202. If ( retval < 0 ) Then Return -1
  1203. Return retval
  1204. End Function
  1205. End Extern
  1206. '* Retrieve the set of stream callbacks for CRT FILE*
  1207. Function openmpt_stream_get_file_callbacks() As openmpt_stream_callbacks
  1208. Static callbacks As openmpt_stream_callbacks = (@openmpt_stream_read_func, @openmpt_stream_seek_func, @openmpt_stream_tell_func)
  1209. Return callbacks
  1210. End Function
  1211. /'* \brief Construct an openmpt_module
  1212. \param file The FreeBASIC file handle to load from.
  1213. \param logfunc Logging function where warning and errors are written. May be NULL.
  1214. \param loguser Logging function user context. Used to pass any user-defined data associated with this module to the logging function.
  1215. \param errfunc Error function to define error behaviour. May be NULL.
  1216. \param erruser Error function user context. Used to pass any user-defined data associated with this module to the error function.
  1217. \param errorcode Pointer to an integer where an error may get stored. May be NULL.
  1218. \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
  1219. \param ctls A map of initial ctl values. See openmpt_module_get_ctls().
  1220. \return A pointer to the constructed openmpt_module, or NULL on failure.
  1221. \remarks The file handle can be closed after an openmpt_module has been constructed successfully.
  1222. \sa openmpt_module_create2
  1223. '/
  1224. Function openmpt_module_create_from_fbhandle2(_
  1225. ByVal file As Integer,_
  1226. ByVal logfunc As openmpt_log_func = 0,_
  1227. ByVal loguser As Any Ptr = 0,_
  1228. ByVal errfunc As openmpt_error_func = 0,_
  1229. ByVal erruser As Any Ptr = 0,_
  1230. ByVal errorcode As Long Ptr = 0,_
  1231. ByVal error_message As Const ZString Ptr Ptr = 0,_
  1232. ByVal ctls As Const openmpt_module_initial_ctl Ptr = 0) As openmpt_module Ptr
  1233. Return openmpt_module_create2(openmpt_stream_get_file_callbacks(), Cast(FILE Ptr, FileAttr(file, fbFileAttrHandle)), logfunc, loguser, errfunc, erruser, errorcode, error_message, ctls)
  1234. End Function
  1235. /'* \brief Construct an openmpt_module
  1236. \param file The FreeBASIC file handle to load from.
  1237. \param logfunc Logging function where warning and errors are written. May be NULL.
  1238. \param loguser Logging function user context. Used to pass any user-defined data associated with this module to the logging function.
  1239. \param ctls A map of initial ctl values. See openmpt_module_get_ctls().
  1240. \return A pointer to the constructed openmpt_module, or NULL on failure.
  1241. \remarks The file handle can be closed after an openmpt_module has been constructed successfully.
  1242. \deprecated Please use openmpt_module_create_from_fbhandle2().
  1243. \sa openmpt_module_create2
  1244. '/
  1245. Function openmpt_module_create_from_fbhandle(_
  1246. ByVal file As Integer,_
  1247. ByVal logfunc As openmpt_log_func = 0,_
  1248. ByVal loguser As Any Ptr = 0,_
  1249. ByVal ctls As Const openmpt_module_initial_ctl Ptr = 0) As openmpt_module Ptr
  1250. Return openmpt_module_create_from_fbhandle2(file, logfunc, loguser, 0, 0, 0, 0, ctls)
  1251. End Function
  1252. /'* \brief Construct an openmpt_module
  1253. \param filename The file to load from.
  1254. \param logfunc Logging function where warning and errors are written. May be NULL.
  1255. \param loguser Logging function user context. Used to pass any user-defined data associated with this module to the logging function.
  1256. \param errfunc Error function to define error behaviour. May be NULL.
  1257. \param erruser Error function user context. Used to pass any user-defined data associated with this module to the error function.
  1258. \param errorcode Pointer to an integer where an error may get stored. May be NULL.
  1259. \param error_message Pointer to a string pointer where an error message may get stored. May be NULL.
  1260. \param ctls A map of initial ctl values. See openmpt_module_get_ctls().
  1261. \return A pointer to the constructed openmpt_module, or NULL on failure.
  1262. \sa openmpt_module_create2
  1263. '/
  1264. Function openmpt_module_create_from_filename2(_
  1265. ByRef filename As String,_
  1266. ByVal logfunc As openmpt_log_func = 0,_
  1267. ByVal loguser As Any Ptr = 0,_
  1268. ByVal errfunc As openmpt_error_func = 0,_
  1269. ByVal erruser As Any Ptr = 0,_
  1270. ByVal errorcode As Long Ptr = 0,_
  1271. ByVal error_message As Const ZString Ptr Ptr = 0,_
  1272. ByVal ctls As Const openmpt_module_initial_ctl Ptr = 0) As openmpt_module Ptr
  1273. Var file = fopen(filename, "rb")
  1274. Var retval = CPtr(openmpt_module Ptr, 0)
  1275. If(file <> 0) Then
  1276. retval = openmpt_module_create2(openmpt_stream_get_file_callbacks(), file, logfunc, loguser, errfunc, erruser, errorcode, error_message, ctls)
  1277. fclose(file)
  1278. EndIf
  1279. Return retval
  1280. End Function
  1281. /'* \brief Construct an openmpt_module
  1282. \param filename The file to load from.
  1283. \param logfunc Logging function where warning and errors are written. May be NULL.
  1284. \param loguser Logging function user context. Used to pass any user-defined data associated with this module to the logging function.
  1285. \param ctls A map of initial ctl values. See openmpt_module_get_ctls().
  1286. \return A pointer to the constructed openmpt_module, or NULL on failure.
  1287. \deprecated Please use openmpt_module_create_from_filename2().
  1288. \sa openmpt_module_create2
  1289. '/
  1290. Function openmpt_module_create_from_filename(_
  1291. ByRef filename As String,_
  1292. ByVal logfunc As openmpt_log_func = 0,_
  1293. ByVal loguser As Any Ptr = 0,_
  1294. ByVal ctls As Const openmpt_module_initial_ctl Ptr = 0) As openmpt_module Ptr
  1295. Return openmpt_module_create_from_filename2(filename, logfunc, loguser, 0, 0, 0, 0, ctls)
  1296. End Function
  1297. '* String handling for wrapping and freeing ZStrings returned by libopenmpt
  1298. Function openmpt_get_zstring(sz As Const ZString Ptr) As String
  1299. If(sz = 0) Then Return ""
  1300. Dim As String s = *sz
  1301. openmpt_free_string(sz)
  1302. Return s
  1303. End Function
  1304. '* \sa openmpt_get_string_
  1305. Function openmpt_get_string(ByVal key As Const ZString Ptr) As String
  1306. Return openmpt_get_zstring(openmpt_get_string_(key))
  1307. End Function
  1308. '* \sa openmpt_error_string_
  1309. Function openmpt_error_string (ByVal errorcode As Long) As String
  1310. Return openmpt_get_zstring(openmpt_error_string_(errorcode))
  1311. End Function
  1312. '* \sa openmpt_module_error_get_last_message_
  1313. Function openmpt_module_error_get_last_message (ByVal module As openmpt_module Ptr) As String
  1314. Return openmpt_get_zstring(openmpt_module_error_get_last_message_(module))
  1315. End Function
  1316. '* \sa openmpt_module_get_metadata_keys_
  1317. Function openmpt_module_get_metadata_keys(ByVal module As openmpt_module Ptr) As String
  1318. Return openmpt_get_zstring(openmpt_module_get_metadata_keys_(module))
  1319. End Function
  1320. '* \sa openmpt_module_get_metadata_
  1321. Function openmpt_module_get_metadata(ByVal module As openmpt_module Ptr, ByVal key As Const ZString Ptr) As String
  1322. Return openmpt_get_zstring(openmpt_module_get_metadata_(module, key))
  1323. End Function
  1324. '* \sa openmpt_module_get_subsong_name_
  1325. Function openmpt_module_get_subsong_name(ByVal module As openmpt_module Ptr, ByVal index As Long) As String
  1326. Return openmpt_get_zstring(openmpt_module_get_subsong_name_(module, index))
  1327. End Function
  1328. '* \sa openmpt_module_get_channel_name_
  1329. Function openmpt_module_get_channel_name(ByVal module As openmpt_module Ptr, ByVal index As Long) As String
  1330. Return openmpt_get_zstring(openmpt_module_get_channel_name_(module, index))
  1331. End Function
  1332. '* \sa openmpt_module_get_order_name_
  1333. Function openmpt_module_get_order_name(ByVal module As openmpt_module Ptr, ByVal index As Long) As String
  1334. Return openmpt_get_zstring(openmpt_module_get_order_name_(module, index))
  1335. End Function
  1336. '* \sa openmpt_module_get_pattern_name_
  1337. Function openmpt_module_get_pattern_name(ByVal module As openmpt_module Ptr, ByVal index As Long) As String
  1338. Return openmpt_get_zstring(openmpt_module_get_pattern_name_(module, index))
  1339. End Function
  1340. '* \sa openmpt_module_get_instrument_name_
  1341. Function openmpt_module_get_instrument_name(ByVal module As openmpt_module Ptr, ByVal index As Long) As String
  1342. Return openmpt_get_zstring(openmpt_module_get_instrument_name_(module, index))
  1343. End Function
  1344. '* \sa openmpt_module_get_sample_name_
  1345. Function openmpt_module_get_sample_name(ByVal module As openmpt_module Ptr, ByVal index As Long) As String
  1346. Return openmpt_get_zstring(openmpt_module_get_sample_name_(module, index))
  1347. End Function
  1348. '* \sa openmpt_module_format_pattern_row_channel_command_
  1349. Function openmpt_module_format_pattern_row_channel_command(ByVal module As openmpt_module Ptr, ByVal pattern As Long, ByVal row As Long, ByVal channel As Long, ByVal command_ As Long) As String
  1350. Return openmpt_get_zstring(openmpt_module_format_pattern_row_channel_command_(module, pattern, row, channel, command_))
  1351. End Function
  1352. '* \sa openmpt_module_highlight_pattern_row_channel_command_
  1353. Function openmpt_module_highlight_pattern_row_channel_command(ByVal module As openmpt_module Ptr, ByVal pattern As Long, ByVal row As Long, ByVal channel As Long, ByVal command_ As Long) As String
  1354. Return openmpt_get_zstring(openmpt_module_highlight_pattern_row_channel_command_(module, pattern, row, channel, command_))
  1355. End Function
  1356. '* \sa openmpt_module_format_pattern_row_channel_
  1357. Function openmpt_module_format_pattern_row_channel(ByVal module As openmpt_module Ptr, ByVal pattern As Long, ByVal row As Long, ByVal channel As Long, ByVal width_ As UInteger, ByVal pad As Long) As String
  1358. Return openmpt_get_zstring(openmpt_module_format_pattern_row_channel_(module, pattern, row, channel, width_, pad))
  1359. End Function
  1360. '* \sa openmpt_module_highlight_pattern_row_channel_
  1361. Function openmpt_module_highlight_pattern_row_channel(ByVal module As openmpt_module Ptr, ByVal pattern As Long, ByVal row As Long, ByVal channel As Long, ByVal width_ As UInteger, ByVal pad As Long) As String
  1362. Return openmpt_get_zstring(openmpt_module_highlight_pattern_row_channel_(module, pattern, row, channel, width_, pad))
  1363. End Function
  1364. '* \sa openmpt_module_get_ctls_
  1365. Function openmpt_module_get_ctls(ByVal module As openmpt_module Ptr) As String
  1366. Return openmpt_get_zstring(openmpt_module_get_ctls_(module))
  1367. End Function
  1368. '* \sa openmpt_module_ctl_get_
  1369. Function openmpt_module_ctl_get(ByVal module As openmpt_module Ptr, ByVal ctl As Const ZString Ptr) As String
  1370. Return openmpt_get_zstring(openmpt_module_ctl_get_(module, ctl))
  1371. End Function