commit a443d3c7fd729d3875eb2c12ffa4c8e2877d2ab8 Author: Michael Zhang Date: Tue Jan 5 04:17:41 2021 -0600 initial diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..2c2c393 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*] +indent_style = space +indent_size = 4 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0b42d2d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..e40d0bb --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2706 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "addr2line" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" + +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + +[[package]] +name = "aho-corasick" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +dependencies = [ + "memchr", +] + +[[package]] +name = "alga" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f823d037a7ec6ea2197046bafd4ae150e6bc36f9ca347404f46a46823fa84f2" +dependencies = [ + "approx", + "num-complex 0.2.4", + "num-traits 0.2.14", +] + +[[package]] +name = "alsa-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0edcbbf9ef68f15ae1b620f722180b82a98b6f0628d30baa6b8d2a5abc87d58" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "andrew" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" +dependencies = [ + "bitflags", + "line_drawing", + "rusttype 0.7.9", + "walkdir", + "xdg", + "xml-rs", +] + +[[package]] +name = "android_glue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" + +[[package]] +name = "anyhow" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee67c11feeac938fae061b232e38e0b6d94f97a9df10e6271319325ac4c56a86" + +[[package]] +name = "approx" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" +dependencies = [ + "num-traits 0.2.14", +] + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "backtrace" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5140344c85b01f9bbb4d4b7288a8aa4b3287ccef913a14bcc78a1063623598" +dependencies = [ + "addr2line", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base-x" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bass-sys" +version = "0.1.0" +dependencies = [ + "log", + "paste", +] + +[[package]] +name = "bindgen" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da379dbebc0b76ef63ca68d8fc6e71c0f13e59432e0987e508c1820e6ab5239" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2 1.0.24", + "quote 1.0.8", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "blake2b_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "bumpalo" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" + +[[package]] +name = "bytecount" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72feb31ffc86498dacdbd0fcebb56138e7177a8cc5cea4516031d15ae85a742e" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "bzip2" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b7c3cbf0fa9c1b82308d57191728ca0256cb821220f4e2fd410a72ade26e3b" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.9+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad3b39a260062fca31f7b0b12f207e8f2590a67d32ec7d59c20484b07ea7285e" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cargo_metadata" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8de60b887edf6d74370fc8eb177040da4847d971d6234c7b13a6da324ef0caf" +dependencies = [ + "semver", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "cc" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" + +[[package]] +name = "cexpr" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cgl" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55e7ec0b74fe5897894cbc207092c577e87c52f8a59e8ca8d97ef37551f60a49" +dependencies = [ + "gleam", + "libc", +] + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits 0.2.14", + "time", + "winapi", +] + +[[package]] +name = "clang-sys" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0659001ab56b791be01d4b729c44376edc6718cf389a502e579b77b758f3296c" +dependencies = [ + "glob", + "libc", + "libloading 0.6.6", +] + +[[package]] +name = "claxon" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bfbf56724aa9eca8afa4fcfadeb479e722935bb2a0900c2d37e0cc477af0688" + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "cocoa" +version = "0.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1706996401131526e36b3b49f0c4d912639ce110996f3ca144d78946727bce54" +dependencies = [ + "bitflags", + "block", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "core-foundation" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" +dependencies = [ + "core-foundation-sys 0.6.2", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa" +dependencies = [ + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" + +[[package]] +name = "core-graphics" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" +dependencies = [ + "bitflags", + "core-foundation", + "foreign-types", + "libc", +] + +[[package]] +name = "coreaudio-rs" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f229761965dad3e9b11081668a6ea00f1def7aa46062321b5ec245b834f6e491" +dependencies = [ + "bitflags", + "coreaudio-sys", +] + +[[package]] +name = "coreaudio-sys" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b7e3347be6a09b46aba228d6608386739fb70beff4f61e07422da87b0bb31fa" +dependencies = [ + "bindgen", +] + +[[package]] +name = "cpal" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d58ae1ed6536b1b233f5e3aeb6997a046ddb4d05e3f61701b58a92eb254a829e" +dependencies = [ + "alsa-sys", + "core-foundation-sys 0.5.1", + "coreaudio-rs", + "lazy_static", + "libc", + "stdweb 0.1.3", + "winapi", +] + +[[package]] +name = "crc32fast" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg 1.0.1", + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "lazy_static", + "maybe-uninit", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg 1.0.1", + "cfg-if 0.1.10", + "lazy_static", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" +dependencies = [ + "autocfg 1.0.1", + "cfg-if 1.0.0", + "lazy_static", +] + +[[package]] +name = "deflate" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" +dependencies = [ + "adler32", + "byteorder", +] + +[[package]] +name = "directories" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" +dependencies = [ + "cfg-if 0.1.10", + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" + +[[package]] +name = "dlib" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" +dependencies = [ + "libloading 0.6.6", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "draw_state" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33cf9537e2d06891448799b96d5a8c8083e0e90522a7fdabe6ebf4f41d79d651" +dependencies = [ + "bitflags", +] + +[[package]] +name = "editor" +version = "0.1.0" +dependencies = [ + "anyhow", + "bass-sys", + "ggez", + "libosu", + "log", + "stderrlog", +] + +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "version_check", +] + +[[package]] +name = "euclid" +version = "0.19.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "596b99621b9477e7a5f94d2d8dd13a9c5c302ac358b822c67a42b6f1054450e1" +dependencies = [ + "euclid_macros", + "num-traits 0.2.14", +] + +[[package]] +name = "euclid_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdcb84c18ea5037a1c5a23039b4ff29403abce2e0d6b1daa11cf0bde2b30be15" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "futures" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3b0c040a1fe6529d30b3c5944b280c7f0dcb2930d2c3062bca967b602583d0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" + +[[package]] +name = "futures-executor" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4caa2b2b68b880003057c1dd49f1ed937e38f22fcf6c212188a121f08cf40a65" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" + +[[package]] +name = "futures-macro" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556" +dependencies = [ + "proc-macro-hack", + "proc-macro2 1.0.24", + "quote 1.0.8", + "syn 1.0.57", +] + +[[package]] +name = "futures-sink" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d" + +[[package]] +name = "futures-task" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" +dependencies = [ + "once_cell", +] + +[[package]] +name = "futures-util" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +dependencies = [ + "typenum", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gfx" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01de46f9508a5c259aef105f0bff760ceddca832ea9c87ce03d1923e22ee155b" +dependencies = [ + "draw_state", + "gfx_core", + "log", +] + +[[package]] +name = "gfx_core" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75fbddaef2e12b4995900539d7209d947b988a3d87ee8737484d049b526e5441" +dependencies = [ + "bitflags", + "draw_state", + "log", +] + +[[package]] +name = "gfx_device_gl" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c385fa380c18888633aa27d1e16cbae518469702a2f69dcb5f52d5378bebc" +dependencies = [ + "gfx_core", + "gfx_gl", + "log", +] + +[[package]] +name = "gfx_gl" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d38164670920cfb7491bc0cf6f49f0554bd1c44cdbedc6c78d2bf91691ff5e" +dependencies = [ + "gl_generator 0.14.0", +] + +[[package]] +name = "gfx_window_glutin" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f415d3534e6ea92f3ded1683e9e00592a76e2e67050e33244bb507719a211eb2" +dependencies = [ + "gfx_core", + "gfx_device_gl", + "glutin", +] + +[[package]] +name = "ggez" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a76347431050a0b4e1a925124cdcde614b628260093bb52560d9c6b48435336" +dependencies = [ + "approx", + "bitflags", + "directories", + "gfx", + "gfx_core", + "gfx_device_gl", + "gfx_window_glutin", + "gilrs", + "glutin", + "glyph_brush 0.5.4", + "image", + "log", + "lyon", + "mint", + "nalgebra", + "rodio", + "serde", + "serde_derive", + "skeptic", + "smart-default", + "toml", + "winit", + "zip", +] + +[[package]] +name = "gif" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "471d90201b3b223f3451cd4ad53e34295f16a1df17b1edf3736d47761c3981af" +dependencies = [ + "color_quant", + "lzw", +] + +[[package]] +name = "gilrs" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122bb249f904e5f4ac73fc514b9b2ce6cce3af511f5df00ffc8000e47de6b290" +dependencies = [ + "fnv", + "gilrs-core", + "log", + "stdweb 0.4.20", + "uuid", + "vec_map", +] + +[[package]] +name = "gilrs-core" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43c758daf46af26d6872fe55507e3b2339779a160a06ad7a9b2a082f221209cd" +dependencies = [ + "core-foundation", + "io-kit-sys", + "libc", + "libudev-sys", + "log", + "nix 0.15.0", + "rusty-xinput", + "stdweb 0.4.20", + "uuid", + "vec_map", + "winapi", +] + +[[package]] +name = "gimli" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" + +[[package]] +name = "gl_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca98bbde17256e02d17336a6bdb5a50f7d0ccacee502e191d3e3d0ec2f96f84a" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + +[[package]] +name = "gleam" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae10d7c99d0e77b4766e850a60898a17c1abaf01075531f1066f03dc7dc5fc5" +dependencies = [ + "gl_generator 0.13.1", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "glutin" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5cc17ac6cb35704f434faaa5bb5e4254a66f50853976c7e6f00aee09ff1bf2" +dependencies = [ + "android_glue", + "cgl", + "cocoa", + "core-foundation", + "core-graphics", + "glutin_egl_sys", + "glutin_gles2_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "lazy_static", + "libc", + "libloading 0.5.2", + "objc", + "osmesa-sys", + "shared_library", + "wayland-client", + "winapi", + "winit", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2abb6aa55523480c4adc5a56bbaa249992e2dddb2fc63dc96e04a3355364c211" +dependencies = [ + "gl_generator 0.14.0", + "winapi", +] + +[[package]] +name = "glutin_gles2_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094e708b730a7c8a1954f4f8a31880af00eb8a1c5b5bf85d28a0a3c6d69103" +dependencies = [ + "gl_generator 0.14.0", + "objc", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e393c8fc02b807459410429150e9c4faffdb312d59b8c038566173c81991351" +dependencies = [ + "gl_generator 0.14.0", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da5951a1569dbab865c6f2a863efafff193a93caf05538d193e9e3816d21696" +dependencies = [ + "gl_generator 0.14.0", +] + +[[package]] +name = "glyph_brush" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131d7d6f3e7ea0988a707da50ae876f8a9c4c7eb397ccfac9fe9309d4ebe8726" +dependencies = [ + "glyph_brush 0.6.3", +] + +[[package]] +name = "glyph_brush" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fca6f9d679bff1322c76c9a1ad4b8553b30a94f3f75bea6936e19032c2f2ec3" +dependencies = [ + "glyph_brush_layout", + "log", + "ordered-float", + "rustc-hash", + "rusttype 0.8.3", + "twox-hash", +] + +[[package]] +name = "glyph_brush_layout" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b70adc570f1dc71b6b32e241cbcc2b42175f5aea71951fbf41e68b04aec24c7" +dependencies = [ + "approx", + "rusttype 0.8.3", + "xi-unicode", +] + +[[package]] +name = "hermit-abi" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +dependencies = [ + "libc", +] + +[[package]] +name = "hound" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" + +[[package]] +name = "image" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08ed2ada878397b045454ac7cfb011d73132c59f31a955d230bd1f1c2e68eb4a" +dependencies = [ + "byteorder", + "gif", + "jpeg-decoder", + "num-iter", + "num-rational 0.2.4", + "num-traits 0.2.14", + "png", + "tiff", +] + +[[package]] +name = "inflate" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" +dependencies = [ + "adler32", +] + +[[package]] +name = "io-kit-sys" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f21dcc74995dd4cd090b147e79789f8d65959cbfb5f0b118002db869ea3bd0a0" +dependencies = [ + "core-foundation-sys 0.6.2", + "mach 0.2.3", +] + +[[package]] +name = "itoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" + +[[package]] +name = "jpeg-decoder" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc797adac5f083b8ff0ca6f6294a999393d76e197c36488e2ef732c4715f6fa3" +dependencies = [ + "byteorder", +] + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "lewton" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d542c1a317036c45c2aa1cf10cc9d403ca91eb2d333ef1a4917e5cb10628bd0" +dependencies = [ + "byteorder", + "ogg", + "smallvec", +] + +[[package]] +name = "libc" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" + +[[package]] +name = "libloading" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +dependencies = [ + "cc", + "winapi", +] + +[[package]] +name = "libloading" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9367bdfa836b7e3cf895867f7a570283444da90562980ec2263d6e1569b16bc" +dependencies = [ + "cfg-if 1.0.0", + "winapi", +] + +[[package]] +name = "libm" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" + +[[package]] +name = "libosu" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1211582bccd34afcda71e9a99d542d6880750b6c04f5506989a7042c5f06284" +dependencies = [ + "anyhow", + "bitflags", + "futures", + "lazy_static", + "num", + "num-derive 0.3.3", + "num-rational 0.3.2", + "num-traits 0.2.14", + "regex", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "libudev-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "line_drawing" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" +dependencies = [ + "num-traits 0.2.14", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" + +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +dependencies = [ + "cfg-if 0.1.10", +] + +[[package]] +name = "lyon" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbe51099b21e92413cd1f692ba6f0140007d1b01ca07e703172d88d45096c9a" +dependencies = [ + "lyon_algorithms", + "lyon_tessellation", +] + +[[package]] +name = "lyon_algorithms" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5acff42f708e6d2d4126c7aee8c4711c08e9be6143f0d6050498fafb7f4a0287" +dependencies = [ + "lyon_path", + "sid", +] + +[[package]] +name = "lyon_geom" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb9bf1f1d43be9a9cc2343a7a096dc113cc25337a13e8f99721b01d1d548b60" +dependencies = [ + "arrayvec 0.4.12", + "euclid", + "num-traits 0.2.14", +] + +[[package]] +name = "lyon_path" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd492548d32f7e8de10509953ed56d11dbc7103c36d56f32f3b74bf72b04cf29" +dependencies = [ + "lyon_geom", +] + +[[package]] +name = "lyon_tessellation" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228f5eedeb6795b57d22fa91f6c215643f2c2aae758f9432585c8d99b7be9143" +dependencies = [ + "lyon_path", + "sid", +] + +[[package]] +name = "lzw" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" + +[[package]] +name = "mach" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" +dependencies = [ + "libc", +] + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "matrixmultiply" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "916806ba0031cd542105d916a97c8572e1fa6dd79c9c51e7eb43a09ec2dd84c1" +dependencies = [ + "rawpointer", +] + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" + +[[package]] +name = "memmap" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg 1.0.1", +] + +[[package]] +name = "minimp3" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce0cff6a0bfd3f8b6b2350819bbddd63bc65cc45e53888bdd0ff49dde16d2d5" +dependencies = [ + "minimp3-sys", + "slice-deque", +] + +[[package]] +name = "minimp3-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e21c73734c69dc95696c9ed8926a2b393171d98b3f5f5935686a26a487ab9b90" +dependencies = [ + "cc", +] + +[[package]] +name = "miniz_oxide" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" +dependencies = [ + "adler", + "autocfg 1.0.1", +] + +[[package]] +name = "mint" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "519df8d6856dcd4b40519947737b408f81be051fc032590659cae5d77d664185" + +[[package]] +name = "nalgebra" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaa9fddbc34c8c35dd2108515587b8ce0cab396f17977b8c738568e4edb521a2" +dependencies = [ + "alga", + "approx", + "generic-array", + "matrixmultiply", + "mint", + "num-complex 0.2.4", + "num-rational 0.2.4", + "num-traits 0.2.14", + "rand 0.6.5", + "typenum", +] + +[[package]] +name = "nix" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" +dependencies = [ + "bitflags", + "cc", + "cfg-if 0.1.10", + "libc", + "void", +] + +[[package]] +name = "nix" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" +dependencies = [ + "bitflags", + "cc", + "cfg-if 0.1.10", + "libc", + "void", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "nom" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +dependencies = [ + "memchr", + "version_check", +] + +[[package]] +name = "num" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7a8e9be5e039e2ff869df49155f1c06bd01ade2117ec783e56ab0932b67a8f" +dependencies = [ + "num-bigint", + "num-complex 0.3.1", + "num-integer", + "num-iter", + "num-rational 0.3.2", + "num-traits 0.2.14", +] + +[[package]] +name = "num-bigint" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e9a41747ae4633fce5adffb4d2e81ffc5e89593cb19917f8fb2cc5ff76507bf" +dependencies = [ + "autocfg 1.0.1", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg 1.0.1", + "num-traits 0.2.14", +] + +[[package]] +name = "num-complex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" +dependencies = [ + "num-traits 0.2.14", +] + +[[package]] +name = "num-derive" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.8", + "syn 1.0.57", +] + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg 1.0.1", + "num-traits 0.2.14", +] + +[[package]] +name = "num-iter" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" +dependencies = [ + "autocfg 1.0.1", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg 1.0.1", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg 1.0.1", + "num-bigint", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.14", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg 1.0.1", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "object" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" + +[[package]] +name = "ogg" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e571c3517af9e1729d4c63571a27edd660ade0667973bfc74a67c660c2b651" +dependencies = [ + "byteorder", +] + +[[package]] +name = "once_cell" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" + +[[package]] +name = "ordered-float" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" +dependencies = [ + "num-traits 0.2.14", +] + +[[package]] +name = "osmesa-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" +dependencies = [ + "shared_library", +] + +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +dependencies = [ + "lock_api", + "parking_lot_core", + "rustc_version", +] + +[[package]] +name = "parking_lot_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +dependencies = [ + "cfg-if 0.1.10", + "cloudabi", + "libc", + "redox_syscall", + "rustc_version", + "smallvec", + "winapi", +] + +[[package]] +name = "paste" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" +dependencies = [ + "paste-impl", + "proc-macro-hack", +] + +[[package]] +name = "paste-impl" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" +dependencies = [ + "proc-macro-hack", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pin-project" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.8", + "syn 1.0.57", +] + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" + +[[package]] +name = "png" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef859a23054bbfee7811284275ae522f0434a3c8e7f4b74bd4a35ae7e1c4a283" +dependencies = [ + "bitflags", + "crc32fast", + "deflate", + "inflate", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + +[[package]] +name = "proc-macro-nested" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +dependencies = [ + "unicode-xid 0.2.1", +] + +[[package]] +name = "pulldown-cmark" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eef52fac62d0ea7b9b4dc7da092aa64ea7ec3d90af6679422d3d7e0e14b6ee15" +dependencies = [ + "bitflags", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + +[[package]] +name = "quote" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" +dependencies = [ + "proc-macro2 1.0.24", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.7", + "libc", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc 0.1.0", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg", + "rand_xorshift", + "winapi", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc", + "rand_core 0.4.2", + "winapi", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" +dependencies = [ + "libc", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "redox_users" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +dependencies = [ + "getrandom", + "redox_syscall", + "rust-argon2", +] + +[[package]] +name = "regex" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", +] + +[[package]] +name = "regex-syntax" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "rodio" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0f961b254e66d147a7b550c78b01308934c97d807a34b417fd0f5a0a0f3a2d" +dependencies = [ + "claxon", + "cpal", + "hound", + "lazy_static", + "lewton", + "minimp3", + "nalgebra", +] + +[[package]] +name = "rust-argon2" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" +dependencies = [ + "base64", + "blake2b_simd", + "constant_time_eq", + "crossbeam-utils 0.8.1", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "rusttype" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" +dependencies = [ + "rusttype 0.8.3", +] + +[[package]] +name = "rusttype" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0" +dependencies = [ + "approx", + "crossbeam-deque", + "crossbeam-utils 0.7.2", + "linked-hash-map", + "num_cpus", + "ordered-float", + "rustc-hash", + "stb_truetype", +] + +[[package]] +name = "rusty-xinput" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2aa654bc32eb9ca14cce1a084abc9dfe43949a4547c35269a094c39272db3bb" +dependencies = [ + "lazy_static", + "log", + "winapi", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.8", + "syn 1.0.57", +] + +[[package]] +name = "serde_json" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" + +[[package]] +name = "shared_library" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" +dependencies = [ + "lazy_static", + "libc", +] + +[[package]] +name = "shlex" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" + +[[package]] +name = "sid" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29e0a6006cf04d568a49363baca3dabddbbe46538f7c76692d405f5f5d140ecd" +dependencies = [ + "num-traits 0.1.43", +] + +[[package]] +name = "skeptic" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6deb8efaf3ad8fd784139db8bbd51806bfbcee87c7be7578e9c930981fb808" +dependencies = [ + "bytecount", + "cargo_metadata", + "error-chain", + "glob", + "pulldown-cmark", + "tempfile", + "walkdir", +] + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + +[[package]] +name = "slice-deque" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ef6ee280cdefba6d2d0b4b78a84a1c1a3f3a4cec98c2d4231c8bc225de0f25" +dependencies = [ + "libc", + "mach 0.3.2", + "winapi", +] + +[[package]] +name = "smallvec" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +dependencies = [ + "maybe-uninit", +] + +[[package]] +name = "smart-default" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9dbd5f03d04e80355cbbe3ce5cf1f65c421eac575402e3d4d6e95d5a44edaa" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ccb8c57049b2a34d2cc2b203fa785020ba0129d31920ef0d317430adaf748fa" +dependencies = [ + "andrew", + "bitflags", + "dlib", + "lazy_static", + "memmap", + "nix 0.14.1", + "wayland-client", + "wayland-commons", + "wayland-protocols", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stb_truetype" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" +dependencies = [ + "byteorder", +] + +[[package]] +name = "stderrlog" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b02f316286ae558d83acc93dd81eaba096e746987a7961d4a9ae026842bae67f" +dependencies = [ + "atty", + "chrono", + "log", + "termcolor", + "thread_local", +] + +[[package]] +name = "stdweb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" + +[[package]] +name = "stdweb" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" +dependencies = [ + "discard", + "rustc_version", + "serde", + "serde_json", + "stdweb-derive", + "stdweb-internal-macros", + "stdweb-internal-runtime", + "wasm-bindgen", +] + +[[package]] +name = "stdweb-derive" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.8", + "serde", + "serde_derive", + "syn 1.0.57", +] + +[[package]] +name = "stdweb-internal-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" +dependencies = [ + "base-x", + "proc-macro2 1.0.24", + "quote 1.0.8", + "serde", + "serde_derive", + "serde_json", + "sha1", + "syn 1.0.57", +] + +[[package]] +name = "stdweb-internal-runtime" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" + +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", +] + +[[package]] +name = "syn" +version = "1.0.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4211ce9909eb971f111059df92c45640aad50a619cf55cd76476be803c4c68e6" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.8", + "unicode-xid 0.2.1", +] + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "rand 0.7.3", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.8", + "syn 1.0.57", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "tiff" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7b7c2cfc4742bd8a32f2e614339dd8ce30dbcf676bb262bd63a2327bc5df57d" +dependencies = [ + "byteorder", + "lzw", + "num-derive 0.2.5", + "num-traits 0.2.14", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "toml" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +dependencies = [ + "serde", +] + +[[package]] +name = "twox-hash" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" +dependencies = [ + "cfg-if 0.1.10", + "rand 0.7.3", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "uuid" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasm-bindgen" +version = "0.2.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2 1.0.24", + "quote 1.0.8", + "syn 1.0.57", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084" +dependencies = [ + "quote 1.0.8", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.8", + "syn 1.0.57", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158" + +[[package]] +name = "wayland-client" +version = "0.21.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49963e5f9eeaf637bfcd1b9f0701c99fd5cd05225eb51035550d4272806f2713" +dependencies = [ + "bitflags", + "downcast-rs", + "libc", + "nix 0.14.1", + "wayland-commons", + "wayland-scanner", + "wayland-sys", +] + +[[package]] +name = "wayland-commons" +version = "0.21.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c08896768b667e1df195d88a62a53a2d1351a1ed96188be79c196b35bb32ec" +dependencies = [ + "nix 0.14.1", + "wayland-sys", +] + +[[package]] +name = "wayland-protocols" +version = "0.21.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afde2ea2a428eee6d7d2c8584fdbe8b82eee8b6c353e129a434cd6e07f42145" +dependencies = [ + "bitflags", + "wayland-client", + "wayland-commons", + "wayland-scanner", + "wayland-sys", +] + +[[package]] +name = "wayland-scanner" +version = "0.21.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf3828c568714507315ee425a9529edc4a4aa9901409e373e9e0027e7622b79e" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "xml-rs", +] + +[[package]] +name = "wayland-sys" +version = "0.21.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520ab0fd578017a0ee2206623ba9ef4afe5e8f23ca7b42f6acfba2f4e66b1628" +dependencies = [ + "dlib", + "lazy_static", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winit" +version = "0.19.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e96eb4bb472fa43e718e8fa4aef82f86cd9deac9483a1e1529230babdb394a8" +dependencies = [ + "android_glue", + "backtrace", + "bitflags", + "cocoa", + "core-foundation", + "core-graphics", + "lazy_static", + "libc", + "log", + "objc", + "parking_lot", + "percent-encoding", + "raw-window-handle", + "smithay-client-toolkit", + "wayland-client", + "winapi", + "x11-dl", +] + +[[package]] +name = "x11-dl" +version = "2.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" +dependencies = [ + "lazy_static", + "libc", + "maybe-uninit", + "pkg-config", +] + +[[package]] +name = "xdg" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" + +[[package]] +name = "xi-unicode" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e71b85d8b1b8bfaf4b5c834187554d201a8cd621c2bbfa33efd41a3ecabd48b2" + +[[package]] +name = "xml-rs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" + +[[package]] +name = "zip" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2896475a242c41366941faa27264df2cb935185a92e059a004d0048feb2ac5" +dependencies = [ + "byteorder", + "bzip2", + "crc32fast", + "thiserror", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..0fdf3ff --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "editor" +version = "0.1.0" +authors = ["Michael Zhang "] +edition = "2018" + +[workspace] +members = [ + "bass-sys", +] + +[dependencies] +anyhow = "1.0.37" +bass-sys = { path = "bass-sys" } +ggez = "0.5.1" +libosu = "0.0.11" +log = "0.4.11" +stderrlog = "0.5.0" diff --git a/bass-sys/Cargo.toml b/bass-sys/Cargo.toml new file mode 100644 index 0000000..052d339 --- /dev/null +++ b/bass-sys/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "bass-sys" +version = "0.1.0" +authors = ["Michael Zhang "] +edition = "2018" + +[dependencies] +log = "0.4.11" +paste = "0.1.18" diff --git a/bass-sys/bass24/bass.chm b/bass-sys/bass24/bass.chm new file mode 100644 index 0000000..2d9ba09 Binary files /dev/null and b/bass-sys/bass24/bass.chm differ diff --git a/bass-sys/bass24/bass.dll b/bass-sys/bass24/bass.dll new file mode 100644 index 0000000..4be4264 Binary files /dev/null and b/bass-sys/bass24/bass.dll differ diff --git a/bass-sys/bass24/bass.txt b/bass-sys/bass24/bass.txt new file mode 100644 index 0000000..c7d2da9 --- /dev/null +++ b/bass-sys/bass24/bass.txt @@ -0,0 +1,2127 @@ +BASS 2.4 +Copyright (c) 1999-2020 Un4seen Developments Ltd. All rights reserved. + +Files that you should have found in the BASS package +==================================================== +Win32 version +------------- +BASS.TXT This file +BASS.DLL BASS module +BASS.CHM BASS documentation +MP3-FREE\ + BASS.DLL BASS module using the OS's MP3 decoder +X64\ + BASS.DLL 64-bit BASS module + MP3-FREE + BASS.DLL 64-bit BASS module using the OS's MP3 decoder +C\ C/C++ API and examples... + BASS.H BASS C/C++ header file + BASS.LIB BASS import library + BASS.SLN Visual Studio solution for examples + MAKEFILE Makefile for examples + MAKEFILE.IN Makefile helper macros + X64\ + BASS.LIB 64-bit BASS import library + 3DTEST\ 3D/EAX example + ... + BASSTEST\ Simple playback example + ... + CONTEST\ Console example + ... + CUSTLOOP\ Custom looping example + ... + DEVLIST\ Device list example + ... + DSPTEST\ DSP example + ... + FXTEST\ DX8 effect example + ... + LIVEFX\ Full-duplex example + ... + LIVESPEC\ "Live" version of spectrum analyser example + ... + MODTEST\ MOD music example + ... + MULTI\ Multiple device example + ... + NETRADIO\ Internet streaming example + ... + PLUGINS\ Plugins example + ... + RECTEST\ Recording example + ... + SPEAKERS\ Multi-speaker example + ... + SPECTRUM\ Spectrum analyser example + ... + SYNTH\ Low latency custom streaming example + ... + WRITEWAV\ WAVE writer example + ... + BIN\ Precompiled examples + 3DTEST.EXE + BASSTEST.EXE + CONTEST.EXE + CUSTLOOP.EXE + DEVLIST.EXE + DSPTEST.EXE + FXTEST.EXE + LIVEFX.EXE + LIVESPEC.EXE + MODTEST.EXE + MULTI.EXE + NETRADIO.EXE + RECTEST.EXE + SPEAKERS.EXE + SPECTRUM.EXE + SYNTH.EXE + WRITEWAV.EXE +DELPHI\ Delphi API and examples... + BASS.PAS BASS Delphi unit + 3DTEST\ 3D/EAX example + ... + BASSTEST\ Simple playback example + ... + CONTEST\ Console example + ... + CUSTLOOP\ Custom looping example + ... + DSPTEST\ DSP example + ... + FXTEST\ DX8 effect example + ... + LIVEFX\ Full-duplex example + ... + LIVESPEC\ "Live" version of spectrum analyser example + ... + MULTI\ Multiple device example + ... + NETRADIO\ Internet streaming example + ... + PLUGINS\ Plugins example + ... + RECORDTEST\ Recording example + ... + SAMPLEVIS\ Visualisation example + ... + SPEAKERS\ Multi-speaker example + ... + SPECTRUM\ Spectrum analyser example + ... + STREAMTEST\ User stream example + ... + WRITEWAV\ WAVE writer example + ... +VB\ Visual Basic API and examples... + BASS.BAS BASS Visual Basic module + 3DTEST\ 3D/EAX example + ... + BASSTEST\ Simple playback example + ... + CUSTLOOP\ Custom looping example + ... + DSPTEST\ DSP example + ... + FXTEST\ DX8 effect example + ... + LIVEFX\ Full-duplex example + ... + LIVESPEC\ "Live" version of spectrum analyser example + ... + MULTI\ Multiple device example + ... + NETRADIO\ Internet streaming example + ... + PLUGINS\ Plugins example + ... + RECTEST\ Recording example + ... + SPEAKERS\ Multi-speaker example + ... + SPECTRUM\ Spectrum analyser example + ... + SYNTH\ Low latency custom streaming example + ... + WRITEWAV\ WAVE writer example + ... + MEMORY\ Playing from memory example by Jobnik + ... + +NOTE: You may need to "Unblock" the BASS.CHM file in its "Properties" to view + it on Windows 7. The documentation can also be viewed online at the BASS + website. + +NOTE: The Delphi and VB examples may not always be up to date with the C + examples, so the latter should be preferred as references if possible. + +NOTE: To run the example EXEs, first you will need to copy BASS.DLL into the + same directory as them. + +macOS version +------------- +BASS.TXT This file +LIBBASS.DYLIB BASS module +BASS.CHM BASS documentation +CHMOX.APP CHM file viewer +BASS.H BASS C/C++ header file +BASS.XCODEPROJ Xcode project for examples +MAKEFILE Makefile for specific architectures +MP3-FREE\ + LIBBASS.DYLIB BASS module using the OS's MP3 decoder +3DTEST\ 3D example + ... +BASSTEST\ Simple playback example + ... +CONTEST\ Console example + ... +CUSTLOOP\ Custom looping example + ... +DEVLIST\ Device list example + ... +DSPTEST\ DSP example + ... +FXTEST\ DX8 effect example + ... +LIVESPEC\ "Live" version of spectrum analyser example + ... +MODTEST\ MOD music example + ... +MULTI\ Multiple device example + ... +NETRADIO\ Internet streaming example + ... +PLUGINS\ Plugins example + ... +RECTEST\ Recording example + ... +SPEAKERS\ Multi-speaker example + ... +SPECTRUM\ Spectrum analyser example + ... +SYNTH\ Low latency custom streaming example + ... +WRITEWAV\ WAVE writer example + ... + +NOTE: To view the documentation, you will need a CHM viewer, such as the + included CHMOX. The documentation can also be viewed online at the BASS + website. + +NOTE: The GUI-based examples (not CONTEST/DEVLIST/WRITEWAV) use the old Carbon + APIs that are not supported by 64-bit macOS. They will be replaced in + future but are currently still included for reference (the BASS parts are + still relevant). + +Linux version +------------- +BASS.TXT This file +LIBBASS.SO BASS module +BASS.CHM BASS documentation +BASS.H BASS C/C++ header file +MAKEFILE Makefile for examples +MAKEFILE.IN Makefile helper macros +MP3-FREE\ + LIBBASS.SO BASS module using the OS's MP3 decoder +X64\ + LIBBASS.SO 64-bit BASS module + MP3-FREE + LIBBASS.SO 64-bit BASS module using the OS's MP3 decoder +PASCAL\ + BASS.PAS BASS Delphi/Pascal unit +3DTEST\ 3D example + ... +BASSTEST\ Simple playback example + ... +CONTEST\ Console example + ... +CUSTLOOP\ Custom looping example + ... +DEVLIST\ Device list example + ... +DSPTEST\ DSP example + ... +FXTEST\ DX8 effect example + ... +LIVESPEC\ "Live" version of spectrum analyser example + ... +MODTEST\ MOD music example + ... +MULTI\ Multiple device example + ... +NETRADIO\ Internet streaming example + ... +PLUGINS\ Plugins example + ... +RECTEST\ Recording example + ... +SPEAKERS\ Multi-speaker example + ... +SPECTRUM\ Spectrum analyser example + ... +SYNTH\ Low latency custom streaming example + ... +WRITEWAV\ WAVE writer example + ... + +NOTE: To view the documentation, you will need a CHM viewer. The documentation + can also be viewed online at the BASS website. + + +What's the point? +================= +BASS is an audio library for use in software on several platforms. Its +purpose is to provide the powerful and efficient sample, stream, MOD +music, and recording functions. All in a compact DLL that won't overly +bloat your software. + +See the documentation for descriptions of all the BASS functions. Also +check the included example source-codes for some examples of how to use +BASS in your own programs. + + +Requirements +============ +Win32 version +------------- +BASS requires WASAPI or DirectSound for playback and recording, but decoding +and silent playback on the "No sound" device is still possible without them. +DirectSound has been included with all Windows versions since Windows 98. On +Windows Vista and above, the default is to use WASAPI instead of DirectSound +for playback. 32-bit and 64-bit Windows are supported. + +macOS version +------------- +macOS 10.5 or above is required. BASS uses CoreAudio for playback and recording, +so there are no special library/driver requirements. x86_64 / arm64 / i386 +architectures are supported in a single universal library. + +Linux version +------------- +BASS requires ALSA for playback and recording, but decoding and silent playback +on the "No sound" device is still possible without it. 32-bit (i386) and 64-bit +(x86-64) architectures are supported. ARM support is also available as a +separate download from the website. + + +Main Features +============= +* Samples + supports WAV/AIFF/MP3/MP2/MP1/OGG and custom generated samples + +* Sample streams + stream any sample data in 8/16/32 bit, with both "push" and "pull" systems + +* File streams + MP3/MP2/MP1/OGG/WAV/AIFF file streaming + +* Internet file streaming + stream files from the internet, including Shout/Icecast + +* User file streaming + stream files from anywhere using any delivery method + +* OS codecs + ACM, Media Foundation and CoreAudio codec support for additional audio formats + +* Multi-channel streaming + support for more than plain stereo, including multi-channel OGG/WAV/AIFF files + +* MOD music + uses the same engine as XMPlay = best accuracy, speed, and quality + +* MO3 music + MP3/OGG compressed MOD music + +* Add-on system + support for more formats is available via add-ons (aka plugins) + +* Multiple outputs + simultaneously use multiple soundcards, and move channels between them + +* Recording + flexible recording system, with support for multiple devices + +* Decode without playback + streams and MOD musics can be outputted in any way you want + +* Speaker assignment + assign streams and MOD musics to specific speakers + +* High precision synchronization + synchronize events in your software to the streams and MOD musics + +* Effects + chorus/compressor/distortion/echo/flanger/gargle/parameq/reverb + +* User defined DSP functions + custom effects may be applied to individual streams or the final output mix + +* 32 bit floating-point decoding and processing + floating-point stream/music decoding, DSP/FX, and recording + +* 3D sound + play samples/streams/musics in any 3D position + + +Using BASS +========== +There is no guarantee that all future BASS versions will be compatible +with all previous versions, so your program should use BASS_GetVersion +to check the version that is loaded. This also means that you should +put the BASS module in the same directory as your executable (not just +somewhere in the path), to avoid the possibility of a wrong version being +loaded. + +If you are updating your software from a previous BASS version, then +you should check the "History" section (below), to see if any of the +functions that you are using have been affected by a change. + +Win32 version +------------- +C/C++, Delphi, and Visual Basic APIs and example projects are provided. To +use BASS with another language you will first have to convert the header +file. Or, as a last resort, you could use LoadLibrary and GetProcAddress. + +The downside is that you have to manually import each function that you +use, with the GetProcAddress function. But it has been made a lot simpler +to import BASS this way by the use of the BASSDEF #define. Here's a small +example: + +#define BASSDEF(f) (WINAPI *f) // define the functions as pointers +#include "bass.h" +... +HINSTANCE bass=LoadLibrary("BASS.DLL"); // load BASS +BASS_Init=GetProcAddress(bass,"BASS_Init"); // get BASS_Init +BASS_Init(-1,44100,0,hWnd,NULL); // call BASS_Init + +To use BASS with Borland C++ Builder, you will first have to create a +Borland C++ Builder import library for it. This is done by using the +IMPLIB tool that comes with Borland C++ Builder. Simply execute this: + + IMPLIB BASSBCB.LIB BASS.DLL + +... and then use BASSBCB.LIB in your projects to import BASS. + +To use BASS with LCC-Win32, you will first have to create a compatible +import library for it. This is done by using the PEDUMP and BUILDLIB +tools that come with LCC-Win32. Run these 2 commands: + + PEDUMP /EXP BASS.LIB > BASSLCC.EXP + BUILDLIB BASSLCC.EXP BASSLCC.LIB + +... and then use BASSLCC.LIB in your projects to import BASS. + +For the BASS functions that return strings (char*), VB users should use +the VBStrFromAnsiPtr function to convert the returned pointer into a VB +string. + +macOS version +------------- +See the example Xcode project. + +NOTE: The LIBBASS.DYLIB file must be put in the same directory as the + executable, it can't just be somewhere in the path. + +LIBBASS.DYLIB is a universal binary with support for the x86_64 / arm64 / i386 +architectures. If not all of those architectures are needed, the included +makefile can be used to extract the wanted one(s). Type "make x86_64" or +"make arm64" or "make i386" to extract a particular architecture. "make 64bit" +can be used to extract the x86_64 and arm64 architectures (exclude i386), and +"make intel" to extract the x86_64 and i386 architectures (exclude arm64). Any +BASS add-ons placed in the same directory will also be processed. + +Linux version +------------- +The LIBBASS.SO file needs to be in the OS's library search path for it to +be found; simply placing it in the same directory as the executable won't +necessarily work as it does on other platforms. The BASS libraries should +also not be placed in the standard library directories to avoid version +conflicts. To meet those competing requirements, a wrapper script could be +used to set the "LD_LIBRARY_PATH" environment variable before loading the +executable. Another option is to set the "rpath" in the executable, to tell +it where to look for libraries. That is what the example makefiles do. + +When building both 32-bit and 64-bit executables, it is possible to simply +try linking with both LIBBASS.SO versions, and the linker will use the +appropriate version and ignore the other. + + +Latest Version +============== +The latest version of BASS can always be found at the BASS website: + + www.un4seen.com + + +Licence +======= +BASS is free for non-commercial use. If you are a non-commercial entity +(eg. an individual) and you are not making any money from your product +(through sales/advertising/etc), then you can use BASS in it for free. +If you wish to use BASS in commercial products, then please also see the +next section. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, BASS IS PROVIDED +"AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD +LIABLE FOR ANY DAMAGE THAT MAY RESULT FROM THE USE OF BASS. YOU USE +BASS ENTIRELY AT YOUR OWN RISK. + +Usage of BASS indicates that you agree to the above conditions. + +All trademarks and other registered names contained in the BASS +package are the property of their respective owners. + +Commercial licensing +-------------------- +BASS is available for use in your commercial products. The licence +types available are as follows: + +SHAREWARE: Allows the usage of BASS in an unlimited number of your +shareware ("try before you buy") products, which must sell for no more +than 40 Euros each. Non-shareware products are also permitted, but the +product price limit is 10 Euros in that case. The price limit can be +raised by purchasing duplicate licences, eg. 2 licences doubles it. If +you are an individual (not a corporation) making and selling your own +software, this is the licence for you. + +SINGLE COMMERCIAL: Allows the usage of BASS in one commercial product. + +UNLIMITED COMMERCIAL: Allows the usage of BASS in an unlimited number +of your commercial products. This licence is on a per-site basis, eg. +if you are creating products with BASS at 2 sites/locations, then 2 +licences are required. + +Please note the products must be end-user products, eg. not components +used by other products. + +These licences only cover your own software, not the publishing of +other's software. If you publish other's software, its developers (or +the software itself) will need to be licensed to use BASS. + +These licences are on a per-platform basis, with reductions available +when licensing for multiple platforms. In all cases there are no royalties +to pay, and you can use future BASS updates without further cost. + +These licences do not allow reselling/sublicensing of BASS. For example, +if a product is a development system, the users of said product are not +licensed to use BASS in their productions; they will need their own +licences. + +If the standard licences do not meet your requirements, or if you have +any questions, please get in touch (email: bass@un4seen.com). + +Visit the BASS website for the latest pricing: + + www.un4seen.com + +MP3 +--- +MP3 technology is patented, and Thomson license the use of their and +Fraunhofer's patents. The inclusion of an MP3 decoder (eg. BASS) in a +commercial product requires an MP3 patent licence. Contact Thomson for +details: + + www.mp3licensing.com + +Alternatively, the "MP3-FREE" BASS version does not include its own MP3 +decoder but instead makes use of the operating system's already licensed +decoder. If an MP3 decoder is not available, then MP3 playback will not +be possible, but everything else will function as normal. + +NOTE: When using the OS's MP3 decoder, BASS still does the file handling + so all the usual features are still supported, including streaming, + tag reading, pre-scanning, gapless playback, etc. + +NOTE: Linux does not include an MP3 decoder as standard. The "MP3-FREE" + BASS version will make use of the libmpg123 decoder, if installed. + + +Credits +======= +Ogg Vorbis decoding is based on libogg/vorbis, +Copyright (c) 2002-2020 Xiph.org Foundation + +CHMOX is (c) 2004 Stphane Boisson, http://chmox.sourceforge.net/ + +API/Sample contributors +----------------------- +Delphi: Titus Miloi, Rogier Timmermans, Alessandro Cappellozza, + Jesse Naranjo, Chris Troesken, Evgeny Melnikov +Visual Basic: Adam Hoult, Hendrik Knaepen, Arthur Aminov, + Peter Hebels + + +History +======= +These are the major (and not so major) changes at each version stage. +There are of course bug fixes and other little improvements made along +the way too! To make upgrading simpler, all functions affected by a +change to the BASS interface are listed. + +2.4.15 - 17/12/2019 +------------------- +* Channel processing granularity option + BASS_ATTRIB_GRANULE (BASS_ChannelSetAttribute option) +* Asynchronous mixtime sync callbacks + BASS_SYNC_THREAD (BASS_ChannelSetSync flag) +* Output device update period can be set in samples + BASS_CONFIG_DEV_PERIOD (BASS_SetConfig option) +* Continuous output when nothing is playing is now optional on macOS/iOS too + BASS_CONFIG_DEV_NONSTOP (BASS_SetConfig option) +* AAudio output support on Android + BASS_Init + BASS_CONFIG_ANDROID_AAUDIO (BASS_SetConfig option) +* Support for audio session IDs on Android + BASS_CONFIG_ANDROID_SESSIONID (BASS_SetConfig option) +* ParcelFileDescriptor support on Android + BASS_StreamCreateFile + BASS_SampleLoad + BASS_MusicLoad +* FloatValue Java class added to receive floating-point values on Android 10 + BASS_Get3DFactors + BASS_RecordGetInput + BASS_ChannelGetAttribute + BASS_ChannelGet3DAttributes +* Audio session configuration option on iOS + BASS_CONFIG_IOS_SESSION (BASS_SetConfig option) +* OGG channel type constant renamed/duplicated to VORBIS + BASS_CTYPE_STREAM_VORBIS +* Error code for recognised file formats without audio + BASS_ERROR_NOTAUDIO (BASS_StreamCreateFile/User/URL error code) +* Error code for unstreamable MP4 files due to atom order + BASS_ERROR_UNSTREAMABLE (BASS_StreamCreateFileUser/URL error code) +* Fix for AAC streaming with BASS_STREAM_BLOCK on macOS 10.15 and iOS 13 + BASS_StreamCreateURL/FileUser +* Fix for playback rate changing bug when using DirectSound + BASS_ATTRIB_FREQ (BASS_ChannelSetAttribute option) +* armv6 architecture support dropped on iOS + +2.4.14 - 16/1/2019 +------------------ +* Support for playback on the "No sound" device + BASS_Init + BASS_StreamCreateFile/User/URL + BASS_SampleLoad/Create + BASS_ChannelPlay +* Improved sample rate conversion quality, including 64 point option + BASS_ATTRIB_SRC (BASS_ChannelSetAttribute option) + BASS_CONFIG_SRC/_SAMPLE (BASS_SetConfig options) +* Loopback (output device) recording on Windows Vista and above + BASS_RecordInit + BASS_RecordGetDeviceInfo + BASS_DEVICE_LOOPBACK (BASS_DEVICEINFO flag) + DEVLIST and RECTEST examples updated +* Native format recording option + BASS_RecordStart +* Access to the 3D output mix for applying DSP/FX + STREAMPROC_DEVICE_3D (BASS_StreamCreate option) +* Retrieval of a device's started/stopped status + BASS_IsStarted +* Sync for when a device stops unexpectedly + BASS_SYNC_DEV_FAIL (BASS_ChannelSetSync type) +* New channel playback state for a paused device + BASS_ACTIVE_PAUSED_DEVICE (BASS_ChannelIsActive) +* Sync for when a device's sample format changes + BASS_SYNC_DEV_FORMAT (BASS_ChannelSetSync type) +* Adjustable output device update period + BASS_CONFIG_DEV_PERIOD (BASS_SetConfig option) +* Nyquist FFT option + BASS_DATA_FFT_NYQUIST (BASS_ChannelGetData flag) +* Plugin-specific flags are ignored in standard stream creation functions + BASS_StreamCreateFile/User/URL +* Pre-buffering during stream creation is now disabled by default + BASS_CONFIG_NET_PREBUF_WAIT (BASS_SetConfig option) + BASS_StreamCreateURL/FileUser +* Existing internet streams are unaffected by read timeout config changes + BASS_CONFIG_NET_READTIMEOUT (BASS_SetConfig option) +* Retrieval of the number of existing handles + BASS_CONFIG_HANDLES (BASS_GetConfig option) +* Windows mixer settings are retained by default and optionally not + BASS_CONFIG_WASAPI_PERSIST (BASS_SetConfig option) +* Configurable OpenSSL library filename on Linux/Android + BASS_CONFIG_LIBSSL (BASS_SetConfigPtr option) +* Files can be deleted/renamed while streaming on Windows (already true on other platforms) + BASS_StreamCreateFile +* Fix for bug in playback buffering disabling option + BASS_ATTRIB_NOBUFFER (BASS_ChannelSetAttribute option) +* Fix to support long logarithmic curves in volume effects + BASS_FX_VOLUME (BASS_ChannelSetFX type) + +2.4.13.8 - 6/2/2018 +------------------- +* Indication of a file's original sample format being floating-point + BASS_ORIGRES_FLOAT (BASS_CHANNELINFO/SAMPLE flag) +* Some extra sample data is retained to account for device latency in data retrieval + BASS_ChannelGetData +* FFT window is shortened to match amount of available data when less than FFT size + BASS_ChannelGetData +* FFT level adjusted to be approx the same regardless of amount of available data + BASS_ChannelGetData +* Fix for crash when decoding channels are dissociated from a device + BASS_NODEVICE (BASS_ChannelSetDevice option) + +2.4.13 - 19/12/2017 +------------------- +* WASAPI output on Windows (DirectSound is fallback/optional) + BASS_DEVICE_DSOUND (BASS_Init flag) + BASS_CONFIG_DEV_BUFFER/NONSTOP (BASS_SetConfig options) + BASS_CONFIG_SRC/_SAMPLE (BASS_SetConfig options) + BASS_ATTRIB_SRC/NORAMP (BASS_ChannelSetAttribute options) +* Default output device following support extended to Windows Vista and macOS + BASS_CONFIG_DEV_DEFAULT (BASS_SetConfig option) +* Seamless playback buffer length changing + BASS_ATTRIB_BUFFER (BASS_ChannelSetAttribute option) + SYNTH example updated +* Access to the final output mix for applying DSP/FX + STREAMPROC_DEVICE (BASS_StreamCreate option) + BASS_CTYPE_STREAM_DEVICE + FXTEST example updated +* Dissociating of decoding channels from a device + BASS_NODEVICE (BASS_ChannelSetDevice option) +* Volume attribute levels above 1.0 for amplification + BASS_ATTRIB_VOL (BASS_ChannelSetAttribute option) +* Logarithmic attribute slides + BASS_SLIDE_LOG (BASS_ChannelSlideAttribute flag) +* Volume & panning attribute affected level retrieval + BASS_LEVEL_VOLPAN (BASS_ChannelGetLevelEx flag) +* Volume level adjustment effect + BASS_FX_VOLUME (BASS_ChannelSetFX type) + BASS_FX_VOLUME_PARAM structure +* Asynchronous pre-buffering + BASS_CONFIG_NET_PREBUF_WAIT (BASS_SetConfig option) + BASS_StreamCreateURL/FileUser + CONTEST and NETRADIO examples updated +* Decoding channels can be dissociated from a device + BASS_ChannelSetDevice +* Resetting of user file streams/decoders + BASS_POS_RESET (BASS_ChannelSetPosition flag) +* Relative seeking + BASS_POS_RELATIVE (BASS_ChannelSetPosition flag) +* RIFF cue points chunk retrieval + BASS_TAG_RIFF_CUE (BASS_ChannelGetTags type) + TAG_CUE structure +* RIFF sample chunk retrieval + BASS_TAG_RIFF_SMPL (BASS_ChannelGetTags type) + TAG_SMPL structure +* Support for Category/Description/Grouping/Keywords/Lyrics MP4 tags + BASS_TAG_MP4 (BASS_ChannelGetTags type) +* Separate channel type for dummy streams + BASS_CTYPE_STREAM_DUMMY +* Stalled internet stream buffering progress retrieval + BASS_FILEPOS_BUFFERING (BASS_StreamGetFilePosition mode) + CONTEST and NETRADIO examples updated +* Playlist recursion depth config option + BASS_CONFIG_NET_PLAYLIST_DEPTH (BASS_SetConfig options) +* Push file system read functions can now return 0 without ending the file + STREAMFILE_BUFFERPUSH (BASS_StreamCreateFileUser system) + FILEREADPROC +* 16 point SRC is used by default when SSE is available + BASS_CONFIG_SRC (BASS_SetConfig option) +* Mono downmixing for all file formats in sample loading + BASS_SAMPLE_MONO (BASS_SampleLoad flag) +* Mono OGG stream downmixing + BASS_SAMPLE_MONO (BASS_StreamCreateFile/User/URL flag) +* Media Foundation availability detection + BASS_CONFIG_MF_DISABLE (BASS_GetConfig option) + PLUGINS example updated +* AudioTrack output on Android + BASS_DEVICE_AUDIOTRACK (BASS_Init flag) +* Support for Android Media codecs + BASS_StreamCreateFile/User/URL + BASS_TAG_AM_MIME/NAME (BASS_ChannelGetTags type) + BASS_CONFIG_AM_DISABLE (BASS_SetConfig option) +* Panning fix for MOD files created with ScreamTracker 3 + BASS_MusicLoad +* Fix for compressor and distotion DX8 effects with floating-point data on Windows + BASS_FX_DX8_COMPRESSOR/DISTORTION (BASS_ChannelSetFX types) +* Fix for plugin freeing issue on 64-bit platforms (HPLUGIN is not library address any more) + BASS_PluginLoad + BASS_PluginFree + +2.4.12 - 10/3/2016 +------------------ +* DSP/FX chain order modification + BASS_FXSetPriority +* Average bitrate retrieval + BASS_ATTRIB_BITRATE +* Ramping-out when stopping/pausing playback + BASS_ChannelStop + BASS_ChannelPause +* Disabling of playback ramping + BASS_ATTRIB_NORAMP (BASS_ChannelSetAttribute option) +* Pre-buffering when playback buffering is disabled + BASS_ChannelUpdate + BASS_ATTRIB_NOBUFFER (BASS_ChannelSetAttribute option) +* Net agent and proxy config options now make a copy of the provided string + BASS_CONFIG_NET_AGENT/PROXY (BASS_SetConfigPtr options) + NETRADIO example updated +* Unicode net agent and proxy config options on Windows + BASS_CONFIG_NET_AGENT/PROXY (BASS_SetConfigPtr options) +* 32768 sample FFT + BASS_DATA_FFT32768 (BASS_ChannelGetData flag) +* Support for iTunes gapless info in MP3 files + BASS_StreamCreateFile/User +* 529 sample delay removed from start of MP3 files without delay info + BASS_StreamCreateFile/User/URL +* Support for numerical MP4 genre (gnre) tags + BASS_TAG_MP4 (BASS_ChannelGetTags type) +* Support for BASSWMA's tag option when using Media Foundation WMA codec + BASS_TAG_WMA (BASS_ChannelGetTags type) +* OpenMPT author tag retrieval + BASS_TAG_MUSIC_AUTH (BASS_ChannelGetTags type) +* FastTracker2 panning for XM files + BASS_MUSIC_FT2PAN (BASS_MusicLoad flag) +* Support for longer device names on Windows + BASS_DEVICEINFO (name member) +* Checking for floating-point support on platforms that might not have it + BASS_CONFIG_FLOAT (BASS_GetConfig option) +* Attribute size retrieval fix + BASS_ChannelGetAttributeEx +* Fix for missing LC_VERSION_MIN issue with Xcode 7 on OSX, ppc architecture (PowerPC) support dropped +* LIST example renamed to DEVLIST + +2.4.11 - 22/12/2014 +------------------- +* Support for custom HTTP request headers + BASS_StreamCreateURL +* HTTPS support on Linux/Android + BASS_StreamCreateURL +* Redirection HTTP headers provided during connection + BASS_STREAM_STATUS (BASS_StreamCreateURL flag) + DOWNLOADPROC +* Adjustable stalled internet stream resumption buffer level + BASS_ATTRIB_NET_RESUME (BASS_ChannelSetAttribute option) +* Extended level retrieval inc. multi-channel and RMS options + BASS_ChannelGetLevelEx +* Inexact/faster seeking + BASS_POS_INEXACT (BASS_ChannelSetPosition flag) +* Post-stream creation scanning (seek table building) + BASS_POS_SCAN (BASS_ChannelSetPosition flag) +* Extended attribute support + BASS_ChannelGet/SetAttributeEx +* Scanned info retrieval and setting + BASS_ATTRIB_SCANINFO (BASS_ChannelGet/SetAttributeEx option) +* Built-in ADPCM WAVE file support on Linux/Android/WinCE + BASS_StreamCreateFile/User/URL + BASS_SampleLoad +* Active MOD channel count retrieval + BASS_ATTRIB_MUSIC_ACTIVE (BASS_ChannelGetAttribute option) +* Fractional sample rates + BASS_ATTRIB_FREQ (BASS_ChannelSetAttribute option) +* Device type information + BASS_DEVICE_TYPE_xxx (BASS_DEVICEINFO flags) +* Unicode support for recording input names + BASS_CONFIG_UNICODE (BASS_SetConfig option) + BASS_RecordGetInputName +* File size retrieval + BASS_FILEPOS_SIZE (BASS_StreamGetFilePosition mode) +* Asynchronous file reading buffer level retrieval + BASS_FILEPOS_ASYNCBUF (BASS_StreamGetFilePosition mode) +* MPEG data search limit raised to 1MB + BASS_CONFIG_VERIFY (BASS_SetConfig option) +* Separate MPEG data search limit for internet/buffered streams + BASS_CONFIG_VERIFY_NET (BASS_SetConfig option) +* Support for iTunes gapless info with Media Foundation and CoreAudio codecs + BASS_StreamCreateFile/User +* Airplay receiver enumeration and selection on OSX + BASS_DEVICES_AIRPLAY (BASS_GetDeviceInfo flag) + BASS_CONFIG_AIRPLAY (BASS_SetConfig option) +* Media Foundation playback of audio from videos is now optional + BASS_CONFIG_MF_VIDEO (BASS_SetConfig option) +* Optional floating-point or fixed-point data retrieval on Android/WinCE + BASS_DATA_FLOAT/FIXED (BASS_ChannelGetData flags) +* Continuous output when nothing is playing on Linux/Android/WinCE + BASS_CONFIG_DEV_NONSTOP (BASS_SetConfig option) +* Fix for decoding channels being ended when stopping the output device + BASS_Stop +* Fix for Media Foundation internet/buffered streaming on Windows 8 + BASS_StreamCreateURL + BASS_StreamCreateFileUser +* Improved compatibility with recent PulseAudio versions on Linux +* LIST and MODTEST examples added +* MASM API and examples removed (available as separate download) + +2.4.10 - 16/2/2013 +------------------ +* Asynchronous file reading/buffering + BASS_ASYNCFILE (BASS_StreamCreateFile/User flag) + BASS_CONFIG_ASYNCFILE_BUFFER (BASS_SetConfig option) +* Support for chained OGG files (multiple logical bitstreams) + BASS_StreamCreateFile/User + BASS_CONFIG_OGG_PRESCAN (BASS_SetConfig option) + BASS_POS_OGG (BASS_ChannelSetPosition/ChannelGetLength mode) +* OGG logical bitstream syncs are no longer automatically "mixtime" + BASS_SYNC_OGG_CHANGE (BASS_ChannelSetSync type) +* Support for Soundtracker MOD files + BASS_MusicLoad +* Complex FFT data + BASS_DATA_FFT_COMPLEX (BASS_ChannelGetData flag) +* Volume levels above 1.0 for decoding channels + BASS_ATTRIB_VOL (BASS_ChannelSetAttribute option) +* Recording device channel count retrieval on Windows/OSX/iOS + BASS_RECORDINFO (formats member) +* Minimum recording period reduced to 5ms + BASS_RecordStart +* Recording device period adjustment on OSX + BASS_RecordStart +* Device UID retrieval on OSX + BASS_DEVICEINFO (driver member) +* The desktop window handle is used when none is provided + BASS_Init + +2.4.9 - 3/5/2012 +---------------- +* Improved and adjustable sample rate conversion quality + BASS_ATTRIB_SRC (BASS_ChannelSetAttribute option) + BASS_CONFIG_SRC/_SAMPLE (BASS_SetConfig options) +* Support for buffered file & internet streams with CoreAudio codecs on OSX/iOS + BASS_StreamCreateURL + BASS_StreamCreateUser +* Data and level retrieval from sample channels + BASS_ChannelGetData + BASS_ChannelGetLevel +* Oldest sample channel will be overridden when there are multiple candidates + BASS_SampleGetChannel +* Use of the device's output rate with MODs + BASS_MusicLoad +* Optional device output rate setting on OSX/iOS + BASS_DEVICE_FREQ (BASS_Init flag) +* UTF-8 device information on Windows + BASS_CONFIG_UNICODE (BASS_SetConfig option) +* Speaker assignment with panning/balance control on Windows Vista/7 + BASS_CONFIG_VISTA_SPEAKERS (BASS_SetConfig option) + BASS_ATTRIB_PAN (BASS_ChannelGet/Set/SlideAttribute option) +* Push stream queue level can be checked after using BASS_STREAMPROC_END + BASS_StreamPutData +* Support for ALSA subdevices on Linux + BASS_Init + BASS_GetDeviceInfo + BASS_RecordInit + BASS_RecordGetDeviceInfo +* Device list fix on 64-bit OSX + BASS_GetDeviceInfo + BASS_RecordGetDeviceInfo +* BASS_UNICODE support fix on Linux + BASS_PluginLoad +* Internet streaming tweaks/fixes on Windows +* SYNTH example updated to use device output rate +* RECTEST example updated (C version) for better Windows Vista/7 support +* Documentation updated with platform-specific info for Android + +2.4.8 - 29/8/2011 +----------------- +* Support for Media Foundation codecs on Windows 7 and updated Vista + BASS_StreamCreateFile/User/URL + BASS_TAG_MF (BASS_ChannelGetTags type) + PLUGINS example updated +* Built-in support for MP4 tags on Win32/OSX/iOS (for Media Foundation & CoreAudio AAC/ALAC codecs) + BASS_TAG_MP4 (BASS_ChannelGetTags type) +* WAVE format chunk retrieval + BASS_TAG_WAVEFORMAT (BASS_ChannelGetTags type) +* Adjustable sample channel limit + BASS_SampleSetInfo +* Per-channel CPU usage monitoring + BASS_ATTRIB_CPU (BASS_ChannelGetAttribute option) +* Pre-allocation of push stream queue space + BASS_StreamPutData +* Support for AIFF files with the data chunk before the format info chunk + BASS_StreamCreateFile/User/URL +* Ramping-in disabled for all but the XM format (and MODs in FT2 mode) in "normal" ramping mode + BASS_MUSIC_RAMP (BASS_MusicLoad flag) +* RIFF "INFO" tag reading fix + BASS_TAG_RIFF_INFO (BASS_ChannelGetTags type) +* OSX 10.7 compatibility fix +* x86_64 architecture support on OSX +* Delphi dynamic loading unit removed (now available as separate download) + +2.4.7 - 30/11/2010 +------------------ +* Decode-to-position seeking + BASS_POS_DECODETO (BASS_ChannelSetPosition flag) +* Support for RIFF "DISP" text tags + BASS_TAG_RIFF_DISP (BASS_ChannelGetTags type) +* Support for APEv1 tags + BASS_TAG_APE (BASS_ChannelGetTags type) + BASS_TAG_APE_BINARY (BASS_ChannelGetTags type) +* 16384 sample FFT + BASS_DATA_FFT16384 (BASS_ChannelGetData flag) +* Support for AIFF files larger than 4GB + BASS_StreamCreateFile/User/URL +* Acceptance of self-signed and invalid certificates + BASS_StreamCreateURL +* Internet stream reading timeout + BASS_CONFIG_NET_READTIMEOUT (BASS_SetConfig option) +* Support for removing a DSP within its DSPPROC + BASS_ChannelRemoveDSP +* Buffer bypassing for lower latency output (not available on Windows) + BASS_ATTRIB_NOBUFFER (BASS_ChannelSetAttribute option) + SYNTH example added (OSX) +* A "Default" device that follows default device changes on Windows 7 + BASS_CONFIG_DEV_DEFAULT (BASS_SetConfig option) +* Xcode examples project added for OSX +* Documentation updated with platform-specific info for iOS/Linux/WinCE + +2.4.6 - 17/6/2010 +----------------- +* Support for APEv2 tags, including binary + BASS_TAG_APE (BASS_ChannelGetTags type) + BASS_TAG_APE_BINARY (BASS_ChannelGetTags type) +* Unicode/IDN URL support + BASS_StreamCreateURL +* Decoding position retrieval + BASS_POS_DECODE (BASS_ChannelGetPosition flag) +* Support for OGG 6/7.1 channel configs + BASS_StreamCreateFile/User/URL +* Support for setting syncs within mixtime SYNCPROCs + BASS_ChannelSetSync +* Support for setting additional DSP/FX within DSPPROCs + BASS_ChannelSetDSP/FX +* DC bias removal in FFT processing + BASS_DATA_FFT_REMOVEDC (BASS_ChannelGetData flag) +* Fix for incorrect (2x) return value when getting FFT data from a 16-bit channel + BASS_ChannelGetData +* Fix for incorrect (STOPPED instead of PAUSED) channel status following BASS_Pause + BASS_ChannelIsActive + +2.4.5 - 18/12/2009 +------------------ +* Support for little-endian AIFF files + BASS_StreamCreateFile/User/URL + BASS_SampleLoad +* Support for 64-bit floating-point WAVE/AIFF files + BASS_StreamCreateFile/User/URL + BASS_SampleLoad +* Input volume retrieval failure results in a reading of -1 instead of 1 + BASS_RecordGetInput + RECTEST example updated +* Input volume support on OSX + BASS_RecordSetInput + BASS_RecordGetInput + RECTEST example updated +* Fix for deferred input settings on Vista + BASS_RecordSetInput +* Windows MP3 codec given preference over other installed MP3 codecs (MP3-FREE version) + BASS_StreamCreateFile/User/URL + BASS_SampleLoad + +2.4.4 - 13/10/2009 +------------------ +* RIFF/BWF "radio traffic" tag retrieval + BASS_TAG_RIFF_CART (BASS_ChannelGetTags type) + TAG_CART structure +* Support for ID3v2 tags in RIFF/WAVE/AIFF files ("ID3 " chunk) + BASS_TAG_ID3V2 (BASS_ChannelGetTags type) +* Pushed fractional samples are refused rather than discarded + BASS_StreamPutData +* DX8 effect emulation on OSX + BASS_FX_DX8_CHORUS/DISTORTION/ECHO/FLANGER/PARAMEQ/REVERB (BASS_ChannelSetFX types) + FXTEST example added +* UTF-16 support on OSX + BASS_UNICODE (BASS_StreamCreateFile/SampleLoad/MusicLoad/PluginLoad flag) + +2.4.3 - 8/5/2009 +---------------- +* MOD order list retrieval + BASS_TAG_MUSIC_ORDERS (BASS_ChannelGetTags type) +* Support for ID3v2 tags in RIFF/WAVE files ("id3 " chunk) + BASS_TAG_ID3V2 (BASS_ChannelGetTags type) +* Improved position reporting precision on Vista + BASS_ChannelGetPosition +* Length retrieval when streaming in blocks (BASS_STREAM_BLOCK) + BASS_ChannelGetLength +* Support for CoreAudio codecs on OSX + BASS_StreamCreateFile/User + BASS_SampleLoad + BASS_TAG_CA_CODEC (BASS_ChannelGetTags type) + TAG_CA_CODEC structure +* 3D algorithm option support on OSX + BASS_CONFIG_3DALGORITHM (BASS_SetConfig option) + +2.4.2 - 18/9/2008 +----------------- +* RF64 support + BASS_StreamCreateFile/User +* RIFF/BWF "Broadcast Audio Extension" tag retrieval + BASS_TAG_RIFF_BEXT (BASS_ChannelGetTags type) + TAG_BEXT structure +* ID3v1 tag structure + TAG_ID3 structure +* Multiple simultaneous recordings per device on Vista & OSX (as on XP) + BASS_RecordStart +* DX8 effect parameter defaults updated/corrected in documentation + +2.4 - 2/4/2008 +-------------- +* "Push" streaming + STREAMPROC_PUSH (BASS_StreamCreate option) + BASS_StreamPutData + LIVEFX and MULTI examples updated +* "Push" buffered file streaming + STREAMFILE_BUFFERPUSH (BASS_StreamCreateFileUser system) + BASS_StreamPutFileData +* STREAMFILEPROC replaced by table of callbacks for each file operation + BASS_FILEPROCS (FILECLOSEPROC/FILELENPROC/FILEREADPROC/FILESEEKPROC) + STREAMFILEPROC *removed* +* 64-bit file positioning + BASS_SampleLoad + BASS_MusicLoad + BASS_StreamCreateFile + BASS_StreamGetFilePosition +* File buffer level retrieval + BASS_FILEPOS_BUFFER (BASS_StreamGetFilePosition mode) +* Sinc interpolated MOD music mixing + BASS_MUSIC_SINCINTER (BASS_MusicLoad flag) +* MO3 2.4 support + BASS_MusicLoad +* MOD orders positioning incorporated into channel functions + BASS_ChannelGetLength + BASS_ChannelSetPosition + BASS_ChannelGetPosition + BASS_MusicGetOrderPosition *removed* + BASS_MusicGetOrders *removed* +* Channel attribute functions consolidated + BASS_ChannelSetAttribute + BASS_ChannelGetAttribute + BASS_ChannelSlideAttribute + BASS_ChannelIsSliding + BASS_ChannelSetAttributes *removed* + BASS_ChannelGetAttributes *removed* + BASS_ChannelSlideAttributes *removed* + BASS_ChannelSetEAXMix *removed* + BASS_ChannelGetEAXMix *removed* + BASS_MusicSetAttribute *removed* + BASS_MusicGetAttribute *removed* +* Floating-point volume and panning + BASS_SetVolume + BASS_GetVolume + BASS_RecordSetInput + BASS_RecordGetInput + BASS_ATTRIB_PAN/VOL (BASS_ChannelGet/Set/SlideAttribute options) + BASS_ATTRIB_MUSIC_VOL_CHAN/INST (BASS_ChannelGet/Set/SlideAttribute options) + BASS_SAMPLE (volume/pan/outvol members) + BASS_CONFIG_MAXVOL *removed* + BASSTEST and RECTEST examples updated +* Output device volume control on Vista (as on other OS) + BASS_SetVolume + BASS_GetVolume +* Multiple update threads + BASS_CONFIG_UPDATETHREADS (BASS_SetConfig option) + BASSTEST example updated +* Global volume range increased to 10000 + BASS_CONFIG_GVOL_SAMPLE/STREAM/MUSIC (BASS_SetConfig options) + BASSTEST example updated +* Setting and retrieving of a sample's data + BASS_SampleSetData + BASS_SampleGetData + BASS_SampleCreate + BASS_SampleCreateDone *removed* +* Channel flag setting mask + BASS_ChannelFlags + BASS_ChannelSetFlags *removed* + SPEAKERS example updated +* 256 sample FFT + BASS_DATA_FFT256 (BASS_ChannelGetData flag) +* Channel locking to prevent access by other threads + BASS_ChannelLock +* Manual channel buffer updating + BASS_ChannelUpdate + BASS_ChannelPreBuf *removed* +* Configurable manual update length + BASS_Update +* Extended device information retrieval and detection of new/removed devices + BASS_GetDeviceInfo + BASS_RecordGetDeviceInfo + BASS_DEVICEINFO structure + BASS_GetDeviceDescription *removed* + BASS_RecordGetDeviceDescription *removed* + BASS_INFO (driver member) *removed* + BASS_RECORDINFO (driver member) *removed* + MULTI example updated +* Default device change tracking on Windows (as on OSX) + BASS_Init + BASS_RecordInit +* Speaker detection from Windows control panel + BASS_DEVICE_CPSPEAKERS (BASS_Init flag) +* Channel automatically stopped & resumed for DX8 effects + BASS_ChannelSetFX + BASS_ChannelRemoveFX +* "double" precision position conversion + BASS_ChannelBytes2Seconds + BASS_ChannelSeconds2Bytes +* Separate config functions for pointers + BASS_SetConfigPtr + BASS_GetConfigPtr + BASS_CONFIG_NET_AGENT/PROXY (BASS_SetConfigPtr options) +* Configurable file format verification length + BASS_CONFIG_VERIFY (BASS_SetConfig option) +* Stream filename retrieval + BASS_CHANNELINFO (file member) +* Channel sample retrieval + BASS_CHANNELINFO (sample member) +* META syncs no longer receive metadata in the "data" parameter + BASS_SYNC_META (BASS_ChannelSetSync type) +* Separate sync for OGG logical bitstream changes (instead of BASS_SYNC_META) + BASS_SYNC_OGG_CHANGE (BASS_ChannelSetSync type) + NETRADIO example updated (C version) +* Message syncing removed (use PostMessage instead) + BASS_SYNC_MESSAGE (BASS_ChannelSetSync flag) *removed* +* Data retrieval from stopped/paused channels + BASS_ChannelGetData +* Callback "user" parameters changed to pointers + BASS_StreamCreate / STREAMPROC + BASS_StreamCreateFileUser + BASS_StreamCreateURL / DOWNLOADPROC + BASS_RecordStart / RECORDPROC + BASS_ChannelSetDSP / DSPPROC + BASS_ChannelSetSync / SYNCPROC + +2.3.0.3 - 30/7/2007 +------------------- +* FX state resetting + BASS_FXReset +* PLS/M3U playlist URL processing + BASS_CONFIG_NET_PLAYLIST (BASS_SetConfig option) + NETRADIO example updated +* Internet stream connection status retrieval + BASS_FILEPOS_CONNECTED (BASS_StreamGetFilePosition mode) +* Lyrics3v2 tags + BASS_TAG_LYRICS3 (BASS_ChannelGetTags type) +* IT virtual channel configuration + BASS_CONFIG_MUSIC_VIRTUAL (BASS_SetConfig option) +* Accurate speaker detection on Vista + BASS_INFO (speakers member) +* Device output/input rate retrieval on Vista + BASS_INFO (freq member) + BASS_RECORDINFO (freq member) +* Syncing upon position changes + BASS_SYNC_SETPOS (BASS_ChannelSetSync type) +* Improved stall handling + BASS_SYNC_STALL +* Invalid decoding channel flags produce an error instead of being ignored + BASS_StreamCreate/File/User/URL + BASS_MusicLoad + +2.3.0.2 - 22/1/2007 +------------------- +* Retrieval of a sample's existing channel handles + BASS_SampleGetChannels +* 8192 sample FFT + BASS_DATA_FFT8192 (BASS_ChannelGetData flag) +* Adjustable recording buffer + BASS_CONFIG_REC_BUFFER (BASS_SetConfig option) +* Stopping decoding channels before the end + BASS_ChannelStop +* Sample channels created paused to prevent overriding before playback + BASS_SampleGetChannel +* Separate "MP3-FREE" version using the OS's MP3 decoder + BASS_CONFIG_MP3_CODEC *removed* + +2.3.0.1 - 12/6/2006 +------------------- +* Ability to move a channel to another device + BASS_ChannelSetDevice + MULTI example updated +* Support for ID3v2.4 tags at end of file + BASS_TAG_ID3V2 (BASS_ChannelGetTags type) + +2.3 - 21/5/2006 +--------------- +* MOD message/instrument/sample text retrieval, merged with stream tag retrieval function + BASS_ChannelGetTags + BASS_TAG_MUSIC_NAME/MESSAGE/INST/SAMPLE (BASS_ChannelGetTags types) + BASS_MusicGetName *removed* + BASS_StreamGetTags *removed* +* Plugin information retrieval + BASS_PluginGetInfo + BASS_PLUGININFO/FORM structures + BASS_CHANNELINFO (plugin member) + PLUGINS example updated +* RIFF/WAVE "INFO" tag retrieval + BASS_TAG_RIFF_INFO (BASS_StreamGetTags type) +* More specific WAVE format information + BASS_CTYPE_STREAM_WAV_PCM/FLOAT (channel types) + BASS_CTYPE_STREAM_WAV (channel type flag) +* Proxy server configuration + BASS_CONFIG_NET_PROXY (BASS_SetConfig option) + BASS_CONFIG_NET_NOPROXY *removed* + NETRADIO example updated +* Passive FTP mode + BASS_CONFIG_NET_PASSIVE (BASS_SetConfig option) +* Agent changes take immediate effect + BASS_CONFIG_NET_AGENT (BASS_SetConfig option) +* Minimum time gap between creating new sample channels + BASS_SAMPLE (mingap member) + BASS_SampleGetChannel +* Support for Unicode plugin filenames + BASS_PluginLoad +* Device output/input rate retrieval (MacOSX only) + BASS_INFO (freq member) + BASS_RECORDINFO (freq member) +* Extended version info (minor revision) + BASS_GetVersion +* Unsupported codec error code + BASS_ERROR_CODEC +* Optional use of the Windows MP3 codec + BASS_CONFIG_MP3_CODEC (BASS_SetConfig option) +* 3D support for MacOSX + BASS_Set3DFactors + BASS_Get3DFactors + BASS_Set3DPosition + BASS_Get3DPosition + BASS_Apply3D + BASS_ChannelSet3DAttributes + BASS_ChannelGet3DAttributes + BASS_ChannelSet3DPosition + BASS_ChannelGet3DPosition + 3DTEST example added (Win32 example also updated) +* VB version of SYNTH example added + +2.2 - 2/10/2005 +--------------- +* Add-on plugin system + BASS_PluginLoad + BASS_PluginFree + BASS_StreamCreateFile/User/URL + BASS_SampleLoad + PLUGINS example added +* MOD position & syncing in bytes + BASS_ChannelSetPosition + BASS_ChannelGetPosition + BASS_MusicGetOrderPosition added for orders position + BASS_SYNC_MUSICPOS added for orders syncing + MAKEMUSICPOS macro/define + CUSTLOOP example updated +* Stream/MOD "length" functions combined (also works with samples), new MOD orders length function + BASS_ChannelGetLength + BASS_MusicGetOrders + BASS_StreamGetLength *removed* + BASS_MusicGetLength *removed* +* Support for AIFF files + BASS_StreamCreateFile/User/URL + BASS_SampleLoad +* Support for 24 and 32-bit (integer) WAV files + BASS_StreamCreateFile/User/URL + BASS_SampleLoad +* WAV files are no longer converted to the "device" resolution + BASS_StreamCreateFile/User/URL +* Recording master control + BASS_RecordGetInput + BASS_RecordSetInput +* Adjustable pre-buffering + BASS_ChannelPreBuf +* Floating-point data retrieval + BASS_DATA_FLOAT (BASS_ChannelGetData flag) +* Support for floating-point samples + BASS_SampleLoad + BASS_SampleCreate +* Multi-channel samples + BASS_SampleLoad/Create + BASS_SAMPLE (chans member) +* Sample lengths given in bytes + BASS_SampleCreate + BASS_SAMPLE (length member) +* MOD music 8-bit resolution option + BASS_MusicLoad +* OGG vendor tag retrieval + BASS_TAG_VENDOR (BASS_StreamGetTags type) +* Configurable "User-Agent" header for internet streams + BASS_CONFIG_NET_AGENT (BASS_SetConfig option) +* Shoutcast metadata is now requested automatically + BASS_STREAM_META flag *removed* +* Download callbacks receive all data from start of file/stream (including any non-audio data) + DOWNLOADPROC +* Length when streaming in blocks is unavailable (BASS_ERROR_NOTAVAIL, not just 0) + BASS_ChannelGetLength +* Support for growing custom file streams + BASS_FILE_LEN (STREAMFILEPROC action) +* Query file action removed + BASS_FILE_QUERY *removed* +* Recording channel syncing + BASS_ChannelSetSync +* Info structure "size" members removed + BASS_INFO structure + BASS_RECORDINFO structure +* Little bit of flag reshuffling + BASS_MP3_SETPOS renamed to BASS_STREAM_PRESCAN + BASS_MUSIC_CALCLEN value changed and renamed to BASS_MUSIC_PRESCAN + BASS_MUSIC_POSRESET value changed +* Add-on API enhancements +* MacOSX port introduced + +2.1 - 28/11/2004 +---------------- +* Improved "mixtime" sync system, allowing custom looping + SYNCPROC + CUSTLOOP example added +* FX can now be in the DSP chain, so can be prioritized and applied in floating-point + BASS_ChannelSetFX + BASS_CONFIG_FLOATDSP (BASS_SetConfig option) +* Ability to set channel flags (eg. looping) independent of playback + BASS_ChannelSetFlags + SPEAKERS example updated +* Stream/MOD "play" and channel "resume" functions combined + BASS_ChannelPlay + BASS_StreamPlay *removed* + BASS_MusicPlay *removed* + BASS_MusicPlayEx *removed* + BASS_ChannelResume *removed* +* Stream/MOD pre-buffering functions combined + BASS_ChannelPreBuf + BASS_StreamPreBuf *removed* + BASS_MusicPreBuf *removed* +* MOD attribute functions combined, with added BPM/speed/globalvolume options + BASS_MusicSetAttribute + BASS_MusicGetAttribute + BASS_MUSIC_ATTRIB_AMPLIFY + BASS_MUSIC_ATTRIB_PANSEP + BASS_MUSIC_ATTRIB_PSCALER + BASS_MUSIC_ATTRIB_BPM + BASS_MUSIC_ATTRIB_SPEED + BASS_MUSIC_ATTRIB_VOL_GLOBAL + BASS_MUSIC_ATTRIB_VOL_CHAN + BASS_MUSIC_ATTRIB_VOL_INST + BASS_MusicSetAmplify *removed* + BASS_MusicSetPanSep *removed* + BASS_MusicSetPositionScaler *removed* + BASS_MusicSetVolume *removed* + BASS_MusicGetVolume *removed* +* Flag to reset bpm/etc as well as notes when seeking in MOD musics + BASS_MUSIC_POSRESETEX (BASS_MusicLoad & BASS_ChannelSetFlags flag) +* More flexible and concise sample channel creation system + BASS_SampleGetChannel + BASS_SamplePlay *removed* + BASS_SamplePlayEx *removed* + BASS_SamplePlay3D *removed* + BASS_SamplePlay3DEx *removed* +* Support for up to 30 speakers + BASS_SPEAKER_N macro/define +* More precise level measurement + BASS_ChannelGetLevel +* Level can now be retrieved from decoding channels + BASS_ChannelGetLevel +* Retrieval of a sample/channel's original sample resolution + BASS_SAMPLE (origres member) + BASS_CHANNELINFO (origres member) +* Support for streaming WAV files in "blocks" + BASS_StreamCreateURL + BASS_StreamCreateFileUser +* Status info (HTTP/ICY tags) available during connection to server + BASS_STREAM_STATUS (BASS_StreamCreateURL flag) + DOWNLOADPROC + NETRADIO example updated (Delphi version also added) +* Adjustable internet stream pre-buffering + BASS_CONFIG_NET_PREBUF (BASS_SetConfig option) +* Option to bypass proxy server + BASS_CONFIG_NET_NOPROXY (BASS_SetConfig option) +* Option whether to allow channels to be played after BASS_Pause + BASS_CONFIG_PAUSE_NOPLAY (BASS_SetConfig option) +* Recording channel count now a separate parameter + BASS_RecordStart (chans parameter) +* Synchronizer for when a channel is freed + BASS_SYNC_FREE (BASS_ChannelSetSync type) +* Data start file position retrieval + BASS_FILEPOS_START (BASS_StreamGetFilePosition mode) +* Performance improvements + MP2 decoding ~20% faster + MP3/MP1 decoding & FFT processing all up to 10% faster + OGG decoding ~3% faster +* C/C++ examples reorganised, with makefiles & VC++ projects +* Add-on API enhancements +* More DLL shrinkage :) + +2.0 - 31/10/2003 +---------------- +* Multiple output device support + BASS_Init (device number changes) + BASS_SetDevice + BASS_GetDevice + BASS_ChannelGetDevice + MULTI example updated (VB version also added) +* Multiple recording device support + BASS_RecordSetDevice + BASS_RecordGetDevice + BASS_RecordStart + BASS_ChannelGetDevice + HRECORD handle + RECORDPROC (handle parameter) +* Recording with DSP/FX + BASS_ChannelSetDSP + BASS_ChannelSetFX +* Recording position retrieval + BASS_ChannelGetPosition +* Start recording paused + BASS_RECORD_PAUSE (BASS_RecordStart flag) +* Multi-channel streams, inc. support for multichannel OGG & WAV files + BASS_StreamCreate + BASS_StreamCreateFile/User/URL +* FFT for individual channels, inc. multi-channel streams + BASS_DATA_FFT_INDIVIDUAL (BASS_ChannelGetData flag) + BASS_DATA_FFT512S/1024S/2048S/4096S *removed* +* DSP prioritizing + BASS_ChannelSetDSP + DSPTEST example updated +* Seeking in internet streamed files + BASS_ChannelSetPosition +* Enhanced custom file stream systems + BASS_StreamCreateFileUser + BASS_FILE_SEEK (STREAMFILEPROC action) + BASS_STREAM_FILEPROC flag *removed* +* Enhanced custom stream system with automatic stalling/resuming + STREAMPROC + BASS_STREAMPROC_END (STREAMPROC flag) +* Synchronizer for stalled/resumed playback + BASS_SYNC_STALL (BASS_ChannelSetSync type) +* Synchronizer for completed download + BASS_SYNC_DOWNLOAD (BASS_ChannelSetSync type) +* End sync support for custom streams + BASS_SYNC_END (BASS_ChannelSetSync type) +* Synchronizer support for decoding channels + BASS_ChannelSetSync +* Unified configuration function + BASS_SetConfig + BASS_GetConfig + BASS_SetBufferLength *removed* + BASS_SetNetConfig *removed* + BASS_SetGlobalVolumes *removed* + BASS_GetGlobalVolumes *removed* + BASS_SetLogCurves *removed* + BASS_Set3DAlgorithm *removed* + BASS_DEVICE_FLOATDSP flag *removed* +* Internet stream saving to disk replaced by more flexible callback + BASS_StreamCreateURL + DOWNLOADPROC + VB NETRADIO example updated +* Buffer length retrieval when "streaming in blocks" + BASS_FILEPOS_END (BASS_StreamGetFilePosition mode) +* Individual sample rate setting for MOD musics + BASS_MusicLoad +* Channel type and default sample rate retrieval + BASS_ChannelGetInfo (replaces BASS_ChannelGetFlags) + BASS_CHANNELINFO +* MOD music flag retrieval + BASS_CHANNELINFO (flags member) +* Adjustable instrument volumes in MOD musics + BASS_MusicSetVolume (replaces BASS_MusicSetChannelVol) + BASS_MusicGetVolume (replaces BASS_MusicGetChannelVol) +* Automatically free a MOD music when it stops or ends + BASS_MUSIC_AUTOFREE (BASS_MusicLoad flag) +* Class GUID added to initialization parameters + BASS_Init + BASS_SetCLSID *removed* +* Update period adjustable at any time + BASS_CONFIG_UPDATEPERIOD (BASS_SetConfig option) + BASS_DEVICE_NOTHREAD flag *removed* +* Customizable maximum volume setting + BASS_CONFIG_MAXVOL (BASS_SetConfig option) + BASS_DEVICE_VOL1000 flag *removed* +* Device volume is now always left as it is during init/freeing + BASS_DEVICE_LEAVEVOL flag *removed* +* Device driver name retrieval + BASS_INFO (driver member) + BASS_RECORDINFO (driver member) +* Error codes are local to the current thread + BASS_ErrorGetCode +* Performance improvements + MP2 decoding 15-20% faster + MP3 decoding ~5% faster +* Built-in CD functions removed (replaced in BASSCD) + BASS_CDDoor *removed* + BASS_CDFree *removed* + BASS_CDGetID *removed* + BASS_CDGetTrackLength *removed* + BASS_CDGetTracks *removed* + BASS_CDInDrive *removed* + BASS_CDInit *removed* + BASS_CDPlay *removed* +* Force channels to use software mixing + BASS_SAMPLE_SOFTWARE (BASS_StreamCreate/File/User/URL & BASS_MusicLoad flag) +* Support for high-pass filter and forward/reverse (S9E/F) IT/MPT effects +* BASS_MUSIC flags rearranged to mirror BASS_SAMPLE/STREAM counterparts +* Output automatically started during initialization +* BASS_ChannelGetData once again accepts any "length" param +* All function comments have been removed from the API headers to avoid + outdated/incorrect information - the documentation should be used. +* TMT Pascal API removed from main distribution - now available on the website +* A few more 'K' knocked off the DLL size :) + +1.8a - 18/6/2003 +---------------- +* Tweaks 'n' fixes, including... + Fixed seeking bug on 32-bit OGG streams + Fixed seeking on a decoding channel after it has reached the end + Low FPU precision (eg. when using Direct3D) issue addressed + Improved speakers (BASS_INFO) detection + BASS_ChannelSeconds2Bytes return value is rounded down to nearest sample + BASS_ChannelGetData "length" param must equal a whole number of samples + Slide syncs are triggered by "-2" volume slides on "autofree" streams +* Support for Unicode filenames + BASS_UNICODE (BASS_SampleLoad/BASS_StreamCreateFile/BASS_MusicLoad flag) +* 4096 sample FFT + BASS_DATA_FFT4096/S (BASS_ChannelGetData flags) +* Another 'K' knocked off the DLL size + +1.8 - 9/3/2003 +-------------- +* 32-bit floating-point channels + BASS_SAMPLE_FLOAT (BASS_StreamCreate/File/URL flag) + BASS_MUSIC_FLOAT (BASS_MusicLoad flag) + BASS_SAMPLE_FLOAT (BASS_RecordStart flag) + BASS_DEVICE_FLOATDSP (BASS_Init flag) + DSPTEST example updated +* Support for 32-bit floating-point (type 3) WAV files + BASS_StreamCreateFile/URL + BASS_SampleLoad +* Channel speaker assignment + BASS_SPEAKER_FRONT (BASS_MusicLoad/BASS_StreamCreate/File/URL flag) + BASS_SPEAKER_REAR " + BASS_SPEAKER_CENLFE " + BASS_SPEAKER_REAR2 " + BASS_SPEAKER_FRONTLEFT " + BASS_SPEAKER_FRONTRIGHT " + BASS_SPEAKER_REARLEFT " + BASS_SPEAKER_REARRIGHT " + BASS_SPEAKER_CENTER " + BASS_SPEAKER_LFE " + BASS_SPEAKER_REAR2LEFT " + BASS_SPEAKER_REAR2RIGHT " + BASS_INFO (speakers member) + BASS_DEVICE_SPEAKERS (BASS_Init flag) + 4SPEAKER example replaced by SPEAKERS example +* Recording input type retrieval + BASS_INPUT_TYPE_xxx (BASS_RecordGetInput) + RECTEST example updated +* Non-interpolated MOD mixing + BASS_MUSIC_NONINTER (BASS_MusicLoad/PlayEx flag) +* Performance improvements + FFT up to 100% faster! + MP3(MPEG2/2.5) decoding up to 60% faster + MMX mixers 5-10% faster + MP3(MPEG1)/MP2/MP1/OGG decoding all ~5% faster +* Optional disabling of FFT windowing + BASS_DATA_FFT_NOWINDOW (BASS_ChannelGetData flag) +* BASS_ERROR_FILEFORM - error code to distinguish between file and sample format + BASS_MusicLoad + BASS_SampleLoad + BASS_StreamCreate/File/URL +* BASS_StreamGetFilePosition mode flags added + BASS_FILEPOS_DECODE/DOWNLOAD/END +* DirectSound 9 detection + BASS_INFO (dsver member) +* Initialization flags retrieval + BASS_INFO (initflags member) +* Half-rate MP3 playback option removed + BASS_MP3_HALFRATE flag *removed* +* New internal "plugin" system - BASSWMA is further integrated as a result +* Improved documentation - integrated with BASSWMA, search option added +* VB version of DSPTEST example added +* Delphi RECORDTEST example added +* Guess what... reduced DLL size again :) + +1.7 - 27/10/2002 +---------------- +* New alternative DX8 (DMO) effects implementation + BASS_StreamCreate/File/URL + BASS_MusicLoad + BASS_ChannelSetFX + SYNTH example updated +* User file streaming + BASS_STREAM_FILEPROC (BASS_StreamCreate flag) + STREAMFILEPROC +* DSP & FX support for decoding channels + BASS_ChannelSetDSP + BASS_ChannelSetFX +* Support for DX8 (DMO) effects in IT/XM/MO3 files + BASS_MusicLoad +* Support for chained OGG streaming (and syncing) + BASS_StreamCreateURL + BASS_SYNC_META (BASS_ChannelSetSync type) +* Attribute (volume/frequency/pan) sliding + BASS_ChannelSlideAttributes + BASS_ChannelIsSliding + BASS_SYNC_SLIDE (BASS_ChannelSetSync type) +* Recording without a callback function + BASS_RecordStart + LIVEFX example added +* Query a channel's buffered data + BASS_DATA_AVAILABLE (BASS_ChannelGetData flag) +* Discard data from the recording buffer + BASS_ChannelGetData +* Adjustable internet stream config (timeout/buffer lengths) + BASS_SetNetConfig +* Recommended minimum buffer length + BASS_INFO (minbuf member) +* MOD music flags adjustment without changing playback position + BASS_MusicPlayEx + PLAYER (MASM) example updated +* More functions are now useable in MOD music "mixtime" syncs + SYNCPROC + BASS_ChannelSetPosition + BASS_MusicPlayEx + BASS_MusicSetAmplify + BASS_MusicSetPanSep +* Maximum buffer length increased to 5 seconds + BASS_SetBufferLength +* Support for extended filter range in IT files + BASS_MusicLoad +* Speedier MOD music file verification + BASS_MusicLoad +* Delphi 3DTEST example fixed +* Magically reduced DLL size again :) + +1.6a - 25/8/2002 +---------------- +* OGG support updated to 1.0 +* Stereo FFT + BASS_DATA_FFT512S/1024S/2048S (BASS_ChannelGetData flags) +* Support for "Invert Loop" (EFx) MOD effect +* Reduced DLL size +* New Delphi examples + WRITEWAV - WAVE writer example + SAMPLEVIS - Visualisation example + +1.6 - 13/6/2002 +--------------- +* 64-bit stream lengths and positions + BASS_StreamGetLength + BASS_ChannelBytes2Seconds + BASS_ChannelSeconds2Bytes + BASS_ChannelGetPosition + BASS_ChannelSetPosition + BASS_ChannelSetSync +* Recording input selection + BASS_RECORDINFO (inputs & singlein members) + BASS_RecordGetInputName + BASS_RecordGetInput + BASS_RecordSetInput +* Adjustable recording update period + BASS_RecordStart +* Load OGG files as samples + BASS_SampleLoad +* CD drive door opening & closing + BASS_CDDoor +* CDDB2 ID retrieval + BASS_CDID_CDDB2 (BASS_CDGetID flag) +* Streaming beyond initial file length + BASS_StreamCreateFile +* Recording position bytes<->seconds translation + BASS_ChannelBytes2Seconds + BASS_ChannelSeconds2Bytes +* Improved multi-threaded support (play from any thread) + BASS_MusicPlay/Ex + BASS_SamplePlay/3D/Ex + BASS_StreamPlay + BASS_DEVICE_NOSYNC flag *removed* +* Paused channel status + BASS_ACTIVE_PAUSED (BASS_ChannelIsActive) +* Integrated WMA stream freeing + BASS_StreamFree + BASS_Free +* Pin-point accurate OGG seeking without BASS_MP3_SETPOS flag +* Win2k DS buffer bug fix + +1.5a - 14/4/2002 +---------------- +* NT4 fix (also enables "nosound" device without DX installed) + BASS_ERROR_DX error code +* MOD music loading without the samples + BASS_MUSIC_NOSAMPLE (BASS_MusicLoad flag) +* Custom decoding channels + BASS_STREAM_DECODE (BASS_StreamCreate flag) +* 5 second HTTP connection timeout + BASS_ERROR_TIMEOUT (BASS_StreamCreateURL error code) + +1.5 - 31/3/2002 +--------------- +* Improved performance + MMX mixers lot faster (over 50% faster in some cases!) + OGG decoding 15-20% faster + MP3 decoding 5-10% faster +* Recording + BASS_RecordGetDeviceDescription + BASS_RecordInit + BASS_RecordFree + BASS_RecordGetInfo + BASS_RecordStart +* OGG support built-in (OGG/VORBIS DLLs not required) + BASS_DEVICE_OGG flag *removed* +* MOD music seeking in seconds + BASS_MusicPlayEx + BASS_ChannelSetPosition +* Shoutcast metadata retrieval + BASS_STREAM_META (BASS_StreamCreateURL flag) + BASS_TAG_META (BASS_StreamGetTags type) + BASS_SYNC_META (BASS_ChannelSetSync type) +* 1000 volume levels + BASS_DEVICE_VOL1000 (BASS_Init/CDInit flag) +* CDDB ID retrieval + BASS_CDID_CDDB (BASS_CDGetID flag) +* Leave the CD volume as it is during init/closing + BASS_DEVICE_LEAVEVOL (BASS_CDInit flag) +* FFT enabled on decoding channels + BASS_ChannelGetData +* Left level duplicated on right for mono channels + BASS_ChannelGetLevel +* Improved MPEG length estimation without BASS_MP3_SETPOS flag + BASS_StreamGetLength +* Support for Modplug/ADPCM compressed files + BASS_MusicLoad +* Device description function parameter change + BASS_GetDeviceDescription +* MASM API + +1.4 - 30/1/2002 +--------------- +* Channel decoding without playback + BASS_MUSIC_DECODE (BASS_MusicLoad flag) + BASS_STREAM_DECODE (BASS_StreamCreateFile/URL flag) + BASS_ChannelGetData +* Windows message sync callbacks + BASS_SYNC_MESSAGE (BASS_ChannelSetSync flag) +* Adjustable channel volumes in MOD musics + BASS_MusicSetChannelVol + BASS_MusicGetChannelVol +* Customizable DirectSound initialization object + BASS_SetCLSID +* Retrieve HMUSIC/HSTREAM/HCHANNEL IDirectSoundBuffer interfaces + BASS_GetDSoundObject +* A3D functions removed (use BASS_SetCLSID/BASS_GetDSoundObject to access A3D) + BASS_DEVICE_A3D (BASS_Init flag) + BASS_SetA3DResManager + BASS_GetA3DResManager + BASS_SetA3DHFAbsorbtion + BASS_GetA3DHFAbsorbtion +* Callback functions now work in VB6 + DSPPROC + STREAMPROC + SYNCPROC +* Improved PCM WAVE streaming performance + BASS_StreamCreateFile + BASS_StreamCreateURL +* OGG modules updated to RC3 +* Stereo sample support in MO3 format +* MO3 encoder now distributed separately from BASS + +1.3 - 17/11/2001 +---------------- +* Manual buffer updating + BASS_DEVICE_NOTHREAD (BASS_Init flag) + BASS_Update +* Adjustable buffer update period (allows small buffer sizes) + BASS_Init +* Output device latency retrieval + BASS_INFO (latency member) +* MPEG/OGG seeking without BASS_MP3_SETPOS flag + BASS_ChannelSetPosition +* Internet file streaming from offsets + BASS_StreamCreateURL +* File stream tag/comment retrieval (ID3/ID3v2/OGG/HTTP/ICY tags) + BASS_StreamGetTags +* Byte<->time position translation + BASS_ChannelBytes2Seconds + BASS_ChannelSeconds2Bytes +* UMX (Unreal/Tournament music package) format support + BASS_MusicLoad +* S3M/IT sync fx changed to S2x (S0x conflicted with S00) + BASS_SYNC_MUSICFX +* Stereo sample support in IT/XM/S3M formats +* MO3: OGG compression supported + +1.2 - 25/9/2001 +--------------- +* OGG (Ogg Vorbis) stream support + BASS_DEVICE_OGG (BASS_Init flag) + BASS_StreamCreateFile + BASS_StreamCreateURL +* Channel linking (start/stop/pause/resume channels together) + BASS_ChannelSetLink + BASS_ChannelRemoveLink +* MOD music playback length calculation + BASS_MUSIC_CALCLEN (BASS_MusicLoad flag) + BASS_MusicGetLength +* Pre-buffering + BASS_MusicPreBuf + BASS_StreamPreBuf +* Samples with single simultaneous playbacks have same HSAMPLE/HCHANNEL handle + BASS_SamplePlay/Ex +* Stopping a custom stream flushes its buffer contents + BASS_ChannelStop + +1.1a - 31/8/2001 +---------------- +* NT4 bug fixed +* XM Wxx effect syncing + BASS_SYNC_MUSICFX +* MP3/2/1 rewinding without BASS_MP3_SETPOS + BASS_ChannelSetPosition + +1.1 - 11/8/2001 +--------------- +* DX8 (DMO) effects + BASS_SAMPLE_FX (BASS_StreamCreate/File/URL flag) + BASS_MUSIC_FX (BASS_MusicLoad flag) + BASS_ChannelSetFX + BASS_ChannelRemoveFX + BASS_FXSetParameters + BASS_FXGetParameters + BASS_FXCHORUS structure + BASS_FXCOMPRESSOR structure + BASS_FXDISTORTION structure + BASS_FXECHO structure + BASS_FXFLANGER structure + BASS_FXGARGLE structure + BASS_FXI3DL2REVERB structure + BASS_FXPARAMEQ structure + BASS_FXREVERB structure +* Internet file streaming in blocks (inc. Shoutcast/Icecast stream support) + BASS_STREAM_BLOCK (BASS_StreamCreateURL flag) +* 512/1024/2048 sample FFT + BASS_DATA_FFT512/1024/2048 (BASS_ChannelGetData flags) +* CD identification + BASS_CDGetID +* Improved DX version detection + BASS_INFO (dsver member) + +1.0 - 20/6/2001 +--------------- +* Load MP3/MP2/MP1 files as samples + BASS_SampleLoad +* Internet file streaming from FTP servers + BASS_StreamCreateURL +* Save a local copy of internet file streams + BASS_StreamCreateURL +* Sample accurate file stream seeking + BASS_ChannelSetPosition + BASS_StreamGetBlockLength *removed* +* Stream position synchronizer + BASS_SYNC_POS +* Increased synchronizer precision +* Improved MPEG file detection and error detection +* Stop MOD musics on a backwards jump effect + BASS_MUSIC_STOPBACK (BASS_MusicLoad/PlayEx flag) +* Leave the volume as it is during closing (as well as initialization) + BASS_DEVICE_LEAVEVOL (BASS_Init flag) +* Optional automatic use of foreground window handle during initialization + BASS_Init +* Reduced DLL size +* VB API fixes + +0.9 - 18/4/2001 +--------------- +* Internet file streaming + BASS_StreamCreateURL +* MP1 & MP2 (MPEG layer 1 & 2) support + BASS_StreamCreateFile/URL +* MPEG 2.5 support (12000/11025/8000hz sample rates) + BASS_StreamCreateFile/URL +* Decoding/download/end file stream position retrieval + BASS_StreamGetFilePosition +* XMPlay surround sound for MOD musics + BASS_MUSIC_SURROUND (BASS_MusicLoad/PlayEx flag) + BASS_MUSIC_SURROUND2 (BASS_MusicLoad/PlayEx flag) +* Restrict the download rate of internet file streams + BASS_STREAM_RESTRATE (BASS_StreamCreateURL flag) +* Check if an internet file stream is stalled + BASS_ChannelIsActive +* Automatically free a stream when it stops or ends + BASS_STREAM_AUTOFREE (BASS_StreamCreate/File/URL flag) +* Leave the volume as it is during initialization + BASS_DEVICE_LEAVEVOL (BASS_Init flag) +* Number of CD tracks retrieval + BASS_CDGetTracks +* CD track length retrieval + BASS_CDGetTrackLength +* Exact stream length set after whole file is streamed + BASS_StreamGetLength +* TMT Pascal API and samples +* Dynamic-loading Delphi API + +0.8a - 28/2/2000 +---------------- +* Updated Delphi API and samples + +0.8 - 24/1/2000 +--------------- +* Improved MP3 performance on P2/K6 and above CPUs +* User DSP functions on streams and MOD musics + BASS_ChannelSetDSP + BASS_ChannelRemoveDSP +* DX7 voice allocation & management + BASS_SAMPLE_VAM (BASS_SampleLoad/Create flag) + BASS_VAM_xxx flags + BASS_SAMPLE (vam & priority members) +* DX7 software 3D algorithm selection + BASS_Set3DAlgorithm +* DirectSound interface retrieval + BASS_GetDSoundObject +* Log/linear volume & panning curves + BASS_SetLogCurves +* User data passed to callback functions + STREAMPROC - BASS_StreamCreate + SYNCPROC - BASS_ChannelSetSync +* New synchronizer + BASS_SYNC_MUSICFX +* New synchronizer flag + BASS_SYNC_MIXTIME +* Disable synchronizers option - saves a little CPU time + BASS_DEVICE_NOSYNC (BASS_Init flag) +* Hi-res floating-point CPU usage monitoring + BASS_GetCPU +* Wait for playback to start when playing a CD + BASS_CDPlay +* DirectSound (dsound.dll) version retrieval + BASS_INFO (dsver member) +* Removed volume sliding functions (they were fairly pointless) + BASS_SlideVolume + BASS_IsSliding +* MO3: read/write encoder settings +* MO3: remove inst/samp/message texts now optional +* MO3: LAME encoder settings + +0.7 - 3/10/1999 +--------------- +* MO3 (MP3 compressed MODs) +* A3D functions + BASS_DEVICE_A3D (BASS_Init flag) + BASS_INFO (a3d member) + BASS_SetA3DResManager + BASS_GetA3DResManager + BASS_SetA3DHFAbsorbtion + BASS_GetA3DHFAbsorbtion +* Music/stream immediate sample data retrieval + BASS_ChannelGetData +* File stream (WAV/MP3) length retrieval + BASS_StreamGetLength + BASS_StreamGetBlockLength +* File stream seeking + BASS_ChannelSetPosition +* Mono MP3 option (lower CPU usage) + BASS_StreamCreateFile +* Music length retrieval + BASS_MusicGetLength +* Music name retrieval + BASS_MusicGetName +* Stop notes when moving MOD music position + BASS_MUSIC_POSRESET (BASS_MusicLoad/BASS_MusicPlayEx flag) +* BASS_ERROR_FREQ - invalid sample rate error code + BASS_SampleCreate + BASS_SamplePlayEx + BASS_SamplePlay3DEx + BASS_StreamCreate + BASS_ChannelSetAttributes +* Delphi and VB APIs + +0.6a - 26/7/1999 +---------------- +* Half rate MP3 option (lower CPU usage) + BASS_MP3_HALFRATE +* Loading/streaming from file offsets + BASS_MusicLoad + BASS_SampleLoad + BASS_StreamCreateFile +* Global music/sample/stream volume levels + BASS_SetGlobalVolumes + BASS_GetGlobalVolumes +* Other new function + BASS_SampleStop +* New synchronizer + BASS_SYNC_END +* New sample overrider + BASS_SAMPLE_OVER_DIST +* LoadLibrary/GetProcAddress instructions and example + +0.5 - 4/7/1999 +-------------- +* Documentation! +* File streaming (MP3 and WAV) + BASS_StreamCreateFile +* Custom generated samples + BASS_SampleCreate + BASS_SampleCreateDone +* Other new function + BASS_MusicSetPositionScaler +* Renamed function + BASS_ChannelClearSync -> BASS_ChannelRemoveSync +* Alterations made to + BASS_ChannelGetPosition + BASS_SampleLoad + BASS_StreamPlay + +0.4 - 30/3/1999 +--------------- +* Compressed WAV samples support (using audio CODECs) +* Updated CD volume handling - now works with SB Live +* More linear channel volume/pan scales (were slightly off before) +* "No sound" device option +* 3D sound functions + BASS_Set3DFactors + BASS_Get3DFactors + BASS_Set3DPosition + BASS_Get3DPosition + BASS_Apply3D + BASS_SamplePlay3D + BASS_SamplePlay3DEx + BASS_ChannelSet3DAttributes + BASS_ChannelGet3DAttributes + BASS_ChannelSet3DPosition + BASS_ChannelGet3DPosition +* EAX functions + BASS_SetEAXParameters + BASS_GetEAXParameters + BASS_ChannelSetEAXMix + BASS_ChannelGetEAXMix +* Other new functions + BASS_GetDeviceDescription + BASS_SetBufferLen + BASS_ChannelGetFlags + BASS_ChannelPause + BASS_ChannelResume + BASS_ChannelSetPosition +* Replaced function + BASS_CDResume -> BASS_ChannelResume +* Alterations made to + BASS_Init + BASS_CDInit + BASS_SampleLoad + BASS_StreamPlay + BASS_INFO structure + BASS_SAMPLE structure + BASS_DEVICE_xxx flags + BASS_SAMPLE_xxx flags + +0.3 - 8/3/1999 +-------------- +* Synchronization functions + BASS_ChannelSetSync + BASS_ChannelClearSync +* Other new functions + BASS_GetVersion + BASS_ChannelGetPosition + BASS_ChannelGetLevel + BASS_ChannelGetAttributes + BASS_ChannelSetAttributes +* Replaced functions + BASS_MusicStop -> BASS_ChannelStop + BASS_MusicSetVolume -> BASS_ChannelSetAttributes + BASS_CDStop -> BASS_ChannelStop + BASS_CDSetVolume -> BASS_ChannelSetAttributes + BASS_CDGetVolume -> BASS_ChannelGetAttributes + BASS_ChannelUpdate -> BASS_ChannelSetAttributes +* Alterations made to + BASS_MusicPlayEx + BASS_StreamPlay + BASS_INFO structure + +0.2 - 28/2/1999 +--------------- +* First public release + + +Bug reports, Suggestions, Comments, Enquiries, etc +================================================== +If you have any of the aforementioned please visit the BASS forum at the +website. If you can't find an answer there, you can also email: + + bass@un4seen.com + diff --git a/bass-sys/bass24/c/3dtest/3dtest.c b/bass-sys/bass24/c/3dtest/3dtest.c new file mode 100644 index 0000000..c434795 --- /dev/null +++ b/bass-sys/bass24/c/3dtest/3dtest.c @@ -0,0 +1,260 @@ +/* + BASS 3D test + Copyright (c) 1999-2017 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include "bass.h" + +HWND win = NULL; + +// channel (sample/music) info structure +typedef struct { + DWORD channel; // the channel + BASS_3DVECTOR pos, vel; // position,velocity +} Channel; + +Channel *chans = NULL; // the channels +int chanc = 0, chan = -1; // number of channels, current channel + +#define TIMERPERIOD 50 // timer period (ms) +#define MAXDIST 50 // maximum distance of the channels (m) +#define SPEED 12 // speed of the channels' movement (m/s) + +// Display error dialogs +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +// Messaging macros +#define ITEM(id) GetDlgItem(win,id) +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)(w),(LPARAM)(l)) +#define LM(m,w,l) MESS(10,m,w,l) + +void UpdateDisplay() +{ + HDC dc; + RECT r; + int c, x, y, cx, cy; + HBRUSH red = CreateSolidBrush(0xff); + + HWND w = ITEM(30); + dc = GetDC(w); + GetClientRect(w, &r); + cx = r.right / 2; + cy = r.bottom / 2; + + // clear the display + FillRect(dc, &r, (HBRUSH)GetStockObject(WHITE_BRUSH)); + + // Draw the listener + SelectObject(dc, GetStockObject(GRAY_BRUSH)); + Ellipse(dc, cx - 4, cy - 4, cx + 4, cy + 4); + + for (c = 0; c < chanc; c++) { + // If the channel's playing then update it's position + if (BASS_ChannelIsActive(chans[c].channel) == BASS_ACTIVE_PLAYING) { + // Check if channel has reached the max distance + if (chans[c].pos.z >= MAXDIST || chans[c].pos.z <= -MAXDIST) + chans[c].vel.z = -chans[c].vel.z; + if (chans[c].pos.x >= MAXDIST || chans[c].pos.x <= -MAXDIST) + chans[c].vel.x = -chans[c].vel.x; + // Update channel position + chans[c].pos.z += chans[c].vel.z * TIMERPERIOD / 1000; + chans[c].pos.x += chans[c].vel.x * TIMERPERIOD / 1000; + BASS_ChannelSet3DPosition(chans[c].channel, &chans[c].pos, NULL, &chans[c].vel); + } + // Draw the channel position indicator + x = cx + (int)((cx - 10) * chans[c].pos.x / MAXDIST); + y = cy - (int)((cy - 10) * chans[c].pos.z / MAXDIST); + SelectObject(dc, chan == c ? red : GetStockObject(WHITE_BRUSH)); + Ellipse(dc, x - 4, y - 4, x + 4, y + 4); + } + // Apply the 3D changes + BASS_Apply3D(); + + ReleaseDC(w, dc); + DeleteObject(red); +} + +// Update the button states +void UpdateButtons() +{ + int a; + for (a = 12; a <= 17; a++) + EnableWindow(ITEM(a), chan == -1 ? FALSE : TRUE); + if (chan != -1) { + SetDlgItemInt(win, 15, abs((int)chans[chan].vel.x), FALSE); + SetDlgItemInt(win, 16, abs((int)chans[chan].vel.z), FALSE); + } +} + +INT_PTR CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + static OPENFILENAME ofn; + + switch (m) { + case WM_TIMER: + UpdateDisplay(); + break; + + case WM_COMMAND: + switch (LOWORD(w)) { + case 10: // change the selected channel + if (HIWORD(w) != LBN_SELCHANGE) break; + chan = LM(LB_GETCURSEL, 0, 0); + if (chan == LB_ERR) chan = -1; + UpdateButtons(); + break; + case 11: // add a channel + { + char file[MAX_PATH] = ""; + DWORD newchan; + ofn.lpstrFile = file; + if (GetOpenFileName(&ofn)) { + // Load a music or sample from "file" + if ((newchan = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_RAMP | BASS_SAMPLE_LOOP | BASS_SAMPLE_3D, 1)) + || (newchan = BASS_SampleLoad(FALSE, file, 0, 0, 1, BASS_SAMPLE_LOOP | BASS_SAMPLE_3D | BASS_SAMPLE_MONO))) { + Channel *c; + chanc++; + chans = (Channel*)realloc((void*)chans, chanc * sizeof(Channel)); + c = chans + chanc - 1; + memset(c, 0, sizeof(Channel)); + c->channel = newchan; + BASS_SampleGetChannel(newchan, FALSE); // initialize sample channel + LM(LB_ADDSTRING, 0, strrchr(file, '\\') + 1); + } else + Error("Can't load file (note samples must be mono)"); + } + } + break; + case 12: // remove a channel + { + Channel *c = chans + chan; + BASS_SampleFree(c->channel); + BASS_MusicFree(c->channel); + memmove(c, c + 1, (chanc - chan - 1) * sizeof(Channel)); + chanc--; + LM(LB_DELETESTRING, chan, 0); + chan = -1; + UpdateButtons(); + } + break; + case 13: + BASS_ChannelPlay(chans[chan].channel, FALSE); + break; + case 14: + BASS_ChannelPause(chans[chan].channel); + break; + case 15: // X velocity + if (HIWORD(w) == EN_CHANGE) { + int v = GetDlgItemInt(win, 15, 0, FALSE); + if (abs((int)chans[chan].vel.x) != v) chans[chan].vel.x = v; + } + break; + case 16: // Z velocity + if (HIWORD(w) == EN_CHANGE) { + int v = GetDlgItemInt(win, 16, 0, FALSE); + if (abs((int)chans[chan].vel.z) != v) chans[chan].vel.z = v; + } + break; + case 17: // reset the position and velocity to 0 + memset(&chans[chan].pos, 0, sizeof(chans[chan].pos)); + memset(&chans[chan].vel, 0, sizeof(chans[chan].vel)); + UpdateButtons(); + break; + case IDCANCEL: + DestroyWindow(h); + break; + } + break; + + case WM_HSCROLL: + if (l) { + int pos = SendMessage((HWND)l, TBM_GETPOS, 0, 0); + switch (GetDlgCtrlID((HWND)l)) { + case 20: // change the rolloff factor + BASS_Set3DFactors(-1, pow(2, (pos - 10) / 5.0), -1); + break; + case 21: // change the doppler factor + BASS_Set3DFactors(-1, -1, pow(2, (pos - 10) / 5.0)); + break; + } + } + break; + + case WM_INITDIALOG: + win = h; + + MESS(20, TBM_SETRANGE, FALSE, MAKELONG(0, 20)); + MESS(20, TBM_SETPOS, TRUE, 10); + MESS(21, TBM_SETRANGE, FALSE, MAKELONG(0, 20)); + MESS(21, TBM_SETPOS, TRUE, 10); + + SetTimer(h, 1, TIMERPERIOD, NULL); + memset(&ofn, 0, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = h; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY | OFN_EXPLORER; + ofn.lpstrFilter = "wav/aif/mo3/xm/mod/s3m/it/mtm/umx\0*.wav;*.aif;*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx\0" + "All files\0*.*\0\0"; + return 1; + + case WM_DESTROY: + KillTimer(h, 1); + if (chans) free(chans); + PostQuitMessage(0); + break; + } + return 0; +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + MSG msg; + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + { // enable trackbar support + INITCOMMONCONTROLSEX cc = { sizeof(cc),ICC_BAR_CLASSES }; + InitCommonControlsEx(&cc); + } + + // Create the main window + if (!CreateDialog(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc)) { + Error("Can't create window"); + return 0; + } + + // Initialize the default output device with 3D support + if (!BASS_Init(-1, 44100, BASS_DEVICE_3D, win, NULL)) { + Error("Can't initialize output device"); + DestroyWindow(win); + return 0; + } + + // Use meters as distance unit, real world rolloff, real doppler effect + BASS_Set3DFactors(1, 1, 1); + + while (GetMessage(&msg, NULL, 0, 0) > 0) { + if (!IsDialogMessage(win, &msg)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + BASS_Free(); + + return 0; +} diff --git a/bass-sys/bass24/c/3dtest/3dtest.dsp b/bass-sys/bass24/c/3dtest/3dtest.dsp new file mode 100644 index 0000000..5afc862 --- /dev/null +++ b/bass-sys/bass24/c/3dtest/3dtest.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="3dtest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=3dtest - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "3dtest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "3dtest.mak" CFG="3dtest - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "3dtest - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comdlg32.lib gdi32.lib comctl32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comdlg32.lib gdi32.lib comctl32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "3dtest - Win32 Release" +# Begin Source File + +SOURCE=3dtest.c +# End Source File +# Begin Source File + +SOURCE=3dtest.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/3dtest/3dtest.rc b/bass-sys/bass24/c/3dtest/3dtest.rc new file mode 100644 index 0000000..df0f2a6 --- /dev/null +++ b/bass-sys/bass24/c/3dtest/3dtest.rc @@ -0,0 +1,29 @@ +#include "windows.h" + +1000 DIALOG DISCARDABLE 100, 100, 255, 141 +STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "BASS - 3D Test" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Channels (sample/music)",-1,5,0,120,111 + LISTBOX 10,10,9,110,35,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP + PUSHBUTTON "Add ...",11,12,49,50,12 + PUSHBUTTON "Remove",12,68,49,50,12,WS_DISABLED + PUSHBUTTON "Play",13,12,65,50,12,WS_DISABLED + PUSHBUTTON "Stop",14,68,65,50,12,WS_DISABLED + GROUPBOX "Movement",-1,5,80,120,31 + LTEXT "x:",-1,12,93,8,8 + EDITTEXT 15,21,91,20,13,ES_NUMBER | WS_DISABLED + LTEXT "z:",-1,50,93,8,8 + EDITTEXT 16,59,91,20,13,ES_NUMBER | WS_DISABLED + PUSHBUTTON "reset",17,88,91,30,12,WS_DISABLED + GROUPBOX "Rolloff factor",-1,5,113,120,23 + CONTROL "",20,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | + WS_TABSTOP,15,123,100,10 + GROUPBOX "Doppler factor",-1,130,113,120,23 + CONTROL "",21,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | + WS_TABSTOP,140,123,100,10 + GROUPBOX "",-1,130,0,120,111 + LTEXT "",30,135,9,109,96,SS_SUNKEN +END diff --git a/bass-sys/bass24/c/3dtest/3dtest.vcproj b/bass-sys/bass24/c/3dtest/3dtest.vcproj new file mode 100644 index 0000000..50a78a6 --- /dev/null +++ b/bass-sys/bass24/c/3dtest/3dtest.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/3dtest/3dtest.vcxproj b/bass-sys/bass24/c/3dtest/3dtest.vcxproj new file mode 100644 index 0000000..d0b65ca --- /dev/null +++ b/bass-sys/bass24/c/3dtest/3dtest.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {98CE30EE-9892-4896-9A68-34725FB454B8} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;comctl32.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;comctl32.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/3dtest/makefile b/bass-sys/bass24/c/3dtest/makefile new file mode 100644 index 0000000..b0b41de --- /dev/null +++ b/bass-sys/bass24/c/3dtest/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = 3dtest.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 -lcomctl32 -lgdi32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/bass.dsw b/bass-sys/bass24/c/bass.dsw new file mode 100644 index 0000000..899d0d4 --- /dev/null +++ b/bass-sys/bass24/c/bass.dsw @@ -0,0 +1,233 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "3dtest"=.\3dtest\3dtest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "BASStest"=.\basstest\basstest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "contest"=.\contest\contest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "custloop"=.\custloop\custloop.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "devlist"=.\devlist\devlist.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "dsptest"=.\dsptest\dsptest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "fxtest"=.\fxtest\fxtest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "livefx"=.\livefx\livefx.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "livespec"=.\livespec\livespec.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "modtest"=.\modtest\modtest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "multi"=.\multi\multi.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "netradio"=.\netradio\netradio.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "plugins"=.\plugins\plugins.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "rectest"=.\rectest\rectest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "speakers"=.\speakers\speakers.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "spectrum"=.\spectrum\spectrum.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "synth"=.\synth\synth.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "writewav"=.\writewav\writewav.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/bass-sys/bass24/c/bass.h b/bass-sys/bass24/c/bass.h new file mode 100644 index 0000000..901f9a2 --- /dev/null +++ b/bass-sys/bass24/c/bass.h @@ -0,0 +1,1160 @@ +/* + BASS 2.4 C/C++ header file + Copyright (c) 1999-2019 Un4seen Developments Ltd. + + See the BASS.CHM file for more detailed documentation +*/ + +#ifndef BASS_H +#define BASS_H + +#ifdef _WIN32 +#include +typedef unsigned __int64 QWORD; +#else +#include +#define WINAPI +#define CALLBACK +typedef uint8_t BYTE; +typedef uint16_t WORD; +typedef uint32_t DWORD; +typedef uint64_t QWORD; +#ifdef __OBJC__ +#include +#else +typedef int BOOL; +#endif +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif +#define LOBYTE(a) (BYTE)(a) +#define HIBYTE(a) (BYTE)((a)>>8) +#define LOWORD(a) (WORD)(a) +#define HIWORD(a) (WORD)((a)>>16) +#define MAKEWORD(a,b) (WORD)(((a)&0xff)|((b)<<8)) +#define MAKELONG(a,b) (DWORD)(((a)&0xffff)|((b)<<16)) +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define BASSVERSION 0x204 // API version +#define BASSVERSIONTEXT "2.4" + +#ifndef BASSDEF +#define BASSDEF(f) WINAPI f +#else +#define NOBASSOVERLOADS +#endif + +typedef DWORD HMUSIC; // MOD music handle +typedef DWORD HSAMPLE; // sample handle +typedef DWORD HCHANNEL; // playing sample's channel handle +typedef DWORD HSTREAM; // sample stream handle +typedef DWORD HRECORD; // recording handle +typedef DWORD HSYNC; // synchronizer handle +typedef DWORD HDSP; // DSP handle +typedef DWORD HFX; // DX8 effect handle +typedef DWORD HPLUGIN; // Plugin handle + +// Error codes returned by BASS_ErrorGetCode +#define BASS_OK 0 // all is OK +#define BASS_ERROR_MEM 1 // memory error +#define BASS_ERROR_FILEOPEN 2 // can't open the file +#define BASS_ERROR_DRIVER 3 // can't find a free/valid driver +#define BASS_ERROR_BUFLOST 4 // the sample buffer was lost +#define BASS_ERROR_HANDLE 5 // invalid handle +#define BASS_ERROR_FORMAT 6 // unsupported sample format +#define BASS_ERROR_POSITION 7 // invalid position +#define BASS_ERROR_INIT 8 // BASS_Init has not been successfully called +#define BASS_ERROR_START 9 // BASS_Start has not been successfully called +#define BASS_ERROR_SSL 10 // SSL/HTTPS support isn't available +#define BASS_ERROR_ALREADY 14 // already initialized/paused/whatever +#define BASS_ERROR_NOTAUDIO 17 // file does not contain audio +#define BASS_ERROR_NOCHAN 18 // can't get a free channel +#define BASS_ERROR_ILLTYPE 19 // an illegal type was specified +#define BASS_ERROR_ILLPARAM 20 // an illegal parameter was specified +#define BASS_ERROR_NO3D 21 // no 3D support +#define BASS_ERROR_NOEAX 22 // no EAX support +#define BASS_ERROR_DEVICE 23 // illegal device number +#define BASS_ERROR_NOPLAY 24 // not playing +#define BASS_ERROR_FREQ 25 // illegal sample rate +#define BASS_ERROR_NOTFILE 27 // the stream is not a file stream +#define BASS_ERROR_NOHW 29 // no hardware voices available +#define BASS_ERROR_EMPTY 31 // the MOD music has no sequence data +#define BASS_ERROR_NONET 32 // no internet connection could be opened +#define BASS_ERROR_CREATE 33 // couldn't create the file +#define BASS_ERROR_NOFX 34 // effects are not available +#define BASS_ERROR_NOTAVAIL 37 // requested data/action is not available +#define BASS_ERROR_DECODE 38 // the channel is/isn't a "decoding channel" +#define BASS_ERROR_DX 39 // a sufficient DirectX version is not installed +#define BASS_ERROR_TIMEOUT 40 // connection timedout +#define BASS_ERROR_FILEFORM 41 // unsupported file format +#define BASS_ERROR_SPEAKER 42 // unavailable speaker +#define BASS_ERROR_VERSION 43 // invalid BASS version (used by add-ons) +#define BASS_ERROR_CODEC 44 // codec is not available/supported +#define BASS_ERROR_ENDED 45 // the channel/file has ended +#define BASS_ERROR_BUSY 46 // the device is busy +#define BASS_ERROR_UNSTREAMABLE 47 // unstreamable file +#define BASS_ERROR_UNKNOWN -1 // some other mystery problem + +// BASS_SetConfig options +#define BASS_CONFIG_BUFFER 0 +#define BASS_CONFIG_UPDATEPERIOD 1 +#define BASS_CONFIG_GVOL_SAMPLE 4 +#define BASS_CONFIG_GVOL_STREAM 5 +#define BASS_CONFIG_GVOL_MUSIC 6 +#define BASS_CONFIG_CURVE_VOL 7 +#define BASS_CONFIG_CURVE_PAN 8 +#define BASS_CONFIG_FLOATDSP 9 +#define BASS_CONFIG_3DALGORITHM 10 +#define BASS_CONFIG_NET_TIMEOUT 11 +#define BASS_CONFIG_NET_BUFFER 12 +#define BASS_CONFIG_PAUSE_NOPLAY 13 +#define BASS_CONFIG_NET_PREBUF 15 +#define BASS_CONFIG_NET_PASSIVE 18 +#define BASS_CONFIG_REC_BUFFER 19 +#define BASS_CONFIG_NET_PLAYLIST 21 +#define BASS_CONFIG_MUSIC_VIRTUAL 22 +#define BASS_CONFIG_VERIFY 23 +#define BASS_CONFIG_UPDATETHREADS 24 +#define BASS_CONFIG_DEV_BUFFER 27 +#define BASS_CONFIG_REC_LOOPBACK 28 +#define BASS_CONFIG_VISTA_TRUEPOS 30 +#define BASS_CONFIG_IOS_SESSION 34 +#define BASS_CONFIG_IOS_MIXAUDIO 34 +#define BASS_CONFIG_DEV_DEFAULT 36 +#define BASS_CONFIG_NET_READTIMEOUT 37 +#define BASS_CONFIG_VISTA_SPEAKERS 38 +#define BASS_CONFIG_IOS_SPEAKER 39 +#define BASS_CONFIG_MF_DISABLE 40 +#define BASS_CONFIG_HANDLES 41 +#define BASS_CONFIG_UNICODE 42 +#define BASS_CONFIG_SRC 43 +#define BASS_CONFIG_SRC_SAMPLE 44 +#define BASS_CONFIG_ASYNCFILE_BUFFER 45 +#define BASS_CONFIG_OGG_PRESCAN 47 +#define BASS_CONFIG_MF_VIDEO 48 +#define BASS_CONFIG_AIRPLAY 49 +#define BASS_CONFIG_DEV_NONSTOP 50 +#define BASS_CONFIG_IOS_NOCATEGORY 51 +#define BASS_CONFIG_VERIFY_NET 52 +#define BASS_CONFIG_DEV_PERIOD 53 +#define BASS_CONFIG_FLOAT 54 +#define BASS_CONFIG_NET_SEEK 56 +#define BASS_CONFIG_AM_DISABLE 58 +#define BASS_CONFIG_NET_PLAYLIST_DEPTH 59 +#define BASS_CONFIG_NET_PREBUF_WAIT 60 +#define BASS_CONFIG_ANDROID_SESSIONID 62 +#define BASS_CONFIG_WASAPI_PERSIST 65 +#define BASS_CONFIG_REC_WASAPI 66 +#define BASS_CONFIG_ANDROID_AAUDIO 67 + +// BASS_SetConfigPtr options +#define BASS_CONFIG_NET_AGENT 16 +#define BASS_CONFIG_NET_PROXY 17 +#define BASS_CONFIG_IOS_NOTIFY 46 +#define BASS_CONFIG_LIBSSL 64 + +// BASS_CONFIG_IOS_SESSION flags +#define BASS_IOS_SESSION_MIX 1 +#define BASS_IOS_SESSION_DUCK 2 +#define BASS_IOS_SESSION_AMBIENT 4 +#define BASS_IOS_SESSION_SPEAKER 8 +#define BASS_IOS_SESSION_DISABLE 16 + +// BASS_Init flags +#define BASS_DEVICE_8BITS 1 // 8 bit +#define BASS_DEVICE_MONO 2 // mono +#define BASS_DEVICE_3D 4 // enable 3D functionality +#define BASS_DEVICE_16BITS 8 // limit output to 16 bit +#define BASS_DEVICE_LATENCY 0x100 // calculate device latency (BASS_INFO struct) +#define BASS_DEVICE_CPSPEAKERS 0x400 // detect speakers via Windows control panel +#define BASS_DEVICE_SPEAKERS 0x800 // force enabling of speaker assignment +#define BASS_DEVICE_NOSPEAKER 0x1000 // ignore speaker arrangement +#define BASS_DEVICE_DMIX 0x2000 // use ALSA "dmix" plugin +#define BASS_DEVICE_FREQ 0x4000 // set device sample rate +#define BASS_DEVICE_STEREO 0x8000 // limit output to stereo +#define BASS_DEVICE_HOG 0x10000 // hog/exclusive mode +#define BASS_DEVICE_AUDIOTRACK 0x20000 // use AudioTrack output +#define BASS_DEVICE_DSOUND 0x40000 // use DirectSound output + +// DirectSound interfaces (for use with BASS_GetDSoundObject) +#define BASS_OBJECT_DS 1 // IDirectSound +#define BASS_OBJECT_DS3DL 2 // IDirectSound3DListener + +// Device info structure +typedef struct { +#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) + const wchar_t *name; // description + const wchar_t *driver; // driver +#else + const char *name; // description + const char *driver; // driver +#endif + DWORD flags; +} BASS_DEVICEINFO; + +// BASS_DEVICEINFO flags +#define BASS_DEVICE_ENABLED 1 +#define BASS_DEVICE_DEFAULT 2 +#define BASS_DEVICE_INIT 4 +#define BASS_DEVICE_LOOPBACK 8 + +#define BASS_DEVICE_TYPE_MASK 0xff000000 +#define BASS_DEVICE_TYPE_NETWORK 0x01000000 +#define BASS_DEVICE_TYPE_SPEAKERS 0x02000000 +#define BASS_DEVICE_TYPE_LINE 0x03000000 +#define BASS_DEVICE_TYPE_HEADPHONES 0x04000000 +#define BASS_DEVICE_TYPE_MICROPHONE 0x05000000 +#define BASS_DEVICE_TYPE_HEADSET 0x06000000 +#define BASS_DEVICE_TYPE_HANDSET 0x07000000 +#define BASS_DEVICE_TYPE_DIGITAL 0x08000000 +#define BASS_DEVICE_TYPE_SPDIF 0x09000000 +#define BASS_DEVICE_TYPE_HDMI 0x0a000000 +#define BASS_DEVICE_TYPE_DISPLAYPORT 0x40000000 + +// BASS_GetDeviceInfo flags +#define BASS_DEVICES_AIRPLAY 0x1000000 + +typedef struct { + DWORD flags; // device capabilities (DSCAPS_xxx flags) + DWORD hwsize; // size of total device hardware memory + DWORD hwfree; // size of free device hardware memory + DWORD freesam; // number of free sample slots in the hardware + DWORD free3d; // number of free 3D sample slots in the hardware + DWORD minrate; // min sample rate supported by the hardware + DWORD maxrate; // max sample rate supported by the hardware + BOOL eax; // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used) + DWORD minbuf; // recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY) + DWORD dsver; // DirectSound version + DWORD latency; // delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY) + DWORD initflags; // BASS_Init "flags" parameter + DWORD speakers; // number of speakers available + DWORD freq; // current output rate +} BASS_INFO; + +// BASS_INFO flags (from DSOUND.H) +#define DSCAPS_CONTINUOUSRATE 0x00000010 // supports all sample rates between min/maxrate +#define DSCAPS_EMULDRIVER 0x00000020 // device does NOT have hardware DirectSound support +#define DSCAPS_CERTIFIED 0x00000040 // device driver has been certified by Microsoft +#define DSCAPS_SECONDARYMONO 0x00000100 // mono +#define DSCAPS_SECONDARYSTEREO 0x00000200 // stereo +#define DSCAPS_SECONDARY8BIT 0x00000400 // 8 bit +#define DSCAPS_SECONDARY16BIT 0x00000800 // 16 bit + +// Recording device info structure +typedef struct { + DWORD flags; // device capabilities (DSCCAPS_xxx flags) + DWORD formats; // supported standard formats (WAVE_FORMAT_xxx flags) + DWORD inputs; // number of inputs + BOOL singlein; // TRUE = only 1 input can be set at a time + DWORD freq; // current input rate +} BASS_RECORDINFO; + +// BASS_RECORDINFO flags (from DSOUND.H) +#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER // device does NOT have hardware DirectSound recording support +#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED // device driver has been certified by Microsoft + +// defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H) +#ifndef WAVE_FORMAT_1M08 +#define WAVE_FORMAT_1M08 0x00000001 /* 11.025 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_1S08 0x00000002 /* 11.025 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_1M16 0x00000004 /* 11.025 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_1S16 0x00000008 /* 11.025 kHz, Stereo, 16-bit */ +#define WAVE_FORMAT_2M08 0x00000010 /* 22.05 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_2S08 0x00000020 /* 22.05 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_2M16 0x00000040 /* 22.05 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_2S16 0x00000080 /* 22.05 kHz, Stereo, 16-bit */ +#define WAVE_FORMAT_4M08 0x00000100 /* 44.1 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_4S08 0x00000200 /* 44.1 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_4M16 0x00000400 /* 44.1 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_4S16 0x00000800 /* 44.1 kHz, Stereo, 16-bit */ +#endif + +// Sample info structure +typedef struct { + DWORD freq; // default playback rate + float volume; // default volume (0-1) + float pan; // default pan (-1=left, 0=middle, 1=right) + DWORD flags; // BASS_SAMPLE_xxx flags + DWORD length; // length (in bytes) + DWORD max; // maximum simultaneous playbacks + DWORD origres; // original resolution + DWORD chans; // number of channels + DWORD mingap; // minimum gap (ms) between creating channels + DWORD mode3d; // BASS_3DMODE_xxx mode + float mindist; // minimum distance + float maxdist; // maximum distance + DWORD iangle; // angle of inside projection cone + DWORD oangle; // angle of outside projection cone + float outvol; // delta-volume outside the projection cone + DWORD vam; // voice allocation/management flags (BASS_VAM_xxx) + DWORD priority; // priority (0=lowest, 0xffffffff=highest) +} BASS_SAMPLE; + +#define BASS_SAMPLE_8BITS 1 // 8 bit +#define BASS_SAMPLE_FLOAT 256 // 32 bit floating-point +#define BASS_SAMPLE_MONO 2 // mono +#define BASS_SAMPLE_LOOP 4 // looped +#define BASS_SAMPLE_3D 8 // 3D functionality +#define BASS_SAMPLE_SOFTWARE 16 // not using hardware mixing +#define BASS_SAMPLE_MUTEMAX 32 // mute at max distance (3D only) +#define BASS_SAMPLE_VAM 64 // DX7 voice allocation & management +#define BASS_SAMPLE_FX 128 // old implementation of DX8 effects +#define BASS_SAMPLE_OVER_VOL 0x10000 // override lowest volume +#define BASS_SAMPLE_OVER_POS 0x20000 // override longest playing +#define BASS_SAMPLE_OVER_DIST 0x30000 // override furthest from listener (3D only) + +#define BASS_STREAM_PRESCAN 0x20000 // enable pin-point seeking/length (MP3/MP2/MP1) +#define BASS_STREAM_AUTOFREE 0x40000 // automatically free the stream when it stop/ends +#define BASS_STREAM_RESTRATE 0x80000 // restrict the download rate of internet file streams +#define BASS_STREAM_BLOCK 0x100000 // download/play internet file stream in small blocks +#define BASS_STREAM_DECODE 0x200000 // don't play the stream, only decode (BASS_ChannelGetData) +#define BASS_STREAM_STATUS 0x800000 // give server status info (HTTP/ICY tags) in DOWNLOADPROC + +#define BASS_MP3_IGNOREDELAY 0x200 // ignore LAME/Xing/VBRI/iTunes delay & padding info +#define BASS_MP3_SETPOS BASS_STREAM_PRESCAN + +#define BASS_MUSIC_FLOAT BASS_SAMPLE_FLOAT +#define BASS_MUSIC_MONO BASS_SAMPLE_MONO +#define BASS_MUSIC_LOOP BASS_SAMPLE_LOOP +#define BASS_MUSIC_3D BASS_SAMPLE_3D +#define BASS_MUSIC_FX BASS_SAMPLE_FX +#define BASS_MUSIC_AUTOFREE BASS_STREAM_AUTOFREE +#define BASS_MUSIC_DECODE BASS_STREAM_DECODE +#define BASS_MUSIC_PRESCAN BASS_STREAM_PRESCAN // calculate playback length +#define BASS_MUSIC_CALCLEN BASS_MUSIC_PRESCAN +#define BASS_MUSIC_RAMP 0x200 // normal ramping +#define BASS_MUSIC_RAMPS 0x400 // sensitive ramping +#define BASS_MUSIC_SURROUND 0x800 // surround sound +#define BASS_MUSIC_SURROUND2 0x1000 // surround sound (mode 2) +#define BASS_MUSIC_FT2PAN 0x2000 // apply FastTracker 2 panning to XM files +#define BASS_MUSIC_FT2MOD 0x2000 // play .MOD as FastTracker 2 does +#define BASS_MUSIC_PT1MOD 0x4000 // play .MOD as ProTracker 1 does +#define BASS_MUSIC_NONINTER 0x10000 // non-interpolated sample mixing +#define BASS_MUSIC_SINCINTER 0x800000 // sinc interpolated sample mixing +#define BASS_MUSIC_POSRESET 0x8000 // stop all notes when moving position +#define BASS_MUSIC_POSRESETEX 0x400000 // stop all notes and reset bmp/etc when moving position +#define BASS_MUSIC_STOPBACK 0x80000 // stop the music on a backwards jump effect +#define BASS_MUSIC_NOSAMPLE 0x100000 // don't load the samples + +// Speaker assignment flags +#define BASS_SPEAKER_FRONT 0x1000000 // front speakers +#define BASS_SPEAKER_REAR 0x2000000 // rear/side speakers +#define BASS_SPEAKER_CENLFE 0x3000000 // center & LFE speakers (5.1) +#define BASS_SPEAKER_REAR2 0x4000000 // rear center speakers (7.1) +#define BASS_SPEAKER_N(n) ((n)<<24) // n'th pair of speakers (max 15) +#define BASS_SPEAKER_LEFT 0x10000000 // modifier: left +#define BASS_SPEAKER_RIGHT 0x20000000 // modifier: right +#define BASS_SPEAKER_FRONTLEFT BASS_SPEAKER_FRONT|BASS_SPEAKER_LEFT +#define BASS_SPEAKER_FRONTRIGHT BASS_SPEAKER_FRONT|BASS_SPEAKER_RIGHT +#define BASS_SPEAKER_REARLEFT BASS_SPEAKER_REAR|BASS_SPEAKER_LEFT +#define BASS_SPEAKER_REARRIGHT BASS_SPEAKER_REAR|BASS_SPEAKER_RIGHT +#define BASS_SPEAKER_CENTER BASS_SPEAKER_CENLFE|BASS_SPEAKER_LEFT +#define BASS_SPEAKER_LFE BASS_SPEAKER_CENLFE|BASS_SPEAKER_RIGHT +#define BASS_SPEAKER_REAR2LEFT BASS_SPEAKER_REAR2|BASS_SPEAKER_LEFT +#define BASS_SPEAKER_REAR2RIGHT BASS_SPEAKER_REAR2|BASS_SPEAKER_RIGHT + +#define BASS_ASYNCFILE 0x40000000 +#define BASS_UNICODE 0x80000000 + +#define BASS_RECORD_PAUSE 0x8000 // start recording paused +#define BASS_RECORD_ECHOCANCEL 0x2000 +#define BASS_RECORD_AGC 0x4000 + +// DX7 voice allocation & management flags +#define BASS_VAM_HARDWARE 1 +#define BASS_VAM_SOFTWARE 2 +#define BASS_VAM_TERM_TIME 4 +#define BASS_VAM_TERM_DIST 8 +#define BASS_VAM_TERM_PRIO 16 + +// Channel info structure +typedef struct { + DWORD freq; // default playback rate + DWORD chans; // channels + DWORD flags; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags + DWORD ctype; // type of channel + DWORD origres; // original resolution + HPLUGIN plugin; // plugin + HSAMPLE sample; // sample + const char *filename; // filename +} BASS_CHANNELINFO; + +#define BASS_ORIGRES_FLOAT 0x10000 + +// BASS_CHANNELINFO types +#define BASS_CTYPE_SAMPLE 1 +#define BASS_CTYPE_RECORD 2 +#define BASS_CTYPE_STREAM 0x10000 +#define BASS_CTYPE_STREAM_VORBIS 0x10002 +#define BASS_CTYPE_STREAM_OGG 0x10002 +#define BASS_CTYPE_STREAM_MP1 0x10003 +#define BASS_CTYPE_STREAM_MP2 0x10004 +#define BASS_CTYPE_STREAM_MP3 0x10005 +#define BASS_CTYPE_STREAM_AIFF 0x10006 +#define BASS_CTYPE_STREAM_CA 0x10007 +#define BASS_CTYPE_STREAM_MF 0x10008 +#define BASS_CTYPE_STREAM_AM 0x10009 +#define BASS_CTYPE_STREAM_DUMMY 0x18000 +#define BASS_CTYPE_STREAM_DEVICE 0x18001 +#define BASS_CTYPE_STREAM_WAV 0x40000 // WAVE flag, LOWORD=codec +#define BASS_CTYPE_STREAM_WAV_PCM 0x50001 +#define BASS_CTYPE_STREAM_WAV_FLOAT 0x50003 +#define BASS_CTYPE_MUSIC_MOD 0x20000 +#define BASS_CTYPE_MUSIC_MTM 0x20001 +#define BASS_CTYPE_MUSIC_S3M 0x20002 +#define BASS_CTYPE_MUSIC_XM 0x20003 +#define BASS_CTYPE_MUSIC_IT 0x20004 +#define BASS_CTYPE_MUSIC_MO3 0x00100 // MO3 flag + +typedef struct { + DWORD ctype; // channel type +#if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) + const wchar_t *name; // format description + const wchar_t *exts; // file extension filter (*.ext1;*.ext2;etc...) +#else + const char *name; // format description + const char *exts; // file extension filter (*.ext1;*.ext2;etc...) +#endif +} BASS_PLUGINFORM; + +typedef struct { + DWORD version; // version (same form as BASS_GetVersion) + DWORD formatc; // number of formats + const BASS_PLUGINFORM *formats; // the array of formats +} BASS_PLUGININFO; + +// 3D vector (for 3D positions/velocities/orientations) +typedef struct BASS_3DVECTOR { +#ifdef __cplusplus + BASS_3DVECTOR() {}; + BASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}; +#endif + float x; // +=right, -=left + float y; // +=up, -=down + float z; // +=front, -=behind +} BASS_3DVECTOR; + +// 3D channel modes +#define BASS_3DMODE_NORMAL 0 // normal 3D processing +#define BASS_3DMODE_RELATIVE 1 // position is relative to the listener +#define BASS_3DMODE_OFF 2 // no 3D processing + +// software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM) +#define BASS_3DALG_DEFAULT 0 +#define BASS_3DALG_OFF 1 +#define BASS_3DALG_FULL 2 +#define BASS_3DALG_LIGHT 3 + +// EAX environments, use with BASS_SetEAXParameters +enum +{ + EAX_ENVIRONMENT_GENERIC, + EAX_ENVIRONMENT_PADDEDCELL, + EAX_ENVIRONMENT_ROOM, + EAX_ENVIRONMENT_BATHROOM, + EAX_ENVIRONMENT_LIVINGROOM, + EAX_ENVIRONMENT_STONEROOM, + EAX_ENVIRONMENT_AUDITORIUM, + EAX_ENVIRONMENT_CONCERTHALL, + EAX_ENVIRONMENT_CAVE, + EAX_ENVIRONMENT_ARENA, + EAX_ENVIRONMENT_HANGAR, + EAX_ENVIRONMENT_CARPETEDHALLWAY, + EAX_ENVIRONMENT_HALLWAY, + EAX_ENVIRONMENT_STONECORRIDOR, + EAX_ENVIRONMENT_ALLEY, + EAX_ENVIRONMENT_FOREST, + EAX_ENVIRONMENT_CITY, + EAX_ENVIRONMENT_MOUNTAINS, + EAX_ENVIRONMENT_QUARRY, + EAX_ENVIRONMENT_PLAIN, + EAX_ENVIRONMENT_PARKINGLOT, + EAX_ENVIRONMENT_SEWERPIPE, + EAX_ENVIRONMENT_UNDERWATER, + EAX_ENVIRONMENT_DRUGGED, + EAX_ENVIRONMENT_DIZZY, + EAX_ENVIRONMENT_PSYCHOTIC, + + EAX_ENVIRONMENT_COUNT // total number of environments +}; + +// EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx) +#define EAX_PRESET_GENERIC EAX_ENVIRONMENT_GENERIC,0.5F,1.493F,0.5F +#define EAX_PRESET_PADDEDCELL EAX_ENVIRONMENT_PADDEDCELL,0.25F,0.1F,0.0F +#define EAX_PRESET_ROOM EAX_ENVIRONMENT_ROOM,0.417F,0.4F,0.666F +#define EAX_PRESET_BATHROOM EAX_ENVIRONMENT_BATHROOM,0.653F,1.499F,0.166F +#define EAX_PRESET_LIVINGROOM EAX_ENVIRONMENT_LIVINGROOM,0.208F,0.478F,0.0F +#define EAX_PRESET_STONEROOM EAX_ENVIRONMENT_STONEROOM,0.5F,2.309F,0.888F +#define EAX_PRESET_AUDITORIUM EAX_ENVIRONMENT_AUDITORIUM,0.403F,4.279F,0.5F +#define EAX_PRESET_CONCERTHALL EAX_ENVIRONMENT_CONCERTHALL,0.5F,3.961F,0.5F +#define EAX_PRESET_CAVE EAX_ENVIRONMENT_CAVE,0.5F,2.886F,1.304F +#define EAX_PRESET_ARENA EAX_ENVIRONMENT_ARENA,0.361F,7.284F,0.332F +#define EAX_PRESET_HANGAR EAX_ENVIRONMENT_HANGAR,0.5F,10.0F,0.3F +#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY,0.153F,0.259F,2.0F +#define EAX_PRESET_HALLWAY EAX_ENVIRONMENT_HALLWAY,0.361F,1.493F,0.0F +#define EAX_PRESET_STONECORRIDOR EAX_ENVIRONMENT_STONECORRIDOR,0.444F,2.697F,0.638F +#define EAX_PRESET_ALLEY EAX_ENVIRONMENT_ALLEY,0.25F,1.752F,0.776F +#define EAX_PRESET_FOREST EAX_ENVIRONMENT_FOREST,0.111F,3.145F,0.472F +#define EAX_PRESET_CITY EAX_ENVIRONMENT_CITY,0.111F,2.767F,0.224F +#define EAX_PRESET_MOUNTAINS EAX_ENVIRONMENT_MOUNTAINS,0.194F,7.841F,0.472F +#define EAX_PRESET_QUARRY EAX_ENVIRONMENT_QUARRY,1.0F,1.499F,0.5F +#define EAX_PRESET_PLAIN EAX_ENVIRONMENT_PLAIN,0.097F,2.767F,0.224F +#define EAX_PRESET_PARKINGLOT EAX_ENVIRONMENT_PARKINGLOT,0.208F,1.652F,1.5F +#define EAX_PRESET_SEWERPIPE EAX_ENVIRONMENT_SEWERPIPE,0.652F,2.886F,0.25F +#define EAX_PRESET_UNDERWATER EAX_ENVIRONMENT_UNDERWATER,1.0F,1.499F,0.0F +#define EAX_PRESET_DRUGGED EAX_ENVIRONMENT_DRUGGED,0.875F,8.392F,1.388F +#define EAX_PRESET_DIZZY EAX_ENVIRONMENT_DIZZY,0.139F,17.234F,0.666F +#define EAX_PRESET_PSYCHOTIC EAX_ENVIRONMENT_PSYCHOTIC,0.486F,7.563F,0.806F + +typedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, void *user); +/* User stream callback function. +handle : The stream that needs writing +buffer : Buffer to write the samples in +length : Number of bytes to write +user : The 'user' parameter value given when calling BASS_StreamCreate +RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end the stream. */ + +#define BASS_STREAMPROC_END 0x80000000 // end of user stream flag + +// special STREAMPROCs +#define STREAMPROC_DUMMY (STREAMPROC*)0 // "dummy" stream +#define STREAMPROC_PUSH (STREAMPROC*)-1 // push stream +#define STREAMPROC_DEVICE (STREAMPROC*)-2 // device mix stream +#define STREAMPROC_DEVICE_3D (STREAMPROC*)-3 // device 3D mix stream + +// BASS_StreamCreateFileUser file systems +#define STREAMFILE_NOBUFFER 0 +#define STREAMFILE_BUFFER 1 +#define STREAMFILE_BUFFERPUSH 2 + +// User file stream callback functions +typedef void (CALLBACK FILECLOSEPROC)(void *user); +typedef QWORD (CALLBACK FILELENPROC)(void *user); +typedef DWORD (CALLBACK FILEREADPROC)(void *buffer, DWORD length, void *user); +typedef BOOL (CALLBACK FILESEEKPROC)(QWORD offset, void *user); + +typedef struct { + FILECLOSEPROC *close; + FILELENPROC *length; + FILEREADPROC *read; + FILESEEKPROC *seek; +} BASS_FILEPROCS; + +// BASS_StreamPutFileData options +#define BASS_FILEDATA_END 0 // end & close the file + +// BASS_StreamGetFilePosition modes +#define BASS_FILEPOS_CURRENT 0 +#define BASS_FILEPOS_DECODE BASS_FILEPOS_CURRENT +#define BASS_FILEPOS_DOWNLOAD 1 +#define BASS_FILEPOS_END 2 +#define BASS_FILEPOS_START 3 +#define BASS_FILEPOS_CONNECTED 4 +#define BASS_FILEPOS_BUFFER 5 +#define BASS_FILEPOS_SOCKET 6 +#define BASS_FILEPOS_ASYNCBUF 7 +#define BASS_FILEPOS_SIZE 8 +#define BASS_FILEPOS_BUFFERING 9 + +typedef void (CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, void *user); +/* Internet stream download callback function. +buffer : Buffer containing the downloaded data... NULL=end of download +length : Number of bytes in the buffer +user : The 'user' parameter value given when calling BASS_StreamCreateURL */ + +// BASS_ChannelSetSync types +#define BASS_SYNC_POS 0 +#define BASS_SYNC_END 2 +#define BASS_SYNC_META 4 +#define BASS_SYNC_SLIDE 5 +#define BASS_SYNC_STALL 6 +#define BASS_SYNC_DOWNLOAD 7 +#define BASS_SYNC_FREE 8 +#define BASS_SYNC_SETPOS 11 +#define BASS_SYNC_MUSICPOS 10 +#define BASS_SYNC_MUSICINST 1 +#define BASS_SYNC_MUSICFX 3 +#define BASS_SYNC_OGG_CHANGE 12 +#define BASS_SYNC_DEV_FAIL 14 +#define BASS_SYNC_DEV_FORMAT 15 +#define BASS_SYNC_THREAD 0x20000000 // flag: call sync in other thread +#define BASS_SYNC_MIXTIME 0x40000000 // flag: sync at mixtime, else at playtime +#define BASS_SYNC_ONETIME 0x80000000 // flag: sync only once, else continuously + +typedef void (CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, void *user); +/* Sync callback function. +handle : The sync that has occured +channel: Channel that the sync occured in +data : Additional data associated with the sync's occurance +user : The 'user' parameter given when calling BASS_ChannelSetSync */ + +typedef void (CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user); +/* DSP callback function. +handle : The DSP handle +channel: Channel that the DSP is being applied to +buffer : Buffer to apply the DSP to +length : Number of bytes in the buffer +user : The 'user' parameter given when calling BASS_ChannelSetDSP */ + +typedef BOOL (CALLBACK RECORDPROC)(HRECORD handle, const void *buffer, DWORD length, void *user); +/* Recording callback function. +handle : The recording handle +buffer : Buffer containing the recorded sample data +length : Number of bytes +user : The 'user' parameter value given when calling BASS_RecordStart +RETURN : TRUE = continue recording, FALSE = stop */ + +// BASS_ChannelIsActive return values +#define BASS_ACTIVE_STOPPED 0 +#define BASS_ACTIVE_PLAYING 1 +#define BASS_ACTIVE_STALLED 2 +#define BASS_ACTIVE_PAUSED 3 +#define BASS_ACTIVE_PAUSED_DEVICE 4 + +// Channel attributes +#define BASS_ATTRIB_FREQ 1 +#define BASS_ATTRIB_VOL 2 +#define BASS_ATTRIB_PAN 3 +#define BASS_ATTRIB_EAXMIX 4 +#define BASS_ATTRIB_NOBUFFER 5 +#define BASS_ATTRIB_VBR 6 +#define BASS_ATTRIB_CPU 7 +#define BASS_ATTRIB_SRC 8 +#define BASS_ATTRIB_NET_RESUME 9 +#define BASS_ATTRIB_SCANINFO 10 +#define BASS_ATTRIB_NORAMP 11 +#define BASS_ATTRIB_BITRATE 12 +#define BASS_ATTRIB_BUFFER 13 +#define BASS_ATTRIB_GRANULE 14 +#define BASS_ATTRIB_MUSIC_AMPLIFY 0x100 +#define BASS_ATTRIB_MUSIC_PANSEP 0x101 +#define BASS_ATTRIB_MUSIC_PSCALER 0x102 +#define BASS_ATTRIB_MUSIC_BPM 0x103 +#define BASS_ATTRIB_MUSIC_SPEED 0x104 +#define BASS_ATTRIB_MUSIC_VOL_GLOBAL 0x105 +#define BASS_ATTRIB_MUSIC_ACTIVE 0x106 +#define BASS_ATTRIB_MUSIC_VOL_CHAN 0x200 // + channel # +#define BASS_ATTRIB_MUSIC_VOL_INST 0x300 // + instrument # + +// BASS_ChannelSlideAttribute flags +#define BASS_SLIDE_LOG 0x1000000 + +// BASS_ChannelGetData flags +#define BASS_DATA_AVAILABLE 0 // query how much data is buffered +#define BASS_DATA_FIXED 0x20000000 // flag: return 8.24 fixed-point data +#define BASS_DATA_FLOAT 0x40000000 // flag: return floating-point sample data +#define BASS_DATA_FFT256 0x80000000 // 256 sample FFT +#define BASS_DATA_FFT512 0x80000001 // 512 FFT +#define BASS_DATA_FFT1024 0x80000002 // 1024 FFT +#define BASS_DATA_FFT2048 0x80000003 // 2048 FFT +#define BASS_DATA_FFT4096 0x80000004 // 4096 FFT +#define BASS_DATA_FFT8192 0x80000005 // 8192 FFT +#define BASS_DATA_FFT16384 0x80000006 // 16384 FFT +#define BASS_DATA_FFT32768 0x80000007 // 32768 FFT +#define BASS_DATA_FFT_INDIVIDUAL 0x10 // FFT flag: FFT for each channel, else all combined +#define BASS_DATA_FFT_NOWINDOW 0x20 // FFT flag: no Hanning window +#define BASS_DATA_FFT_REMOVEDC 0x40 // FFT flag: pre-remove DC bias +#define BASS_DATA_FFT_COMPLEX 0x80 // FFT flag: return complex data +#define BASS_DATA_FFT_NYQUIST 0x100 // FFT flag: return extra Nyquist value + +// BASS_ChannelGetLevelEx flags +#define BASS_LEVEL_MONO 1 +#define BASS_LEVEL_STEREO 2 +#define BASS_LEVEL_RMS 4 +#define BASS_LEVEL_VOLPAN 8 + +// BASS_ChannelGetTags types : what's returned +#define BASS_TAG_ID3 0 // ID3v1 tags : TAG_ID3 structure +#define BASS_TAG_ID3V2 1 // ID3v2 tags : variable length block +#define BASS_TAG_OGG 2 // OGG comments : series of null-terminated UTF-8 strings +#define BASS_TAG_HTTP 3 // HTTP headers : series of null-terminated ANSI strings +#define BASS_TAG_ICY 4 // ICY headers : series of null-terminated ANSI strings +#define BASS_TAG_META 5 // ICY metadata : ANSI string +#define BASS_TAG_APE 6 // APE tags : series of null-terminated UTF-8 strings +#define BASS_TAG_MP4 7 // MP4/iTunes metadata : series of null-terminated UTF-8 strings +#define BASS_TAG_WMA 8 // WMA tags : series of null-terminated UTF-8 strings +#define BASS_TAG_VENDOR 9 // OGG encoder : UTF-8 string +#define BASS_TAG_LYRICS3 10 // Lyric3v2 tag : ASCII string +#define BASS_TAG_CA_CODEC 11 // CoreAudio codec info : TAG_CA_CODEC structure +#define BASS_TAG_MF 13 // Media Foundation tags : series of null-terminated UTF-8 strings +#define BASS_TAG_WAVEFORMAT 14 // WAVE format : WAVEFORMATEEX structure +#define BASS_TAG_AM_MIME 15 // Android Media MIME type : ASCII string +#define BASS_TAG_AM_NAME 16 // Android Media codec name : ASCII string +#define BASS_TAG_RIFF_INFO 0x100 // RIFF "INFO" tags : series of null-terminated ANSI strings +#define BASS_TAG_RIFF_BEXT 0x101 // RIFF/BWF "bext" tags : TAG_BEXT structure +#define BASS_TAG_RIFF_CART 0x102 // RIFF/BWF "cart" tags : TAG_CART structure +#define BASS_TAG_RIFF_DISP 0x103 // RIFF "DISP" text tag : ANSI string +#define BASS_TAG_RIFF_CUE 0x104 // RIFF "cue " chunk : TAG_CUE structure +#define BASS_TAG_RIFF_SMPL 0x105 // RIFF "smpl" chunk : TAG_SMPL structure +#define BASS_TAG_APE_BINARY 0x1000 // + index #, binary APE tag : TAG_APE_BINARY structure +#define BASS_TAG_MUSIC_NAME 0x10000 // MOD music name : ANSI string +#define BASS_TAG_MUSIC_MESSAGE 0x10001 // MOD message : ANSI string +#define BASS_TAG_MUSIC_ORDERS 0x10002 // MOD order list : BYTE array of pattern numbers +#define BASS_TAG_MUSIC_AUTH 0x10003 // MOD author : UTF-8 string +#define BASS_TAG_MUSIC_INST 0x10100 // + instrument #, MOD instrument name : ANSI string +#define BASS_TAG_MUSIC_SAMPLE 0x10300 // + sample #, MOD sample name : ANSI string + +// ID3v1 tag structure +typedef struct { + char id[3]; + char title[30]; + char artist[30]; + char album[30]; + char year[4]; + char comment[30]; + BYTE genre; +} TAG_ID3; + +// Binary APE tag structure +typedef struct { + const char *key; + const void *data; + DWORD length; +} TAG_APE_BINARY; + +// BWF "bext" tag structure +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4200) +#endif +#pragma pack(push,1) +typedef struct { + char Description[256]; // description + char Originator[32]; // name of the originator + char OriginatorReference[32]; // reference of the originator + char OriginationDate[10]; // date of creation (yyyy-mm-dd) + char OriginationTime[8]; // time of creation (hh-mm-ss) + QWORD TimeReference; // first sample count since midnight (little-endian) + WORD Version; // BWF version (little-endian) + BYTE UMID[64]; // SMPTE UMID + BYTE Reserved[190]; +#if defined(__GNUC__) && __GNUC__<3 + char CodingHistory[0]; // history +#elif 1 // change to 0 if compiler fails the following line + char CodingHistory[]; // history +#else + char CodingHistory[1]; // history +#endif +} TAG_BEXT; +#pragma pack(pop) + +// BWF "cart" tag structures +typedef struct +{ + DWORD dwUsage; // FOURCC timer usage ID + DWORD dwValue; // timer value in samples from head +} TAG_CART_TIMER; + +typedef struct +{ + char Version[4]; // version of the data structure + char Title[64]; // title of cart audio sequence + char Artist[64]; // artist or creator name + char CutID[64]; // cut number identification + char ClientID[64]; // client identification + char Category[64]; // category ID, PSA, NEWS, etc + char Classification[64]; // classification or auxiliary key + char OutCue[64]; // out cue text + char StartDate[10]; // yyyy-mm-dd + char StartTime[8]; // hh:mm:ss + char EndDate[10]; // yyyy-mm-dd + char EndTime[8]; // hh:mm:ss + char ProducerAppID[64]; // name of vendor or application + char ProducerAppVersion[64]; // version of producer application + char UserDef[64]; // user defined text + DWORD dwLevelReference; // sample value for 0 dB reference + TAG_CART_TIMER PostTimer[8]; // 8 time markers after head + char Reserved[276]; + char URL[1024]; // uniform resource locator +#if defined(__GNUC__) && __GNUC__<3 + char TagText[0]; // free form text for scripts or tags +#elif 1 // change to 0 if compiler fails the following line + char TagText[]; // free form text for scripts or tags +#else + char TagText[1]; // free form text for scripts or tags +#endif +} TAG_CART; + +// RIFF "cue " tag structures +typedef struct +{ + DWORD dwName; + DWORD dwPosition; + DWORD fccChunk; + DWORD dwChunkStart; + DWORD dwBlockStart; + DWORD dwSampleOffset; +} TAG_CUE_POINT; + +typedef struct +{ + DWORD dwCuePoints; +#if defined(__GNUC__) && __GNUC__<3 + TAG_CUE_POINT CuePoints[0]; +#elif 1 // change to 0 if compiler fails the following line + TAG_CUE_POINT CuePoints[]; +#else + TAG_CUE_POINT CuePoints[1]; +#endif +} TAG_CUE; + +// RIFF "smpl" tag structures +typedef struct +{ + DWORD dwIdentifier; + DWORD dwType; + DWORD dwStart; + DWORD dwEnd; + DWORD dwFraction; + DWORD dwPlayCount; +} TAG_SMPL_LOOP; + +typedef struct +{ + DWORD dwManufacturer; + DWORD dwProduct; + DWORD dwSamplePeriod; + DWORD dwMIDIUnityNote; + DWORD dwMIDIPitchFraction; + DWORD dwSMPTEFormat; + DWORD dwSMPTEOffset; + DWORD cSampleLoops; + DWORD cbSamplerData; +#if defined(__GNUC__) && __GNUC__<3 + TAG_SMPL_LOOP SampleLoops[0]; +#elif 1 // change to 0 if compiler fails the following line + TAG_SMPL_LOOP SampleLoops[]; +#else + TAG_SMPL_LOOP SampleLoops[1]; +#endif +} TAG_SMPL; +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +// CoreAudio codec info structure +typedef struct { + DWORD ftype; // file format + DWORD atype; // audio format + const char *name; // description +} TAG_CA_CODEC; + +#ifndef _WAVEFORMATEX_ +#define _WAVEFORMATEX_ +#pragma pack(push,1) +typedef struct tWAVEFORMATEX +{ + WORD wFormatTag; + WORD nChannels; + DWORD nSamplesPerSec; + DWORD nAvgBytesPerSec; + WORD nBlockAlign; + WORD wBitsPerSample; + WORD cbSize; +} WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX; +typedef const WAVEFORMATEX *LPCWAVEFORMATEX; +#pragma pack(pop) +#endif + +// BASS_ChannelGetLength/GetPosition/SetPosition modes +#define BASS_POS_BYTE 0 // byte position +#define BASS_POS_MUSIC_ORDER 1 // order.row position, MAKELONG(order,row) +#define BASS_POS_OGG 3 // OGG bitstream number +#define BASS_POS_RESET 0x2000000 // flag: reset user file buffers +#define BASS_POS_RELATIVE 0x4000000 // flag: seek relative to the current position +#define BASS_POS_INEXACT 0x8000000 // flag: allow seeking to inexact position +#define BASS_POS_DECODE 0x10000000 // flag: get the decoding (not playing) position +#define BASS_POS_DECODETO 0x20000000 // flag: decode to the position instead of seeking +#define BASS_POS_SCAN 0x40000000 // flag: scan to the position + +// BASS_ChannelSetDevice/GetDevice option +#define BASS_NODEVICE 0x20000 + +// BASS_RecordSetInput flags +#define BASS_INPUT_OFF 0x10000 +#define BASS_INPUT_ON 0x20000 + +#define BASS_INPUT_TYPE_MASK 0xff000000 +#define BASS_INPUT_TYPE_UNDEF 0x00000000 +#define BASS_INPUT_TYPE_DIGITAL 0x01000000 +#define BASS_INPUT_TYPE_LINE 0x02000000 +#define BASS_INPUT_TYPE_MIC 0x03000000 +#define BASS_INPUT_TYPE_SYNTH 0x04000000 +#define BASS_INPUT_TYPE_CD 0x05000000 +#define BASS_INPUT_TYPE_PHONE 0x06000000 +#define BASS_INPUT_TYPE_SPEAKER 0x07000000 +#define BASS_INPUT_TYPE_WAVE 0x08000000 +#define BASS_INPUT_TYPE_AUX 0x09000000 +#define BASS_INPUT_TYPE_ANALOG 0x0a000000 + +// BASS_ChannelSetFX effect types +#define BASS_FX_DX8_CHORUS 0 +#define BASS_FX_DX8_COMPRESSOR 1 +#define BASS_FX_DX8_DISTORTION 2 +#define BASS_FX_DX8_ECHO 3 +#define BASS_FX_DX8_FLANGER 4 +#define BASS_FX_DX8_GARGLE 5 +#define BASS_FX_DX8_I3DL2REVERB 6 +#define BASS_FX_DX8_PARAMEQ 7 +#define BASS_FX_DX8_REVERB 8 +#define BASS_FX_VOLUME 9 + +typedef struct { + float fWetDryMix; + float fDepth; + float fFeedback; + float fFrequency; + DWORD lWaveform; // 0=triangle, 1=sine + float fDelay; + DWORD lPhase; // BASS_DX8_PHASE_xxx +} BASS_DX8_CHORUS; + +typedef struct { + float fGain; + float fAttack; + float fRelease; + float fThreshold; + float fRatio; + float fPredelay; +} BASS_DX8_COMPRESSOR; + +typedef struct { + float fGain; + float fEdge; + float fPostEQCenterFrequency; + float fPostEQBandwidth; + float fPreLowpassCutoff; +} BASS_DX8_DISTORTION; + +typedef struct { + float fWetDryMix; + float fFeedback; + float fLeftDelay; + float fRightDelay; + BOOL lPanDelay; +} BASS_DX8_ECHO; + +typedef struct { + float fWetDryMix; + float fDepth; + float fFeedback; + float fFrequency; + DWORD lWaveform; // 0=triangle, 1=sine + float fDelay; + DWORD lPhase; // BASS_DX8_PHASE_xxx +} BASS_DX8_FLANGER; + +typedef struct { + DWORD dwRateHz; // Rate of modulation in hz + DWORD dwWaveShape; // 0=triangle, 1=square +} BASS_DX8_GARGLE; + +typedef struct { + int lRoom; // [-10000, 0] default: -1000 mB + int lRoomHF; // [-10000, 0] default: 0 mB + float flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 + float flDecayTime; // [0.1, 20.0] default: 1.49s + float flDecayHFRatio; // [0.1, 2.0] default: 0.83 + int lReflections; // [-10000, 1000] default: -2602 mB + float flReflectionsDelay; // [0.0, 0.3] default: 0.007 s + int lReverb; // [-10000, 2000] default: 200 mB + float flReverbDelay; // [0.0, 0.1] default: 0.011 s + float flDiffusion; // [0.0, 100.0] default: 100.0 % + float flDensity; // [0.0, 100.0] default: 100.0 % + float flHFReference; // [20.0, 20000.0] default: 5000.0 Hz +} BASS_DX8_I3DL2REVERB; + +typedef struct { + float fCenter; + float fBandwidth; + float fGain; +} BASS_DX8_PARAMEQ; + +typedef struct { + float fInGain; // [-96.0,0.0] default: 0.0 dB + float fReverbMix; // [-96.0,0.0] default: 0.0 db + float fReverbTime; // [0.001,3000.0] default: 1000.0 ms + float fHighFreqRTRatio; // [0.001,0.999] default: 0.001 +} BASS_DX8_REVERB; + +#define BASS_DX8_PHASE_NEG_180 0 +#define BASS_DX8_PHASE_NEG_90 1 +#define BASS_DX8_PHASE_ZERO 2 +#define BASS_DX8_PHASE_90 3 +#define BASS_DX8_PHASE_180 4 + +typedef struct { + float fTarget; + float fCurrent; + float fTime; + DWORD lCurve; +} BASS_FX_VOLUME_PARAM; + +typedef void (CALLBACK IOSNOTIFYPROC)(DWORD status); +/* iOS notification callback function. +status : The notification (BASS_IOSNOTIFY_xxx) */ + +#define BASS_IOSNOTIFY_INTERRUPT 1 // interruption started +#define BASS_IOSNOTIFY_INTERRUPT_END 2 // interruption ended + +BOOL BASSDEF(BASS_SetConfig)(DWORD option, DWORD value); +DWORD BASSDEF(BASS_GetConfig)(DWORD option); +BOOL BASSDEF(BASS_SetConfigPtr)(DWORD option, const void *value); +void *BASSDEF(BASS_GetConfigPtr)(DWORD option); +DWORD BASSDEF(BASS_GetVersion)(); +int BASSDEF(BASS_ErrorGetCode)(); +BOOL BASSDEF(BASS_GetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info); +#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) +BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, HWND win, const GUID *dsguid); +#else +BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, void *win, void *dsguid); +#endif +BOOL BASSDEF(BASS_SetDevice)(DWORD device); +DWORD BASSDEF(BASS_GetDevice)(); +BOOL BASSDEF(BASS_Free)(); +#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) +void *BASSDEF(BASS_GetDSoundObject)(DWORD object); +#endif +BOOL BASSDEF(BASS_GetInfo)(BASS_INFO *info); +BOOL BASSDEF(BASS_Update)(DWORD length); +float BASSDEF(BASS_GetCPU)(); +BOOL BASSDEF(BASS_Start)(); +BOOL BASSDEF(BASS_Stop)(); +BOOL BASSDEF(BASS_Pause)(); +BOOL BASSDEF(BASS_IsStarted)(); +BOOL BASSDEF(BASS_SetVolume)(float volume); +float BASSDEF(BASS_GetVolume)(); + +HPLUGIN BASSDEF(BASS_PluginLoad)(const char *file, DWORD flags); +BOOL BASSDEF(BASS_PluginFree)(HPLUGIN handle); +const BASS_PLUGININFO *BASSDEF(BASS_PluginGetInfo)(HPLUGIN handle); + +BOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf); +BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf); +BOOL BASSDEF(BASS_Set3DPosition)(const BASS_3DVECTOR *pos, const BASS_3DVECTOR *vel, const BASS_3DVECTOR *front, const BASS_3DVECTOR *top); +BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top); +void BASSDEF(BASS_Apply3D)(); +#if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP) +BOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, float damp); +BOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp); +#endif + +HMUSIC BASSDEF(BASS_MusicLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD flags, DWORD freq); +BOOL BASSDEF(BASS_MusicFree)(HMUSIC handle); + +HSAMPLE BASSDEF(BASS_SampleLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD max, DWORD flags); +HSAMPLE BASSDEF(BASS_SampleCreate)(DWORD length, DWORD freq, DWORD chans, DWORD max, DWORD flags); +BOOL BASSDEF(BASS_SampleFree)(HSAMPLE handle); +BOOL BASSDEF(BASS_SampleSetData)(HSAMPLE handle, const void *buffer); +BOOL BASSDEF(BASS_SampleGetData)(HSAMPLE handle, void *buffer); +BOOL BASSDEF(BASS_SampleGetInfo)(HSAMPLE handle, BASS_SAMPLE *info); +BOOL BASSDEF(BASS_SampleSetInfo)(HSAMPLE handle, const BASS_SAMPLE *info); +HCHANNEL BASSDEF(BASS_SampleGetChannel)(HSAMPLE handle, BOOL onlynew); +DWORD BASSDEF(BASS_SampleGetChannels)(HSAMPLE handle, HCHANNEL *channels); +BOOL BASSDEF(BASS_SampleStop)(HSAMPLE handle); + +HSTREAM BASSDEF(BASS_StreamCreate)(DWORD freq, DWORD chans, DWORD flags, STREAMPROC *proc, void *user); +HSTREAM BASSDEF(BASS_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags); +HSTREAM BASSDEF(BASS_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user); +HSTREAM BASSDEF(BASS_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *proc, void *user); +BOOL BASSDEF(BASS_StreamFree)(HSTREAM handle); +QWORD BASSDEF(BASS_StreamGetFilePosition)(HSTREAM handle, DWORD mode); +DWORD BASSDEF(BASS_StreamPutData)(HSTREAM handle, const void *buffer, DWORD length); +DWORD BASSDEF(BASS_StreamPutFileData)(HSTREAM handle, const void *buffer, DWORD length); + +BOOL BASSDEF(BASS_RecordGetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info); +BOOL BASSDEF(BASS_RecordInit)(int device); +BOOL BASSDEF(BASS_RecordSetDevice)(DWORD device); +DWORD BASSDEF(BASS_RecordGetDevice)(); +BOOL BASSDEF(BASS_RecordFree)(); +BOOL BASSDEF(BASS_RecordGetInfo)(BASS_RECORDINFO *info); +const char *BASSDEF(BASS_RecordGetInputName)(int input); +BOOL BASSDEF(BASS_RecordSetInput)(int input, DWORD flags, float volume); +DWORD BASSDEF(BASS_RecordGetInput)(int input, float *volume); +HRECORD BASSDEF(BASS_RecordStart)(DWORD freq, DWORD chans, DWORD flags, RECORDPROC *proc, void *user); + +double BASSDEF(BASS_ChannelBytes2Seconds)(DWORD handle, QWORD pos); +QWORD BASSDEF(BASS_ChannelSeconds2Bytes)(DWORD handle, double pos); +DWORD BASSDEF(BASS_ChannelGetDevice)(DWORD handle); +BOOL BASSDEF(BASS_ChannelSetDevice)(DWORD handle, DWORD device); +DWORD BASSDEF(BASS_ChannelIsActive)(DWORD handle); +BOOL BASSDEF(BASS_ChannelGetInfo)(DWORD handle, BASS_CHANNELINFO *info); +const char *BASSDEF(BASS_ChannelGetTags)(DWORD handle, DWORD tags); +DWORD BASSDEF(BASS_ChannelFlags)(DWORD handle, DWORD flags, DWORD mask); +BOOL BASSDEF(BASS_ChannelUpdate)(DWORD handle, DWORD length); +BOOL BASSDEF(BASS_ChannelLock)(DWORD handle, BOOL lock); +BOOL BASSDEF(BASS_ChannelPlay)(DWORD handle, BOOL restart); +BOOL BASSDEF(BASS_ChannelStop)(DWORD handle); +BOOL BASSDEF(BASS_ChannelPause)(DWORD handle); +BOOL BASSDEF(BASS_ChannelSetAttribute)(DWORD handle, DWORD attrib, float value); +BOOL BASSDEF(BASS_ChannelGetAttribute)(DWORD handle, DWORD attrib, float *value); +BOOL BASSDEF(BASS_ChannelSlideAttribute)(DWORD handle, DWORD attrib, float value, DWORD time); +BOOL BASSDEF(BASS_ChannelIsSliding)(DWORD handle, DWORD attrib); +BOOL BASSDEF(BASS_ChannelSetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size); +DWORD BASSDEF(BASS_ChannelGetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size); +BOOL BASSDEF(BASS_ChannelSet3DAttributes)(DWORD handle, int mode, float min, float max, int iangle, int oangle, float outvol); +BOOL BASSDEF(BASS_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, float *max, DWORD *iangle, DWORD *oangle, float *outvol); +BOOL BASSDEF(BASS_ChannelSet3DPosition)(DWORD handle, const BASS_3DVECTOR *pos, const BASS_3DVECTOR *orient, const BASS_3DVECTOR *vel); +BOOL BASSDEF(BASS_ChannelGet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel); +QWORD BASSDEF(BASS_ChannelGetLength)(DWORD handle, DWORD mode); +BOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mode); +QWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle, DWORD mode); +DWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle); +BOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags); +DWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length); +HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user); +BOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync); +HDSP BASSDEF(BASS_ChannelSetDSP)(DWORD handle, DSPPROC *proc, void *user, int priority); +BOOL BASSDEF(BASS_ChannelRemoveDSP)(DWORD handle, HDSP dsp); +BOOL BASSDEF(BASS_ChannelSetLink)(DWORD handle, DWORD chan); +BOOL BASSDEF(BASS_ChannelRemoveLink)(DWORD handle, DWORD chan); +HFX BASSDEF(BASS_ChannelSetFX)(DWORD handle, DWORD type, int priority); +BOOL BASSDEF(BASS_ChannelRemoveFX)(DWORD handle, HFX fx); + +BOOL BASSDEF(BASS_FXSetParameters)(HFX handle, const void *params); +BOOL BASSDEF(BASS_FXGetParameters)(HFX handle, void *params); +BOOL BASSDEF(BASS_FXReset)(HFX handle); +BOOL BASSDEF(BASS_FXSetPriority)(HFX handle, int priority); + +#ifdef __cplusplus +} + +#if defined(_WIN32) && !defined(NOBASSOVERLOADS) +static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) +{ + return BASS_PluginLoad((const char*)file, flags|BASS_UNICODE); +} + +static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq) +{ + return BASS_MusicLoad(mem, (const void*)file, offset, length, flags|BASS_UNICODE, freq); +} + +static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags) +{ + return BASS_SampleLoad(mem, (const void*)file, offset, length, max, flags|BASS_UNICODE); +} + +static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags) +{ + return BASS_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE); +} + +static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user) +{ + return BASS_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user); +} + +static inline BOOL BASS_SetConfigPtr(DWORD option, const WCHAR *value) +{ + return BASS_SetConfigPtr(option|BASS_UNICODE, (const void*)value); +} +#endif +#endif + +#endif diff --git a/bass-sys/bass24/c/bass.lib b/bass-sys/bass24/c/bass.lib new file mode 100644 index 0000000..0f04905 Binary files /dev/null and b/bass-sys/bass24/c/bass.lib differ diff --git a/bass-sys/bass24/c/bass.sln b/bass-sys/bass24/c/bass.sln new file mode 100644 index 0000000..4a7c1d4 --- /dev/null +++ b/bass-sys/bass24/c/bass.sln @@ -0,0 +1,120 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "3dtest", "3dtest\3dtest.vcxproj", "{98CE30EE-9892-4896-9A68-34725FB454B8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "basstest", "basstest\basstest.vcxproj", "{DEE82226-C3D7-4C31-A234-8934FC43EF82}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "contest", "contest\contest.vcxproj", "{1151BD42-BAB0-4C67-A3CA-D23457250C41}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "custloop", "custloop\custloop.vcxproj", "{BC8FF451-F01D-404B-B39A-D7C59A567D95}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "devlist", "devlist\devlist.vcxproj", "{1151BD42-BAB0-4C67-A3CA-D23457250C42}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsptest", "dsptest\dsptest.vcxproj", "{89104783-85C4-4E31-9EDC-FAF7D6792BF0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fxtest", "fxtest\fxtest.vcxproj", "{46119084-C4AA-4240-A2D6-A6AFC1A82106}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "livefx", "livefx\livefx.vcxproj", "{0C580261-3DF5-4160-BE1A-17BCC66BEE8C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "livespec", "livespec\livespec.vcxproj", "{6AAE12B9-8731-4CDE-BD76-EC5B4EC5AE48}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "modtest", "modtest\modtest.vcxproj", "{9465CD7D-3DAC-472F-AA85-DD144AC094F7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi", "multi\multi.vcxproj", "{305E5C8D-85DB-4E36-A82E-856BC9972413}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netradio", "netradio\netradio.vcxproj", "{DFA5AC9E-4073-4555-92E8-E4808EE32B43}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plugins", "plugins\plugins.vcxproj", "{9465CD7D-3DAC-472F-AA85-DD144AC094F0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rectest", "rectest\rectest.vcxproj", "{4FD2AD5D-39B5-4B75-A79F-93D6DD15A06B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "speakers", "speakers\speakers.vcxproj", "{FD419538-B54A-4472-8DA6-3BDE8DDBA1F1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spectrum", "spectrum\spectrum.vcxproj", "{BDCC1DDE-3BAB-436C-934A-348C76B050E2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "synth", "synth\synth.vcxproj", "{F710CC47-BAAF-44DD-9F1B-D7F5AEEEDB56}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "writewav", "writewav\writewav.vcxproj", "{6102AFDE-AFAD-4750-AC38-75DDC9268531}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {98CE30EE-9892-4896-9A68-34725FB454B8}.Release|Win32.ActiveCfg = Release|Win32 + {98CE30EE-9892-4896-9A68-34725FB454B8}.Release|Win32.Build.0 = Release|Win32 + {98CE30EE-9892-4896-9A68-34725FB454B8}.Release|x64.ActiveCfg = Release|x64 + {98CE30EE-9892-4896-9A68-34725FB454B8}.Release|x64.Build.0 = Release|x64 + {DEE82226-C3D7-4C31-A234-8934FC43EF82}.Release|Win32.ActiveCfg = Release|Win32 + {DEE82226-C3D7-4C31-A234-8934FC43EF82}.Release|Win32.Build.0 = Release|Win32 + {DEE82226-C3D7-4C31-A234-8934FC43EF82}.Release|x64.ActiveCfg = Release|x64 + {DEE82226-C3D7-4C31-A234-8934FC43EF82}.Release|x64.Build.0 = Release|x64 + {1151BD42-BAB0-4C67-A3CA-D23457250C41}.Release|Win32.ActiveCfg = Release|Win32 + {1151BD42-BAB0-4C67-A3CA-D23457250C41}.Release|Win32.Build.0 = Release|Win32 + {1151BD42-BAB0-4C67-A3CA-D23457250C41}.Release|x64.ActiveCfg = Release|x64 + {1151BD42-BAB0-4C67-A3CA-D23457250C41}.Release|x64.Build.0 = Release|x64 + {BC8FF451-F01D-404B-B39A-D7C59A567D95}.Release|Win32.ActiveCfg = Release|Win32 + {BC8FF451-F01D-404B-B39A-D7C59A567D95}.Release|Win32.Build.0 = Release|Win32 + {BC8FF451-F01D-404B-B39A-D7C59A567D95}.Release|x64.ActiveCfg = Release|x64 + {BC8FF451-F01D-404B-B39A-D7C59A567D95}.Release|x64.Build.0 = Release|x64 + {1151BD42-BAB0-4C67-A3CA-D23457250C42}.Release|Win32.ActiveCfg = Release|Win32 + {1151BD42-BAB0-4C67-A3CA-D23457250C42}.Release|Win32.Build.0 = Release|Win32 + {1151BD42-BAB0-4C67-A3CA-D23457250C42}.Release|x64.ActiveCfg = Release|x64 + {1151BD42-BAB0-4C67-A3CA-D23457250C42}.Release|x64.Build.0 = Release|x64 + {89104783-85C4-4E31-9EDC-FAF7D6792BF0}.Release|Win32.ActiveCfg = Release|Win32 + {89104783-85C4-4E31-9EDC-FAF7D6792BF0}.Release|Win32.Build.0 = Release|Win32 + {89104783-85C4-4E31-9EDC-FAF7D6792BF0}.Release|x64.ActiveCfg = Release|x64 + {89104783-85C4-4E31-9EDC-FAF7D6792BF0}.Release|x64.Build.0 = Release|x64 + {46119084-C4AA-4240-A2D6-A6AFC1A82106}.Release|Win32.ActiveCfg = Release|Win32 + {46119084-C4AA-4240-A2D6-A6AFC1A82106}.Release|Win32.Build.0 = Release|Win32 + {46119084-C4AA-4240-A2D6-A6AFC1A82106}.Release|x64.ActiveCfg = Release|x64 + {46119084-C4AA-4240-A2D6-A6AFC1A82106}.Release|x64.Build.0 = Release|x64 + {0C580261-3DF5-4160-BE1A-17BCC66BEE8C}.Release|Win32.ActiveCfg = Release|Win32 + {0C580261-3DF5-4160-BE1A-17BCC66BEE8C}.Release|Win32.Build.0 = Release|Win32 + {0C580261-3DF5-4160-BE1A-17BCC66BEE8C}.Release|x64.ActiveCfg = Release|x64 + {0C580261-3DF5-4160-BE1A-17BCC66BEE8C}.Release|x64.Build.0 = Release|x64 + {6AAE12B9-8731-4CDE-BD76-EC5B4EC5AE48}.Release|Win32.ActiveCfg = Release|Win32 + {6AAE12B9-8731-4CDE-BD76-EC5B4EC5AE48}.Release|Win32.Build.0 = Release|Win32 + {6AAE12B9-8731-4CDE-BD76-EC5B4EC5AE48}.Release|x64.ActiveCfg = Release|x64 + {6AAE12B9-8731-4CDE-BD76-EC5B4EC5AE48}.Release|x64.Build.0 = Release|x64 + {9465CD7D-3DAC-472F-AA85-DD144AC094F7}.Release|Win32.ActiveCfg = Release|Win32 + {9465CD7D-3DAC-472F-AA85-DD144AC094F7}.Release|Win32.Build.0 = Release|Win32 + {9465CD7D-3DAC-472F-AA85-DD144AC094F7}.Release|x64.ActiveCfg = Release|x64 + {9465CD7D-3DAC-472F-AA85-DD144AC094F7}.Release|x64.Build.0 = Release|x64 + {305E5C8D-85DB-4E36-A82E-856BC9972413}.Release|Win32.ActiveCfg = Release|Win32 + {305E5C8D-85DB-4E36-A82E-856BC9972413}.Release|Win32.Build.0 = Release|Win32 + {305E5C8D-85DB-4E36-A82E-856BC9972413}.Release|x64.ActiveCfg = Release|x64 + {305E5C8D-85DB-4E36-A82E-856BC9972413}.Release|x64.Build.0 = Release|x64 + {DFA5AC9E-4073-4555-92E8-E4808EE32B43}.Release|Win32.ActiveCfg = Release|Win32 + {DFA5AC9E-4073-4555-92E8-E4808EE32B43}.Release|Win32.Build.0 = Release|Win32 + {DFA5AC9E-4073-4555-92E8-E4808EE32B43}.Release|x64.ActiveCfg = Release|x64 + {DFA5AC9E-4073-4555-92E8-E4808EE32B43}.Release|x64.Build.0 = Release|x64 + {9465CD7D-3DAC-472F-AA85-DD144AC094F0}.Release|Win32.ActiveCfg = Release|Win32 + {9465CD7D-3DAC-472F-AA85-DD144AC094F0}.Release|Win32.Build.0 = Release|Win32 + {9465CD7D-3DAC-472F-AA85-DD144AC094F0}.Release|x64.ActiveCfg = Release|x64 + {9465CD7D-3DAC-472F-AA85-DD144AC094F0}.Release|x64.Build.0 = Release|x64 + {4FD2AD5D-39B5-4B75-A79F-93D6DD15A06B}.Release|Win32.ActiveCfg = Release|Win32 + {4FD2AD5D-39B5-4B75-A79F-93D6DD15A06B}.Release|Win32.Build.0 = Release|Win32 + {4FD2AD5D-39B5-4B75-A79F-93D6DD15A06B}.Release|x64.ActiveCfg = Release|x64 + {4FD2AD5D-39B5-4B75-A79F-93D6DD15A06B}.Release|x64.Build.0 = Release|x64 + {FD419538-B54A-4472-8DA6-3BDE8DDBA1F1}.Release|Win32.ActiveCfg = Release|Win32 + {FD419538-B54A-4472-8DA6-3BDE8DDBA1F1}.Release|Win32.Build.0 = Release|Win32 + {FD419538-B54A-4472-8DA6-3BDE8DDBA1F1}.Release|x64.ActiveCfg = Release|x64 + {FD419538-B54A-4472-8DA6-3BDE8DDBA1F1}.Release|x64.Build.0 = Release|x64 + {BDCC1DDE-3BAB-436C-934A-348C76B050E2}.Release|Win32.ActiveCfg = Release|Win32 + {BDCC1DDE-3BAB-436C-934A-348C76B050E2}.Release|Win32.Build.0 = Release|Win32 + {BDCC1DDE-3BAB-436C-934A-348C76B050E2}.Release|x64.ActiveCfg = Release|x64 + {BDCC1DDE-3BAB-436C-934A-348C76B050E2}.Release|x64.Build.0 = Release|x64 + {F710CC47-BAAF-44DD-9F1B-D7F5AEEEDB56}.Release|Win32.ActiveCfg = Release|Win32 + {F710CC47-BAAF-44DD-9F1B-D7F5AEEEDB56}.Release|Win32.Build.0 = Release|Win32 + {F710CC47-BAAF-44DD-9F1B-D7F5AEEEDB56}.Release|x64.ActiveCfg = Release|x64 + {F710CC47-BAAF-44DD-9F1B-D7F5AEEEDB56}.Release|x64.Build.0 = Release|x64 + {6102AFDE-AFAD-4750-AC38-75DDC9268531}.Release|Win32.ActiveCfg = Release|Win32 + {6102AFDE-AFAD-4750-AC38-75DDC9268531}.Release|Win32.Build.0 = Release|Win32 + {6102AFDE-AFAD-4750-AC38-75DDC9268531}.Release|x64.ActiveCfg = Release|x64 + {6102AFDE-AFAD-4750-AC38-75DDC9268531}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/bass-sys/bass24/c/basstest/basstest.c b/bass-sys/bass24/c/basstest/basstest.c new file mode 100644 index 0000000..6e37aaf --- /dev/null +++ b/bass-sys/bass24/c/basstest/basstest.c @@ -0,0 +1,282 @@ +/* + BASS simple playback test + Copyright (c) 1999-2019 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include "bass.h" + +HWND win = NULL; + +HSTREAM *strs = NULL; +int strc = 0; +HMUSIC *mods = NULL; +int modc = 0; +HSAMPLE *sams = NULL; +int samc = 0; + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +// messaging macros +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)(w),(LPARAM)(l)) +#define STLM(m,w,l) MESS(10,m,w,l) +#define MLM(m,w,l) MESS(20,m,w,l) +#define SLM(m,w,l) MESS(30,m,w,l) +#define GETSTR() STLM(LB_GETCURSEL,0,0) +#define GETMOD() MLM(LB_GETCURSEL,0,0) +#define GETSAM() SLM(LB_GETCURSEL,0,0) + +INT_PTR CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + static OPENFILENAME ofn; + + switch (m) { + case WM_TIMER: + { + // update the CPU usage display + char text[10]; + sprintf(text, "%.2f", BASS_GetCPU()); + MESS(40, WM_SETTEXT, 0, text); + // update volume slider in case it's been changed outside of the app + MESS(43, TBM_SETPOS, 1, BASS_GetVolume() * 100); + } + break; + + case WM_COMMAND: + switch (LOWORD(w)) { + case IDCANCEL: + EndDialog(h, 0); + break; + + case 14: + { + char file[MAX_PATH] = ""; + HSTREAM str; + ofn.lpstrFilter = "Streamable files (wav/aif/mp3/mp2/mp1/ogg)\0*.wav;*.aif;*.mp3;*.mp2;*.mp1;*.ogg\0All files\0*.*\0\0"; + ofn.lpstrFile = file; + if (GetOpenFileName(&ofn)) { + if (str = BASS_StreamCreateFile(FALSE, file, 0, 0, 0)) { + strc++; + strs = (HSTREAM*)realloc((void*)strs, strc * sizeof(*strs)); + strs[strc - 1] = str; + STLM(LB_ADDSTRING, 0, strrchr(file, '\\') + 1); + } else + Error("Can't open stream"); + } + } + break; + case 15: + { + int s = GETSTR(); + if (s != LB_ERR) { + STLM(LB_DELETESTRING, s, 0); + BASS_StreamFree(strs[s]); // free the stream + strc--; + memcpy(strs + s, strs + s + 1, (strc - s) * sizeof(*strs)); + } + } + break; + case 11: + { + int s = GETSTR(); + if (s != LB_ERR) + if (!BASS_ChannelPlay(strs[s], FALSE)) // play the stream (continue from current position) + Error("Can't play stream"); + } + break; + case 12: + { + int s = GETSTR(); + if (s != LB_ERR) BASS_ChannelStop(strs[s]); // stop the stream + } + break; + case 13: + { + int s = GETSTR(); + if (s != LB_ERR) BASS_ChannelPlay(strs[s], TRUE); // play the stream from the start + } + break; + + case 24: + { + char file[MAX_PATH] = ""; + HMUSIC mod; + ofn.lpstrFilter = "MOD music files (mo3/xm/mod/s3m/it/mtm/umx)\0*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx\0All files\0*.*\0\0"; + ofn.lpstrFile = file; + if (GetOpenFileName(&ofn)) { + // load a music from "file" with ramping enabled + if (mod = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_RAMPS, 1)) { + modc++; + mods = (HMUSIC*)realloc((void*)mods, modc * sizeof(*mods)); + mods[modc - 1] = mod; + MLM(LB_ADDSTRING, 0, strrchr(file, '\\') + 1); + } else + Error("Can't load music"); + } + } + break; + case 25: + { + int s = GETMOD(); + if (s != LB_ERR) { + MLM(LB_DELETESTRING, s, 0); + BASS_MusicFree(mods[s]); // free the music + modc--; + memcpy(mods + s, mods + s + 1, (modc - s) * sizeof(*mods)); + } + } + break; + case 21: + { + int s = GETMOD(); + if (s != LB_ERR) + if (!BASS_ChannelPlay(mods[s], FALSE)) // play the music (continue from current position) + Error("Can't play music"); + } + break; + case 22: + { + int s = GETMOD(); + if (s != LB_ERR) BASS_ChannelStop(mods[s]); // stop the music + } + break; + case 23: + { + int s = GETMOD(); + if (s != LB_ERR) BASS_ChannelPlay(mods[s], TRUE); // play the music from the start + } + break; + + case 32: + { + char file[MAX_PATH] = ""; + HSAMPLE sam; + ofn.lpstrFilter = "Sample files (wav/aif)\0*.wav;*.aif\0All files\0*.*\0\0"; + ofn.lpstrFile = file; + if (GetOpenFileName(&ofn)) { + /* Load a sample from "file" and give it a max of 3 simultaneous + playings using playback position as override decider */ + if (sam = BASS_SampleLoad(FALSE, file, 0, 0, 3, BASS_SAMPLE_OVER_POS)) { + samc++; + sams = (HSAMPLE*)realloc((void*)sams, samc * sizeof(*sams)); + sams[samc - 1] = sam; + SLM(LB_ADDSTRING, 0, strrchr(file, '\\') + 1); + } else + Error("Can't load sample"); + } + } + break; + case 33: + { + int s = GETSAM(); + if (s != LB_ERR) { + SLM(LB_DELETESTRING, s, 0); + BASS_SampleFree(sams[s]); // free the sample + samc--; + memcpy(sams + s, sams + s + 1, (samc - s) * sizeof(*sams)); + } + } + break; + case 31: + { + int s = GETSAM(); + if (s != LB_ERR) { + // play the sample (at default rate, volume=50%, random pan position) + HCHANNEL ch = BASS_SampleGetChannel(sams[s], FALSE); + BASS_ChannelSetAttribute(ch, BASS_ATTRIB_VOL, 0.5f); + BASS_ChannelSetAttribute(ch, BASS_ATTRIB_PAN, ((rand() % 201) - 100) / 100.f); + if (!BASS_ChannelPlay(ch, FALSE)) + Error("Can't play sample"); + } + } + break; + + case 41: + BASS_Pause(); // pause output + break; + case 42: + BASS_Start(); // resume output + break; + case 44: + BASS_SetConfig(BASS_CONFIG_UPDATETHREADS, MESS(44, BM_GETCHECK, 0, 0) ? 2 : 1); // set 1 or 2 update threads + break; + } + break; + + case WM_HSCROLL: + if (l && LOWORD(w) != SB_THUMBPOSITION && LOWORD(w) != SB_ENDSCROLL) { + int p = SendMessage((HWND)l, TBM_GETPOS, 0, 0); + switch (GetDlgCtrlID((HWND)l)) { + case 16: + BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, p * 100); // global stream volume (0-10000) + break; + case 26: + BASS_SetConfig(BASS_CONFIG_GVOL_MUSIC, p * 100); // global MOD volume (0-10000) + break; + case 34: + BASS_SetConfig(BASS_CONFIG_GVOL_SAMPLE, p * 100); // global sample volume (0-10000) + break; + case 43: + BASS_SetVolume(p / 100.f); // output volume (0-1) + break; + } + } + break; + + case WM_INITDIALOG: + win = h; + // initialize default output device + if (!BASS_Init(-1, 44100, 0, win, NULL)) { + Error("Can't initialize device"); + EndDialog(win, 0); + return 0; + } + // initialize volume sliders + MESS(16, TBM_SETRANGE, 1, MAKELONG(0, 100)); + MESS(16, TBM_SETPOS, 1, 100); + MESS(26, TBM_SETRANGE, 1, MAKELONG(0, 100)); + MESS(26, TBM_SETPOS, 1, 100); + MESS(34, TBM_SETRANGE, 1, MAKELONG(0, 100)); + MESS(34, TBM_SETPOS, 1, 100); + MESS(43, TBM_SETRANGE, 1, MAKELONG(0, 100)); + MESS(43, TBM_SETPOS, 1, BASS_GetVolume() * 100); + SetTimer(h, 1, 500, NULL); + memset(&ofn, 0, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = h; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY | OFN_EXPLORER; + return 1; + + case WM_DESTROY: + KillTimer(h, 1); + BASS_Free(); // close output + break; + } + return 0; +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + // enable "Default" device that follows default device changes + BASS_SetConfig(BASS_CONFIG_DEV_DEFAULT, 1); + + // display the window + DialogBox(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc); + + return 0; +} diff --git a/bass-sys/bass24/c/basstest/basstest.dsp b/bass-sys/bass24/c/basstest/basstest.dsp new file mode 100644 index 0000000..da5bfb5 --- /dev/null +++ b/bass-sys/bass24/c/basstest/basstest.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="basstest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=basstest - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "basstest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "basstest.mak" CFG="basstest - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "basstest - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "basstest - Win32 Release" +# Begin Source File + +SOURCE=basstest.c +# End Source File +# Begin Source File + +SOURCE=basstest.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/basstest/basstest.rc b/bass-sys/bass24/c/basstest/basstest.rc new file mode 100644 index 0000000..a1874ad --- /dev/null +++ b/bass-sys/bass24/c/basstest/basstest.rc @@ -0,0 +1,48 @@ +#include "windows.h" + +1000 DIALOG DISCARDABLE 100, 100, 350, 130 +STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "BASS - simple playback test" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Stream",-1,5,0,110,107 + LISTBOX 10,10,10,100,35,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP + PUSHBUTTON "Play",11,10,50,30,12 + PUSHBUTTON "Stop",12,45,50,30,12 + PUSHBUTTON "Restart",13,80,50,30,12 + PUSHBUTTON "Add ...",14,10,65,48,16 + PUSHBUTTON "Remove",15,62,65,48,16 + LTEXT "global volume:",-1,10,83,46,8 + CONTROL "Slider1",16,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | + WS_TABSTOP,10,92,100,11 + GROUPBOX "MOD Music",-1,120,0,110,107 + LISTBOX 20,125,10,100,35,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP + PUSHBUTTON "Play",21,125,50,30,12 + PUSHBUTTON "Stop",22,160,50,30,12 + PUSHBUTTON "Restart",23,195,50,30,12 + PUSHBUTTON "Add ...",24,125,65,48,16 + PUSHBUTTON "Remove",25,177,65,48,16 + LTEXT "global volume:",-1,125,83,46,8 + CONTROL "Slider1",26,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | + WS_TABSTOP,125,92,100,11 + GROUPBOX "Sample",-1,235,0,110,107 + LISTBOX 30,240,10,100,35,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP + PUSHBUTTON "Play",31,240,50,100,12 + PUSHBUTTON "Add ...",32,240,65,48,16 + PUSHBUTTON "Remove",33,292,65,48,16 + LTEXT "global volume:",-1,240,83,46,8 + CONTROL "Slider1",34,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | + WS_TABSTOP,240,92,100,11 + PUSHBUTTON "Stop Output",41,20,112,60,14 + PUSHBUTTON "Resume",42,85,112,60,14 + LTEXT "volume:",-1,160,109,26,8 + CONTROL "Slider1",43,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | + WS_TABSTOP,160,118,100,11 + LTEXT "CPU%",-1,291,120,25,8 + LTEXT "",40,316,120,30,8 + CONTROL "2 update threads",44,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,272,109,69,10 +END diff --git a/bass-sys/bass24/c/basstest/basstest.vcproj b/bass-sys/bass24/c/basstest/basstest.vcproj new file mode 100644 index 0000000..c1d7c8d --- /dev/null +++ b/bass-sys/bass24/c/basstest/basstest.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/basstest/basstest.vcxproj b/bass-sys/bass24/c/basstest/basstest.vcxproj new file mode 100644 index 0000000..5227e3d --- /dev/null +++ b/bass-sys/bass24/c/basstest/basstest.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {DEE82226-C3D7-4C31-A234-8934FC43EF82} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/basstest/makefile b/bass-sys/bass24/c/basstest/makefile new file mode 100644 index 0000000..fa6e50b --- /dev/null +++ b/bass-sys/bass24/c/basstest/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = basstest.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/bin/3dtest.exe b/bass-sys/bass24/c/bin/3dtest.exe new file mode 100644 index 0000000..bd2e9f9 Binary files /dev/null and b/bass-sys/bass24/c/bin/3dtest.exe differ diff --git a/bass-sys/bass24/c/bin/basstest.exe b/bass-sys/bass24/c/bin/basstest.exe new file mode 100644 index 0000000..a81d8a5 Binary files /dev/null and b/bass-sys/bass24/c/bin/basstest.exe differ diff --git a/bass-sys/bass24/c/bin/contest.exe b/bass-sys/bass24/c/bin/contest.exe new file mode 100644 index 0000000..c50b37a Binary files /dev/null and b/bass-sys/bass24/c/bin/contest.exe differ diff --git a/bass-sys/bass24/c/bin/custloop.exe b/bass-sys/bass24/c/bin/custloop.exe new file mode 100644 index 0000000..6c6e1c4 Binary files /dev/null and b/bass-sys/bass24/c/bin/custloop.exe differ diff --git a/bass-sys/bass24/c/bin/devlist.exe b/bass-sys/bass24/c/bin/devlist.exe new file mode 100644 index 0000000..ebdd032 Binary files /dev/null and b/bass-sys/bass24/c/bin/devlist.exe differ diff --git a/bass-sys/bass24/c/bin/dsptest.exe b/bass-sys/bass24/c/bin/dsptest.exe new file mode 100644 index 0000000..d58a3ed Binary files /dev/null and b/bass-sys/bass24/c/bin/dsptest.exe differ diff --git a/bass-sys/bass24/c/bin/fxtest.exe b/bass-sys/bass24/c/bin/fxtest.exe new file mode 100644 index 0000000..fffee68 Binary files /dev/null and b/bass-sys/bass24/c/bin/fxtest.exe differ diff --git a/bass-sys/bass24/c/bin/livefx.exe b/bass-sys/bass24/c/bin/livefx.exe new file mode 100644 index 0000000..2fb7d74 Binary files /dev/null and b/bass-sys/bass24/c/bin/livefx.exe differ diff --git a/bass-sys/bass24/c/bin/livespec.exe b/bass-sys/bass24/c/bin/livespec.exe new file mode 100644 index 0000000..027d537 Binary files /dev/null and b/bass-sys/bass24/c/bin/livespec.exe differ diff --git a/bass-sys/bass24/c/bin/modtest.exe b/bass-sys/bass24/c/bin/modtest.exe new file mode 100644 index 0000000..5c14cb8 Binary files /dev/null and b/bass-sys/bass24/c/bin/modtest.exe differ diff --git a/bass-sys/bass24/c/bin/multi.exe b/bass-sys/bass24/c/bin/multi.exe new file mode 100644 index 0000000..917dcfb Binary files /dev/null and b/bass-sys/bass24/c/bin/multi.exe differ diff --git a/bass-sys/bass24/c/bin/netradio.exe b/bass-sys/bass24/c/bin/netradio.exe new file mode 100644 index 0000000..962c02d Binary files /dev/null and b/bass-sys/bass24/c/bin/netradio.exe differ diff --git a/bass-sys/bass24/c/bin/plugins.exe b/bass-sys/bass24/c/bin/plugins.exe new file mode 100644 index 0000000..0b36439 Binary files /dev/null and b/bass-sys/bass24/c/bin/plugins.exe differ diff --git a/bass-sys/bass24/c/bin/rectest.exe b/bass-sys/bass24/c/bin/rectest.exe new file mode 100644 index 0000000..735e3e7 Binary files /dev/null and b/bass-sys/bass24/c/bin/rectest.exe differ diff --git a/bass-sys/bass24/c/bin/speakers.exe b/bass-sys/bass24/c/bin/speakers.exe new file mode 100644 index 0000000..8c4a790 Binary files /dev/null and b/bass-sys/bass24/c/bin/speakers.exe differ diff --git a/bass-sys/bass24/c/bin/spectrum.exe b/bass-sys/bass24/c/bin/spectrum.exe new file mode 100644 index 0000000..ea56ec1 Binary files /dev/null and b/bass-sys/bass24/c/bin/spectrum.exe differ diff --git a/bass-sys/bass24/c/bin/synth.exe b/bass-sys/bass24/c/bin/synth.exe new file mode 100644 index 0000000..b96f47e Binary files /dev/null and b/bass-sys/bass24/c/bin/synth.exe differ diff --git a/bass-sys/bass24/c/bin/writewav.exe b/bass-sys/bass24/c/bin/writewav.exe new file mode 100644 index 0000000..7e7fa75 Binary files /dev/null and b/bass-sys/bass24/c/bin/writewav.exe differ diff --git a/bass-sys/bass24/c/contest/contest.c b/bass-sys/bass24/c/contest/contest.c new file mode 100644 index 0000000..8052807 --- /dev/null +++ b/bass-sys/bass24/c/contest/contest.c @@ -0,0 +1,163 @@ +/* + BASS simple console player + Copyright (c) 1999-2019 Un4seen Developments Ltd. +*/ + +#include +#include +#include "bass.h" + +#ifdef _WIN32 // Windows +#include +#else // OSX/Linux +#include +#include +#include +#include + +#define Sleep(x) usleep(x*1000) + +int _kbhit() +{ + int r; + fd_set rfds; + struct timeval tv = { 0 }; + struct termios term, oterm; + tcgetattr(0, &oterm); + memcpy(&term, &oterm, sizeof(term)); + cfmakeraw(&term); + tcsetattr(0, TCSANOW, &term); + FD_ZERO(&rfds); + FD_SET(0, &rfds); + r = select(1, &rfds, NULL, NULL, &tv); + tcsetattr(0, TCSANOW, &oterm); + return r; +} +#endif + +// display error messages +void Error(const char *text) +{ + printf("Error(%d): %s\n", BASS_ErrorGetCode(), text); + BASS_Free(); + exit(0); +} + +void ListDevices() +{ + BASS_DEVICEINFO di; + int a; + for (a = 0; BASS_GetDeviceInfo(a, &di); a++) { + if (di.flags & BASS_DEVICE_ENABLED) // enabled output device + printf("dev %d: %s\n", a, di.name); + } +} + +void main(int argc, char **argv) +{ + DWORD chan, act, time, level; + BOOL ismod; + QWORD pos; + int a, filep, device = -1; + + printf("BASS simple console player\n" + "--------------------------\n"); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + printf("An incorrect version of BASS was loaded"); + return; + } + + for (filep = 1; filep < argc; filep++) { + if (!strcmp(argv[filep], "-l")) { + ListDevices(); + return; + } else if (!strcmp(argv[filep], "-d") && filep + 1 < argc) device = atoi(argv[++filep]); + else break; + } + if (filep == argc) { + printf("\tusage: contest [-l] [-d #] \n" + "\t-l = list devices\n" + "\t-d = device number\n"); + return; + } + + BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1); // enable playlist processing + BASS_SetConfig(BASS_CONFIG_NET_PREBUF_WAIT, 0); // disable BASS_StreamCreateURL pre-buffering + + // initialize output device + if (!BASS_Init(device, 44100, 0, 0, NULL)) + Error("Can't initialize device"); + + // try streaming the file/url + if ((chan = BASS_StreamCreateFile(FALSE, argv[filep], 0, 0, BASS_SAMPLE_LOOP)) + || (chan = BASS_StreamCreateURL(argv[filep], 0, BASS_SAMPLE_LOOP, 0, 0))) { + pos = BASS_ChannelGetLength(chan, BASS_POS_BYTE); + if (BASS_StreamGetFilePosition(chan, BASS_FILEPOS_DOWNLOAD) != -1) { + // streaming from the internet + if (pos != -1) + printf("streaming internet file [%lld bytes]", pos); + else + printf("streaming internet file"); + } else + printf("streaming file [%lld bytes]", pos); + ismod = FALSE; + } else { + // try loading the MOD (with looping, sensitive ramping, and calculate the duration) + if (!(chan = BASS_MusicLoad(FALSE, argv[filep], 0, 0, BASS_SAMPLE_LOOP | BASS_MUSIC_RAMPS | BASS_MUSIC_PRESCAN, 1))) + // not a MOD either + Error("Can't play the file"); + { // count channels + float dummy; + for (a = 0; BASS_ChannelGetAttribute(chan, BASS_ATTRIB_MUSIC_VOL_CHAN + a, &dummy); a++); + } + printf("playing MOD music \"%s\" [%u chans, %u orders]", + BASS_ChannelGetTags(chan, BASS_TAG_MUSIC_NAME), a, (DWORD)BASS_ChannelGetLength(chan, BASS_POS_MUSIC_ORDER)); + pos = BASS_ChannelGetLength(chan, BASS_POS_BYTE); + ismod = TRUE; + } + + // display the time length + if (pos != -1) { + time = (DWORD)BASS_ChannelBytes2Seconds(chan, pos); + printf(" %u:%02u\n", time / 60, time % 60); + } else // no time length available + printf("\n"); + + BASS_ChannelPlay(chan, FALSE); + + while (!_kbhit() && (act = BASS_ChannelIsActive(chan))) { + // display some stuff and wait a bit + level = BASS_ChannelGetLevel(chan); + pos = BASS_ChannelGetPosition(chan, BASS_POS_BYTE); + time = BASS_ChannelBytes2Seconds(chan, pos); + printf("pos %09llu", pos); + if (ismod) { + pos = BASS_ChannelGetPosition(chan, BASS_POS_MUSIC_ORDER); + printf(" (%03u:%03u)", LOWORD(pos), HIWORD(pos)); + } + printf(" - %u:%02u - L ", time / 60, time % 60); + if (act == BASS_ACTIVE_STALLED) { // playback has stalled + printf("- buffering: %3u%% -", 100 - (DWORD)BASS_StreamGetFilePosition(chan, BASS_FILEPOS_BUFFERING)); + } else { + for (a = 27204; a > 200; a = a * 2 / 3) putchar(LOWORD(level) >= a ? '*' : '-'); + putchar(' '); + for (a = 210; a < 32768; a = a * 3 / 2) putchar(HIWORD(level) >= a ? '*' : '-'); + } + printf(" R - cpu %.2f%% \r", BASS_GetCPU()); + fflush(stdout); + Sleep(50); + } + printf(" \r"); + + // wind the frequency down... + BASS_ChannelSlideAttribute(chan, BASS_ATTRIB_FREQ, 1000, 500); + Sleep(400); + // ...and fade-out to avoid a "click" + BASS_ChannelSlideAttribute(chan, BASS_ATTRIB_VOL | BASS_SLIDE_LOG, -1, 100); + // wait for slide to finish (could use BASS_SYNC_SLIDE instead) + while (BASS_ChannelIsSliding(chan, 0)) Sleep(1); + + BASS_Free(); +} diff --git a/bass-sys/bass24/c/contest/contest.dsp b/bass-sys/bass24/c/contest/contest.dsp new file mode 100644 index 0000000..cbc8b85 --- /dev/null +++ b/bass-sys/bass24/c/contest/contest.dsp @@ -0,0 +1,53 @@ +# Microsoft Developer Studio Project File - Name="contest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=contest - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "contest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "contest.mak" CFG="contest - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "contest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 +# Begin Target + +# Name "contest - Win32 Release" +# Begin Source File + +SOURCE=contest.c +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/contest/contest.vcproj b/bass-sys/bass24/c/contest/contest.vcproj new file mode 100644 index 0000000..37471d0 --- /dev/null +++ b/bass-sys/bass24/c/contest/contest.vcproj @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/contest/contest.vcxproj b/bass-sys/bass24/c/contest/contest.vcxproj new file mode 100644 index 0000000..7983dd0 --- /dev/null +++ b/bass-sys/bass24/c/contest/contest.vcxproj @@ -0,0 +1,72 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {1151BD42-BAB0-4C67-A3CA-D23457250C41} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Console + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/contest/makefile b/bass-sys/bass24/c/contest/makefile new file mode 100644 index 0000000..69d2081 --- /dev/null +++ b/bass-sys/bass24/c/contest/makefile @@ -0,0 +1,8 @@ +include ..\makefile.in + +TARGET = contest.exe + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/custloop/custloop.c b/bass-sys/bass24/c/custloop/custloop.c new file mode 100644 index 0000000..0af022f --- /dev/null +++ b/bass-sys/bass24/c/custloop/custloop.c @@ -0,0 +1,267 @@ +/* + BASS custom looping example + Copyright (c) 2004-2014 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include "bass.h" + +#define WIDTH 600 // display width +#define HEIGHT 201 // height (odd number for centre line) + +HWND win = NULL; +DWORD scanthread = 0; +BOOL killscan = FALSE; + +DWORD chan; +DWORD bpp; // bytes per pixel +QWORD loop[2] = { 0 }; // loop start & end +HSYNC lsync; // looping sync + +HDC wavedc = 0; +HBITMAP wavebmp = 0; +BYTE *wavebuf; + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +void CALLBACK LoopSyncProc(HSYNC handle, DWORD channel, DWORD data, void *user) +{ + if (!BASS_ChannelSetPosition(channel, loop[0], BASS_POS_BYTE)) // try seeking to loop start + BASS_ChannelSetPosition(channel, 0, BASS_POS_BYTE); // failed, go to start of file instead +} + +void SetLoopStart(QWORD pos) +{ + loop[0] = pos; +} + +void SetLoopEnd(QWORD pos) +{ + loop[1] = pos; + BASS_ChannelRemoveSync(chan, lsync); // remove old sync + lsync = BASS_ChannelSetSync(chan, BASS_SYNC_POS | BASS_SYNC_MIXTIME, loop[1], LoopSyncProc, 0); // set new sync +} + +// scan the peaks +void __cdecl ScanPeaks(void *p) +{ + DWORD decoder = (DWORD)p; + DWORD pos = 0; + float spp = BASS_ChannelBytes2Seconds(decoder, bpp); // seconds per pixel + while (!killscan) { + float peak[2]; + if (spp > 1) { // more than 1 second per pixel, break it down... + float todo = spp; + peak[1] = peak[0] = 0; + do { + float level[2], step = (todo < 1 ? todo : 1); + BASS_ChannelGetLevelEx(decoder, level, step, BASS_LEVEL_STEREO); // scan peaks + if (peak[0] < level[0]) peak[0] = level[0]; + if (peak[1] < level[1]) peak[1] = level[1]; + todo -= step; + } while (todo > 0); + } else + BASS_ChannelGetLevelEx(decoder, peak, spp, BASS_LEVEL_STEREO); // scan peaks + { + DWORD a; + for (a = 0; a < peak[0] * (HEIGHT / 2); a++) + wavebuf[(HEIGHT / 2 - 1 - a) * WIDTH + pos] = 1 + a; // draw left peak + for (a = 0; a < peak[1] * (HEIGHT / 2); a++) + wavebuf[(HEIGHT / 2 + 1 + a) * WIDTH + pos] = 1 + a; // draw right peak + } + pos++; + if (pos >= WIDTH) break; // reached end of display + if (!BASS_ChannelIsActive(decoder)) break; // reached end of channel + } + if (!killscan) { + DWORD size; + BASS_ChannelSetPosition(decoder, (QWORD)-1, BASS_POS_BYTE | BASS_POS_SCAN); // build seek table (scan to end) + size = BASS_ChannelGetAttributeEx(decoder, BASS_ATTRIB_SCANINFO, 0, 0); // get seek table size + if (size) { // got it + void *info = malloc(size); // allocate a buffer + BASS_ChannelGetAttributeEx(decoder, BASS_ATTRIB_SCANINFO, info, size); // get the seek table + BASS_ChannelSetAttributeEx(chan, BASS_ATTRIB_SCANINFO, info, size); // apply it to the playback channel + free(info); + } + } + BASS_StreamFree(decoder); // free the decoder + scanthread = 0; +} + +// select a file to play, and start scanning it +BOOL PlayFile() +{ + char file[MAX_PATH] = ""; + OPENFILENAME ofn = { 0 }; + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = win; + ofn.nMaxFile = MAX_PATH; + ofn.lpstrFile = file; + ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_EXPLORER; + ofn.lpstrTitle = "Select a file to play"; + ofn.lpstrFilter = "Playable files\0*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif;*.mo3;*.it;*.xm;*.s3m;*.mtm;*.mod;*.umx\0All files\0*.*\0\0"; + if (!GetOpenFileName(&ofn)) return FALSE; + + if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, 0)) + && !(chan = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_RAMPS | BASS_MUSIC_POSRESET | BASS_MUSIC_PRESCAN, 1))) { + Error("Can't play file"); + return FALSE; // Can't load the file + } + { + BYTE data[2000] = { 0 }; + BITMAPINFOHEADER *bh = (BITMAPINFOHEADER*)data; + RGBQUAD *pal = (RGBQUAD*)(data + sizeof(*bh)); + int a; + bh->biSize = sizeof(*bh); + bh->biWidth = WIDTH; + bh->biHeight = -HEIGHT; + bh->biPlanes = 1; + bh->biBitCount = 8; + bh->biClrUsed = bh->biClrImportant = HEIGHT / 2 + 1; + // setup palette + for (a = 1; a <= HEIGHT / 2; a++) { + pal[a].rgbRed = (255 * a) / (HEIGHT / 2); + pal[a].rgbGreen = 255 - pal[a].rgbRed; + } + // create the bitmap + wavebmp = CreateDIBSection(0, (BITMAPINFO*)bh, DIB_RGB_COLORS, (void**)&wavebuf, NULL, 0); + wavedc = CreateCompatibleDC(0); + SelectObject(wavedc, wavebmp); + } + bpp = BASS_ChannelGetLength(chan, BASS_POS_BYTE) / WIDTH; // bytes per pixel + { + DWORD bpp1 = BASS_ChannelSeconds2Bytes(chan, 0.001); // minimum 1ms per pixel + if (bpp < bpp1) bpp = bpp1; + } + BASS_ChannelSetSync(chan, BASS_SYNC_END | BASS_SYNC_MIXTIME, 0, LoopSyncProc, 0); // set sync to loop at end + BASS_ChannelPlay(chan, FALSE); // start playing + { // create another channel to scan + DWORD chan2 = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_STREAM_DECODE); + if (!chan2) chan2 = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_DECODE, 1); + scanthread = _beginthread(ScanPeaks, 0, (void*)chan2); // start scanning in a new thread + } + return TRUE; +} + +void DrawTimeLine(HDC dc, QWORD pos, DWORD col, DWORD y) +{ + HPEN pen = CreatePen(PS_SOLID, 0, col), oldpen; + DWORD wpos = pos / bpp; + DWORD time = BASS_ChannelBytes2Seconds(chan, pos) * 1000; // position in milliseconds + char text[16]; + sprintf(text, "%u:%02u.%03u", time / 60000, (time / 1000) % 60, time % 1000); + oldpen = (HPEN)SelectObject(dc, pen); + MoveToEx(dc, wpos, 0, NULL); + LineTo(dc, wpos, HEIGHT); + SetTextColor(dc, col); + SetBkMode(dc, TRANSPARENT); + SetTextAlign(dc, wpos >= WIDTH / 2 ? TA_RIGHT : TA_LEFT); + TextOut(dc, wpos, y, text, strlen(text)); + SelectObject(dc, oldpen); + DeleteObject(pen); +} + +// window procedure +LRESULT CALLBACK SpectrumWindowProc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_LBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_MOUSEMOVE: + if (w & MK_LBUTTON) SetLoopStart(LOWORD(l) * bpp); // set loop start + if (w & MK_RBUTTON) SetLoopEnd(LOWORD(l) * bpp); // set loop end + return 0; + + case WM_MBUTTONDOWN: + BASS_ChannelSetPosition(chan, LOWORD(l) * bpp, BASS_POS_BYTE); // set current pos + return 0; + + case WM_TIMER: + InvalidateRect(h, 0, 0); // refresh window + return 0; + + case WM_PAINT: + if (GetUpdateRect(h, 0, 0)) { + PAINTSTRUCT p; + HDC dc; + if (!(dc = BeginPaint(h, &p))) return 0; + BitBlt(dc, 0, 0, WIDTH, HEIGHT, wavedc, 0, 0, SRCCOPY); // draw peak waveform + DrawTimeLine(dc, loop[0], 0xffff00, 12); // loop start + DrawTimeLine(dc, loop[1], 0x00ffff, 24); // loop end + DrawTimeLine(dc, BASS_ChannelGetPosition(chan, BASS_POS_BYTE), 0xffffff, 0); // current pos + EndPaint(h, &p); + } + return 0; + + case WM_CREATE: + win = h; + // initialize output + if (!BASS_Init(-1, 44100, 0, win, NULL)) { + Error("Can't initialize device"); + return -1; + } + if (!PlayFile()) { // start a file playing + BASS_Free(); + return -1; + } + SetTimer(h, 0, 100, 0); // set update timer (10hz) + break; + + case WM_DESTROY: + KillTimer(h, 0); + if (scanthread) { // still scanning + killscan = TRUE; + WaitForSingleObject((HANDLE)scanthread, 1000); // wait for the thread + } + BASS_Free(); + if (wavedc) DeleteDC(wavedc); + if (wavebmp) DeleteObject(wavebmp); + PostQuitMessage(0); + break; + } + return DefWindowProc(h, m, w, l); +} + +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + WNDCLASS wc; + MSG msg; + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + // register window class and create the window + memset(&wc, 0, sizeof(wc)); + wc.lpfnWndProc = SpectrumWindowProc; + wc.hInstance = hInstance; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.lpszClassName = "BASS-CustLoop"; + if (!RegisterClass(&wc) || !CreateWindow("BASS-CustLoop", + "BASS custom looping example (left-click to set loop start, right-click to set end)", + WS_POPUPWINDOW | WS_CAPTION | WS_VISIBLE, 100, 100, + WIDTH + 2 * GetSystemMetrics(SM_CXDLGFRAME), + HEIGHT + GetSystemMetrics(SM_CYCAPTION) + 2 * GetSystemMetrics(SM_CYDLGFRAME), + NULL, NULL, hInstance, NULL)) { + Error("Can't create window"); + return 0; + } + ShowWindow(win, SW_SHOWNORMAL); + + while (GetMessage(&msg, NULL, 0, 0) > 0) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + return 0; +} diff --git a/bass-sys/bass24/c/custloop/custloop.dsp b/bass-sys/bass24/c/custloop/custloop.dsp new file mode 100644 index 0000000..6b02eff --- /dev/null +++ b/bass-sys/bass24/c/custloop/custloop.dsp @@ -0,0 +1,53 @@ +# Microsoft Developer Studio Project File - Name="custloop" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=custloop - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "custloop.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "custloop.mak" CFG="custloop - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "custloop - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comdlg32.lib gdi32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comdlg32.lib gdi32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "custloop - Win32 Release" +# Begin Source File + +SOURCE=custloop.c +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/custloop/custloop.vcproj b/bass-sys/bass24/c/custloop/custloop.vcproj new file mode 100644 index 0000000..d5d4090 --- /dev/null +++ b/bass-sys/bass24/c/custloop/custloop.vcproj @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/custloop/custloop.vcxproj b/bass-sys/bass24/c/custloop/custloop.vcxproj new file mode 100644 index 0000000..3607caf --- /dev/null +++ b/bass-sys/bass24/c/custloop/custloop.vcxproj @@ -0,0 +1,72 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {BC8FF451-F01D-404B-B39A-D7C59A567D95} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/custloop/makefile b/bass-sys/bass24/c/custloop/makefile new file mode 100644 index 0000000..91c4dc2 --- /dev/null +++ b/bass-sys/bass24/c/custloop/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = custloop.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 -lgdi32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/devlist/devlist.c b/bass-sys/bass24/c/devlist/devlist.c new file mode 100644 index 0000000..c09f8e8 --- /dev/null +++ b/bass-sys/bass24/c/devlist/devlist.c @@ -0,0 +1,76 @@ +/* + BASS device list example + Copyright (c) 2014-2019 Un4seen Developments Ltd. +*/ + +#include +#include "bass.h" + +void DisplayDeviceInfo(BASS_DEVICEINFO *di) +{ +#if 0//def _WIN32 + const char *path = di->driver + strlen(di->driver) + 1; + if (path[0]) + printf("%s\n\tdriver: %s\n\tpath: %s\n\ttype: ", di->name, di->driver, path); + else +#endif + printf("%s\n\tdriver: %s\n\ttype: ", di->name, di->driver); + switch (di->flags & BASS_DEVICE_TYPE_MASK) { + case BASS_DEVICE_TYPE_NETWORK: + printf("Remote Network"); + break; + case BASS_DEVICE_TYPE_SPEAKERS: + printf("Speakers"); + break; + case BASS_DEVICE_TYPE_LINE: + printf("Line"); + break; + case BASS_DEVICE_TYPE_HEADPHONES: + printf("Headphones"); + break; + case BASS_DEVICE_TYPE_MICROPHONE: + printf("Microphone"); + break; + case BASS_DEVICE_TYPE_HEADSET: + printf("Headset"); + break; + case BASS_DEVICE_TYPE_HANDSET: + printf("Handset"); + break; + case BASS_DEVICE_TYPE_DIGITAL: + printf("Digital"); + break; + case BASS_DEVICE_TYPE_SPDIF: + printf("SPDIF"); + break; + case BASS_DEVICE_TYPE_HDMI: + printf("HDMI"); + break; + case BASS_DEVICE_TYPE_DISPLAYPORT: + printf("DisplayPort"); + break; + default: + printf("Unknown"); + } + printf("\n\tflags:"); + if (di->flags & BASS_DEVICE_LOOPBACK) printf(" loopback"); + if (di->flags & BASS_DEVICE_ENABLED) printf(" enabled"); + if (di->flags & BASS_DEVICE_DEFAULT) printf(" default"); + printf(" (%x)\n", di->flags); +} + +void main() +{ + BASS_DEVICEINFO di; + int a; + printf("Output Devices\n"); + for (a = 1; BASS_GetDeviceInfo(a, &di); a++) { + printf("%d: ", a); + DisplayDeviceInfo(&di); + } + printf("\nInput Devices\n"); + for (a = 0; BASS_RecordGetDeviceInfo(a, &di); a++) { + printf("%d: ", a); + DisplayDeviceInfo(&di); + } +} diff --git a/bass-sys/bass24/c/devlist/devlist.dsp b/bass-sys/bass24/c/devlist/devlist.dsp new file mode 100644 index 0000000..03c6ea4 --- /dev/null +++ b/bass-sys/bass24/c/devlist/devlist.dsp @@ -0,0 +1,53 @@ +# Microsoft Developer Studio Project File - Name="devlist" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=devlist - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "devlist.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "devlist.mak" CFG="devlist - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "devlist - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 +# Begin Target + +# Name "devlist - Win32 Release" +# Begin Source File + +SOURCE=devlist.c +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/devlist/devlist.vcproj b/bass-sys/bass24/c/devlist/devlist.vcproj new file mode 100644 index 0000000..f73508c --- /dev/null +++ b/bass-sys/bass24/c/devlist/devlist.vcproj @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/devlist/devlist.vcxproj b/bass-sys/bass24/c/devlist/devlist.vcxproj new file mode 100644 index 0000000..351bba3 --- /dev/null +++ b/bass-sys/bass24/c/devlist/devlist.vcxproj @@ -0,0 +1,72 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {1151BD42-BAB0-4C67-A3CA-D23457250C42} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Console + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/devlist/makefile b/bass-sys/bass24/c/devlist/makefile new file mode 100644 index 0000000..9c109f9 --- /dev/null +++ b/bass-sys/bass24/c/devlist/makefile @@ -0,0 +1,8 @@ +include ..\makefile.in + +TARGET = devlist.exe + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/dsptest/dsptest.c b/bass-sys/bass24/c/dsptest/dsptest.c new file mode 100644 index 0000000..1dcdda1 --- /dev/null +++ b/bass-sys/bass24/c/dsptest/dsptest.c @@ -0,0 +1,223 @@ +/* + BASS simple DSP test + Copyright (c) 2000-2012 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include "bass.h" + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +HWND win = NULL; + +DWORD floatable; // floating-point channel support? +DWORD chan; // the channel... HMUSIC or HSTREAM + +OPENFILENAME ofn; + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + + +// "rotate" +HDSP rotdsp = 0; // DSP handle +float rotpos; // cur.pos +void CALLBACK Rotate(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user) +{ + float *d = (float*)buffer; + DWORD a; + + for (a = 0; a < length / 4; a += 2) { + d[a] *= fabs(sin(rotpos)); + d[a + 1] *= fabs(cos(rotpos)); + rotpos += 0.00003; + } + rotpos = fmod(rotpos, 2 * M_PI); +} + +// "echo" +HDSP echdsp = 0; // DSP handle +#define ECHBUFLEN 1200 // buffer length +float echbuf[ECHBUFLEN][2]; // buffer +int echpos; // cur.pos +void CALLBACK Echo(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user) +{ + float *d = (float*)buffer; + DWORD a; + + for (a = 0; a < length / 4; a += 2) { + float l = d[a] + (echbuf[echpos][1] / 2); + float r = d[a + 1] + (echbuf[echpos][0] / 2); +#if 1 // 0=echo, 1=basic "bathroom" reverb + echbuf[echpos][0] = d[a] = l; + echbuf[echpos][1] = d[a + 1] = r; +#else + echbuf[echpos][0] = d[a]; + echbuf[echpos][1] = d[a + 1]; + d[a] = l; + d[a + 1] = r; +#endif + echpos++; + if (echpos == ECHBUFLEN) echpos = 0; + } +} + +// "flanger" +HDSP fladsp = 0; // DSP handle +#define FLABUFLEN 350 // buffer length +float flabuf[FLABUFLEN][2]; // buffer +int flapos; // cur.pos +float flas, flasinc; // sweep pos/increment +void CALLBACK Flange(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user) +{ + float *d = (float*)buffer; + DWORD a; + + for (a = 0; a < length / 4; a += 2) { + int p1 = (flapos + (int)flas) % FLABUFLEN; + int p2 = (p1 + 1) % FLABUFLEN; + float f = flas - (int)flas; + float s; + + s = (d[a] + ((flabuf[p1][0] * (1 - f)) + (flabuf[p2][0] * f))) * 0.7; + flabuf[flapos][0] = d[a]; + d[a] = s; + + s = (d[a + 1] + ((flabuf[p1][1] * (1 - f)) + (flabuf[p2][1] * f))) * 0.7; + flabuf[flapos][1] = d[a + 1]; + d[a + 1] = s; + + flapos++; + if (flapos == FLABUFLEN) flapos = 0; + flas += flasinc; + if (flas<0 || flas>FLABUFLEN - 1) { + flasinc = -flasinc; + flas += flasinc; + } + } +} + + +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)(w),(LPARAM)(l)) + +INT_PTR CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_COMMAND: + switch (LOWORD(w)) { + case IDCANCEL: + EndDialog(h, 0); + break; + case 10: + { + BASS_CHANNELINFO info; + char file[MAX_PATH] = ""; + ofn.lpstrFilter = "playable files\0*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif\0All files\0*.*\0\0"; + ofn.lpstrFile = file; + if (GetOpenFileName(&ofn)) { + // free both MOD and stream, it must be one of them! :) + BASS_MusicFree(chan); + BASS_StreamFree(chan); + if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP | floatable)) + && !(chan = BASS_MusicLoad(FALSE, file, 0, 0, BASS_SAMPLE_LOOP | BASS_MUSIC_RAMPS | floatable, 1))) { + // whatever it is, it ain't playable + MESS(10, WM_SETTEXT, 0, "click here to open a file..."); + Error("Can't play the file"); + break; + } + BASS_ChannelGetInfo(chan, &info); + if (info.chans != 2) { // only stereo is allowed + MESS(10, WM_SETTEXT, 0, "click here to open a file..."); + BASS_MusicFree(chan); + BASS_StreamFree(chan); + Error("only stereo sources are supported"); + break; + } + MESS(10, WM_SETTEXT, 0, file); + // setup DSPs on new channel and play it + SendMessage(win, WM_COMMAND, 11, 0); + SendMessage(win, WM_COMMAND, 12, 0); + SendMessage(win, WM_COMMAND, 13, 0); + BASS_ChannelPlay(chan, FALSE); + } + } + break; + case 11: // toggle "rotate" + if (MESS(11, BM_GETCHECK, 0, 0)) { + rotpos = M_PI / 4; + rotdsp = BASS_ChannelSetDSP(chan, &Rotate, 0, 2); + } else + BASS_ChannelRemoveDSP(chan, rotdsp); + break; + case 12: // toggle "echo" + if (MESS(12, BM_GETCHECK, 0, 0)) { + memset(echbuf, 0, sizeof(echbuf)); + echpos = 0; + echdsp = BASS_ChannelSetDSP(chan, &Echo, 0, 1); + } else + BASS_ChannelRemoveDSP(chan, echdsp); + break; + case 13: // toggle "flanger" + if (MESS(13, BM_GETCHECK, 0, 0)) { + memset(flabuf, 0, sizeof(flabuf)); + flapos = 0; + flas = FLABUFLEN / 2; + flasinc = 0.002f; + fladsp = BASS_ChannelSetDSP(chan, &Flange, 0, 0); + } else + BASS_ChannelRemoveDSP(chan, fladsp); + break; + } + break; + + case WM_INITDIALOG: + win = h; + memset(&ofn, 0, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = h; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY | OFN_EXPLORER; + // enable floating-point DSP + BASS_SetConfig(BASS_CONFIG_FLOATDSP, TRUE); + // initialize default output device + if (!BASS_Init(-1, 44100, 0, win, NULL)) { + Error("Can't initialize device"); + EndDialog(h, 0); + break; + } + // check for floating-point capability + floatable = BASS_StreamCreate(44100, 2, BASS_SAMPLE_FLOAT, NULL, 0); + if (floatable) { // woohoo! + BASS_StreamFree(floatable); + floatable = BASS_SAMPLE_FLOAT; + } + return 1; + + case WM_DESTROY: + BASS_Free(); + break; + } + return 0; +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + DialogBox(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc); + + return 0; +} diff --git a/bass-sys/bass24/c/dsptest/dsptest.dsp b/bass-sys/bass24/c/dsptest/dsptest.dsp new file mode 100644 index 0000000..8f5cf18 --- /dev/null +++ b/bass-sys/bass24/c/dsptest/dsptest.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="dsptest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=dsptest - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "dsptest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "dsptest.mak" CFG="dsptest - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "dsptest - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "dsptest - Win32 Release" +# Begin Source File + +SOURCE=dsptest.c +# End Source File +# Begin Source File + +SOURCE=dsptest.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/dsptest/dsptest.rc b/bass-sys/bass24/c/dsptest/dsptest.rc new file mode 100644 index 0000000..8c98a6b --- /dev/null +++ b/bass-sys/bass24/c/dsptest/dsptest.rc @@ -0,0 +1,15 @@ +#include "windows.h" + +1000 DIALOG DISCARDABLE 100, 100, 200, 49 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS simple DSP test" +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "click here to open a file...",10,5,5,190,14 + CONTROL "rotate",11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,30, + 35,10 + CONTROL "echo",12,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,80,30,35, + 10 + CONTROL "flanger",13,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120, + 30,35,10 +END diff --git a/bass-sys/bass24/c/dsptest/dsptest.vcproj b/bass-sys/bass24/c/dsptest/dsptest.vcproj new file mode 100644 index 0000000..f943ba4 --- /dev/null +++ b/bass-sys/bass24/c/dsptest/dsptest.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/dsptest/dsptest.vcxproj b/bass-sys/bass24/c/dsptest/dsptest.vcxproj new file mode 100644 index 0000000..4469fa5 --- /dev/null +++ b/bass-sys/bass24/c/dsptest/dsptest.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {89104783-85C4-4E31-9EDC-FAF7D6792BF0} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/dsptest/makefile b/bass-sys/bass24/c/dsptest/makefile new file mode 100644 index 0000000..6986c06 --- /dev/null +++ b/bass-sys/bass24/c/dsptest/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = dsptest.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/fxtest/fxtest.c b/bass-sys/bass24/c/fxtest/fxtest.c new file mode 100644 index 0000000..545b6fa --- /dev/null +++ b/bass-sys/bass24/c/fxtest/fxtest.c @@ -0,0 +1,198 @@ +/* + BASS DX8 effects test + Copyright (c) 2001-2017 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include "bass.h" + +HWND win = NULL; + +DWORD chan; // channel handle +DWORD fxchan = 0; // output stream handle +DWORD fxchansync; // output stream FREE sync +HFX fx[4]; // 3 eq bands + reverb + +OPENFILENAME ofn; + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)(w),(LPARAM)(l)) + +void UpdateFX(int b) +{ + int v = MESS(20 + b, TBM_GETPOS, 0, 0); + if (b < 3) { + BASS_DX8_PARAMEQ p; + BASS_FXGetParameters(fx[b], &p); + p.fGain = 10.0 - v; + BASS_FXSetParameters(fx[b], &p); + } else { + BASS_DX8_REVERB p; + BASS_FXGetParameters(fx[3], &p); + p.fReverbMix = (v < 20 ? log(1 - v / 20.0) * 20 : -96); + BASS_FXSetParameters(fx[3], &p); + } +} + +void SetupFX() +{ + // setup the effects + BASS_DX8_PARAMEQ p; + DWORD ch = fxchan ? fxchan : chan; // set on output stream if enabled, else file stream + fx[0] = BASS_ChannelSetFX(ch, BASS_FX_DX8_PARAMEQ, 0); + fx[1] = BASS_ChannelSetFX(ch, BASS_FX_DX8_PARAMEQ, 0); + fx[2] = BASS_ChannelSetFX(ch, BASS_FX_DX8_PARAMEQ, 0); + fx[3] = BASS_ChannelSetFX(ch, BASS_FX_DX8_REVERB, 0); + p.fGain = 0; + p.fBandwidth = 18; + p.fCenter = 125; + BASS_FXSetParameters(fx[0], &p); + p.fCenter = 1000; + BASS_FXSetParameters(fx[1], &p); + p.fCenter = 8000; + BASS_FXSetParameters(fx[2], &p); + UpdateFX(0); + UpdateFX(1); + UpdateFX(2); + UpdateFX(3); +} + +void CALLBACK DeviceFreeSync(HSYNC handle, DWORD channel, DWORD data, void *user) +{ + // the device output stream has been freed due to format change, get a new one with new format + if (!fxchan) return; + fxchan = BASS_StreamCreate(0, 0, 0, STREAMPROC_DEVICE, 0); + fxchansync = BASS_ChannelSetSync(fxchan, BASS_SYNC_FREE, 0, DeviceFreeSync, 0); + SetupFX(); +} + +INT_PTR CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_COMMAND: + switch (LOWORD(w)) { + case IDCANCEL: + EndDialog(h, 0); + break; + case 10: + { + char file[MAX_PATH] = ""; + ofn.lpstrFilter = "playable files\0*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif\0All files\0*.*\0\0"; + ofn.lpstrFile = file; + if (GetOpenFileName(&ofn)) { + // free both MOD and stream, it must be one of them! :) + BASS_MusicFree(chan); + BASS_StreamFree(chan); + if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP | BASS_SAMPLE_FLOAT)) + && !(chan = BASS_MusicLoad(FALSE, file, 0, 0, BASS_SAMPLE_LOOP | BASS_MUSIC_RAMP | BASS_SAMPLE_FLOAT, 1))) { + // whatever it is, it ain't playable + MESS(10, WM_SETTEXT, 0, "click here to open a file..."); + Error("Can't play the file"); + break; + } + MESS(10, WM_SETTEXT, 0, file); + if (!fxchan) SetupFX(); // set effects on file if not using output stream + BASS_ChannelPlay(chan, FALSE); + } + } + break; + case 30: + { + // remove current effects + DWORD ch = fxchan ? fxchan : chan; + BASS_ChannelRemoveFX(ch, fx[0]); + BASS_ChannelRemoveFX(ch, fx[1]); + BASS_ChannelRemoveFX(ch, fx[2]); + BASS_ChannelRemoveFX(ch, fx[3]); + if (MESS(30, BM_GETCHECK, 0, 0)) { + fxchan = BASS_StreamCreate(0, 0, 0, STREAMPROC_DEVICE, 0); // get device output stream + fxchansync = BASS_ChannelSetSync(fxchan, BASS_SYNC_FREE, 0, DeviceFreeSync, 0); // sync when device output stream is freed (format change) + } else { + BASS_ChannelRemoveSync(fxchan, fxchansync); // remove sync from device output stream + fxchan = 0; // stop using device output stream + } + SetupFX(); + } + break; + } + break; + + case WM_VSCROLL: + if (l) { + UpdateFX(GetDlgCtrlID((HWND)l) - 20); + } + break; + + case WM_INITDIALOG: + win = h; + memset(&ofn, 0, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = h; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY | OFN_EXPLORER; + // initialize default device + if (!BASS_Init(-1, 44100, 0, win, NULL)) { + Error("Can't initialize device"); + EndDialog(win, 0); + return 0; + } + { + // check that DX8 features are available + BASS_INFO bi = { sizeof(bi) }; + BASS_GetInfo(&bi); + if (bi.dsver < 8) { + BASS_Free(); + Error("DirectX 8 is not installed"); + EndDialog(win, 0); + return 0; + } + // disable output stream option if using DirectSound output + if (bi.initflags & BASS_DEVICE_DSOUND) + EnableWindow(GetDlgItem(win, 30), FALSE); + } + // initialize eq/reverb sliders + MESS(20, TBM_SETRANGE, FALSE, MAKELONG(0, 20)); + MESS(20, TBM_SETPOS, TRUE, 10); + MESS(21, TBM_SETRANGE, FALSE, MAKELONG(0, 20)); + MESS(21, TBM_SETPOS, TRUE, 10); + MESS(22, TBM_SETRANGE, FALSE, MAKELONG(0, 20)); + MESS(22, TBM_SETPOS, TRUE, 10); + MESS(23, TBM_SETRANGE, FALSE, MAKELONG(0, 20)); + MESS(23, TBM_SETPOS, TRUE, 20); + return 1; + + case WM_DESTROY: + if (fxchan) BASS_ChannelRemoveSync(fxchan, fxchansync); // remove sync from device output stream + BASS_Free(); + break; + } + return 0; +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + { // enable trackbar support + INITCOMMONCONTROLSEX cc = { sizeof(cc),ICC_BAR_CLASSES }; + InitCommonControlsEx(&cc); + } + + DialogBox(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc); + + return 0; +} diff --git a/bass-sys/bass24/c/fxtest/fxtest.dsp b/bass-sys/bass24/c/fxtest/fxtest.dsp new file mode 100644 index 0000000..5b20253 --- /dev/null +++ b/bass-sys/bass24/c/fxtest/fxtest.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="fxtest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=fxtest - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "fxtest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "fxtest.mak" CFG="fxtest - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "fxtest - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comdlg32.lib comctl32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comdlg32.lib comctl32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "fxtest - Win32 Release" +# Begin Source File + +SOURCE=fxtest.c +# End Source File +# Begin Source File + +SOURCE=fxtest.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/fxtest/fxtest.rc b/bass-sys/bass24/c/fxtest/fxtest.rc new file mode 100644 index 0000000..582191d --- /dev/null +++ b/bass-sys/bass24/c/fxtest/fxtest.rc @@ -0,0 +1,23 @@ +#include + +1000 DIALOG DISCARDABLE 100, 100, 200, 100 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS DX8 effects test" +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "click here to open a file...",10,5,5,190,14 + CONTROL "",20,"msctls_trackbar32",TBS_BOTH | TBS_VERT | + WS_TABSTOP,20,25,30,45 + CONTROL "",21,"msctls_trackbar32",TBS_BOTH | TBS_VERT | + WS_TABSTOP,55,25,30,45 + CONTROL "",22,"msctls_trackbar32",TBS_BOTH | TBS_VERT | + WS_TABSTOP,90,25,30,45 + CONTROL "",23,"msctls_trackbar32",TBS_BOTH | TBS_VERT | + WS_TABSTOP,150,25,30,45 + CTEXT "125 hz",-1,20,72,30,8 + CTEXT "1 khz",-1,55,72,30,8 + CTEXT "8 khz",-1,90,72,30,8 + CTEXT "reverb",-1,150,72,30,8 + CONTROL "Apply effects to final output instead of file",30,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,5,87,150,10 +END diff --git a/bass-sys/bass24/c/fxtest/fxtest.vcproj b/bass-sys/bass24/c/fxtest/fxtest.vcproj new file mode 100644 index 0000000..9d1ffa6 --- /dev/null +++ b/bass-sys/bass24/c/fxtest/fxtest.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/fxtest/fxtest.vcxproj b/bass-sys/bass24/c/fxtest/fxtest.vcxproj new file mode 100644 index 0000000..6ee80d9 --- /dev/null +++ b/bass-sys/bass24/c/fxtest/fxtest.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {46119084-C4AA-4240-A2D6-A6AFC1A82106} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;comctl32.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;comctl32.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/fxtest/makefile b/bass-sys/bass24/c/fxtest/makefile new file mode 100644 index 0000000..127f4ea --- /dev/null +++ b/bass-sys/bass24/c/fxtest/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = fxtest.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 -lcomctl32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/livefx/livefx.c b/bass-sys/bass24/c/livefx/livefx.c new file mode 100644 index 0000000..fb5e198 --- /dev/null +++ b/bass-sys/bass24/c/livefx/livefx.c @@ -0,0 +1,227 @@ +/* + BASS full-duplex test + Copyright (c) 2002-2014 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include "bass.h" + +HWND win = NULL; + +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)(w),(LPARAM)(l)) + +HRECORD rchan; // recording channel +HSTREAM chan; // playback stream +HFX fx[4] = { 0 }; // FX handles +int chunk; // recording chunk size +int input; // current input source +int latency = 0; // current latency + +#define SAMPLERATE 44100 +#define ADJUSTRATE // adjust the output rate (in case input and output devices are going at slightly different speeds) + +DWORD rate; // current output rate +DWORD prebuf; // prebuffering amount +#ifdef ADJUSTRATE +DWORD targbuf; // target buffer level +DWORD prevbuf; // previous buffer level/threshold +#endif + +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +BOOL CALLBACK RecordingCallback(HRECORD handle, const void *buffer, DWORD length, void *user) +{ + DWORD bl; + BASS_StreamPutData(chan, buffer, length); // feed recorded data to output stream + bl = BASS_ChannelGetData(chan, NULL, BASS_DATA_AVAILABLE); // get output buffer level + if (prebuf) { // prebuffering + if (bl >= prebuf + length) { // gone 1 block past the prebuffering target +#ifdef ADJUSTRATE + targbuf = bl; // target the current level + prevbuf = 0; +#endif + prebuf = 0; // finished prebuffering + BASS_ChannelPlay(chan, FALSE); // start the output + } + } else { // playing +#ifdef ADJUSTRATE + if (bl < targbuf) { // buffer level is below target, slow down... + rate--; + BASS_ChannelSetAttribute(chan, BASS_ATTRIB_FREQ, rate); + prevbuf = 0; + } else if (bl > targbuf && bl >= prevbuf) { // buffer level is high and not falling, speed up... + rate++; + BASS_ChannelSetAttribute(chan, BASS_ATTRIB_FREQ, rate); + prevbuf = bl; + } +#endif + } + return TRUE; // continue recording +} + +BOOL Initialize() +{ + BASS_INFO bi; + + // initialize default output device (and measure latency) + if (!BASS_Init(-1, SAMPLERATE, BASS_DEVICE_LATENCY, win, NULL)) { + Error("Can't initialize output"); + return FALSE; + } + + BASS_GetInfo(&bi); + if (bi.dsver < 8) { // no DX8, so disable effect buttons + EnableWindow(GetDlgItem(win, 20), FALSE); + EnableWindow(GetDlgItem(win, 21), FALSE); + EnableWindow(GetDlgItem(win, 22), FALSE); + EnableWindow(GetDlgItem(win, 23), FALSE); + } + + // create a stream to play the recording + chan = BASS_StreamCreate(SAMPLERATE, 2, 0, STREAMPROC_PUSH, 0); + + rate = SAMPLERATE; + prebuf = BASS_ChannelSeconds2Bytes(chan, bi.minbuf / 1000.f); // prebuffer at least "minbuf" worth of data + + // start recording with 10ms period + if (!BASS_RecordInit(-1) || !(rchan = BASS_RecordStart(SAMPLERATE, 2, MAKELONG(0, 10), RecordingCallback, 0))) { + BASS_RecordFree(); + BASS_Free(); + Error("Can't initialize recording"); + return FALSE; + } + + { // get list of inputs + int c; + const char *i; + for (c = 0; i = BASS_RecordGetInputName(c); c++) { + float level; + MESS(10, CB_ADDSTRING, 0, i); + if (!(BASS_RecordGetInput(c, &level) & BASS_INPUT_OFF)) { // this 1 is currently "on" + input = c; + MESS(10, CB_SETCURSEL, input, 0); + MESS(11, TBM_SETPOS, TRUE, level * 100); // set level slider + } + } + } + + return TRUE; +} + +INT_PTR CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_TIMER: + { // display current latency (input+output buffer level) + char buf[20]; + latency = (latency * 3 + BASS_ChannelGetData(chan, NULL, BASS_DATA_AVAILABLE) + + BASS_ChannelGetData(rchan, NULL, BASS_DATA_AVAILABLE)) / 4; + sprintf(buf, "%d", (int)(BASS_ChannelBytes2Seconds(chan, latency) * 1000)); + MESS(15, WM_SETTEXT, 0, buf); + } + break; + + case WM_COMMAND: + switch (LOWORD(w)) { + case IDCANCEL: + EndDialog(h, 0); + break; + case 10: + if (HIWORD(w) == CBN_SELCHANGE) { // input selection changed + int i; + float level; + input = MESS(10, CB_GETCURSEL, 0, 0); // get the selection + for (i = 0; BASS_RecordSetInput(i, BASS_INPUT_OFF, -1); i++); // 1st disable all inputs, then... + BASS_RecordSetInput(input, BASS_INPUT_ON, -1); // enable the selected input + BASS_RecordGetInput(input, &level); // get the level + MESS(11, TBM_SETPOS, TRUE, level * 100); + } + break; + case 20: // toggle chorus + if (fx[0]) { + BASS_ChannelRemoveFX(chan, fx[0]); + fx[0] = 0; + } else + fx[0] = BASS_ChannelSetFX(chan, BASS_FX_DX8_CHORUS, 0); + break; + case 21: // toggle gargle + if (fx[1]) { + BASS_ChannelRemoveFX(chan, fx[1]); + fx[1] = 0; + } else + fx[1] = BASS_ChannelSetFX(chan, BASS_FX_DX8_GARGLE, 0); + break; + case 22: // toggle reverb + if (fx[2]) { + BASS_ChannelRemoveFX(chan, fx[2]); + fx[2] = 0; + } else + fx[2] = BASS_ChannelSetFX(chan, BASS_FX_DX8_REVERB, 0); + break; + case 23: // toggle flanger + if (fx[3]) { + BASS_ChannelRemoveFX(chan, fx[3]); + fx[3] = 0; + } else + fx[3] = BASS_ChannelSetFX(chan, BASS_FX_DX8_FLANGER, 0); + break; + } + break; + + case WM_HSCROLL: + if (l) { // set input source level + float level = SendMessage((HWND)l, TBM_GETPOS, 0, 0) / 100.f; + if (!BASS_RecordSetInput(input, 0, level)) // failed to set input level + BASS_RecordSetInput(-1, 0, level); // try master level instead + } + break; + + case WM_INITDIALOG: + win = h; + MESS(11, TBM_SETRANGE, FALSE, MAKELONG(0, 100)); // initialize input level slider + MessageBox(win, + "Do not set the input to 'WAVE' / 'What you hear' (etc...) with\n" + "the level set high, as that is likely to result in nasty feedback.\n", + "Feedback warning", MB_ICONWARNING); + if (!Initialize()) { + EndDialog(win, 0); + break; + } + SetTimer(h, 1, 250, NULL); + return 1; + + case WM_DESTROY: + KillTimer(h, 1); + // release it all + BASS_RecordFree(); + BASS_Free(); + break; + } + return 0; +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + { // enable trackbar support (for the level control) + INITCOMMONCONTROLSEX cc = { sizeof(cc),ICC_BAR_CLASSES }; + InitCommonControlsEx(&cc); + } + + DialogBox(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc); + + return 0; +} diff --git a/bass-sys/bass24/c/livefx/livefx.dsp b/bass-sys/bass24/c/livefx/livefx.dsp new file mode 100644 index 0000000..bd5d9cb --- /dev/null +++ b/bass-sys/bass24/c/livefx/livefx.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="livefx" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=livefx - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "livefx.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "livefx.mak" CFG="livefx - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "livefx - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comctl32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comctl32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "livefx - Win32 Release" +# Begin Source File + +SOURCE=livefx.c +# End Source File +# Begin Source File + +SOURCE=livefx.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/livefx/livefx.rc b/bass-sys/bass24/c/livefx/livefx.rc new file mode 100644 index 0000000..58a1be9 --- /dev/null +++ b/bass-sys/bass24/c/livefx/livefx.rc @@ -0,0 +1,21 @@ +#include "windows.h" + +1000 DIALOG DISCARDABLE 200, 100, 220, 31 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS full-duplex test with effects" +FONT 8, "MS Sans Serif" +BEGIN + COMBOBOX 10,5,5,65,72,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "",11,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | + WS_TABSTOP,5,20,65,10 + CTEXT "latency",-1,80,2,40,8 + CTEXT "",15,80,12,40,13,SS_CENTERIMAGE | SS_SUNKEN + CONTROL "Chorus",20,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,5, + 38,10 + CONTROL "Gargle",21,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 130,18,38,10 + CONTROL "Reverb",22,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,175,5, + 39,10 + CONTROL "Flanger",23,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,175, + 18,39,10 +END diff --git a/bass-sys/bass24/c/livefx/livefx.vcproj b/bass-sys/bass24/c/livefx/livefx.vcproj new file mode 100644 index 0000000..8b21068 --- /dev/null +++ b/bass-sys/bass24/c/livefx/livefx.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/livefx/livefx.vcxproj b/bass-sys/bass24/c/livefx/livefx.vcxproj new file mode 100644 index 0000000..bc6d2d5 --- /dev/null +++ b/bass-sys/bass24/c/livefx/livefx.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {0C580261-3DF5-4160-BE1A-17BCC66BEE8C} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;comctl32.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;comctl32.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/livefx/makefile b/bass-sys/bass24/c/livefx/makefile new file mode 100644 index 0000000..ca1e9c1 --- /dev/null +++ b/bass-sys/bass24/c/livefx/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = livefx.exe +FLAGS += -mwindows +LIBS += -lcomctl32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/livespec/livespec.c b/bass-sys/bass24/c/livespec/livespec.c new file mode 100644 index 0000000..dc5f37e --- /dev/null +++ b/bass-sys/bass24/c/livespec/livespec.c @@ -0,0 +1,233 @@ +/* + BASS "live" spectrum analyser example + Copyright (c) 2002-2014 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include "bass.h" + +#define SPECWIDTH 368 // display width +#define SPECHEIGHT 127 // height (changing requires palette adjustments too) + +HWND win = NULL; +DWORD timer = 0; + +HRECORD chan; // recording channel + +HDC specdc = 0; +HBITMAP specbmp = 0; +BYTE *specbuf; + +int specmode = 0, specpos = 0; // spectrum mode (and marker pos for 3D mode) + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +// update the spectrum display - the interesting bit :) +void CALLBACK UpdateSpectrum(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) +{ + static DWORD quietcount = 0; + HDC dc; + int x, y, y1; + + if (specmode == 3) { // waveform + short buf[SPECWIDTH]; + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT); + BASS_ChannelGetData(chan, buf, sizeof(buf)); // get the sample data + for (x = 0; x < SPECWIDTH; x++) { + int v = (32767 - buf[x]) * SPECHEIGHT / 65536; // invert and scale to fit display + if (!x) y = v; + do { // draw line from previous sample... + if (y < v) y++; + else if (y > v) y--; + specbuf[y * SPECWIDTH + x] = abs(y - SPECHEIGHT / 2) * 2 + 1; + } while (y != v); + } + } else { + float fft[1024]; + BASS_ChannelGetData(chan, fft, BASS_DATA_FFT2048); // get the FFT data + + if (!specmode) { // "normal" FFT + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT); + for (x = 0; x < SPECWIDTH / 2; x++) { +#if 1 + y = sqrt(fft[x + 1]) * 3 * SPECHEIGHT - 4; // scale it (sqrt to make low values more visible) +#else + y = fft[x + 1] * 10 * SPECHEIGHT; // scale it (linearly) +#endif + if (y > SPECHEIGHT) y = SPECHEIGHT; // cap it + if (x && (y1 = (y + y1) / 2)) // interpolate from previous to make the display smoother + while (--y1 >= 0) specbuf[y1 * SPECWIDTH + x * 2 - 1] = y1 + 1; + y1 = y; + while (--y >= 0) specbuf[y * SPECWIDTH + x * 2] = y + 1; // draw level + } + } else if (specmode == 1) { // logarithmic, combine bins + int b0 = 0; + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT); +#define BANDS 28 + for (x = 0; x < BANDS; x++) { + float peak = 0; + int b1 = pow(2, x * 10.0 / (BANDS - 1)); + if (b1 <= b0) b1 = b0 + 1; // make sure it uses at least 1 FFT bin + if (b1 > 1023) b1 = 1023; + for (; b0 < b1; b0++) + if (peak < fft[1 + b0]) peak = fft[1 + b0]; + y = sqrt(peak) * 3 * SPECHEIGHT - 4; // scale it (sqrt to make low values more visible) + if (y > SPECHEIGHT) y = SPECHEIGHT; // cap it + while (--y >= 0) + memset(specbuf + y * SPECWIDTH + x * (SPECWIDTH / BANDS), y + 1, SPECWIDTH / BANDS - 2); // draw bar + } + } else { // "3D" + for (x = 0; x < SPECHEIGHT; x++) { + y = sqrt(fft[x + 1]) * 3 * 127; // scale it (sqrt to make low values more visible) + if (y > 127) y = 127; // cap it + specbuf[x * SPECWIDTH + specpos] = 128 + y; // plot it + } + // move marker onto next position + specpos = (specpos + 1) % SPECWIDTH; + for (x = 0; x < SPECHEIGHT; x++) specbuf[x * SPECWIDTH + specpos] = 255; + } + } + + // update the display + dc = GetDC(win); + BitBlt(dc, 0, 0, SPECWIDTH, SPECHEIGHT, specdc, 0, 0, SRCCOPY); + if (LOWORD(BASS_ChannelGetLevel(chan)) < 1000) { // check if it's quiet + quietcount++; + if (quietcount > 40 && (quietcount & 16)) { // it's been quiet for over a second + RECT r = { 0,0,SPECWIDTH,SPECHEIGHT }; + SetTextColor(dc, 0xffffff); + SetBkMode(dc, TRANSPARENT); + DrawText(dc, "make some noise!", -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE); + } + } else + quietcount = 0; // not quiet + ReleaseDC(win, dc); +} + +// Recording callback - not doing anything with the data +BOOL CALLBACK DuffRecording(HRECORD handle, const void *buffer, DWORD length, void *user) +{ + return TRUE; // continue recording +} + +// window procedure +LRESULT CALLBACK SpectrumWindowProc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_PAINT: + if (GetUpdateRect(h, 0, 0)) { + PAINTSTRUCT p; + HDC dc; + if (!(dc = BeginPaint(h, &p))) return 0; + BitBlt(dc, 0, 0, SPECWIDTH, SPECHEIGHT, specdc, 0, 0, SRCCOPY); + EndPaint(h, &p); + } + return 0; + + case WM_LBUTTONUP: + specmode = (specmode + 1) % 4; // change spectrum mode + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT); // clear display + return 0; + + case WM_CREATE: + win = h; + // initialize default recording device + if (!BASS_RecordInit(-1)) { + Error("Can't initialize device"); + return -1; + } + // start recording (44100hz mono 16-bit) + if (!(chan = BASS_RecordStart(44100, 1, 0, &DuffRecording, 0))) { + Error("Can't start recording"); + return -1; + } + + { // create bitmap to draw spectrum in (8 bit for easy updating) + BYTE data[2000] = { 0 }; + BITMAPINFOHEADER *bh = (BITMAPINFOHEADER*)data; + RGBQUAD *pal = (RGBQUAD*)(data + sizeof(*bh)); + int a; + bh->biSize = sizeof(*bh); + bh->biWidth = SPECWIDTH; + bh->biHeight = SPECHEIGHT; // upside down (line 0=bottom) + bh->biPlanes = 1; + bh->biBitCount = 8; + bh->biClrUsed = bh->biClrImportant = 256; + // setup palette + for (a = 1; a < 128; a++) { + pal[a].rgbGreen = 256 - 2 * a; + pal[a].rgbRed = 2 * a; + } + for (a = 0; a < 32; a++) { + pal[128 + a].rgbBlue = 8 * a; + pal[128 + 32 + a].rgbBlue = 255; + pal[128 + 32 + a].rgbRed = 8 * a; + pal[128 + 64 + a].rgbRed = 255; + pal[128 + 64 + a].rgbBlue = 8 * (31 - a); + pal[128 + 64 + a].rgbGreen = 8 * a; + pal[128 + 96 + a].rgbRed = 255; + pal[128 + 96 + a].rgbGreen = 255; + pal[128 + 96 + a].rgbBlue = 8 * a; + } + // create the bitmap + specbmp = CreateDIBSection(0, (BITMAPINFO*)bh, DIB_RGB_COLORS, (void**)&specbuf, NULL, 0); + specdc = CreateCompatibleDC(0); + SelectObject(specdc, specbmp); + } + // start update timer (40hz) + timer = timeSetEvent(25, 25, (LPTIMECALLBACK)&UpdateSpectrum, 0, TIME_PERIODIC); + break; + + case WM_DESTROY: + if (timer) timeKillEvent(timer); + BASS_RecordFree(); + if (specdc) DeleteDC(specdc); + if (specbmp) DeleteObject(specbmp); + PostQuitMessage(0); + break; + } + return DefWindowProc(h, m, w, l); +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + WNDCLASS wc = { 0 }; + MSG msg; + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + // register window class and create the window + wc.lpfnWndProc = SpectrumWindowProc; + wc.hInstance = hInstance; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.lpszClassName = "BASS-Spectrum"; + if (!RegisterClass(&wc) || !CreateWindow("BASS-Spectrum", + "BASS \"live\" spectrum (click to switch mode)", + WS_POPUPWINDOW | WS_CAPTION | WS_VISIBLE, 200, 200, + SPECWIDTH + 2 * GetSystemMetrics(SM_CXDLGFRAME), + SPECHEIGHT + GetSystemMetrics(SM_CYCAPTION) + 2 * GetSystemMetrics(SM_CYDLGFRAME), + NULL, NULL, hInstance, NULL)) { + Error("Can't create window"); + return 0; + } + ShowWindow(win, SW_SHOWNORMAL); + + while (GetMessage(&msg, NULL, 0, 0) > 0) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + return 0; +} diff --git a/bass-sys/bass24/c/livespec/livespec.dsp b/bass-sys/bass24/c/livespec/livespec.dsp new file mode 100644 index 0000000..96cf92b --- /dev/null +++ b/bass-sys/bass24/c/livespec/livespec.dsp @@ -0,0 +1,53 @@ +# Microsoft Developer Studio Project File - Name="livespec" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=livespec - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "livespec.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "livespec.mak" CFG="livespec - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "livespec - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winmm.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "livespec - Win32 Release" +# Begin Source File + +SOURCE=livespec.c +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/livespec/livespec.vcproj b/bass-sys/bass24/c/livespec/livespec.vcproj new file mode 100644 index 0000000..d9364f8 --- /dev/null +++ b/bass-sys/bass24/c/livespec/livespec.vcproj @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/livespec/livespec.vcxproj b/bass-sys/bass24/c/livespec/livespec.vcxproj new file mode 100644 index 0000000..5a0b157 --- /dev/null +++ b/bass-sys/bass24/c/livespec/livespec.vcxproj @@ -0,0 +1,72 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {6AAE12B9-8731-4CDE-BD76-EC5B4EC5AE48} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;winmm.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;winmm.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/livespec/makefile b/bass-sys/bass24/c/livespec/makefile new file mode 100644 index 0000000..6a1b355 --- /dev/null +++ b/bass-sys/bass24/c/livespec/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = livespec.exe +FLAGS += -mwindows +LIBS += -lgdi32 -lwinmm + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/makefile b/bass-sys/bass24/c/makefile new file mode 100644 index 0000000..a5c4548 --- /dev/null +++ b/bass-sys/bass24/c/makefile @@ -0,0 +1,11 @@ +EXAMPLES = 3dtest basstest contest custloop devlist dsptest fxtest livefx livespec modtest multi netradio plugins rectest speakers spectrum synth writewav + +.PHONY: all clean $(EXAMPLES) + +all: $(EXAMPLES) + +clean: + @$(foreach x,$(EXAMPLES),$(MAKE) -C $(x) clean;) + +$(EXAMPLES): + $(MAKE) -C $@ diff --git a/bass-sys/bass24/c/makefile.in b/bass-sys/bass24/c/makefile.in new file mode 100644 index 0000000..afe8fd5 --- /dev/null +++ b/bass-sys/bass24/c/makefile.in @@ -0,0 +1,17 @@ +FLAGS = -Os -I.. -L.. +LIBS = -lbass +OUTDIR = ..\bin + +CC = gcc +RM = del +RES = windres + +%.exe: %.c %.rc + $(RES) -i $*.rc -o rsrc.obj + $(CC) $(FLAGS) $*.c rsrc.obj $(LIBS) -o $(OUTDIR)\$@ + $(RM) rsrc.obj + +%.exe: %.c + $(CC) $(FLAGS) $*.c $(LIBS) -o $(OUTDIR)\$@ + +.PHONY: all clean diff --git a/bass-sys/bass24/c/modtest/makefile b/bass-sys/bass24/c/modtest/makefile new file mode 100644 index 0000000..abb692e --- /dev/null +++ b/bass-sys/bass24/c/modtest/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = modtest.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/modtest/modtest.c b/bass-sys/bass24/c/modtest/modtest.c new file mode 100644 index 0000000..729dd3f --- /dev/null +++ b/bass-sys/bass24/c/modtest/modtest.c @@ -0,0 +1,192 @@ +/* + BASS MOD music test + Copyright (c) 1999-2014 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include "bass.h" + +HWND win = NULL; + +DWORD music; // the HMUSIC channel + +OPENFILENAME ofn; + +// display error messages +void Error(char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, "Error", 0); +} + +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)w,(LPARAM)l) + +DWORD GetFlags() +{ + DWORD flags = BASS_MUSIC_POSRESET; // stop notes when seeking + switch (MESS(21, CB_GETCURSEL, 0, 0)) { + case 0: + flags |= BASS_MUSIC_NONINTER; // no interpolation + break; + case 2: + flags |= BASS_MUSIC_SINCINTER; // sinc interpolation + break; + } + switch (MESS(22, CB_GETCURSEL, 0, 0)) { + case 1: + flags |= BASS_MUSIC_RAMP; // ramping + break; + case 2: + flags |= BASS_MUSIC_RAMPS; // "sensitive" ramping + break; + } + switch (MESS(23, CB_GETCURSEL, 0, 0)) { + case 1: + flags |= BASS_MUSIC_SURROUND; // surround + break; + case 2: + flags |= BASS_MUSIC_SURROUND2; // "mode2" + break; + } + return flags; +} + +INT_PTR CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_TIMER: + { // update display + char text[16]; + QWORD pos = BASS_ChannelGetPosition(music, BASS_POS_MUSIC_ORDER); + if (pos != (QWORD)-1) { + MESS(20, TBM_SETPOS, 1, LOWORD(pos)); + sprintf(text, "%03d.%03d", LOWORD(pos), HIWORD(pos)); + MESS(15, WM_SETTEXT, 0, text); + } + } + break; + + case WM_COMMAND: + switch (LOWORD(w)) { + case IDCANCEL: + EndDialog(h, 0); + break; + case 10: + { + char file[MAX_PATH] = ""; + ofn.lpstrFilter = "mo3/it/xm/s3m/mtm/mod/umx files\0*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx\0All files\0*.*\0\0"; + ofn.lpstrFile = file; + if (GetOpenFileName(&ofn)) { + BASS_MusicFree(music); // free the current music + music = BASS_MusicLoad(FALSE, file, 0, 0, GetFlags(), 1); // load the new music + if (music) { // success + DWORD length = BASS_ChannelGetLength(music, BASS_POS_MUSIC_ORDER); // get the order length + MESS(10, WM_SETTEXT, 0, file); + { + char text[100], *ctype = ""; + BASS_CHANNELINFO info; + int channels = 0; + while (BASS_ChannelGetAttributeEx(music, BASS_ATTRIB_MUSIC_VOL_CHAN + channels, 0, 0)) channels++; // count channels + BASS_ChannelGetInfo(music, &info); + switch (info.ctype & ~BASS_CTYPE_MUSIC_MO3) { + case BASS_CTYPE_MUSIC_MOD: + ctype = "MOD"; + break; + case BASS_CTYPE_MUSIC_MTM: + ctype = "MTM"; + break; + case BASS_CTYPE_MUSIC_S3M: + ctype = "S3M"; + break; + case BASS_CTYPE_MUSIC_XM: + ctype = "XM"; + break; + case BASS_CTYPE_MUSIC_IT: + ctype = "IT"; + break; + } + _snprintf(text, sizeof(text), "name: %s, format: %dch %s%s", BASS_ChannelGetTags(music, BASS_TAG_MUSIC_NAME), channels, ctype, info.ctype & BASS_CTYPE_MUSIC_MO3 ? " (MO3)" : ""); + MESS(11, WM_SETTEXT, 0, text); + } + MESS(20, TBM_SETRANGEMAX, 1, length - 1); // update scroller range + BASS_ChannelPlay(music, FALSE); // start it + } else { // failed + MESS(10, WM_SETTEXT, 0, "click here to open a file..."); + MESS(11, WM_SETTEXT, 0, ""); + MESS(15, WM_SETTEXT, 0, ""); + Error("Can't play the file"); + } + } + } + break; + case 12: + if (BASS_ChannelIsActive(music) == BASS_ACTIVE_PLAYING) + BASS_ChannelPause(music); + else + BASS_ChannelPlay(music, FALSE); + break; + case 21: + case 22: + case 23: + BASS_ChannelFlags(music, GetFlags(), -1); // update flags + break; + } + break; + + case WM_HSCROLL: + if (l && LOWORD(w) != SB_THUMBPOSITION && LOWORD(w) != SB_ENDSCROLL) { + int pos = SendMessage((HWND)l, TBM_GETPOS, 0, 0); + BASS_ChannelSetPosition(music, pos, BASS_POS_MUSIC_ORDER); // set the position + } + break; + + case WM_INITDIALOG: + win = h; + // initialize default output device + if (!BASS_Init(-1, 44100, 0, win, NULL)) { + Error("Can't initialize device"); + EndDialog(h, 0); + break; + } + memset(&ofn, 0, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = h; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY | OFN_EXPLORER; + MESS(21, CB_ADDSTRING, 0, "off"); + MESS(21, CB_ADDSTRING, 0, "linear"); + MESS(21, CB_ADDSTRING, 0, "sinc"); + MESS(21, CB_SETCURSEL, 1, 0); + MESS(22, CB_ADDSTRING, 0, "off"); + MESS(22, CB_ADDSTRING, 0, "normal"); + MESS(22, CB_ADDSTRING, 0, "sensitive"); + MESS(22, CB_SETCURSEL, 2, 0); + MESS(23, CB_ADDSTRING, 0, "off"); + MESS(23, CB_ADDSTRING, 0, "mode1"); + MESS(23, CB_ADDSTRING, 0, "mode2"); + MESS(23, CB_SETCURSEL, 0, 0); + SetTimer(win, 1, 100, NULL); + return 1; + + case WM_DESTROY: + BASS_Free(); + break; + } + return 0; +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + DialogBox(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc); + + return 0; +} diff --git a/bass-sys/bass24/c/modtest/modtest.dsp b/bass-sys/bass24/c/modtest/modtest.dsp new file mode 100644 index 0000000..0bd91a7 --- /dev/null +++ b/bass-sys/bass24/c/modtest/modtest.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="modtest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=modtest - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "modtest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "modtest.mak" CFG="modtest - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "modtest - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "modtest - Win32 Release" +# Begin Source File + +SOURCE=modtest.c +# End Source File +# Begin Source File + +SOURCE=modtest.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/modtest/modtest.rc b/bass-sys/bass24/c/modtest/modtest.rc new file mode 100644 index 0000000..9c853a4 --- /dev/null +++ b/bass-sys/bass24/c/modtest/modtest.rc @@ -0,0 +1,23 @@ +#include "windows.h" + +1000 DIALOG DISCARDABLE 100, 100, 200, 88 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS MOD music test" +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "click here to open a file...",10,5,5,190,14 + CTEXT "",11,5,21,190,8 + CTEXT "",15,20,34,45,10,SS_SUNKEN + PUSHBUTTON "Play / Pause",12,120,33,60,12 + CONTROL "Slider1",20,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | + WS_TABSTOP,5,48,190,12 + CTEXT "Interpolation",-1,22,61,45,8 + COMBOBOX 21,22,70,45,70,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP + CTEXT "Ramping",-1,77,61,45,8 + COMBOBOX 22,77,70,45,70,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP + CTEXT "Surround",-1,132,61,45,8 + COMBOBOX 23,132,70,45,70,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP +END diff --git a/bass-sys/bass24/c/modtest/modtest.vcproj b/bass-sys/bass24/c/modtest/modtest.vcproj new file mode 100644 index 0000000..072b55e --- /dev/null +++ b/bass-sys/bass24/c/modtest/modtest.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/modtest/modtest.vcxproj b/bass-sys/bass24/c/modtest/modtest.vcxproj new file mode 100644 index 0000000..81d573c --- /dev/null +++ b/bass-sys/bass24/c/modtest/modtest.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {9465CD7D-3DAC-472F-AA85-DD144AC094F7} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/multi/makefile b/bass-sys/bass24/c/multi/makefile new file mode 100644 index 0000000..abcf56f --- /dev/null +++ b/bass-sys/bass24/c/multi/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = multi.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/multi/multi.c b/bass-sys/bass24/c/multi/multi.c new file mode 100644 index 0000000..722bbf6 --- /dev/null +++ b/bass-sys/bass24/c/multi/multi.c @@ -0,0 +1,216 @@ +/* + BASS multiple output example + Copyright (c) 2001-2008 Un4seen Developments Ltd. +*/ + +#include +#include +#include + +#include "bass.h" + +HWND win = NULL; + +DWORD outdev[2]; // output devices +DWORD latency[2]; // latencies +HSTREAM chan[2]; // the streams + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +// Cloning DSP function +void CALLBACK CloneDSP(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user) +{ + BASS_StreamPutData((HSTREAM)user, buffer, length); // user = clone +} + +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)(w),(LPARAM)(l)) + +INT_PTR CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + static OPENFILENAME ofn; + + switch (m) { + case WM_COMMAND: + switch (LOWORD(w)) { + case IDCANCEL: + EndDialog(h, 0); + break; + case 10: // open a file to play on device #1 + case 11: // open a file to play on device #2 + { + int devn = LOWORD(w) - 10; + char file[MAX_PATH] = ""; + ofn.lpstrFilter = "streamable files\0*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif\0All files\0*.*\0\0"; + ofn.lpstrFile = file; + if (GetOpenFileName(&ofn)) { + BASS_StreamFree(chan[devn]); // free old stream + BASS_SetDevice(outdev[devn]); // set the device to create stream on + if (!(chan[devn] = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP))) { + MESS(10 + devn, WM_SETTEXT, 0, "click here to open a file..."); + Error("Can't play the file"); + break; + } + BASS_ChannelPlay(chan[devn], FALSE); // play new stream + MESS(10 + devn, WM_SETTEXT, 0, file); + } + } + break; + case 15: // clone on device #1 + case 16: // clone on device #2 + { + int devn = LOWORD(w) - 15; + BASS_CHANNELINFO i; + if (!BASS_ChannelGetInfo(chan[devn ^ 1], &i)) { + Error("Nothing to clone"); + break; + } + BASS_StreamFree(chan[devn]); // free old stream + BASS_SetDevice(outdev[devn]); // set the device to create stream on + if (!(chan[devn] = BASS_StreamCreate(i.freq, i.chans, i.flags, STREAMPROC_PUSH, 0))) { // create a "push" stream + MESS(10 + devn, WM_SETTEXT, 0, "click here to open a file..."); + Error("Can't create clone"); + break; + } + BASS_ChannelLock(chan[devn ^ 1], TRUE); // lock source stream to synchonise buffer contents + BASS_ChannelSetDSP(chan[devn ^ 1], CloneDSP, (void*)chan[devn], 0); // set DSP to feed data to clone + { // copy buffered data to clone + DWORD d = BASS_ChannelSeconds2Bytes(chan[devn], latency[devn] / 1000.f); // playback delay + DWORD c = BASS_ChannelGetData(chan[devn ^ 1], 0, BASS_DATA_AVAILABLE); + BYTE *buf = (BYTE*)malloc(c); + c = BASS_ChannelGetData(chan[devn ^ 1], buf, c); + if (c > d) BASS_StreamPutData(chan[devn], buf + d, c - d); + free(buf); + } + BASS_ChannelLock(chan[devn ^ 1], FALSE); // unlock source stream + BASS_ChannelPlay(chan[devn], FALSE); // play clone + MESS(10 + devn, WM_SETTEXT, 0, "clone"); + } + break; + case 30: // swap channel devices + { + { // swap handles + HSTREAM temp = chan[0]; + chan[0] = chan[1]; + chan[1] = temp; + } + { // swap text + char temp1[MAX_PATH], temp2[MAX_PATH]; + MESS(10, WM_GETTEXT, MAX_PATH, temp1); + MESS(11, WM_GETTEXT, MAX_PATH, temp2); + MESS(10, WM_SETTEXT, 0, temp2); + MESS(11, WM_SETTEXT, 0, temp1); + } + // update the channel devices + BASS_ChannelSetDevice(chan[0], outdev[0]); + BASS_ChannelSetDevice(chan[1], outdev[1]); + } + break; + } + break; + + case WM_INITDIALOG: + win = h; + memset(&ofn, 0, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = h; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY | OFN_EXPLORER; + { // initialize output devices + BASS_INFO info; + if (!BASS_Init(outdev[0], 44100, BASS_DEVICE_LATENCY, win, NULL)) { + Error("Can't initialize device 1"); + EndDialog(h, 0); + } + BASS_GetInfo(&info); + latency[0] = info.latency; + if (!BASS_Init(outdev[1], 44100, BASS_DEVICE_LATENCY, win, NULL)) { + Error("Can't initialize device 2"); + EndDialog(h, 0); + } + BASS_GetInfo(&info); + latency[1] = info.latency; + } + { + BASS_DEVICEINFO i; + BASS_GetDeviceInfo(outdev[0], &i); + MESS(20, WM_SETTEXT, 0, i.name); + BASS_GetDeviceInfo(outdev[1], &i); + MESS(21, WM_SETTEXT, 0, i.name); + } + return 1; + + case WM_DESTROY: + // release both devices + BASS_SetDevice(outdev[0]); + BASS_Free(); + BASS_SetDevice(outdev[1]); + BASS_Free(); + break; + } + return 0; +} + + +// Simple device selector dialog stuff begins here +INT_PTR CALLBACK devicedialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_COMMAND: + switch (LOWORD(w)) { + case 10: + if (HIWORD(w) != LBN_DBLCLK) break; + case IDOK: + { + int device = SendDlgItemMessage(h, 10, LB_GETCURSEL, 0, 0); + device = SendDlgItemMessage(h, 10, LB_GETITEMDATA, device, 0); // get device # + EndDialog(h, device); + } + break; + } + break; + + case WM_INITDIALOG: + { + char text[30]; + BASS_DEVICEINFO i; + int c; + sprintf(text, "Select output device #%d", l); + SetWindowText(h, text); + for (c = 1; BASS_GetDeviceInfo(c, &i); c++) { // device 1 = 1st real device + if (i.flags & BASS_DEVICE_ENABLED) { // enabled, so add it... + int idx = SendDlgItemMessage(h, 10, LB_ADDSTRING, 0, (LPARAM)i.name); + SendDlgItemMessage(h, 10, LB_SETITEMDATA, idx, c); // store device # + } + } + SendDlgItemMessage(h, 10, LB_SETCURSEL, 0, 0); + } + return 1; + } + return 0; +} +// Device selector stuff ends here + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + // Let the user choose the output devices + outdev[0] = DialogBoxParam(hInstance, MAKEINTRESOURCE(2000), NULL, devicedialogproc, 1); + outdev[1] = DialogBoxParam(hInstance, MAKEINTRESOURCE(2000), NULL, devicedialogproc, 2); + + // main dialog + DialogBox(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc); + + return 0; +} + diff --git a/bass-sys/bass24/c/multi/multi.dsp b/bass-sys/bass24/c/multi/multi.dsp new file mode 100644 index 0000000..c07cd6b --- /dev/null +++ b/bass-sys/bass24/c/multi/multi.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="multi" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=multi - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "multi.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "multi.mak" CFG="multi - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "multi - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "multi - Win32 Release" +# Begin Source File + +SOURCE=multi.c +# End Source File +# Begin Source File + +SOURCE=multi.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/multi/multi.rc b/bass-sys/bass24/c/multi/multi.rc new file mode 100644 index 0000000..a2e3565 --- /dev/null +++ b/bass-sys/bass24/c/multi/multi.rc @@ -0,0 +1,25 @@ +#include "windows.h" + +1000 DIALOG DISCARDABLE 100, 100, 260, 68 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS multiple output example" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "",20,5,2,250,29 + PUSHBUTTON "click here to open a file...",10,10,11,180,14 + GROUPBOX "",21,5,35,250,29 + PUSHBUTTON "click here to open a file...",11,10,44,180,14 + PUSHBUTTON "clone #2",15,195,11,40,14 + PUSHBUTTON "clone #1",16,195,44,40,14 + PUSHBUTTON "swap",30,225,27,25,14 +END + +2000 DIALOG DISCARDABLE 115, 100, 170, 60 +STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX 10,5,5,160,35,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,100,44,60,12 +END + diff --git a/bass-sys/bass24/c/multi/multi.vcproj b/bass-sys/bass24/c/multi/multi.vcproj new file mode 100644 index 0000000..5e033c5 --- /dev/null +++ b/bass-sys/bass24/c/multi/multi.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/multi/multi.vcxproj b/bass-sys/bass24/c/multi/multi.vcxproj new file mode 100644 index 0000000..a110ff0 --- /dev/null +++ b/bass-sys/bass24/c/multi/multi.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {305E5C8D-85DB-4E36-A82E-856BC9972413} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/netradio/makefile b/bass-sys/bass24/c/netradio/makefile new file mode 100644 index 0000000..116a95d --- /dev/null +++ b/bass-sys/bass24/c/netradio/makefile @@ -0,0 +1,9 @@ +include ..\makefile.in + +TARGET = netradio.exe +FLAGS += -mwindows + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/netradio/netradio.c b/bass-sys/bass24/c/netradio/netradio.c new file mode 100644 index 0000000..ef3a221 --- /dev/null +++ b/bass-sys/bass24/c/netradio/netradio.c @@ -0,0 +1,242 @@ +/* + BASS internet radio example + Copyright (c) 2002-2019 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include "bass.h" + +// HLS definitions (copied from BASSHLS.H) +#define BASS_SYNC_HLS_SEGMENT 0x10300 +#define BASS_TAG_HLS_EXTINF 0x14000 + +HWND win = NULL; +CRITICAL_SECTION lock; +DWORD req = 0; // request number/counter +HSTREAM chan; // stream handle + +const char *urls[10] = { // preset stream URLs + "http://stream-dc1.radioparadise.com/rp_192m.ogg", "http://www.radioparadise.com/m3u/mp3-32.m3u", + "http://network.absoluteradio.co.uk/core/audio/mp3/live.pls?service=a8bb", "http://network.absoluteradio.co.uk/core/audio/aacplus/live.pls?service=a8", + "http://somafm.com/secretagent.pls", "http://somafm.com/secretagent32.pls", + "http://somafm.com/suburbsofgoa.pls", "http://somafm.com/suburbsofgoa32.pls", + "http://ai-radio.org/256.ogg", "http://ai-radio.org/48.aacp" +}; + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)(w),(LPARAM)(l)) + +// update stream title from metadata +void DoMeta() +{ + const char *meta = BASS_ChannelGetTags(chan, BASS_TAG_META); + if (meta) { // got Shoutcast metadata + const char *p = strstr(meta, "StreamTitle='"); // locate the title + if (p) { + const char *p2 = strstr(p, "';"); // locate the end of it + if (p2) { + char *t = strdup(p + 13); + t[p2 - (p + 13)] = 0; + MESS(30, WM_SETTEXT, 0, t); + free(t); + } + } + } else { + meta = BASS_ChannelGetTags(chan, BASS_TAG_OGG); + if (meta) { // got Icecast/OGG tags + const char *artist = NULL, *title = NULL, *p = meta; + for (; *p; p += strlen(p) + 1) { + if (!strnicmp(p, "artist=", 7)) // found the artist + artist = p + 7; + if (!strnicmp(p, "title=", 6)) // found the title + title = p + 6; + } + if (title) { + if (artist) { + char text[100]; + _snprintf(text, sizeof(text), "%s - %s", artist, title); + MESS(30, WM_SETTEXT, 0, text); + } else + MESS(30, WM_SETTEXT, 0, title); + } + } else { + meta = BASS_ChannelGetTags(chan, BASS_TAG_HLS_EXTINF); + if (meta) { // got HLS segment info + const char *p = strchr(meta, ','); + if (p) MESS(30, WM_SETTEXT, 0, p + 1); + } + } + } +} + +void CALLBACK MetaSync(HSYNC handle, DWORD channel, DWORD data, void *user) +{ + DoMeta(); +} + +void CALLBACK StallSync(HSYNC handle, DWORD channel, DWORD data, void *user) +{ + if (!data) // stalled + SetTimer(win, 0, 50, 0); // start buffer monitoring +} + +void CALLBACK EndSync(HSYNC handle, DWORD channel, DWORD data, void *user) +{ + KillTimer(win, 0); // stop buffer monitoring + MESS(31, WM_SETTEXT, 0, "not playing"); + MESS(30, WM_SETTEXT, 0, ""); + MESS(32, WM_SETTEXT, 0, ""); +} + +void CALLBACK StatusProc(const void *buffer, DWORD length, void *user) +{ + if (buffer && !length && (DWORD)user == req) // got HTTP/ICY tags, and this is still the current request + MESS(32, WM_SETTEXT, 0, buffer); // display status +} + +void __cdecl OpenURL(void *url) +{ + DWORD c, r; + EnterCriticalSection(&lock); // make sure only 1 thread at a time can do the following + r = ++req; // increment the request counter for this request + LeaveCriticalSection(&lock); + KillTimer(win, 0); // stop buffer monitoring + BASS_StreamFree(chan); // close old stream + MESS(31, WM_SETTEXT, 0, "connecting..."); + MESS(30, WM_SETTEXT, 0, ""); + MESS(32, WM_SETTEXT, 0, ""); + c = BASS_StreamCreateURL(url, 0, BASS_STREAM_BLOCK | BASS_STREAM_STATUS | BASS_STREAM_AUTOFREE, StatusProc, (void*)r); // open URL + free(url); // free temp URL buffer + EnterCriticalSection(&lock); + if (r != req) { // there is a newer request, discard this stream + LeaveCriticalSection(&lock); + if (c) BASS_StreamFree(c); + return; + } + chan = c; // this is now the current stream + LeaveCriticalSection(&lock); + if (!chan) { // failed to open + MESS(31, WM_SETTEXT, 0, "not playing"); + Error("Can't play the stream"); + } else { + // start buffer monitoring + SetTimer(win, 0, 50, 0); + // set syncs for stream title updates + BASS_ChannelSetSync(chan, BASS_SYNC_META, 0, MetaSync, 0); // Shoutcast + BASS_ChannelSetSync(chan, BASS_SYNC_OGG_CHANGE, 0, MetaSync, 0); // Icecast/OGG + BASS_ChannelSetSync(chan, BASS_SYNC_HLS_SEGMENT, 0, MetaSync, 0); // HLS + // set sync for stalling/buffering + BASS_ChannelSetSync(chan, BASS_SYNC_STALL, 0, StallSync, 0); + // set sync for end of stream + BASS_ChannelSetSync(chan, BASS_SYNC_END, 0, EndSync, 0); + // play it! + BASS_ChannelPlay(chan, FALSE); + } +} + +INT_PTR CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_TIMER: + { // monitor buffering progress + if (BASS_ChannelIsActive(chan) == BASS_ACTIVE_PLAYING) { + KillTimer(win, 0); // finished buffering, stop monitoring + MESS(31, WM_SETTEXT, 0, "playing"); + { // get the broadcast name and URL + const char *icy = BASS_ChannelGetTags(chan, BASS_TAG_ICY); + if (!icy) icy = BASS_ChannelGetTags(chan, BASS_TAG_HTTP); // no ICY tags, try HTTP + if (icy) { + for (; *icy; icy += strlen(icy) + 1) { + if (!strnicmp(icy, "icy-name:", 9)) + MESS(31, WM_SETTEXT, 0, icy + 9); + if (!strnicmp(icy, "icy-url:", 8)) + MESS(32, WM_SETTEXT, 0, icy + 8); + } + } + } + // get the stream title + DoMeta(); + } else { + char text[32]; + sprintf(text, "buffering... %d%%", 100 - (int)BASS_StreamGetFilePosition(chan, BASS_FILEPOS_BUFFERING)); + MESS(31, WM_SETTEXT, 0, text); + } + } + break; + + case WM_COMMAND: + switch (LOWORD(w)) { + case IDCANCEL: + EndDialog(h, 0); + return 1; + default: + if ((LOWORD(w) >= 10 && LOWORD(w) < 20) || LOWORD(w) == 21) { + char *url; + if (LOWORD(w) == 21) { // custom stream URL + char temp[200]; + MESS(20, WM_GETTEXT, sizeof(temp), temp); + url = strdup(temp); + } else // preset + url = strdup(urls[LOWORD(w) - 10]); + if (MESS(41, BM_GETCHECK, 0, 0)) + BASS_SetConfigPtr(BASS_CONFIG_NET_PROXY, NULL); // disable proxy + else { + char proxy[100]; + GetDlgItemText(win, 40, proxy, sizeof(proxy) - 1); + proxy[sizeof(proxy) - 1] = 0; + BASS_SetConfigPtr(BASS_CONFIG_NET_PROXY, proxy); // set proxy server + } + // open URL in a new thread (so that main thread is free) + _beginthread(OpenURL, 0, url); + } + } + break; + + case WM_INITDIALOG: + win = h; + // initialize default output device + if (!BASS_Init(-1, 44100, 0, win, NULL)) { + Error("Can't initialize device"); + EndDialog(win, 0); + break; + } + InitializeCriticalSection(&lock); + MESS(20, WM_SETTEXT, 0, "http://"); + return 1; + + case WM_DESTROY: + BASS_Free(); + break; + } + return 0; +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1); // enable playlist processing + BASS_SetConfig(BASS_CONFIG_NET_PREBUF_WAIT, 0); // disable BASS_StreamCreateURL pre-buffering + + BASS_PluginLoad("bass_aac.dll", 0); // load BASS_AAC (if present) for AAC support on older Windows + BASS_PluginLoad("bassflac.dll", 0); // load BASSFLAC (if present) for FLAC support + BASS_PluginLoad("basshls.dll", 0); // load BASSHLS (if present) for HLS support + + // display the window + DialogBox(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc); + + return 0; +} diff --git a/bass-sys/bass24/c/netradio/netradio.dsp b/bass-sys/bass24/c/netradio/netradio.dsp new file mode 100644 index 0000000..9ea140f --- /dev/null +++ b/bass-sys/bass24/c/netradio/netradio.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="netradio" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=netradio - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "netradio.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "netradio.mak" CFG="netradio - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "netradio - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "netradio - Win32 Release" +# Begin Source File + +SOURCE=netradio.c +# End Source File +# Begin Source File + +SOURCE=netradio.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/netradio/netradio.rc b/bass-sys/bass24/c/netradio/netradio.rc new file mode 100644 index 0000000..2b2e749 --- /dev/null +++ b/bass-sys/bass24/c/netradio/netradio.rc @@ -0,0 +1,33 @@ +#include "windows.h" + +1000 DIALOG DISCARDABLE 200, 50, 195, 185 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS internet radio tuner" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Presets",-1,5,2,185,45 + LTEXT "High bitrate",-1,10,15,48,8 + LTEXT "Low bitrate",-1,10,30,48,8 + PUSHBUTTON "1",10,60,11,20,15 + PUSHBUTTON "1",11,60,27,20,15 + PUSHBUTTON "2",12,86,11,20,15 + PUSHBUTTON "2",13,86,27,20,15 + PUSHBUTTON "3",14,112,11,20,15 + PUSHBUTTON "3",15,112,27,20,15 + PUSHBUTTON "4",16,138,11,20,15 + PUSHBUTTON "4",17,138,27,20,15 + PUSHBUTTON "5",18,164,11,20,15 + PUSHBUTTON "5",19,164,27,20,15 + GROUPBOX "Custom",-1,5,50,185,28 + EDITTEXT 20,10,60,145,12,ES_AUTOHSCROLL + PUSHBUTTON "open",21,160,60,25,12 + GROUPBOX "Currently playing",-1,5,81,185,57 + CTEXT "",30,10,91,175,16,SS_NOPREFIX + CTEXT "not playing",31,10,109,175,16,SS_NOPREFIX + CTEXT "",32,10,127,175,8,SS_NOPREFIX + GROUPBOX "Proxy server",-1,5,141,185,40 + EDITTEXT 40,10,151,175,12,ES_AUTOHSCROLL + LTEXT "[user:pass@]server:port",-1,109,165,76,8 + CONTROL "Direct connection",41,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,15,167,72,10 +END diff --git a/bass-sys/bass24/c/netradio/netradio.vcproj b/bass-sys/bass24/c/netradio/netradio.vcproj new file mode 100644 index 0000000..e70ebf3 --- /dev/null +++ b/bass-sys/bass24/c/netradio/netradio.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/netradio/netradio.vcxproj b/bass-sys/bass24/c/netradio/netradio.vcxproj new file mode 100644 index 0000000..b715300 --- /dev/null +++ b/bass-sys/bass24/c/netradio/netradio.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {DFA5AC9E-4073-4555-92E8-E4808EE32B43} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/plugins/makefile b/bass-sys/bass24/c/plugins/makefile new file mode 100644 index 0000000..29bf340 --- /dev/null +++ b/bass-sys/bass24/c/plugins/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = plugins.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/plugins/plugins.c b/bass-sys/bass24/c/plugins/plugins.c new file mode 100644 index 0000000..73dda51 --- /dev/null +++ b/bass-sys/bass24/c/plugins/plugins.c @@ -0,0 +1,179 @@ +/* + BASS plugin test + Copyright (c) 2005-2011 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include "bass.h" + +HWND win = NULL; + +DWORD chan; // the channel + +OPENFILENAME ofn; +char filter[2000]; + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +// translate a CTYPE value to text +const char *GetCTypeString(DWORD ctype, HPLUGIN plugin) +{ + if (plugin) { // using a plugin + const BASS_PLUGININFO *pinfo = BASS_PluginGetInfo(plugin); // get plugin info + int a; + for (a = 0; a < pinfo->formatc; a++) { + if (pinfo->formats[a].ctype == ctype) // found a "ctype" match... + return pinfo->formats[a].name; // return its name + } + } + // check built-in stream formats... + if (ctype == BASS_CTYPE_STREAM_OGG) return "Ogg Vorbis"; + if (ctype == BASS_CTYPE_STREAM_MP1) return "MPEG layer 1"; + if (ctype == BASS_CTYPE_STREAM_MP2) return "MPEG layer 2"; + if (ctype == BASS_CTYPE_STREAM_MP3) return "MPEG layer 3"; + if (ctype == BASS_CTYPE_STREAM_AIFF) return "Audio IFF"; + if (ctype == BASS_CTYPE_STREAM_WAV_PCM) return "PCM WAVE"; + if (ctype == BASS_CTYPE_STREAM_WAV_FLOAT) return "Floating-point WAVE"; + if (ctype == BASS_CTYPE_STREAM_MF) { // a Media Foundation codec, check the format... + const WAVEFORMATEX *wf = (WAVEFORMATEX*)BASS_ChannelGetTags(chan, BASS_TAG_WAVEFORMAT); + if (wf->wFormatTag == 0x1610) return "Advanced Audio Coding"; + if (wf->wFormatTag >= 0x0160 && wf->wFormatTag <= 0x0163) return "Windows Media Audio"; + } + if (ctype & BASS_CTYPE_STREAM_WAV) // other WAVE codec, could use acmFormatTagDetails to get its name, but for now... + return "WAVE"; + return "?"; +} + +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)(w),(LPARAM)(l)) + +INT_PTR CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_COMMAND: + switch (LOWORD(w)) { + case IDCANCEL: + EndDialog(h, 0); + break; + case 10: + { + char file[MAX_PATH] = ""; + ofn.lpstrFile = file; + ofn.nMaxFile = MAX_PATH; + if (GetOpenFileName(&ofn)) { + BASS_StreamFree(chan); // free the old stream + if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP))) { + // it ain't playable + MESS(10, WM_SETTEXT, 0, "click here to open a file..."); + MESS(11, WM_SETTEXT, 0, ""); + Error("Can't play the file"); + break; + } + MESS(10, WM_SETTEXT, 0, file); + { // display the file type and length + QWORD bytes = BASS_ChannelGetLength(chan, BASS_POS_BYTE); + DWORD time = BASS_ChannelBytes2Seconds(chan, bytes); + BASS_CHANNELINFO info; + BASS_ChannelGetInfo(chan, &info); + sprintf(file, "channel type = %x (%s)\nlength = %I64u (%u:%02u)", + info.ctype, GetCTypeString(info.ctype, info.plugin), bytes, time / 60, time % 60); + MESS(11, WM_SETTEXT, 0, file); + MESS(12, TBM_SETRANGEMAX, 1, time); // update scroller range + } + BASS_ChannelPlay(chan, FALSE); + } + } + break; + } + break; + + case WM_HSCROLL: + if (l && LOWORD(w) != SB_THUMBPOSITION && LOWORD(w) != SB_ENDSCROLL) { // set the position + int pos = SendMessage((HWND)l, TBM_GETPOS, 0, 0); + BASS_ChannelSetPosition(chan, BASS_ChannelSeconds2Bytes(chan, pos), BASS_POS_BYTE); + } + break; + + case WM_TIMER: + MESS(12, TBM_SETPOS, 1, (DWORD)BASS_ChannelBytes2Seconds(chan, BASS_ChannelGetPosition(chan, BASS_POS_BYTE))); // update position + break; + + case WM_INITDIALOG: + win = h; + // initialize default output device + if (!BASS_Init(-1, 44100, 0, win, NULL)) { + Error("Can't initialize device"); + EndDialog(h, 0); + break; + } + // initialize file selector + memset(&ofn, 0, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = h; + ofn.Flags = OFN_HIDEREADONLY | OFN_EXPLORER; + ofn.lpstrFilter = filter; + memcpy(filter, "BASS built-in formats (*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif)\0*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif\0", 96); + { // look for plugins (in the executable's directory) + WIN32_FIND_DATA fd; + HANDLE fh; + char path[MAX_PATH], *fp = filter + 96; + GetModuleFileName(0, path, sizeof(path)); + strcpy(strrchr(path, '\\') + 1, "bass*.dll"); + fh = FindFirstFile(path, &fd); + if (fh != INVALID_HANDLE_VALUE) { + do { + HPLUGIN plug; + if (plug = BASS_PluginLoad(fd.cFileName, 0)) { // plugin loaded... + const BASS_PLUGININFO *pinfo = BASS_PluginGetInfo(plug); // get plugin info to add to the file selector filter... + int a; + for (a = 0; a < pinfo->formatc; a++) { + fp += sprintf(fp, "%s (%s) - %s", pinfo->formats[a].name, pinfo->formats[a].exts, fd.cFileName) + 1; // format description + fp += sprintf(fp, "%s", pinfo->formats[a].exts) + 1; // extension filter + } + // add plugin to the list + MESS(20, LB_ADDSTRING, 0, fd.cFileName); + } + } while (FindNextFile(fh, &fd)); + FindClose(fh); + } + if (!MESS(20, LB_GETCOUNT, 0, 0)) // no plugins... + MESS(20, LB_ADDSTRING, 0, "no plugins - visit the BASS webpage to get some"); + // check if Media Foundation is available + if (!BASS_GetConfig(BASS_CONFIG_MF_DISABLE)) { + fp += sprintf(fp, "Media Foundation formats (*.aac;*.m4a;*.mp4;*.wma)") + 1; + fp += sprintf(fp, "*.aac;*.m4a;*.mp4;*.wma") + 1; + } + memcpy(fp, "All files\0*.*\0\0", 15); + } + SetTimer(h, 0, 500, 0); // timer to update the position + return 1; + + case WM_DESTROY: + // "free" the output device and all plugins + BASS_Free(); + BASS_PluginFree(0); + break; + } + return 0; +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + DialogBox(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc); + + return 0; +} diff --git a/bass-sys/bass24/c/plugins/plugins.dsp b/bass-sys/bass24/c/plugins/plugins.dsp new file mode 100644 index 0000000..af408f3 --- /dev/null +++ b/bass-sys/bass24/c/plugins/plugins.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="plugins" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=plugins - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "plugins.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "plugins.mak" CFG="plugins - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "plugins - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "plugins - Win32 Release" +# Begin Source File + +SOURCE=plugins.c +# End Source File +# Begin Source File + +SOURCE=plugins.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/plugins/plugins.rc b/bass-sys/bass24/c/plugins/plugins.rc new file mode 100644 index 0000000..c4d33da --- /dev/null +++ b/bass-sys/bass24/c/plugins/plugins.rc @@ -0,0 +1,15 @@ +#include "windows.h" + +1000 DIALOG DISCARDABLE 100, 100, 200, 122 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS plugin test" +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "click here to open a file...",10,5,67,190,14 + GROUPBOX "Loaded plugins",-1,5,3,190,59 + LISTBOX 20,10,13,180,43,LBS_SORT | LBS_NOINTEGRALHEIGHT | + LBS_NOSEL | WS_VSCROLL + CTEXT "",11,10,85,180,17 + CONTROL "Slider1",12,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | + WS_TABSTOP,15,103,170,15 +END diff --git a/bass-sys/bass24/c/plugins/plugins.vcproj b/bass-sys/bass24/c/plugins/plugins.vcproj new file mode 100644 index 0000000..79d0e99 --- /dev/null +++ b/bass-sys/bass24/c/plugins/plugins.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/plugins/plugins.vcxproj b/bass-sys/bass24/c/plugins/plugins.vcxproj new file mode 100644 index 0000000..5625e30 --- /dev/null +++ b/bass-sys/bass24/c/plugins/plugins.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {9465CD7D-3DAC-472F-AA85-DD144AC094F0} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/rectest/makefile b/bass-sys/bass24/c/rectest/makefile new file mode 100644 index 0000000..b0f8ef9 --- /dev/null +++ b/bass-sys/bass24/c/rectest/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = rectest.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 -lcomctl32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/rectest/rectest.c b/bass-sys/bass24/c/rectest/rectest.c new file mode 100644 index 0000000..1576f46 --- /dev/null +++ b/bass-sys/bass24/c/rectest/rectest.c @@ -0,0 +1,335 @@ +/* + BASS recording example + Copyright (c) 2002-2019 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include "bass.h" + +HWND win = NULL; + +#define FREQ 44100 +#define CHANS 2 +#define BUFSTEP 200000 // memory allocation unit + +int input; // current input source +BYTE *recbuf = NULL; // recording buffer +DWORD reclen; // recording length +HRECORD rchan = 0; // recording channel +HSTREAM chan = 0; // playback channel + +void StopRecording(); + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +// messaging macros +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)(w),(LPARAM)(l)) +#define DLGITEM(id) GetDlgItem(win,id) + +// buffer the recorded data +BOOL CALLBACK RecordingCallback(HRECORD handle, const void *buffer, DWORD length, void *user) +{ + // increase buffer size if needed + if ((reclen % BUFSTEP) + length >= BUFSTEP) { + recbuf = realloc(recbuf, ((reclen + length) / BUFSTEP + 1) * BUFSTEP); + if (!recbuf) { + rchan = 0; + Error("Out of memory!"); + MESS(10, WM_SETTEXT, 0, "Record"); + return FALSE; // stop recording + } + } + // buffer the data + memcpy(recbuf + reclen, buffer, length); + reclen += length; + return TRUE; // continue recording +} + +void StartRecording() +{ + WAVEFORMATEX *wf; + if (recbuf) { // free old recording + BASS_StreamFree(chan); + chan = 0; + free(recbuf); + recbuf = NULL; + EnableWindow(DLGITEM(11), FALSE); + EnableWindow(DLGITEM(12), FALSE); + } + // allocate initial buffer and make space for WAVE header + recbuf = malloc(BUFSTEP); + reclen = 44; + // fill the WAVE header + memcpy(recbuf, "RIFF\0\0\0\0WAVEfmt \20\0\0\0", 20); + memcpy(recbuf + 36, "data\0\0\0\0", 8); + wf = (WAVEFORMATEX*)(recbuf + 20); + wf->wFormatTag = 1; + wf->nChannels = CHANS; + wf->wBitsPerSample = 16; + wf->nSamplesPerSec = FREQ; + wf->nBlockAlign = wf->nChannels * wf->wBitsPerSample / 8; + wf->nAvgBytesPerSec = wf->nSamplesPerSec * wf->nBlockAlign; + // start recording + rchan = BASS_RecordStart(FREQ, CHANS, 0, RecordingCallback, 0); + if (!rchan) { + Error("Can't start recording"); + free(recbuf); + recbuf = 0; + return; + } + MESS(10, WM_SETTEXT, 0, "Stop"); +} + +void StopRecording() +{ + BASS_ChannelStop(rchan); + rchan = 0; + MESS(10, WM_SETTEXT, 0, "Record"); + // complete the WAVE header + *(DWORD*)(recbuf + 4) = reclen - 8; + *(DWORD*)(recbuf + 40) = reclen - 44; + // enable "save" button + EnableWindow(DLGITEM(12), TRUE); + // create a stream from the recording + if (chan = BASS_StreamCreateFile(TRUE, recbuf, 0, reclen, 0)) + EnableWindow(DLGITEM(11), TRUE); // enable "play" button +} + +// write the recorded data to disk +void WriteToDisk() +{ + FILE *fp; + char file[MAX_PATH] = ""; + OPENFILENAME ofn = { 0 }; + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = win; + ofn.nMaxFile = MAX_PATH; + ofn.lpstrFile = file; + ofn.Flags = OFN_HIDEREADONLY | OFN_EXPLORER; + ofn.lpstrFilter = "WAV files\0*.wav\0All files\0*.*\0\0"; + ofn.lpstrDefExt = "wav"; + if (!GetSaveFileName(&ofn)) return; + if (!(fp = fopen(file, "wb"))) { + Error("Can't create the file"); + return; + } + fwrite(recbuf, reclen, 1, fp); + fclose(fp); +} + +void UpdateInputInfo() +{ + char *type; + float level; + int it = BASS_RecordGetInput(input, &level); // get info on the input + if (it == -1 || level < 0) { // failed to get level + it = BASS_RecordGetInput(-1, &level); // try master input instead + if (it == -1 || level < 0) { // that failed too + level = 1; // just display 100% + EnableWindow(DLGITEM(14), FALSE); + } else + EnableWindow(DLGITEM(14), TRUE); + } else + EnableWindow(DLGITEM(14), TRUE); + MESS(14, TBM_SETPOS, TRUE, level * 100); // set the level slider + switch (it & BASS_INPUT_TYPE_MASK) { + case BASS_INPUT_TYPE_DIGITAL: + type = "digital"; + break; + case BASS_INPUT_TYPE_LINE: + type = "line-in"; + break; + case BASS_INPUT_TYPE_MIC: + type = "microphone"; + break; + case BASS_INPUT_TYPE_SYNTH: + type = "midi synth"; + break; + case BASS_INPUT_TYPE_CD: + type = "analog cd"; + break; + case BASS_INPUT_TYPE_PHONE: + type = "telephone"; + break; + case BASS_INPUT_TYPE_SPEAKER: + type = "pc speaker"; + break; + case BASS_INPUT_TYPE_WAVE: + type = "wave/pcm"; + break; + case BASS_INPUT_TYPE_AUX: + type = "aux"; + break; + case BASS_INPUT_TYPE_ANALOG: + type = "analog"; + break; + default: + type = "undefined"; + { + // check if it's a loopback device + BASS_DEVICEINFO info; + BASS_RecordGetDeviceInfo(BASS_RecordGetDevice(), &info); + if (info.flags & BASS_DEVICE_LOOPBACK) type = "loopback"; + } + } + MESS(15, WM_SETTEXT, 0, type); // display the type +} + +BOOL InitDevice(int device) +{ + BASS_RecordFree(); // free current device (and recording channel) if there is one + // initalize new device + if (!BASS_RecordInit(device)) { + Error("Can't initialize recording device"); + return FALSE; + } + { // get list of inputs + int c; + const char *i; + MESS(13, CB_RESETCONTENT, 0, 0); + input = 0; + for (c = 0; i = BASS_RecordGetInputName(c); c++) { + MESS(13, CB_ADDSTRING, 0, i); + if (!(BASS_RecordGetInput(c, NULL) & BASS_INPUT_OFF)) { // this one is currently "on" + input = c; + MESS(13, CB_SETCURSEL, input, 0); + } + } + UpdateInputInfo(); + } + return TRUE; +} + +INT_PTR CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_TIMER: + { // update the recording/playback counter + char text[30] = ""; + if (rchan) { // recording + if (rchan != 1 && !BASS_ChannelIsActive(rchan)) { // the recording has stopped, eg. unplugged device + StopRecording(); + Error("The recording stopped"); + break; + } + sprintf(text, "%d", reclen - 44); + } else if (chan) { + if (BASS_ChannelIsActive(chan)) // playing + sprintf(text, "%I64d / %I64d", BASS_ChannelGetPosition(chan, BASS_POS_BYTE), BASS_ChannelGetLength(chan, BASS_POS_BYTE)); + else + sprintf(text, "%I64d", BASS_ChannelGetLength(chan, BASS_POS_BYTE)); + } + MESS(20, WM_SETTEXT, 0, text); + } + break; + + case WM_COMMAND: + switch (LOWORD(w)) { + case IDCANCEL: + EndDialog(h, 0); + break; + case 10: + if (!rchan) + StartRecording(); + else + StopRecording(); + break; + case 11: + BASS_ChannelPlay(chan, TRUE); // play the recorded data + break; + case 12: + WriteToDisk(); + break; + case 13: + if (HIWORD(w) == CBN_SELCHANGE) { // input selection changed + int i; + input = MESS(13, CB_GETCURSEL, 0, 0); // get the selection + // enable the selected input + for (i = 0; BASS_RecordSetInput(i, BASS_INPUT_OFF, -1); i++); // 1st disable all inputs, then... + BASS_RecordSetInput(input, BASS_INPUT_ON, -1); // enable the selected + UpdateInputInfo(); + } + break; + case 16: + if (HIWORD(w) == CBN_SELCHANGE) { // device selection changed + int i = MESS(16, CB_GETCURSEL, 0, 0); // get the selection + if (rchan) rchan = 1; // special handle (real handles always have highest bit set) to prevent timer ending the recording + // initialize the selected device + if (InitDevice(i)) { + if (rchan) { // continue recording on the new device... + HRECORD newrchan = BASS_RecordStart(FREQ, CHANS, 0, RecordingCallback, NULL); + if (!newrchan) + Error("Couldn't start recording"); + else + rchan = newrchan; + } + } + } + break; + } + break; + + case WM_HSCROLL: + if (l) { // set input source level + float level = SendMessage((HWND)l, TBM_GETPOS, 0, 0) / 100.f; + if (!BASS_RecordSetInput(input, 0, level)) // failed to set input level + BASS_RecordSetInput(-1, 0, level); // try master level instead + } + break; + + case WM_INITDIALOG: + win = h; + MESS(14, TBM_SETRANGE, FALSE, MAKELONG(0, 100)); + { // get list of recording devices + int c, def; + BASS_DEVICEINFO di; + for (c = 0; BASS_RecordGetDeviceInfo(c, &di); c++) { + MESS(16, CB_ADDSTRING, 0, di.name); + if (di.flags & BASS_DEVICE_DEFAULT) { // got the default device + MESS(16, CB_SETCURSEL, c, 0); + def = c; + } + } + InitDevice(def); // initialize default recording device + } + // initialize default output device + if (!BASS_Init(-1, FREQ, 0, win, NULL)) + Error("Can't initialize output device"); + SetTimer(h, 0, 200, 0); // timer to update the position display + return 1; + + case WM_DESTROY: + // release all BASS stuff + BASS_RecordFree(); + BASS_Free(); + break; + } + return 0; +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + { // enable trackbar support (for the level control) + INITCOMMONCONTROLSEX cc = { sizeof(cc),ICC_BAR_CLASSES }; + InitCommonControlsEx(&cc); + } + + DialogBox(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc); + + return 0; +} diff --git a/bass-sys/bass24/c/rectest/rectest.dsp b/bass-sys/bass24/c/rectest/rectest.dsp new file mode 100644 index 0000000..9400ac2 --- /dev/null +++ b/bass-sys/bass24/c/rectest/rectest.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="rectest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=rectest - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "rectest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "rectest.mak" CFG="rectest - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "rectest - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comdlg32.lib comctl32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comdlg32.lib comctl32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "rectest - Win32 Release" +# Begin Source File + +SOURCE=rectest.c +# End Source File +# Begin Source File + +SOURCE=rectest.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/rectest/rectest.rc b/bass-sys/bass24/c/rectest/rectest.rc new file mode 100644 index 0000000..48a02ff --- /dev/null +++ b/bass-sys/bass24/c/rectest/rectest.rc @@ -0,0 +1,17 @@ +#include "windows.h" + +1000 DIALOG DISCARDABLE 200, 100, 200, 55 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS recording test" +FONT 8, "MS Sans Serif" +BEGIN + COMBOBOX 16,5,5,65,72,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX 13,5,20,65,72,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CTEXT "",15,5,34,65,8,SS_CENTERIMAGE + CONTROL "",14,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | + WS_TABSTOP,5,43,65,9 + PUSHBUTTON "Record",10,75,5,120,13 + PUSHBUTTON "Play",11,75,21,57,13,WS_DISABLED + PUSHBUTTON "Save",12,138,21,57,13,WS_DISABLED + CTEXT "",20,75,38,120,12,SS_CENTERIMAGE | SS_SUNKEN +END diff --git a/bass-sys/bass24/c/rectest/rectest.vcproj b/bass-sys/bass24/c/rectest/rectest.vcproj new file mode 100644 index 0000000..ef1d693 --- /dev/null +++ b/bass-sys/bass24/c/rectest/rectest.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/rectest/rectest.vcxproj b/bass-sys/bass24/c/rectest/rectest.vcxproj new file mode 100644 index 0000000..eb6edcf --- /dev/null +++ b/bass-sys/bass24/c/rectest/rectest.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {4FD2AD5D-39B5-4B75-A79F-93D6DD15A06B} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;comctl32.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;comctl32.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/speakers/makefile b/bass-sys/bass24/c/speakers/makefile new file mode 100644 index 0000000..cbcebb7 --- /dev/null +++ b/bass-sys/bass24/c/speakers/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = speakers.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/speakers/speakers.c b/bass-sys/bass24/c/speakers/speakers.c new file mode 100644 index 0000000..7a4e2e9 --- /dev/null +++ b/bass-sys/bass24/c/speakers/speakers.c @@ -0,0 +1,185 @@ +/* + BASS multi-speaker example + Copyright (c) 2003-2014 Un4seen Developments Ltd. +*/ + +#include +#include +#include "bass.h" + +HWND win = NULL; + +DWORD flags[4] = { BASS_SPEAKER_FRONT,BASS_SPEAKER_REAR,BASS_SPEAKER_CENLFE,BASS_SPEAKER_REAR2 }; +HSTREAM chan[4]; + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +#define MESS(id,m,w,l) SendDlgItemMessage(win,id,m,(WPARAM)(w),(LPARAM)(l)) +#define ITEM(id) GetDlgItem(win,id) + +void UpdateSpeakerFlags(DWORD speaker) +{ + int mono = MESS(30 + speaker * 2, BM_GETCHECK, 0, 0) | (MESS(30 + speaker * 2 + 1, BM_GETCHECK, 0, 0) << 1); // get mono switch states + BASS_ChannelFlags(chan[speaker], flags[speaker] | (mono == 1 ? BASS_SPEAKER_LEFT : mono == 2 ? BASS_SPEAKER_RIGHT : 0), BASS_SPEAKER_FRONT); // update speaker flags +} + +BOOL CALLBACK dialogproc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + static OPENFILENAME ofn; + + switch (m) { + case WM_COMMAND: + switch (LOWORD(w)) { + case IDCANCEL: + EndDialog(h, 0); + return 1; + case 10: // open a file to play on #1 + case 11: // open a file to play on #2 + case 12: // open a file to play on #3 + case 13: // open a file to play on #4 + { + int speaker = LOWORD(w) - 10; + char file[MAX_PATH] = ""; + ofn.lpstrFile = file; + if (GetOpenFileName(&ofn)) { + BASS_StreamFree(chan[speaker]); // free old stream before opening new + if (!(chan[speaker] = BASS_StreamCreateFile(FALSE, file, 0, 0, flags[speaker] | BASS_SAMPLE_LOOP))) { + MESS(10 + speaker, WM_SETTEXT, 0, "click here to open a file..."); + Error("Can't play the file"); + return 1; + } + MESS(10 + speaker, WM_SETTEXT, 0, file); + { // reset mono speaker switches + BASS_CHANNELINFO ci; + BASS_ChannelGetInfo(chan[speaker], &ci); + MESS(30 + speaker * 2, BM_SETCHECK, 0, 0); + MESS(30 + speaker * 2 + 1, BM_SETCHECK, 0, 0); + EnableWindow(ITEM(30 + speaker * 2), ci.chans == 1); + EnableWindow(ITEM(30 + speaker * 2 + 1), ci.chans == 1); + } + BASS_ChannelPlay(chan[speaker], FALSE); + } + } + return 1; + case 20: // swap #1 & #2 + case 21: // swap #2 & #3 + case 22: // swap #3 & #4 + { + int speaker = LOWORD(w) - 20; + { // swap handles + HSTREAM temp = chan[speaker]; + chan[speaker] = chan[speaker + 1]; + chan[speaker + 1] = temp; + } + { // swap text + char temp1[MAX_PATH], temp2[MAX_PATH]; + MESS(10 + speaker, WM_GETTEXT, MAX_PATH, temp1); + MESS(10 + speaker + 1, WM_GETTEXT, MAX_PATH, temp2); + MESS(10 + speaker, WM_SETTEXT, 0, temp2); + MESS(10 + speaker + 1, WM_SETTEXT, 0, temp1); + } + { // swap mono switch states + int temp = MESS(30 + speaker * 2, BM_GETCHECK, 0, 0); + MESS(30 + speaker * 2, BM_SETCHECK, MESS(32 + speaker * 2, BM_GETCHECK, 0, 0), 0); + MESS(32 + speaker * 2, BM_SETCHECK, temp, 0); + temp = MESS(31 + speaker * 2, BM_GETCHECK, 0, 0); + MESS(31 + speaker * 2, BM_SETCHECK, MESS(33 + speaker * 2, BM_GETCHECK, 0, 0), 0); + MESS(33 + speaker * 2, BM_SETCHECK, temp, 0); + temp = IsWindowEnabled(ITEM(30 + speaker * 2)); + EnableWindow(ITEM(30 + speaker * 2), IsWindowEnabled(ITEM(32 + speaker * 2))); + EnableWindow(ITEM(32 + speaker * 2), temp); + temp = IsWindowEnabled(ITEM(31 + speaker * 2)); + EnableWindow(ITEM(31 + speaker * 2), IsWindowEnabled(ITEM(33 + speaker * 2))); + EnableWindow(ITEM(33 + speaker * 2), temp); + } + // update speaker flags + UpdateSpeakerFlags(speaker); + UpdateSpeakerFlags(speaker + 1); + } + return 1; + case 30: // left #1 + case 31: // right #1 + case 32: // left #2 + case 33: // right #2 + case 34: // left #3 + case 35: // right #3 + case 36: // right #4 + case 37: // right #4 + { + int speaker = (LOWORD(w) - 30) / 2; + UpdateSpeakerFlags(speaker); + } + return 1; + } + break; + + case WM_INITDIALOG: + win = h; + memset(&ofn, 0, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = h; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY | OFN_EXPLORER; + ofn.lpstrFilter = "Streamable files\0*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif\0All files\0*.*\0\0"; + // initialize BASS - default device + if (!BASS_Init(-1, 44100, 0, win, NULL)) { + Error("Can't initialize device"); + EndDialog(h, 0); + break; + } + { // check how many speakers the device supports + BASS_INFO i; + BASS_GetInfo(&i); + if (i.speakers < 4 && LOBYTE(GetVersion()) < 6) { // no extra speakers detected, enable them anyway? (on older Windows than Vista) + if (MessageBox(0, "Do you wish to enable \"speaker assignment\" anyway?", "No extra speakers detected", MB_ICONQUESTION | MB_YESNO) == IDYES) { + // reinitialize BASS - forcing speaker assignment + BASS_Free(); + if (!BASS_Init(-1, 44100, BASS_DEVICE_SPEAKERS, win, NULL)) { + Error("Can't initialize device"); + EndDialog(h, 0); + break; + } + BASS_GetInfo(&i); // get info again + } + } + if (i.speakers < 8) { + EnableWindow(GetDlgItem(h, 13), FALSE); + EnableWindow(GetDlgItem(h, 22), FALSE); + } + if (i.speakers < 6) { + EnableWindow(GetDlgItem(h, 12), FALSE); + EnableWindow(GetDlgItem(h, 21), FALSE); + } + if (i.speakers < 4) { + EnableWindow(GetDlgItem(h, 11), FALSE); + EnableWindow(GetDlgItem(h, 20), FALSE); + } + } + return 1; + + case WM_DESTROY: + BASS_Free(); + break; + } + return 0; +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + // main dialog + DialogBox(hInstance, MAKEINTRESOURCE(1000), NULL, dialogproc); + + return 0; +} diff --git a/bass-sys/bass24/c/speakers/speakers.dsp b/bass-sys/bass24/c/speakers/speakers.dsp new file mode 100644 index 0000000..0587ad0 --- /dev/null +++ b/bass-sys/bass24/c/speakers/speakers.dsp @@ -0,0 +1,57 @@ +# Microsoft Developer Studio Project File - Name="speakers" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=speakers - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "speakers.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "speakers.mak" CFG="speakers - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "speakers - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib comdlg32.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "speakers - Win32 Release" +# Begin Source File + +SOURCE=speakers.c +# End Source File +# Begin Source File + +SOURCE=speakers.rc +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/speakers/speakers.rc b/bass-sys/bass24/c/speakers/speakers.rc new file mode 100644 index 0000000..6bc9636 --- /dev/null +++ b/bass-sys/bass24/c/speakers/speakers.rc @@ -0,0 +1,35 @@ +#include "windows.h" + +1000 DIALOG DISCARDABLE 100, 100, 230, 126 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS multi-speaker example" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "1 - front",-1,5,0,220,29 + PUSHBUTTON "click here to open a file...",10,10,10,165,14 + CONTROL "L",30,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,182,12,20,10 + CONTROL "R",31,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,202,12,21,10 + GROUPBOX "2 - rear",-1,5,31,220,29 + PUSHBUTTON "click here to open a file...",11,10,40,165,14 + CONTROL "L",32,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,182,42,20,10 + CONTROL "R",33,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,202,42,21,10 + GROUPBOX "3 - center/LFE",-1,5,62,220,29 + PUSHBUTTON "click here to open a file...",12,10,72,165,14 + CONTROL "L",34,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,182,74,20,10 + CONTROL "R",35,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,202,74,21,10 + GROUPBOX "4 - rear center",-1,5,92,220,29 + PUSHBUTTON "click here to open a file...",13,10,102,165,14 + CONTROL "L",36,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,182,104,20,10 + CONTROL "R",37,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,202,104,21,10 + PUSHBUTTON "swap",20,195,24,25,14 + PUSHBUTTON "swap",21,195,55,25,14 + PUSHBUTTON "swap",22,195,86,25,14 +END diff --git a/bass-sys/bass24/c/speakers/speakers.vcproj b/bass-sys/bass24/c/speakers/speakers.vcproj new file mode 100644 index 0000000..f3f872b --- /dev/null +++ b/bass-sys/bass24/c/speakers/speakers.vcproj @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/speakers/speakers.vcxproj b/bass-sys/bass24/c/speakers/speakers.vcxproj new file mode 100644 index 0000000..c9ed90d --- /dev/null +++ b/bass-sys/bass24/c/speakers/speakers.vcxproj @@ -0,0 +1,75 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {FD419538-B54A-4472-8DA6-3BDE8DDBA1F1} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/spectrum/makefile b/bass-sys/bass24/c/spectrum/makefile new file mode 100644 index 0000000..c03b96e --- /dev/null +++ b/bass-sys/bass24/c/spectrum/makefile @@ -0,0 +1,10 @@ +include ..\makefile.in + +TARGET = spectrum.exe +FLAGS += -mwindows +LIBS += -lcomdlg32 -lgdi32 -lwinmm + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/spectrum/spectrum.c b/bass-sys/bass24/c/spectrum/spectrum.c new file mode 100644 index 0000000..be66cfe --- /dev/null +++ b/bass-sys/bass24/c/spectrum/spectrum.c @@ -0,0 +1,248 @@ +/* + BASS spectrum analyser example + Copyright (c) 2002-2014 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include "bass.h" + +#define SPECWIDTH 368 // display width +#define SPECHEIGHT 127 // height (changing requires palette adjustments too) + +HWND win = NULL; +DWORD timer = 0; + +DWORD chan; + +HDC specdc = 0; +HBITMAP specbmp = 0; +BYTE *specbuf; + +int specmode = 0, specpos = 0; // spectrum mode (and marker pos for 3D mode) + +// display error messages +void Error(const char *es) +{ + char mes[200]; + sprintf(mes, "%s\n(error code: %d)", es, BASS_ErrorGetCode()); + MessageBox(win, mes, 0, 0); +} + +// select a file to play, and play it +BOOL PlayFile() +{ + char file[MAX_PATH] = ""; + OPENFILENAME ofn = { 0 }; + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = win; + ofn.nMaxFile = MAX_PATH; + ofn.lpstrFile = file; + ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_EXPLORER; + ofn.lpstrTitle = "Select a file to play"; + ofn.lpstrFilter = "playable files\0*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif\0All files\0*.*\0\0"; + if (!GetOpenFileName(&ofn)) return FALSE; + + if (!(chan = BASS_StreamCreateFile(FALSE, file, 0, 0, BASS_SAMPLE_LOOP)) + && !(chan = BASS_MusicLoad(FALSE, file, 0, 0, BASS_MUSIC_RAMP | BASS_SAMPLE_LOOP, 1))) { + Error("Can't play file"); + return FALSE; // Can't load the file + } + + BASS_ChannelPlay(chan, FALSE); + + return TRUE; +} + +// update the spectrum display - the interesting bit :) +void CALLBACK UpdateSpectrum(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) +{ + HDC dc; + int x, y, y1; + + if (specmode == 3) { // waveform + int c; + float *buf; + BASS_CHANNELINFO ci; + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT); + BASS_ChannelGetInfo(chan, &ci); // get number of channels + buf = alloca(ci.chans * SPECWIDTH * sizeof(float)); // allocate buffer for data + BASS_ChannelGetData(chan, buf, (ci.chans * SPECWIDTH * sizeof(float)) | BASS_DATA_FLOAT); // get the sample data (floating-point to avoid 8 & 16 bit processing) + for (c = 0; c < ci.chans; c++) { + for (x = 0; x < SPECWIDTH; x++) { + int v = (1 - buf[x * ci.chans + c]) * SPECHEIGHT / 2; // invert and scale to fit display + if (v < 0) v = 0; + else if (v >= SPECHEIGHT) v = SPECHEIGHT - 1; + if (!x) y = v; + do { // draw line from previous sample... + if (y < v) y++; + else if (y > v) y--; + specbuf[y * SPECWIDTH + x] = c & 1 ? 127 : 1; // left=green, right=red (could add more colours to palette for more chans) + } while (y != v); + } + } + } else { + float fft[1024]; + BASS_ChannelGetData(chan, fft, BASS_DATA_FFT2048); // get the FFT data + + if (!specmode) { // "normal" FFT + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT); + for (x = 0; x < SPECWIDTH / 2; x++) { +#if 1 + y = sqrt(fft[x + 1]) * 3 * SPECHEIGHT - 4; // scale it (sqrt to make low values more visible) +#else + y = fft[x + 1] * 10 * SPECHEIGHT; // scale it (linearly) +#endif + if (y > SPECHEIGHT) y = SPECHEIGHT; // cap it + if (x && (y1 = (y + y1) / 2)) // interpolate from previous to make the display smoother + while (--y1 >= 0) specbuf[y1 * SPECWIDTH + x * 2 - 1] = y1 + 1; + y1 = y; + while (--y >= 0) specbuf[y * SPECWIDTH + x * 2] = y + 1; // draw level + } + } else if (specmode == 1) { // logarithmic, combine bins + int b0 = 0; + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT); +#define BANDS 28 + for (x = 0; x < BANDS; x++) { + float peak = 0; + int b1 = pow(2, x * 10.0 / (BANDS - 1)); + if (b1 <= b0) b1 = b0 + 1; // make sure it uses at least 1 FFT bin + if (b1 > 1023) b1 = 1023; + for (; b0 < b1; b0++) + if (peak < fft[1 + b0]) peak = fft[1 + b0]; + y = sqrt(peak) * 3 * SPECHEIGHT - 4; // scale it (sqrt to make low values more visible) + if (y > SPECHEIGHT) y = SPECHEIGHT; // cap it + while (--y >= 0) + memset(specbuf + y * SPECWIDTH + x * (SPECWIDTH / BANDS), y + 1, SPECWIDTH / BANDS - 2); // draw bar + } + } else { // "3D" + for (x = 0; x < SPECHEIGHT; x++) { + y = sqrt(fft[x + 1]) * 3 * 127; // scale it (sqrt to make low values more visible) + if (y > 127) y = 127; // cap it + specbuf[x * SPECWIDTH + specpos] = 128 + y; // plot it + } + // move marker onto next position + specpos = (specpos + 1) % SPECWIDTH; + for (x = 0; x < SPECHEIGHT; x++) specbuf[x * SPECWIDTH + specpos] = 255; + } + } + + // update the display + dc = GetDC(win); + BitBlt(dc, 0, 0, SPECWIDTH, SPECHEIGHT, specdc, 0, 0, SRCCOPY); + ReleaseDC(win, dc); +} + +// window procedure +LRESULT CALLBACK SpectrumWindowProc(HWND h, UINT m, WPARAM w, LPARAM l) +{ + switch (m) { + case WM_PAINT: + if (GetUpdateRect(h, 0, 0)) { + PAINTSTRUCT p; + HDC dc; + if (!(dc = BeginPaint(h, &p))) return 0; + BitBlt(dc, 0, 0, SPECWIDTH, SPECHEIGHT, specdc, 0, 0, SRCCOPY); + EndPaint(h, &p); + } + return 0; + + case WM_LBUTTONUP: + specmode = (specmode + 1) % 4; // change spectrum mode + memset(specbuf, 0, SPECWIDTH * SPECHEIGHT); // clear display + return 0; + + case WM_CREATE: + win = h; + // initialize BASS + if (!BASS_Init(-1, 44100, 0, win, NULL)) { + Error("Can't initialize device"); + return -1; + } + if (!PlayFile()) { // start a file playing + BASS_Free(); + return -1; + } + { // create bitmap to draw spectrum in (8 bit for easy updating) + BYTE data[2000] = { 0 }; + BITMAPINFOHEADER *bh = (BITMAPINFOHEADER*)data; + RGBQUAD *pal = (RGBQUAD*)(data + sizeof(*bh)); + int a; + bh->biSize = sizeof(*bh); + bh->biWidth = SPECWIDTH; + bh->biHeight = SPECHEIGHT; // upside down (line 0=bottom) + bh->biPlanes = 1; + bh->biBitCount = 8; + bh->biClrUsed = bh->biClrImportant = 256; + // setup palette + for (a = 1; a < 128; a++) { + pal[a].rgbGreen = 256 - 2 * a; + pal[a].rgbRed = 2 * a; + } + for (a = 0; a < 32; a++) { + pal[128 + a].rgbBlue = 8 * a; + pal[128 + 32 + a].rgbBlue = 255; + pal[128 + 32 + a].rgbRed = 8 * a; + pal[128 + 64 + a].rgbRed = 255; + pal[128 + 64 + a].rgbBlue = 8 * (31 - a); + pal[128 + 64 + a].rgbGreen = 8 * a; + pal[128 + 96 + a].rgbRed = 255; + pal[128 + 96 + a].rgbGreen = 255; + pal[128 + 96 + a].rgbBlue = 8 * a; + } + // create the bitmap + specbmp = CreateDIBSection(0, (BITMAPINFO*)bh, DIB_RGB_COLORS, (void**)&specbuf, NULL, 0); + specdc = CreateCompatibleDC(0); + SelectObject(specdc, specbmp); + } + // start update timer (40hz) + timer = timeSetEvent(25, 25, (LPTIMECALLBACK)&UpdateSpectrum, 0, TIME_PERIODIC); + break; + + case WM_DESTROY: + if (timer) timeKillEvent(timer); + BASS_Free(); + if (specdc) DeleteDC(specdc); + if (specbmp) DeleteObject(specbmp); + PostQuitMessage(0); + break; + } + return DefWindowProc(h, m, w, l); +} + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + WNDCLASS wc = { 0 }; + MSG msg; + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + MessageBox(0, "An incorrect version of BASS.DLL was loaded", 0, MB_ICONERROR); + return 0; + } + + // register window class and create the window + wc.lpfnWndProc = SpectrumWindowProc; + wc.hInstance = hInstance; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.lpszClassName = "BASS-Spectrum"; + if (!RegisterClass(&wc) || !CreateWindow("BASS-Spectrum", + "BASS spectrum example (click to switch mode)", + WS_POPUPWINDOW | WS_CAPTION | WS_VISIBLE, 200, 200, + SPECWIDTH + 2 * GetSystemMetrics(SM_CXDLGFRAME), + SPECHEIGHT + GetSystemMetrics(SM_CYCAPTION) + 2 * GetSystemMetrics(SM_CYDLGFRAME), + NULL, NULL, hInstance, NULL)) { + Error("Can't create window"); + return 0; + } + ShowWindow(win, SW_SHOWNORMAL); + + while (GetMessage(&msg, NULL, 0, 0) > 0) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + return 0; +} diff --git a/bass-sys/bass24/c/spectrum/spectrum.dsp b/bass-sys/bass24/c/spectrum/spectrum.dsp new file mode 100644 index 0000000..f93b0e1 --- /dev/null +++ b/bass-sys/bass24/c/spectrum/spectrum.dsp @@ -0,0 +1,53 @@ +# Microsoft Developer Studio Project File - Name="spectrum" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=spectrum - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "spectrum.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "spectrum.mak" CFG="spectrum - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "spectrum - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib /nologo /subsystem:windows /pdb:none /machine:I386 +# Begin Target + +# Name "spectrum - Win32 Release" +# Begin Source File + +SOURCE=spectrum.c +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/spectrum/spectrum.vcproj b/bass-sys/bass24/c/spectrum/spectrum.vcproj new file mode 100644 index 0000000..44e1922 --- /dev/null +++ b/bass-sys/bass24/c/spectrum/spectrum.vcproj @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/spectrum/spectrum.vcxproj b/bass-sys/bass24/c/spectrum/spectrum.vcxproj new file mode 100644 index 0000000..d5385f8 --- /dev/null +++ b/bass-sys/bass24/c/spectrum/spectrum.vcxproj @@ -0,0 +1,72 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {BDCC1DDE-3BAB-436C-934A-348C76B050E2} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;winmm.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Windows + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;winmm.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Windows + MachineX64 + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/synth/makefile b/bass-sys/bass24/c/synth/makefile new file mode 100644 index 0000000..ee71f9e --- /dev/null +++ b/bass-sys/bass24/c/synth/makefile @@ -0,0 +1,8 @@ +include ..\makefile.in + +TARGET = synth.exe + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/synth/synth.c b/bass-sys/bass24/c/synth/synth.c new file mode 100644 index 0000000..cb9dc79 --- /dev/null +++ b/bass-sys/bass24/c/synth/synth.c @@ -0,0 +1,157 @@ +/* + BASS simple synth + Copyright (c) 2001-2017 Un4seen Developments Ltd. +*/ + +#include +#include +#include +#include +#include "bass.h" + +BASS_INFO info; +HSTREAM stream; // the stream + +// display error messages +void Error(const char *text) +{ + printf("Error(%d): %s\n", BASS_ErrorGetCode(), text); + BASS_Free(); + ExitProcess(0); +} + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +#define KEYS 20 +const WORD keys[KEYS] = { + 'Q','2','W','3','E','R','5','T','6','Y','7','U', + 'I','9','O','0','P',219,187,221 +}; +#define MAXVOL (0.22*32768) +#define DECAY (MAXVOL/4000) +float vol[KEYS] = { 0 }, pos[KEYS]; // keys' volume and pos + +DWORD CALLBACK WriteStream(HSTREAM handle, short *buffer, DWORD length, void *user) +{ + int k, c, s; + float omega; + memset(buffer, 0, length); + for (k = 0; k < KEYS; k++) { + if (!vol[k]) continue; + omega = 2 * M_PI * pow(2.0, (k + 3) / 12.0) * 440.0 / info.freq; + for (c = 0; c < length / sizeof(short); c += 2) { + s = buffer[c] + sin(pos[k]) * vol[k]; + if (s > 32767) s = 32767; + else if (s < -32768) s = -32768; + buffer[c + 1] = buffer[c] = s; // left and right channels are the same + pos[k] += omega; + if (vol[k] < MAXVOL) { + vol[k] -= DECAY; + if (vol[k] <= 0) { // faded-out + vol[k] = 0; + break; + } + } + } + pos[k] = fmod(pos[k], 2 * M_PI); + } + return length; +} + +void main(int argc, char **argv) +{ + const char *fxname[9] = { "CHORUS","COMPRESSOR","DISTORTION","ECHO", + "FLANGER","GARGLE","I3DL2REVERB","PARAMEQ","REVERB" }; + HFX fx[9] = { 0 }; // effect handles + INPUT_RECORD keyin; + DWORD r, buflen; + + printf("BASS Simple Sinewave Synth\n" + "--------------------------\n"); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + printf("An incorrect version of BASS.DLL was loaded"); + return; + } + + BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 10); // 10ms update period + + // initialize default output device (and measure latency) + if (!BASS_Init(-1, 44100, BASS_DEVICE_LATENCY, 0, NULL)) + Error("Can't initialize device"); + + BASS_SetConfig(BASS_CONFIG_BUFFER, 200); // set default/maximum buffer length to 200ms + BASS_GetInfo(&info); + if (!info.freq) info.freq = 44100; // if the device's output rate is unknown, default to 44100 Hz + stream = BASS_StreamCreate(info.freq, 2, 0, (STREAMPROC*)WriteStream, 0); // create a stream (stereo for effects) + buflen = 10 + info.minbuf + 1; // default buffer size = update period + 'minbuf' + 1ms extra margin + BASS_ChannelSetAttribute(stream, BASS_ATTRIB_BUFFER, buflen / 1000.f); // apply it + BASS_ChannelPlay(stream, FALSE); // start it + + printf("device latency: %dms\n", info.latency); + printf("device minbuf: %dms\n", info.minbuf); + printf("ds version: %d (effects %s)\n", info.dsver, info.dsver < 8 ? "disabled" : "enabled"); + printf("press these keys to play:\n\n" + " 2 3 5 6 7 9 0 =\n" + " Q W ER T Y UI O P[ ]\n\n" + "press -/+ to de/increase the buffer\n" + "press spacebar to quit\n\n"); + if (info.dsver >= 8) // DX8 effects available + printf("press F1-F9 to toggle effects\n\n"); + printf("using a %dms buffer\r", buflen); + + while (ReadConsoleInput(GetStdHandle(STD_INPUT_HANDLE), &keyin, 1, &r)) { + int key; + if (keyin.EventType != KEY_EVENT) continue; + if (keyin.Event.KeyEvent.wVirtualKeyCode == VK_SPACE) break; + if (keyin.Event.KeyEvent.bKeyDown) { + if (keyin.Event.KeyEvent.wVirtualKeyCode == VK_SUBTRACT + || keyin.Event.KeyEvent.wVirtualKeyCode == VK_ADD) { + // change the buffer size + if (keyin.Event.KeyEvent.wVirtualKeyCode == VK_SUBTRACT) { // smaller buffer + if (buflen > 11) + buflen--; + else if (!(info.initflags & BASS_DEVICE_DSOUND)) + buflen = 0; // no buffer (not available with DirectSound) + } else { // bigger buffer + if (!buflen) + buflen = 11; + else if (buflen < 200) + buflen++; + } + BASS_ChannelSetAttribute(stream, BASS_ATTRIB_BUFFER, buflen / 1000.f); // apply it + if (buflen) + printf("using a %dms buffer\t\t\r", buflen); + else + printf("using no buffer\t\t\r"); + } + if (keyin.Event.KeyEvent.wVirtualKeyCode >= VK_F1 + && keyin.Event.KeyEvent.wVirtualKeyCode <= VK_F9) { + r = keyin.Event.KeyEvent.wVirtualKeyCode - VK_F1; + if (fx[r]) { + BASS_ChannelRemoveFX(stream, fx[r]); + fx[r] = 0; + printf("effect %s = OFF\t\t\r", fxname[r]); + } else { + // set the effect, not bothering with parameters (use defaults) + if (fx[r] = BASS_ChannelSetFX(stream, BASS_FX_DX8_CHORUS + r, 0)) + printf("effect %s = ON\t\t\r", fxname[r]); + } + } + } + for (key = 0; key < KEYS; key++) + if (keyin.Event.KeyEvent.wVirtualKeyCode == keys[key]) { + if (keyin.Event.KeyEvent.bKeyDown && vol[key] < MAXVOL) { + pos[key] = 0; + vol[key] = MAXVOL + DECAY / 2; // start key (setting "vol" slightly higher than MAXVOL to cover any rounding-down) + } else if (!keyin.Event.KeyEvent.bKeyDown && vol[key]) + vol[key] -= DECAY; // trigger key fadeout + break; + } + } + + BASS_Free(); +} diff --git a/bass-sys/bass24/c/synth/synth.dsp b/bass-sys/bass24/c/synth/synth.dsp new file mode 100644 index 0000000..e44d90b --- /dev/null +++ b/bass-sys/bass24/c/synth/synth.dsp @@ -0,0 +1,53 @@ +# Microsoft Developer Studio Project File - Name="synth" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=synth - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "synth.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "synth.mak" CFG="synth - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "synth - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 +# Begin Target + +# Name "synth - Win32 Release" +# Begin Source File + +SOURCE=synth.c +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/synth/synth.vcproj b/bass-sys/bass24/c/synth/synth.vcproj new file mode 100644 index 0000000..0999dc2 --- /dev/null +++ b/bass-sys/bass24/c/synth/synth.vcproj @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/synth/synth.vcxproj b/bass-sys/bass24/c/synth/synth.vcxproj new file mode 100644 index 0000000..463fb74 --- /dev/null +++ b/bass-sys/bass24/c/synth/synth.vcxproj @@ -0,0 +1,72 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {F710CC47-BAAF-44DD-9F1B-D7F5AEEEDB56} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Console + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/writewav/makefile b/bass-sys/bass24/c/writewav/makefile new file mode 100644 index 0000000..cba5392 --- /dev/null +++ b/bass-sys/bass24/c/writewav/makefile @@ -0,0 +1,8 @@ +include ..\makefile.in + +TARGET = writewav.exe + +all: $(TARGET) + +clean: + $(RM) $(OUTDIR)\$(TARGET) diff --git a/bass-sys/bass24/c/writewav/writewav.c b/bass-sys/bass24/c/writewav/writewav.c new file mode 100644 index 0000000..b0e47f3 --- /dev/null +++ b/bass-sys/bass24/c/writewav/writewav.c @@ -0,0 +1,168 @@ +/* + BASS console WAV writer + Copyright (c) 2002-2008 Un4seen Developments Ltd. +*/ + +#include +#include +#include "bass.h" + +#ifdef _WIN32 // Windows +#include +#else // OSX +#include +#include +#include +#include + +int _kbhit() +{ + int r; + fd_set rfds; + struct timeval tv; + struct termios term, oterm; + tcgetattr(0, &oterm); + memcpy(&term, &oterm, sizeof(term)); + cfmakeraw(&term); + tcsetattr(0, TCSANOW, &term); + FD_ZERO(&rfds); + FD_SET(0, &rfds); + tv.tv_sec = tv.tv_usec = 0; + r = select(1, &rfds, NULL, NULL, &tv); + tcsetattr(0, TCSANOW, &oterm); + return r; +} +#endif + +#ifdef _BIG_ENDIAN +inline DWORD le_32(DWORD v) +{ + return (v >> 24) | ((v >> 8) & 0xff00) | ((v & 0xff00) << 8) | (v << 24); +} +inline WORD le_16(WORD v) +{ + return (v >> 8) | (v << 8); +} +#else +#define le_32(v) (v) +#define le_16(v) (v) +#endif + +// display error messages +void Error(const char *text) +{ + printf("Error(%d): %s\n", BASS_ErrorGetCode(), text); + BASS_Free(); + exit(0); +} + +void main(int argc, char **argv) +{ + BASS_CHANNELINFO info; + DWORD chan, p; + QWORD pos; + FILE *fp; + short buf[10000]; + WAVEFORMATEX wf; + + printf("BASS WAV writer example : MOD/MPx/OGG -> BASS.WAV\n" + "-------------------------------------------------\n"); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion()) != BASSVERSION) { + printf("An incorrect version of BASS was loaded"); + return; + } + + if (argc != 2) { + printf("\tusage: writewav \n"); + return; + } + + // initalize "no sound" device + if (!BASS_Init(0, 44100, 0, 0, NULL)) + Error("Can't initialize device"); + + // try streaming the file/url + if ((chan = BASS_StreamCreateFile(FALSE, argv[1], 0, 0, BASS_STREAM_DECODE)) + || (chan = BASS_StreamCreateURL(argv[1], 0, BASS_STREAM_DECODE | BASS_STREAM_BLOCK, 0, 0))) { + pos = BASS_ChannelGetLength(chan, BASS_POS_BYTE); + if (pos == -1) // length not available + printf("streaming file"); + else +#ifdef _WIN32 + printf("streaming file [%I64u bytes]", pos); +#else + printf("streaming file [%llu bytes]", pos); +#endif + } else { + // try loading the MOD (with sensitive ramping, and calculate the duration) + if (!(chan = BASS_MusicLoad(FALSE, argv[1], 0, 0, BASS_MUSIC_DECODE | BASS_MUSIC_RAMP | BASS_MUSIC_PRESCAN, 0))) + // not a MOD either + Error("Can't play the file"); + { // count channels + float dummy; + for (p = 0; BASS_ChannelGetAttribute(chan, BASS_ATTRIB_MUSIC_VOL_CHAN + p, &dummy); p++); + } + printf("MOD music \"%s\" [%u chans, %u orders]", + BASS_ChannelGetTags(chan, BASS_TAG_MUSIC_NAME), p, (DWORD)BASS_ChannelGetLength(chan, BASS_POS_MUSIC_ORDER)); + pos = BASS_ChannelGetLength(chan, BASS_POS_BYTE); + } + + // display the time length + if (pos && pos != -1) { + p = (DWORD)BASS_ChannelBytes2Seconds(chan, pos); + printf(" %u:%02u\n", p / 60, p % 60); + } else // no time length available + printf("\n"); + + if (!(fp = fopen("bass.wav", "wb"))) Error("Can't create file"); + printf("writing to BASS.WAV file... press a key to stop\n"); + // write WAV header + BASS_ChannelGetInfo(chan, &info); + wf.wFormatTag = 1; + wf.nChannels = info.chans; + wf.wBitsPerSample = (info.flags & BASS_SAMPLE_8BITS ? 8 : 16); + wf.nBlockAlign = wf.nChannels * wf.wBitsPerSample / 8; + wf.nSamplesPerSec = info.freq; + wf.nAvgBytesPerSec = wf.nSamplesPerSec * wf.nBlockAlign; +#ifdef _BIG_ENDIAN // swap byte order + wf.wFormatTag = le_16(wf.wFormatTag); + wf.nChannels = le_16(wf.nChannels); + wf.wBitsPerSample = le_16(wf.wBitsPerSample); + wf.nBlockAlign = le_16(wf.nBlockAlign); + wf.nSamplesPerSec = le_32(wf.nSamplesPerSec); + wf.nAvgBytesPerSec = le_32(wf.nAvgBytesPerSec); +#endif + fwrite("RIFF\0\0\0\0WAVEfmt \20\0\0\0", 20, 1, fp); + fwrite(&wf, 16, 1, fp); + fwrite("data\0\0\0\0", 8, 1, fp); + + while (!_kbhit() && BASS_ChannelIsActive(chan)) { + int c = BASS_ChannelGetData(chan, buf, 20000); +#ifdef _BIG_ENDIAN + if (!(info.flags & BASS_SAMPLE_8BITS)) // swap 16-bit byte order + for (p = 0; p < c / 2; p++) buf[p] = le_16(buf[p]); +#endif + fwrite(buf, 1, c, fp); + pos = BASS_ChannelGetPosition(chan, BASS_POS_BYTE); +#ifdef _WIN32 + printf("pos %09I64u\r", pos); +#else + printf("pos %09llu\r", pos); +#endif + fflush(stdout); + } + // complete WAV header + fflush(fp); + p = ftell(fp); + fseek(fp, 4, SEEK_SET); + putw(le_32(p - 8), fp); + fflush(fp); + fseek(fp, 40, SEEK_SET); + putw(le_32(p - 44), fp); + fflush(fp); + fclose(fp); + + BASS_Free(); +} diff --git a/bass-sys/bass24/c/writewav/writewav.dsp b/bass-sys/bass24/c/writewav/writewav.dsp new file mode 100644 index 0000000..9cc48de --- /dev/null +++ b/bass-sys/bass24/c/writewav/writewav.dsp @@ -0,0 +1,53 @@ +# Microsoft Developer Studio Project File - Name="writewav" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=writewav - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "writewav.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "writewav.mak" CFG="writewav - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "writewav - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "../bin" +# PROP BASE Intermediate_Dir "Release" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../bin" +# PROP Intermediate_Dir "Release" +# ADD BASE CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +# ADD CPP /nologo /MD /GX /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c +BSC32=bscmake.exe +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 +# ADD LINK32 kernel32.lib user32.lib /nologo /subsystem:console /pdb:none /machine:I386 +# Begin Target + +# Name "writewav - Win32 Release" +# Begin Source File + +SOURCE=writewav.c +# End Source File +# Begin Source File + +SOURCE=..\bass.lib +# End Source File +# End Target +# End Project diff --git a/bass-sys/bass24/c/writewav/writewav.vcproj b/bass-sys/bass24/c/writewav/writewav.vcproj new file mode 100644 index 0000000..80c8a3e --- /dev/null +++ b/bass-sys/bass24/c/writewav/writewav.vcproj @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bass-sys/bass24/c/writewav/writewav.vcxproj b/bass-sys/bass24/c/writewav/writewav.vcxproj new file mode 100644 index 0000000..1aef7d0 --- /dev/null +++ b/bass-sys/bass24/c/writewav/writewav.vcxproj @@ -0,0 +1,72 @@ + + + + + Release + Win32 + + + Release + x64 + + + + {6102AFDE-AFAD-4750-AC38-75DDC9268531} + + + + Application + NotSet + + + Application + NotSet + + + + + + + + + + + + + ..\bin\ + + + ..\bin\x64\ + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..;%(AdditionalLibraryDirectories) + Console + + + + + ..;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + bass.lib;%(AdditionalDependencies) + ..\x64;%(AdditionalLibraryDirectories) + Console + MachineX64 + + + + + + + + + \ No newline at end of file diff --git a/bass-sys/bass24/c/x64/bass.lib b/bass-sys/bass24/c/x64/bass.lib new file mode 100644 index 0000000..2e4eec5 Binary files /dev/null and b/bass-sys/bass24/c/x64/bass.lib differ diff --git a/bass-sys/bass24/delphi/3dTest/D3Test.dpr b/bass-sys/bass24/delphi/3dTest/D3Test.dpr new file mode 100644 index 0000000..f029ce8 --- /dev/null +++ b/bass-sys/bass24/delphi/3dTest/D3Test.dpr @@ -0,0 +1,57 @@ +{ +BASS 3D Test, copyright (c) 1999-2004 Ian Luck. +=============================================== +Other source: DTMain.pas, DTMain.dfm, DTSelect.pas, DTSelect.dfm +Delphi version by Titus Miloi (titus.a.m@t-online.de) +} +program D3Test; + +uses + Windows, + Forms, + SysUtils, + DTMain in 'DTMain.pas' {Form1}, + Bass in '..\Bass.pas'; + +var + eaxon: Boolean; +begin + // initialize application + Application.Initialize; + Application.Title := 'BASS - 3D Test'; + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then + begin + MessageBox(0,'An incorrect version of BASS.DLL was loaded',nil,MB_ICONERROR); + Halt; + end; + + Application.CreateForm(TForm1, Form1); + Form1.Visible := True; + + // Initialize the default output device with 3D + if not BASS_Init(-1, 44100, BASS_DEVICE_3D, Application.handle, nil) then + begin + MessageBox(0, 'Can''t initialize output device', nil, 0); + Halt; + end; + + // Use meters as distance unit, real world rolloff, real doppler effect + BASS_Set3DFactors(1.0, 1.0, 1.0); + // Turn EAX off (volume=0.0), if error then EAX is not supported + eaxon := FALSE; + if BASS_SetEAXParameters(-1, 0.0, -1.0, -1.0) then + eaxon := TRUE; + + // create and start the main application form + with Form1 do + begin + ComboBox1.Enabled := eaxon; + ComboBox1.ItemIndex := 0; + end; + Application.Run; + + BASS_Free; +end. + diff --git a/bass-sys/bass24/delphi/3dTest/DTMain.dfm b/bass-sys/bass24/delphi/3dTest/DTMain.dfm new file mode 100644 index 0000000..192ac9d Binary files /dev/null and b/bass-sys/bass24/delphi/3dTest/DTMain.dfm differ diff --git a/bass-sys/bass24/delphi/3dTest/DTMain.pas b/bass-sys/bass24/delphi/3dTest/DTMain.pas new file mode 100644 index 0000000..eab254a --- /dev/null +++ b/bass-sys/bass24/delphi/3dTest/DTMain.pas @@ -0,0 +1,463 @@ +unit DTMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, ExtCtrls, BASS, Math, ComCtrls; + +const + + XDIST = 70; + YDIST = 65; + XCENTER = 268; + YCENTER = 92; + DIAM = 10; + TIMERPERIOD = 50; // timer period (ms) + MAXDIST = 50; // maximum distance of the channels (m) + SPEED = 12; + +type + PSource = ^TSource; + TSource = record + next: PSource; + Channel: DWORD; + pos, vel: BASS_3DVECTOR; + end; + + TForm1 = class(TForm) + GroupBox1: TGroupBox; + ListBox1: TListBox; + Button1: TButton; + Button2: TButton; + Button3: TButton; + Button4: TButton; + Bevel1: TBevel; + StaticText1: TStaticText; + GroupBox2: TGroupBox; + ComboBox1: TComboBox; + GroupBox3: TGroupBox; + GroupBox4: TGroupBox; + Timer1: TTimer; + OpenDialog1: TOpenDialog; + ScrollBar_Rolloff: TTrackBar; + ScrollBar_Doppler: TTrackBar; + ed_X: TEdit; + ed_Z: TEdit; + Label1: TLabel; + Label2: TLabel; + btnReset: TButton; + Bevel2: TBevel; + Bevel3: TBevel; + procedure FormCreate(Sender: TObject); + procedure Timer1Timer(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure ListBox1Click(Sender: TObject); + procedure Button2Click(Sender: TObject); + procedure ListBox1KeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure Button3Click(Sender: TObject); + procedure Button4Click(Sender: TObject); + procedure ComboBox1Change(Sender: TObject); + procedure ScrollBar_DopplerChange(Sender: TObject); + procedure ScrollBar_RollofChange(Sender: TObject); + procedure btnResetClick(Sender: TObject); + procedure ed_XKeyPress(Sender: TObject; var Key: Char); + procedure ed_XChange(Sender: TObject); + procedure FormPaint(Sender: TObject); + private + { Private-Deklarationen } + sources: PSource; + procedure Error(msg: string); + procedure AddSource(name: string); + procedure RemSource(num: Integer); + function GetSource(num: Integer): PSource; + procedure DrawSources; + procedure FreeSources; + procedure ActualizeSources(forceupdate: Boolean); + procedure ActualizeButtons; + + public + { Public-Deklarationen } + end; + +var + Form1: TForm1; + +implementation + +{$R *.DFM} + +procedure TForm1.Error(msg: string); +var + s: string; +begin + s := msg + #13#10 + '(error code: ' + IntToStr(BASS_ErrorGetCode) + ')'; + MessageBox(handle, PChar(s), nil, 0); +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + sources := nil; +end; + +procedure TForm1.AddSource(name: string); +var + NewCHan: DWORD; + p, last: PSource; +begin + + // Load a music from "file" with 3D enabled, and make it loop & use ramping + newchan := BASS_MusicLoad(FALSE, PChar(name), 0, 0, BASS_MUSIC_RAMP or BASS_MUSIC_LOOP or + BASS_SAMPLE_3D {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}, 1); + if (newchan = 0) then + begin + // Load a sample from "file" with 3D enabled, and make it loop + newchan := BASS_SampleLoad(FALSE, PChar(name), 0, 0, 1, BASS_SAMPLE_LOOP or BASS_SAMPLE_3D or + BASS_SAMPLE_MONO {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + end; + if (newchan = 0) then + begin + Error('Can''t load file (note samples must be mono)'); + Exit; + end; + + New(p); + FillChar(p^, SizeOf(P^), 0); + p.Channel := newchan; + BASS_SampleGetChannel(newchan, False); // initialize sample channel + last := sources; + if last <> nil then + while (last.next <> nil) do + last := last.next; + if last = nil then + sources := p + else + last.next := p; + ListBox1.Items.Add(name); + ActualizeButtons; +end; + +procedure TForm1.RemSource(num: Integer); +var + p, prev: PSource; + i: Integer; +begin + prev := nil; + p := sources; + i := 0; + while (p <> nil) and (i < num) do + begin + Inc(i); + prev := p; + p := p.next; + end; + if (p <> nil) then + begin + if (prev <> nil) then + prev.next := p.next + else + sources := p.next; + BASS_SampleFree(p.channel); + BASS_MusicFree(p.channel); + Dispose(p); + end; + ListBox1.Items.Delete(num); + ActualizeButtons; +end; + +function TForm1.GetSource(num: Integer): PSource; +var + p: PSource; + i: Integer; +begin + if num < 0 then + begin + Result := nil; + Exit; + end; + p := sources; + i := 0; + while (p <> nil) and (i < num) do + begin + Inc(i); + p := p.next; + end; + Result := p; +end; + +procedure TForm1.DrawSources; +var + p: PSource; + i, j: Integer; +begin + p := sources; + with Canvas do + begin + Brush.Color := Form1.Color; + Pen.Color := Form1.Color; + Rectangle(XCENTER - XDIST - DIAM, + YCENTER - YDIST - DIAM, + XCENTER + XDIST + DIAM, + YCENTER + YDIST + DIAM); + Brush.Color := clGray; + Pen.Color := clBlack; + Ellipse(XCENTER - DIAM div 2, + YCENTER - DIAM div 2, + XCENTER + DIAM div 2, + YCENTER + DIAM div 2); + Pen.Color := Form1.Color; + i := 0; + j := ListBox1.ItemIndex; + while (p <> nil) do + begin + if (i = j) then + Brush.Color := clRed + else + Brush.Color := clBlack; + + Ellipse(XCENTER + Trunc(p.pos.x)+ DIAM div 2, + YCENTER - Trunc(p.pos.z) + DIAM div 2, + XCENTER + Trunc(p.pos.x)- DIAM div 2, + YCENTER - Trunc(p.pos.z)- DIAM div 2); + p := p.next; + Inc(i); + end; + end; +end; + +procedure TForm1.ActualizeSources(forceupdate: Boolean); +var + p: PSource; + chng, fchng: Boolean; + tmp: BASS_3DVECTOR; +begin + fchng := forceupdate; + p := sources; + while (p <> nil) do + begin + chng := forceupdate; + if (BASS_ChannelIsActive(p.channel) = BASS_ACTIVE_PLAYING) then + begin + + if (P.pos.z >= MAXDIST) or (P.pos.z <= -MAXDIST) then + P.vel.z := -P.vel.z; + if (p.pos.X >= MAXDIST) or (p.pos.X <= -MAXDIST) then + P.vel.X := -P.vel.X; + + // Update channel position + P.pos.z := P.pos.z + P.vel.z * TIMERPERIOD / 1000; + P.pos.X := P.pos.X + P.vel.X * TIMERPERIOD / 1000; + ZeroMemory(@tmp, sizeof(tmp)); + BASS_ChannelSet3DPosition(P.channel, P.pos, tmp, P.vel); + chng := true; + end; + p := p.next; + if chng then + fchng := TRUE; + end; + if fchng then + begin + DrawSources; + BASS_Apply3D; + end; +end; + +procedure TForm1.FreeSources; +var + p, v: PSource; +begin + p := sources; + while (p <> nil) do + begin + v := p.next; + Dispose(v); + p := v; + end; + sources := nil; +end; + +procedure TForm1.Timer1Timer(Sender: TObject); +begin + ActualizeSources(false); + +end; + +procedure TForm1.Button1Click(Sender: TObject); +begin + if OpenDialog1.Execute then + begin + AddSource(OpenDialog1.FileName); + end; +end; + +procedure TForm1.FormDestroy(Sender: TObject); +begin + FreeSources; + BASS_Stop; + BASS_Free; +end; + +procedure TForm1.ActualizeButtons; +var + en: Boolean; +begin + en := (ListBox1.ItemIndex >= 0); + Button2.Enabled := en; + Button3.Enabled := en; + Button4.Enabled := en; + ed_x.Enabled := en; + ed_z.Enabled := en; + btnReset.Enabled := en; + if en then + DrawSources; +end; + +procedure TForm1.ListBox1Click(Sender: TObject); +begin + ActualizeButtons; +end; + +procedure TForm1.Button2Click(Sender: TObject); +begin + if ListBox1.ItemIndex >= 0 then + RemSource(ListBox1.ItemIndex); +end; + +procedure TForm1.ListBox1KeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + ActualizeButtons; +end; + +procedure TForm1.Button3Click(Sender: TObject); +var + p: PSource; +begin + if ListBox1.ItemIndex < 0 then + Exit; + p := GetSource(ListBox1.itemIndex); + if p <> nil then + BASS_ChannelPlay(p.channel, False); +end; + +procedure TForm1.Button4Click(Sender: TObject); +var + p: PSource; +begin + if ListBox1.ItemIndex < 0 then + Exit; + p := GetSource(ListBox1.ItemIndex); + if p = nil then + Exit; + BASS_ChannelPause(p.channel); +end; + +procedure TForm1.ComboBox1Change(Sender: TObject); +begin + case (ComboBox1.ItemIndex) of + 0: BASS_SetEAXParameters (-1, 0, -1, -1); + 1: BASS_SetEAXPreset(EAX_ENVIRONMENT_GENERIC); + 2: BASS_SetEAXPreset(EAX_ENVIRONMENT_PADDEDCELL); + 3: BASS_SetEAXPreset(EAX_ENVIRONMENT_ROOM); + 4: BASS_SetEAXPreset(EAX_ENVIRONMENT_BATHROOM); + 5: BASS_SetEAXPreset(EAX_ENVIRONMENT_LIVINGROOM); + 6: BASS_SetEAXPreset(EAX_ENVIRONMENT_STONEROOM); + 7: BASS_SetEAXPreset(EAX_ENVIRONMENT_AUDITORIUM); + 8: BASS_SetEAXPreset(EAX_ENVIRONMENT_CONCERTHALL); + 9: BASS_SetEAXPreset(EAX_ENVIRONMENT_CAVE); + 10: BASS_SetEAXPreset(EAX_ENVIRONMENT_ARENA); + 11: BASS_SetEAXPreset(EAX_ENVIRONMENT_HANGAR); + 12: BASS_SetEAXPreset(EAX_ENVIRONMENT_CARPETEDHALLWAY); + 13: BASS_SetEAXPreset(EAX_ENVIRONMENT_HALLWAY); + 14: BASS_SetEAXPreset(EAX_ENVIRONMENT_STONECORRIDOR); + 15: BASS_SetEAXPreset(EAX_ENVIRONMENT_ALLEY); + 16: BASS_SetEAXPreset(EAX_ENVIRONMENT_FOREST); + 17: BASS_SetEAXPreset(EAX_ENVIRONMENT_CITY); + 18: BASS_SetEAXPreset(EAX_ENVIRONMENT_MOUNTAINS); + 19: BASS_SetEAXPreset(EAX_ENVIRONMENT_QUARRY); + 20: BASS_SetEAXPreset(EAX_ENVIRONMENT_PLAIN); + 21: BASS_SetEAXPreset(EAX_ENVIRONMENT_PARKINGLOT); + 22: BASS_SetEAXPreset(EAX_ENVIRONMENT_SEWERPIPE); + 23: BASS_SetEAXPreset(EAX_ENVIRONMENT_UNDERWATER); + 24: BASS_SetEAXPreset(EAX_ENVIRONMENT_DRUGGED); + 25: BASS_SetEAXPreset(EAX_ENVIRONMENT_DIZZY); + 26: BASS_SetEAXPreset(EAX_ENVIRONMENT_PSYCHOTIC); + end; +end; + +procedure TForm1.ScrollBar_DopplerChange(Sender: TObject); +var + a: integer; +begin + a := ScrollBar_Doppler.Position; + BASS_Set3DFactors(-1, -1, Power(2, a - 10 / 5.0)); +end; + +procedure TForm1.ScrollBar_RollofChange(Sender: TObject); +var + a: integer; +begin + a:= ScrollBar_Rolloff.Position; + BASS_Set3DFactors(-1, Power(2, (a - 10) / 5.0), -1); +end; + +procedure TForm1.btnResetClick(Sender: TObject); +var + p: PSource; + tmp : BASS_3DVECTOR; +begin + ed_x.Text := '0'; + ed_z.Text := '0'; + if ListBox1.ItemIndex < 0 then + Exit; + p := GetSource(ListBox1.ItemIndex); + if p <> nil then + begin + ZeroMemory(@tmp, sizeof(tmp)); + p.pos := tmp; + p.vel := tmp; + ActualizeSources(TRUE); + end; +end; + +procedure TForm1.ed_XKeyPress(Sender: TObject; var Key: Char); +begin + if Key in [Char(VK_BACK)] then + Key := '0' + else if not (Key in ['0'..'9']) then + Key := #0; + //Only Numbers and Back key allowed +end; + +procedure TForm1.ed_XChange(Sender: TObject); +var + p: PSource; + v_x, v_z: integer; +begin + if ListBox1.ItemIndex < 0 then + Exit; + p := GetSource(ListBox1.ItemIndex); + if p <> nil then + begin + v_x := strtointdef(ed_x.Text, 0); + v_z := strtointdef(ed_z.Text, 0); + // X velocity + + if abs(round(P.vel.x))<> v_x then + P.vel.x := v_x; + // Z velocity + if abs(round(P.vel.z)) <> v_z then + P.vel.z := v_z; + ActualizeSources(TRUE); + end; +end; + +procedure TForm1.FormPaint(Sender: TObject); +begin +DrawSources; +end; + +end. + diff --git a/bass-sys/bass24/delphi/BassTest/BTMain.dfm b/bass-sys/bass24/delphi/BassTest/BTMain.dfm new file mode 100644 index 0000000..4951d07 Binary files /dev/null and b/bass-sys/bass24/delphi/BassTest/BTMain.dfm differ diff --git a/bass-sys/bass24/delphi/BassTest/BTMain.pas b/bass-sys/bass24/delphi/BassTest/BTMain.pas new file mode 100644 index 0000000..b74d5df --- /dev/null +++ b/bass-sys/bass24/delphi/BassTest/BTMain.pas @@ -0,0 +1,337 @@ +(* + * BassTest - Simple BASS Test for Delphi + *) + +unit BTMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Bass, StdCtrls, ExtCtrls, Buttons; + +type + TForm1 = class(TForm) + GroupBox1: TGroupBox; + GroupBox2: TGroupBox; + GroupBox3: TGroupBox; + Button1: TButton; + Button2: TButton; + Label1: TLabel; + ListBox1: TListBox; + ListBox2: TListBox; + Button4: TButton; + Button5: TButton; + Button6: TButton; + Button7: TButton; + Button8: TButton; + Button9: TButton; + Button10: TButton; + Button11: TButton; + OpenDialog1: TOpenDialog; + Timer1: TTimer; + OpenDialog2: TOpenDialog; + OpenDialog3: TOpenDialog; + ListBox3: TListBox; + Button3: TButton; + Button12: TButton; + Button13: TButton; + Button14: TButton; + Button15: TButton; + procedure FormCreate(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure Button4Click(Sender: TObject); + procedure Button5Click(Sender: TObject); + procedure Button6Click(Sender: TObject); + procedure Button7Click(Sender: TObject); + procedure Button8Click(Sender: TObject); + procedure Timer1Timer(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure Button2Click(Sender: TObject); + procedure Button10Click(Sender: TObject); + procedure Button11Click(Sender: TObject); + procedure Button9Click(Sender: TObject); + procedure Button15Click(Sender: TObject); + procedure Button14Click(Sender: TObject); + procedure Button3Click(Sender: TObject); + procedure Button12Click(Sender: TObject); + procedure Button13Click(Sender: TObject); + private + mods: array[0..128] of HMUSIC; + modc: Integer; + sams: array[0..128] of HSAMPLE; + samc: Integer; + strs: array[0..128] of HSTREAM; + strc: Integer; + procedure Error(msg: string); + public + end; + +var + Form1: TForm1; + +implementation + +{$R *.DFM} + + +procedure TForm1.Error(msg: string); +var + s: string; +begin + s := msg + #13#10 + '(Error code: ' + IntToStr(BASS_ErrorGetCode) + ')'; + MessageBox(Handle, PChar(s), nil, 0); +end; + + +procedure TForm1.FormCreate(Sender: TObject); +begin + modc := 0; // music module count + samc := 0; // sample count + strc := 0; // stream count + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then + begin + MessageBox(0,'An incorrect version of BASS.DLL was loaded',nil,MB_ICONERROR); + Halt; + end; + + // Initialize audio - default device, 44100hz, stereo, 16 bits + if not BASS_Init(-1, 44100, 0, Handle, nil) then + Error('Error initializing audio!'); +end; + + +procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); +var + a: Integer; +begin + (* + (It's not actually necessary to free the streams, musics and + samples because they are automatically freed by BASS_Free.) + *) + + // Free stream + if strc > 0 then + for a := 0 to strc - 1 do + BASS_StreamFree(strs[a]); + + // Free music + if modc > 0 then + for a := 0 to modc - 1 do + BASS_MusicFree(mods[a]); + + // Free samples + if samc > 0 then + for a := 0 to samc - 1 do + BASS_SampleFree(sams[a]); + + // Close BASS + BASS_Free(); +end; + + +procedure TForm1.Button4Click(Sender: TObject); +var + i: Integer; +begin + i := ListBox1.ItemIndex; + // Play the music (continuing from current position) + if i >= 0 then + if not BASS_ChannelPlay(mods[i], False) then + Error('Error playing music!'); +end; + + +procedure TForm1.Button5Click(Sender: TObject); +var + i: Integer; +begin + i := ListBox1.ItemIndex; + // Stop the music + if i >= 0 then + BASS_ChannelStop(mods[i]); +end; + + +procedure TForm1.Button6Click(Sender: TObject); +var + i: Integer; +begin + i := ListBox1.ItemIndex; + // Play the music from the beginning + if i >= 0 then + BASS_ChannelPlay(mods[i], True); +end; + + +procedure TForm1.Button7Click(Sender: TObject); +var + f: PChar; +begin + if not OpenDialog1.Execute then Exit; + f := PChar(OpenDialog1.FileName); + mods[modc] := BASS_MusicLoad(False, f, 0, 0, BASS_MUSIC_RAMP {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}, 1); + if mods[modc] <> 0 then + begin + ListBox1.Items.Add(OpenDialog1.FileName); + Inc(modc); + end + else + Error('Error loading music!'); +end; + + +procedure TForm1.Button8Click(Sender: TObject); +var + a, i: Integer; +begin + i := ListBox1.ItemIndex; + if i >= 0 then + begin + BASS_MusicFree(mods[i]); + if i < modc then + for a := i to modc - 1 do + mods[a] := mods[a + 1]; + Dec(modc); + ListBox1.Items.Delete(i); + end; +end; + + +procedure TForm1.Timer1Timer(Sender: TObject); +begin + // update the CPU usage % display + Label1.Caption := 'CPU% ' + FloatToStrF(BASS_GetCPU, ffFixed, 4, 2); +end; + + +procedure TForm1.Button1Click(Sender: TObject); +begin + // Pause audio output + BASS_Pause(); +end; + +procedure TForm1.Button2Click(Sender: TObject); +begin + // Resume audio output + BASS_Start(); +end; + + +procedure TForm1.Button10Click(Sender: TObject); +var + f: PChar; +begin + if not OpenDialog3.Execute then Exit; + f := PChar(OpenDialog3.FileName); + sams[samc] := BASS_SampleLoad(FALSE, f, 0, 0, 3, BASS_SAMPLE_OVER_POS {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if sams[samc] <> 0 then + begin + ListBox2.Items.Add(OpenDialog3.FileName); + Inc(samc); + end + else + Error('Error loading sample!'); +end; + + +procedure TForm1.Button11Click(Sender: TObject); +var + a, i: Integer; +begin + i := ListBox2.ItemIndex; + if i >= 0 then + begin + BASS_SampleFree(sams[i]); + if i < samc then + for a := i to samc - 1 do + sams[a] := sams[a + 1]; + Dec(samc); + ListBox2.Items.Delete(i); + end; +end; + +procedure TForm1.Button9Click(Sender: TObject); +var + i: Integer; + ch: HCHANNEL; +begin + i := ListBox2.ItemIndex; + // Play the sample at default rate, volume=50%, random pan position + if i >= 0 then + begin + ch := BASS_SampleGetChannel(sams[i], False); + BASS_ChannelSetAttribute(ch, BASS_ATTRIB_PAN, (Random(201) - 100) / 100); + BASS_ChannelSetAttribute(ch, BASS_ATTRIB_VOL, 0.5); + if not BASS_ChannelPlay(ch, False) then + Error('Error playing sample!'); + end; +end; + + +procedure TForm1.Button15Click(Sender: TObject); +var + f: PChar; +begin + if not OpenDialog2.Execute then Exit; + f := PChar(OpenDialog2.FileName); + strs[strc] := BASS_StreamCreateFile(False, f, 0, 0, 0 {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if strs[strc] <> 0 then + begin + ListBox3.Items.Add(OpenDialog2.FileName); + Inc(strc); + end + else + Error('Error creating stream!'); +end; + +procedure TForm1.Button14Click(Sender: TObject); +var + a, i: Integer; +begin + i := ListBox3.ItemIndex; + if i >= 0 then + begin + BASS_StreamFree(strs[i]); + if i < strc then + for a := i to strc - 1 do + strs[a] := strs[a + 1]; + Dec(strc); + ListBox3.Items.Delete(i); + end; +end; + +procedure TForm1.Button3Click(Sender: TObject); +var + i: Integer; +begin + i := ListBox3.ItemIndex; + // Play the stream (continuing from current position) + if i >= 0 then + if not BASS_ChannelPlay(strs[i], False) then + Error('Error playing stream!'); +end; + +procedure TForm1.Button12Click(Sender: TObject); +var + i: Integer; +begin + i := ListBox3.ItemIndex; + // Stop the stream + if i >= 0 then + BASS_ChannelStop(strs[i]); +end; + +procedure TForm1.Button13Click(Sender: TObject); +var + i: Integer; +begin + i := ListBox3.ItemIndex; + // Play the stream from the beginning + if i >= 0 then + BASS_ChannelPlay(strs[i], True); +end; + +end. diff --git a/bass-sys/bass24/delphi/BassTest/BassTest.dpr b/bass-sys/bass24/delphi/BassTest/BassTest.dpr new file mode 100644 index 0000000..3ddcea9 --- /dev/null +++ b/bass-sys/bass24/delphi/BassTest/BassTest.dpr @@ -0,0 +1,19 @@ +{ +BASS Simple Test, copyright (c) 1999-2004 Ian Luck. +=================================================== +Other source: BTMain.pas; BTMain.dfm +Delphi version by Titus Miloi (titus.a.m@t-online.de) +} +program BassTest; + +uses + Forms, + BTMain in 'BTMain.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.Title := 'BASS - Simple Test'; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/ConTest/ConTest.dpr b/bass-sys/bass24/delphi/ConTest/ConTest.dpr new file mode 100644 index 0000000..4eb1de5 --- /dev/null +++ b/bass-sys/bass24/delphi/ConTest/ConTest.dpr @@ -0,0 +1,160 @@ +program ConTest; + +{$APPTYPE CONSOLE} + +uses + Windows, + SysUtils, + MMSystem, + Bass in '..\Bass.pas'; + +function IntToFixed(val, digits: Integer): string; +var + s: string; +begin + s := IntToStr(val); + while Length(s) < digits do s := '0' + s; + Result := s; +end; + +// display error messages +procedure Error(text: string); +begin + WriteLn('Error(' + IntToStr(BASS_ErrorGetCode) + '): ' + text); + BASS_Free; + Halt(0); +end; + +var + chn: DWORD; + ismod: Boolean; + time, pos, level, act: DWORD; + a: Integer; + AValue: Single; +begin + WriteLn('Simple console mode BASS example : MOD/MPx/OGG/WAV player'); + Writeln('---------------------------------------------------------'); + + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then + begin + Writeln('An incorrect version of BASS.DLL was loaded'); + Exit; + end; + if (ParamCount <> 1) then + begin + WriteLn(#9 + 'usage: contest '); + Exit; + end; + + // setup output - default device, 44100hz, stereo, 16 bits + if not BASS_Init(-1, 44100, 0, 0, nil) then + Error('Can''t initialize device'); + + // try streaming the file + chn := BASS_StreamCreateFile(FALSE, PChar(ParamStr(1)), 0, 0, BASS_SAMPLE_LOOP {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if (chn = 0) then + chn := BASS_StreamCreateURL(PAnsiChar(AnsiString(ParamStr(1))), 0, BASS_SAMPLE_LOOP, nil, nil); + if (chn <> 0) then + begin + pos := BASS_ChannelGetLength(chn, BASS_POS_BYTE); + if (BASS_StreamGetFilePosition(chn, BASS_FILEPOS_DOWNLOAD) <> QW_ERROR) then + begin + // streaming from the internet + if (pos <> QW_ERROR) then + Write('streaming internet file [' + IntToStr(pos) + ' bytes]') + else + Write('streaming internet file'); + end + else + Write('streaming file [' + IntToStr(pos) + ' bytes]'); + ismod := False; + end + else + begin + // load the MOD (with looping and sensitive ramping) + chn := BASS_MusicLoad(FALSE, PChar(ParamStr(1)), 0, 0, BASS_MUSIC_LOOP or BASS_MUSIC_RAMPS or BASS_MUSIC_PRESCAN {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}, 1); + if (chn = 0) then + // not a MOD either + Error('Can''t play the file'); + // count channels + a := 0; + while BASS_ChannelGetAttribute(chn, BASS_ATTRIB_MUSIC_VOL_CHAN + a, AValue) do + a := a + 1; + Write('playing MOD music "' + BASS_ChannelGetTags(chn, BASS_TAG_MUSIC_NAME) + '" [' + IntToStr(a) + ' chans, ' + IntToStr(BASS_ChannelGetLength(chn, BASS_POS_MUSIC_ORDER)) + ' orders]'); + pos := BASS_ChannelGetLength(chn, BASS_POS_BYTE); + ismod := True; + end; + + // display the time length + if (pos > 0) then + begin + time := Trunc(BASS_ChannelBytes2Seconds(chn,pos)); + WriteLn(Format(' %d:%.2d', [time div 60, time mod 60])); + end + else // no time length available + WriteLn(''); + + BASS_ChannelPlay(chn, False); + + act := BASS_ChannelIsActive(chn); + while (*not KeyPressed and*) (act > 0) do + begin + // display some stuff and wait a bit + level := BASS_ChannelGetLevel(chn); + pos := BASS_ChannelGetPosition(chn, BASS_POS_BYTE); + time := Trunc(BASS_ChannelBytes2Seconds(chn,pos)); + Write(Format('pos %.9d', [pos])); + if (ismod) then + begin + pos := BASS_ChannelGetPosition(chn, BASS_POS_MUSIC_ORDER); + Write(Format(' (%.3d:%.3d)',[LOWORD(pos),HIWORD(pos)])); + end; + Write(Format(' - %d:%.2d - L ', [time div 60,time mod 60])); + + if (act=BASS_ACTIVE_STALLED) then // playback has stalled + begin + Write(Format('-- buffering : %.5d --', + [BASS_StreamGetFilePosition(chn,BASS_FILEPOS_DOWNLOAD)-BASS_StreamGetFilePosition(chn,BASS_FILEPOS_DECODE)])); + end + else + begin + a := 27204; + while (a > 200) do + begin + if (LOWORD(level) >= a) then + Write('*') + else + Write('-'); + a := a * 2 div 3; + end; + Write(' '); + a := 210; + while (a < 32768) do + begin + if (HIWORD(level) >= a) then + Write('*') + else + Write('-'); + a := a * 3 div 2; + end; + end; + Write(Format(' R - cpu %.2f%%' + #13, [BASS_GetCPU])); + Sleep(50); + + // Needs to update act to the current Active + // status for the look to react accordingly + act := BASS_ChannelIsActive(chn); + end; + WriteLn(' '); + + // wind the frequency down... + BASS_ChannelSlideAttribute(chn, BASS_ATTRIB_FREQ, 1000, 500); + Sleep(300); + // ...and fade-out to avoid a "click" + BASS_ChannelSlideAttribute(chn, BASS_ATTRIB_VOL, 0, 200); + while BASS_ChannelIsSliding(chn, BASS_ATTRIB_VOL) do + Sleep(1); + + BASS_Free(); +end. diff --git a/bass-sys/bass24/delphi/DspTest/DTMain.dfm b/bass-sys/bass24/delphi/DspTest/DTMain.dfm new file mode 100644 index 0000000..d9f9030 Binary files /dev/null and b/bass-sys/bass24/delphi/DspTest/DTMain.dfm differ diff --git a/bass-sys/bass24/delphi/DspTest/DTMain.pas b/bass-sys/bass24/delphi/DspTest/DTMain.pas new file mode 100644 index 0000000..036a5a8 --- /dev/null +++ b/bass-sys/bass24/delphi/DspTest/DTMain.pas @@ -0,0 +1,266 @@ +unit DTMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, BASS; + +type + TForm1 = class(TForm) + Button1: TButton; + CheckBox1: TCheckBox; + CheckBox2: TCheckBox; + CheckBox3: TCheckBox; + OpenDialog1: TOpenDialog; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure CheckBox1Click(Sender: TObject); + procedure CheckBox2Click(Sender: TObject); + procedure CheckBox3Click(Sender: TObject); + private + { Private-Deklarationen } + public + { Public-Deklarationen } + end; + +const + ECHBUFLEN = 1200; // buffer length + FLABUFLEN = 350; // buffer length + +var + Form1: TForm1; + + floatable: DWORD; // floating-point channel support? + chan: DWORD; // the channel... HMUSIC or HSTREAM + + rotdsp: HDSP = 0; // DSP handle + rotpos: Single; // cur.pos + + echdsp: HDSP = 0; // DSP handle + echbuf: array[0..ECHBUFLEN - 1,0..1] of Single; // buffer + echpos: Integer; // cur.pos + + fladsp: HDSP = 0; // DSP handle + flabuf: array[0..FLABUFLEN - 1,0..1] of Single; // buffer + flapos: Integer; // cur.pos + flas, flasinc: Single; // sweep pos/increment + +implementation + +{$R *.DFM} + +function fmod(a, b: Single): Single; +begin + Result := a - (b * Trunc(a / b)); +end; + +procedure Rotate(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: Pointer); stdcall; +var + a: DWORD; + d: PSingle; +begin + d := buffer; + + a := 0; + while (a < (length div 4)) do + begin + d^ := d^ * Abs(Sin(rotpos)); + Inc(d); + d^ := d^ * Abs(Cos(rotpos)); + + rotpos := fmod(rotpos + 0.00003, Pi); + + Inc(d); + a := a + 2; + end; +end; + +procedure Echo(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: Pointer); stdcall; +var + a: DWORD; + d: PSingle; + l, r: Single; +begin + d := buffer; + + a := 0; + while (a < (length div 4)) do + begin + l := d^ + (echbuf[echpos,1] / 2); + Inc(d); + r := d^ + (echbuf[echpos,0] / 2); + Dec(d); + + { Basic "bathroom" reverb } + d^ := l; + echbuf[echpos,0] := l; + Inc(d); + d^ := r; + echbuf[echpos,1] := r; + + { Echo } +// echbuf[echpos,0] := d^; +// d^ := l; +// Inc(d); +// echbuf[echpos,1] := d^; +// d^ := r; + + echpos := echpos + 1; + if (echpos = ECHBUFLEN) then + echpos := 0; + + Inc(d); + a := a + 2; + end; +end; + +procedure Flange(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: Pointer); stdcall; +var + a: DWORD; + d: PSingle; + f, s: Single; + p1, p2: Integer; +begin + d := buffer; + + a := 0; + while (a < (length div 4)) do + begin + p1 := Trunc(flapos + flas) mod FLABUFLEN; + p2 := (p1 + 1) mod FLABUFLEN; + f := fmod(flas, 1); + + s := d^ + ((flabuf[p1, 0] * (1 - f)) + (flabuf[p2, 0] * f)); + flabuf[flapos, 0] := d^; + d^ := s; + + Inc(d); + s := d^ + ((flabuf[p1, 1] * (1 - f)) + (flabuf[p2, 1] * f)); + flabuf[flapos, 1] := d^; + d^ := s; + + flapos := flapos + 1; + if (flapos = FLABUFLEN) then + flapos := 0; + + flas := flas + flasinc; + if (flas < 0.0) or (flas > FLABUFLEN) then + flasinc := -flasinc; + + Inc(d); + a := a + 2; + end; +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then + begin + MessageBox(0,'An incorrect version of BASS.DLL was loaded',0,MB_ICONERROR); + Halt; + end; + + BASS_SetConfig(BASS_CONFIG_FLOATDSP, 1); + if not BASS_Init(-1, 44100, 0, Handle, nil) then + begin + MessageBox(0, 'Can''t initialize device', 0, 0); + Halt; + end; + + floatable := BASS_StreamCreate(44100, 2, BASS_SAMPLE_FLOAT, nil, 0); + if (floatable > 0) then + begin + BASS_StreamFree(floatable); // woohoo! + floatable := BASS_SAMPLE_FLOAT; + end +end; + +procedure TForm1.FormDestroy(Sender: TObject); +begin + BASS_Free; +end; + +procedure TForm1.Button1Click(Sender: TObject); +var + info: BASS_CHANNELINFO; +begin + if not OpenDialog1.Execute then + Exit; + + // free both MOD and stream, it must be one of them! :) + BASS_MusicFree(chan); + BASS_StreamFree(chan); + + chan := BASS_StreamCreateFile(False, PChar(OpenDialog1.FileName), 0, 0, floatable or BASS_SAMPLE_LOOP {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if (chan = 0) then + chan := BASS_MusicLoad(False, PChar(OpenDialog1.FileName), 0, 0, BASS_MUSIC_LOOP or BASS_MUSIC_RAMPS or floatable {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}, 1); + if (chan = 0) then + begin + // whatever it is, it ain't playable + Button1.Caption := 'click here to open a file...'; + MessageBox(0, 'Can''t play the file', 0, 0); + Exit; + end; + + BASS_ChannelGetInfo(chan, info); + if (info.chans <> 2) then // only stereo is allowed + begin + Button1.Caption := 'click here to open a file...'; + BASS_MusicFree(chan); + BASS_StreamFree(chan); + MessageBox(0, 'Only stereo sources are supported', 0, 0); + Exit; + end; + + Button1.Caption := OpenDialog1.FileName; + // setup DSPs on new channel + CheckBox1.OnClick(Self); + CheckBox2.OnClick(Self); + CheckBox3.OnClick(Self); + + // play both MOD and stream, it must be one of them! + BASS_ChannelPlay(chan, False); +end; + +procedure TForm1.CheckBox1Click(Sender: TObject); +begin + if (CheckBox1.Checked) then + begin + rotpos := 0.7853981; + rotdsp := BASS_ChannelSetDSP(chan, @Rotate, 0, 2); + end + else + BASS_ChannelRemoveDSP(chan, rotdsp); +end; + +procedure TForm1.CheckBox2Click(Sender: TObject); +begin + if (CheckBox2.Checked) then + begin + FillChar(echbuf, SizeOf(echbuf), 0); + echpos := 0; + echdsp := BASS_ChannelSetDSP(chan, @Echo, 0, 1); + end + else + BASS_ChannelRemoveDSP(chan, echdsp); +end; + +procedure TForm1.CheckBox3Click(Sender: TObject); +begin + if (CheckBox3.Checked) then + begin + FillChar(flabuf, SizeOf(flabuf), 0); + flapos := 0; + flas := FLABUFLEN / 2; + flasinc := 0.002; + fladsp := BASS_ChannelSetDSP(chan, @Flange, 0, 0); + end + else + BASS_ChannelRemoveDSP(chan, fladsp); +end; + +end. + diff --git a/bass-sys/bass24/delphi/DspTest/DspTest.dpr b/bass-sys/bass24/delphi/DspTest/DspTest.dpr new file mode 100644 index 0000000..1844c29 --- /dev/null +++ b/bass-sys/bass24/delphi/DspTest/DspTest.dpr @@ -0,0 +1,19 @@ +{ +BASS simple DSP test, copyright (c) 2000-2004 Ian Luck. +======================================================= +Other source: DTMain.pas; DTMain.dcu +Delphi version by Titus Miloi (titus.a.m@t-online.de) +} +program DspTest; + +uses + Forms, + DTMain in 'DTMain.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.Title := 'BASS simple DSP Test'; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/RecordTest/RecordTest.dpr b/bass-sys/bass24/delphi/RecordTest/RecordTest.dpr new file mode 100644 index 0000000..88d43fb --- /dev/null +++ b/bass-sys/bass24/delphi/RecordTest/RecordTest.dpr @@ -0,0 +1,12 @@ +program RecordTest; + +uses + Forms, + Unit1 in 'Unit1.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/RecordTest/Unit1.dfm b/bass-sys/bass24/delphi/RecordTest/Unit1.dfm new file mode 100644 index 0000000..2fdd07c --- /dev/null +++ b/bass-sys/bass24/delphi/RecordTest/Unit1.dfm @@ -0,0 +1,134 @@ +object Form1: TForm1 + Left = 193 + Top = 105 + Caption = 'BASS recording example' + ClientHeight = 93 + ClientWidth = 328 + Color = clBtnFace + Constraints.MaxHeight = 120 + Constraints.MinHeight = 90 + Constraints.MinWidth = 336 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + DesignSize = ( + 328 + 93) + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 3 + Top = 30 + Width = 118 + Height = 13 + Alignment = taCenter + Anchors = [akLeft, akTop, akRight] + AutoSize = False + ExplicitWidth = 154 + end + object Bevel1: TBevel + Left = 111 + Top = 35 + Width = 211 + Height = 20 + Anchors = [akTop, akRight] + ExplicitLeft = 147 + end + object lPos: TLabel + Left = 135 + Top = 39 + Width = 196 + Height = 13 + Alignment = taCenter + Anchors = [akTop, akRight] + AutoSize = False + ExplicitLeft = 171 + end + object VolumeLevel: TLabel + Left = 8 + Top = 72 + Width = 64 + Height = 13 + Caption = 'VolumeLevel:' + end + object Label2: TLabel + Left = 88 + Top = 72 + Width = 6 + Height = 13 + Caption = '0' + end + object ComboBox1: TComboBox + Left = 8 + Top = 8 + Width = 93 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + TabOrder = 0 + OnChange = ComboBox1Change + end + object bRecord: TButton + Left = 111 + Top = 8 + Width = 90 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Record' + TabOrder = 1 + OnClick = bRecordClick + end + object bPlay: TButton + Left = 208 + Top = 8 + Width = 53 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Play' + TabOrder = 2 + OnClick = bPlayClick + end + object TrackBar1: TTrackBar + Left = 6 + Top = 45 + Width = 95 + Height = 15 + Anchors = [akLeft, akTop, akRight] + Max = 100 + TabOrder = 3 + ThumbLength = 9 + TickMarks = tmBoth + TickStyle = tsNone + OnChange = TrackBar1Change + end + object bSave: TButton + Left = 268 + Top = 8 + Width = 53 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Save' + TabOrder = 4 + OnClick = bSaveClick + end + object PosTimer: TTimer + Interval = 200 + OnTimer = PosTimerTimer + Left = 120 + Top = 32 + end + object SaveDialog: TSaveDialog + DefaultExt = 'wav' + Filter = 'WAV files|*.wav|All files|*.*' + Title = 'Save WAV...' + Left = 152 + Top = 32 + end +end diff --git a/bass-sys/bass24/delphi/RecordTest/Unit1.pas b/bass-sys/bass24/delphi/RecordTest/Unit1.pas new file mode 100644 index 0000000..1f6276d --- /dev/null +++ b/bass-sys/bass24/delphi/RecordTest/Unit1.pas @@ -0,0 +1,297 @@ +(* + * BASS Recording example for Delphi + *) + +unit Unit1; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Bass, ExtCtrls, ComCtrls; + +type + WAVHDR = packed record + riff: array[0..3] of AnsiChar; + len: DWord; + cWavFmt: array[0..7] of AnsiChar; + dwHdrLen: DWord; + wFormat: Word; + wNumChannels: Word; + dwSampleRate: DWord; + dwBytesPerSec: DWord; + wBlockAlign: Word; + wBitsPerSample: Word; + cData: array[0..3] of AnsiChar; + dwDataLen: DWord; + end; + +type + TForm1 = class(TForm) + ComboBox1: TComboBox; + bRecord: TButton; + bPlay: TButton; + Label1: TLabel; + TrackBar1: TTrackBar; + Bevel1: TBevel; + bSave: TButton; + lPos: TLabel; + PosTimer: TTimer; + SaveDialog: TSaveDialog; + Label2 : TLabel; + procedure FormCreate(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure bRecordClick(Sender: TObject); + procedure bPlayClick(Sender: TObject); + procedure ComboBox1Change(Sender: TObject); + procedure StartRecording; + procedure StopRecording; + procedure PosTimerTimer(Sender: TObject); + procedure UpdateInputInfo; + procedure TrackBar1Change(Sender: TObject); + procedure bSaveClick(Sender: TObject); + private + { Private declarations } + WaveStream: TMemoryStream; + public + { Public declarations } + end; + + +var + Form1: TForm1; + WaveHdr: WAVHDR; // WAV header + rchan: HRECORD; // recording channel + chan: HSTREAM; // playback channel + + +implementation + +{$R *.dfm} + + +(* This is called while recording audio *) +function RecordingCallback(Handle: HRECORD; buffer: Pointer; length: DWORD; user: Pointer): boolean; stdcall; +begin + // Copy new buffer contents to the memory buffer + Form1.WaveStream.Write(buffer^, length); + // Allow recording to continue + Result := True; +end; + + +(* Initialize BASS, form controls, memory stream *) +procedure TForm1.FormCreate(Sender: TObject); +var + i: Integer; + dName: PAnsiChar; + level: Single; +begin + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then + begin + MessageBox(0,'An incorrect version of BASS.DLL was loaded', nil,MB_ICONERROR); + Halt; + end; + if (not BASS_RecordInit(-1)) or (not BASS_Init(-1, 44100, 0, Handle, nil)) then + begin + BASS_RecordFree; + BASS_Free(); + MessageDlg('Cannot start default recording device!', mtError, [mbOk], 0); + Halt; + end; + WaveStream := TMemoryStream.Create; + i := 0; + dName := BASS_RecordGetInputName(i); + while dName <> nil do + begin + ComboBox1.Items.Add(StrPas(dName)); + // is this one currently "on"? + if (BASS_RecordGetInput(i, level) and BASS_INPUT_OFF) = 0 then + ComboBox1.ItemIndex := i; + Inc(i); + dName := BASS_RecordGetInputName(i); + end; + ComboBox1Change(Self); // display info +end; + + +procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + + +(* Application closing, release stuff *) +procedure TForm1.FormDestroy(Sender: TObject); +begin + WaveStream.Free; + BASS_RecordFree; + BASS_Free; + BASS_Stop; +end; + + +(* Start recording to memory *) +procedure TForm1.StartRecording; +begin + if ComboBox1.ItemIndex < 0 then Exit; + if WaveStream.Size > 0 then + begin // free old recording + BASS_StreamFree(chan); + WaveStream.Clear; + end; + // generate header for WAV file + with WaveHdr do + begin + riff := 'RIFF'; + len := 36; + cWavFmt := 'WAVEfmt '; + dwHdrLen := 16; + wFormat := 1; + wNumChannels := 2; + dwSampleRate := 44100; + wBlockAlign := 4; + dwBytesPerSec := 176400; + wBitsPerSample := 16; + cData := 'data'; + dwDataLen := 0; + end; + WaveStream.Write(WaveHdr, SizeOf(WAVHDR)); + // start recording @ 44100hz 16-bit stereo + rchan := BASS_RecordStart(44100, 2, 0, @RecordingCallback, nil); + if rchan = 0 then + begin + MessageDlg('Couldn''t start recording!', mtError, [mbOk], 0); + WaveStream.Clear; + end + else + begin + bRecord.Caption := 'Stop'; + bPlay.Enabled := False; + bSave.Enabled := False; + end; +end; + + +(* Stop recording *) +procedure TForm1.StopRecording; +var + i: integer; +begin + BASS_ChannelStop(rchan); + bRecord.Caption := 'Record'; + // complete the WAV header + WaveStream.Position := 4; + i := WaveStream.Size - 8; + WaveStream.Write(i, 4); + i := i - $24; + WaveStream.Position := 40; + WaveStream.Write(i, 4); + WaveStream.Position := 0; + // create a stream from the recorded data + chan := BASS_StreamCreateFile(True, WaveStream.Memory, 0, WaveStream.Size, 0); + if chan <> 0 then + begin + // enable "Play" & "Save" buttons + bPlay.Enabled := True; + bSave.Enabled := True; + end + else + MessageDlg('Error creating stream from recorded data!', mtError, [mbOk], 0); +end; + + +(* Start/stop recording *) +procedure TForm1.bRecordClick(Sender: TObject); +begin + if BASS_ChannelIsActive(rchan) <> 0 + then StopRecording + else StartRecording; +end; + + +(* Play the recorded data *) +procedure TForm1.bPlayClick(Sender: TObject); +begin + BASS_ChannelPlay(chan, True); +end; + + +(* Change recording input *) +procedure TForm1.ComboBox1Change(Sender: TObject); +var + i: Integer; + r: Boolean; +begin + // enable the selected input + r := True; + i := 0; + // first disable all inputs, then... + while r do + begin + r := BASS_RecordSetInput(i, BASS_INPUT_OFF, -1); + Inc(i); + end; + // ...enable the selected. + BASS_RecordSetInput(ComboBox1.ItemIndex, BASS_INPUT_ON, -1); + UpdateInputInfo; // update info +end; + + +procedure TForm1.UpdateInputInfo; +var + i: DWord; + level: Single; +begin + I := BASS_RecordGetInput(ComboBox1.ItemIndex, level); + TrackBar1.Position := Round(level * 100); // set the level slider + Label2.Caption := IntToStr(TrackBar1.Position); + + case (i and BASS_INPUT_TYPE_MASK) of + BASS_INPUT_TYPE_DIGITAL: Label1.Caption := 'digital'; + BASS_INPUT_TYPE_LINE: Label1.Caption := 'line-in'; + BASS_INPUT_TYPE_MIC: Label1.Caption := 'microphone'; + BASS_INPUT_TYPE_SYNTH: Label1.Caption := 'midi synth'; + BASS_INPUT_TYPE_CD: Label1.Caption := 'analog cd'; + BASS_INPUT_TYPE_PHONE: Label1.Caption := 'telephone'; + BASS_INPUT_TYPE_SPEAKER: Label1.Caption := 'pc speaker'; + BASS_INPUT_TYPE_WAVE: Label1.Caption := 'wave/pcm'; + BASS_INPUT_TYPE_AUX: Label1.Caption := 'aux'; + BASS_INPUT_TYPE_ANALOG: Label1.Caption := 'analog'; + else + Label1.Caption := 'undefined'; + end; +end; + + +(* Update rec/playback position display *) +procedure TForm1.PosTimerTimer(Sender: TObject); +begin + if WaveStream.Size < 1 then Exit; + if BASS_ChannelIsActive(chan) = BASS_ACTIVE_STOPPED then + lPos.Caption := IntToStr(WaveStream.Size) else + lPos.Caption := IntToStr(BASS_ChannelGetPosition(chan, BASS_POS_BYTE)) + ' / ' + IntToStr(WaveStream.Size); +end; + + +(* Set recording volume *) +procedure TForm1.TrackBar1Change(Sender: TObject); +begin + BASS_RecordSetInput(ComboBox1.ItemIndex, 0, TrackBar1.Position / 100); + Label2.Caption := IntToStr(TrackBar1.Position); + +end; + + +(* Save recorded audio to WAV file *) +procedure TForm1.bSaveClick(Sender: TObject); +begin + if SaveDialog.Execute then + WaveStream.SaveToFile(SaveDialog.FileName); +end; + + +end. + diff --git a/bass-sys/bass24/delphi/SampleVis/CommonTypes.pas b/bass-sys/bass24/delphi/SampleVis/CommonTypes.pas new file mode 100644 index 0000000..4f4064c --- /dev/null +++ b/bass-sys/bass24/delphi/SampleVis/CommonTypes.pas @@ -0,0 +1,15 @@ +unit CommonTypes; +{ CommonTypes by Alessandro Cappellozza + version 0.8 02/2002 + http://digilander.Libero.it/Kappe/audioobject +} + +interface + uses Windows, Dialogs, Forms, Controls, StdCtrls, Classes, ExtCtrls, SysUtils; + + Type TWaveData = array [ 0..2048] of DWORD; + Type TFFTData = array [0..512] of Single; + +implementation + +end. diff --git a/bass-sys/bass24/delphi/SampleVis/circle_vis.pas b/bass-sys/bass24/delphi/SampleVis/circle_vis.pas new file mode 100644 index 0000000..e968e84 --- /dev/null +++ b/bass-sys/bass24/delphi/SampleVis/circle_vis.pas @@ -0,0 +1,109 @@ +unit circle_vis; +{ Circle Visualyzation by Alessandro Cappellozza + version 0.5 05/2002 + http://digilander.iol.it/Kappe/audioobject +} + +interface + uses Windows, Dialogs, Graphics, SysUtils, CommonTypes, Classes; + + type TCircleScope = Class(TObject) + private + VisBuff : TBitmap; + BackBmp : TBitmap; + + BkgColor : TColor; + ScopeRad : Integer; + ScopeOff : Integer; + PenColor : TColor; + DrawType : Integer; + DrawRes : Integer; + FrmClear : Boolean; + UseBkg : Boolean; + + public + Constructor Create (Width, Height : Integer); + procedure Draw(HWND : THandle; WaveData : TWaveData; X, Y : Integer); + procedure SetBackGround (Active : Boolean; BkgCanvas : TGraphic); + + property BackColor : TColor read BkgColor write BkgColor; + property Radius : Integer read ScopeRad write ScopeRad; + property Offset : Integer read ScopeOff write ScopeOff; + property Pen : TColor read PenColor write PenColor; + property Mode : Integer read DrawType write DrawType; + property Res : Integer read DrawRes write DrawRes; + property FrameClear : Boolean read FrmClear write FrmClear; + end; + + var CircleScope : TCircleScope; + +implementation + + Constructor TCircleScope.Create(Width, Height : Integer); + begin + VisBuff := TBitmap.Create; + BackBmp := TBitmap.Create; + + VisBuff.Width := Width; + VisBuff.Height := Height; + BackBmp.Width := Width; + BackBmp.Height := Height; + + BkgColor := clBlack; + ScopeRad := 30; + ScopeOff := 30; + PenColor := clWhite; + DrawType := 0; + DrawRes := 2; + FrmClear := True; + UseBkg := False; + end; + + procedure TCircleScope.SetBackGround (Active : Boolean; BkgCanvas : TGraphic); + begin + UseBkg := Active; + BackBmp.Canvas.Draw(0, 0, BkgCanvas); + end; + + procedure TCircleScope.Draw(HWND : THandle; WaveData : TWaveData; X, Y : Integer); + var i, Rd : Integer; Angle : Single; R, L : SmallInt; + begin + if FrmClear then begin + VisBuff.Canvas.Pen.Color := BkgColor; + VisBuff.Canvas.Brush.Color := BkgColor; + VisBuff.Canvas.Rectangle(0, 0, VisBuff.Width, VisBuff.Height); + if UseBkg then VisBuff.Canvas.CopyRect(Rect(0, 0, BackBmp.Width, BackBmp.Height), BackBmp.Canvas, Rect(0, 0, BackBmp.Width, BackBmp.Height)); + end; + + VisBuff.Canvas.Pen.Color := PenColor; + R := LOWORD(WaveData[0]); + L := HIWORD(WaveData[0]); + Rd := Trunc(((R + L) / (2 * 65535)) * ScopeOff) + ScopeRad; + VisBuff.Canvas.MoveTo(X, Y + Rd); + + for i := 1 to 254 do begin + Angle := (i /256) * (6.28); + R := LOWORD(WaveData[i * DrawRes]); + L := HIWORD(WaveData[i * DrawRes]); + Rd := Trunc(((R + L) / (2 * 65535)) * ScopeOff) + ScopeRad; + + case DrawType of + 0 : VisBuff.Canvas.lineto(X + Trunc(sin(Angle) * Rd), Y + Trunc(cos(Angle) * Rd)); + + 1 : begin + VisBuff.Canvas.MoveTo(X, Y); + VisBuff.Canvas.lineto(X + Trunc(sin(Angle) * Rd), Y + Trunc(cos(Angle) * Rd)); + end; + + 2 : VisBuff.Canvas.Pixels[X + Trunc(sin(Angle) * Rd), Y + Trunc(cos(Angle) * Rd)] := PenColor; + end; + end; + + R := LOWORD(WaveData[0]); + L := HIWORD(WaveData[0]); + Rd := Trunc(((R + L) / (2 * 65535)) * ScopeOff) + ScopeRad; + VisBuff.Canvas.lineto(X, Y + Rd); + + BitBlt(HWND, 0, 0, VisBuff.Width, VisBuff.Height, VisBuff.Canvas.Handle, 0, 0, srccopy) + end; +end. diff --git a/bass-sys/bass24/delphi/SampleVis/main.dfm b/bass-sys/bass24/delphi/SampleVis/main.dfm new file mode 100644 index 0000000..3d21dd1 Binary files /dev/null and b/bass-sys/bass24/delphi/SampleVis/main.dfm differ diff --git a/bass-sys/bass24/delphi/SampleVis/main.pas b/bass-sys/bass24/delphi/SampleVis/main.pas new file mode 100644 index 0000000..0219230 --- /dev/null +++ b/bass-sys/bass24/delphi/SampleVis/main.pas @@ -0,0 +1,247 @@ +{ + Source code under Bass license + by Alessandro Cappellozza + + http://digilander.libero.it/Kappe + mail acappellozza@ieee.org + + Notice + The body (this unit) only drive the classes and Bass, + the rest is wrtitten in OOD for separate the draw code + } + +unit main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, osc_vis, spectrum_vis, + Dialogs, ExtCtrls, StdCtrls, ComCtrls, circle_vis, Bass, CommonTypes, ExtDlgs; + +type + TFormPlayer = class(TForm) + Button1: TButton; + OpenDialog: TOpenDialog; + PaintFrame: TPaintBox; + TimerRender: TTimer; + BackImageRes: TImage; + Button2: TButton; + RadioMode: TRadioGroup; + RadioDraw: TRadioGroup; + GroupBox1: TGroupBox; + TrackOff: TTrackBar; + TrackRes: TTrackBar; + TrackY: TTrackBar; + TrackX: TTrackBar; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + PanelBkg: TPanel; + PanelPen: TPanel; + Label6: TLabel; + Label7: TLabel; + ColorDialog: TColorDialog; + GroupBox2: TGroupBox; + TrackRad: TTrackBar; + Label5: TLabel; + GroupBox3: TGroupBox; + SpecTrackWidth: TTrackBar; + Label8: TLabel; + PanelPeakColor: TPanel; + Label9: TLabel; + Label10: TLabel; + Label11: TLabel; + Button3: TButton; + CheckSpecPeaks: TCheckBox; + OpenPictureDialog: TOpenPictureDialog; + SpinLineFall: TUpDown; + SpinPeakFall: TUpDown; + EditLineFall: TEdit; + EditPeakFall: TEdit; + procedure FormCreate(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure TimerRenderTimer(Sender: TObject); + procedure Button2Click(Sender: TObject); + procedure RadioModeClick(Sender: TObject); + procedure TrackOffChange(Sender: TObject); + procedure TrackResChange(Sender: TObject); + procedure TrackRadChange(Sender: TObject); + procedure PanelBkgClick(Sender: TObject); + procedure PanelPenClick(Sender: TObject); + procedure SpecTrackWidthChange(Sender: TObject); + procedure PanelPeakColorClick(Sender: TObject); + procedure Button3Click(Sender: TObject); + procedure CheckSpecPeaksClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure SpinLineFallClick(Sender: TObject; Button: TUDBtnType); + procedure SpinPeakFallClick(Sender: TObject; Button: TUDBtnType); + private + { Private declarations } + public + { Public declarations } + end; + +var + FormPlayer : TFormPlayer; + Channel : DWORD; + +implementation + +{$R *.dfm} + +procedure TFormPlayer.FormCreate(Sender: TObject); +begin + BASS_Init(-1, 44100, 0, Application.Handle, nil); + + CircleScope := TCircleScope.Create(PaintFrame.Width, PaintFrame.Height); + OcilloScope := TOcilloScope.Create(PaintFrame.Width, PaintFrame.Height); + Spectrum := TSpectrum.Create(PaintFrame.Width, PaintFrame.Height); +end; + + +procedure TFormPlayer.Button1Click(Sender: TObject); +begin + OpenDialog.Title := 'Open Files'; + OpenDialog.Filter := 'mp3|*.mp3'; + if not OpenDialog.Execute then exit; + Channel := BASS_StreamCreateFile(FALSE, PChar(OpenDialog.FileName), 0, 0, 0 {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + BASS_ChannelPlay(Channel, False); +end; + +procedure TFormPlayer.TimerRenderTimer(Sender: TObject); + var FFTFata : TFFTData; WaveData : TWaveData; +begin + + if BASS_ChannelIsActive(Channel) <> BASS_ACTIVE_PLAYING then Exit; + +case RadioDraw.ItemIndex of + 0 : + begin + BASS_ChannelGetData(Channel, @WaveData, 2048); + CircleScope.Draw (PaintFrame.Canvas.Handle, WaveData, TrackX.Position, TrackY.Position); + end; + + 1 : + begin + BASS_ChannelGetData(Channel, @WaveData, 2048); + OcilloScope.Draw (PaintFrame.Canvas.Handle, WaveData, TrackX.Position - 50, TrackY.Position); + end; + + 2 : + begin + BASS_ChannelGetData(Channel, @FFTFata, BASS_DATA_FFT1024); + Spectrum.Draw (PaintFrame.Canvas.Handle, FFTFata, TrackX.Position - 40, TrackY.Position - 60); + end; +end; +end; + +procedure TFormPlayer.Button2Click(Sender: TObject); +begin + OpenPictureDialog.Title := 'Open Background Bitmap'; + OpenPictureDialog.Filter := 'BMP|*.bmp'; + if not OpenPictureDialog.Execute then exit; + BackImageRes.Picture.LoadFromFile(OpenPictureDialog.FileName); + + CircleScope.SetBackGround(True, BackImageRes.Picture.Graphic); + CircleScope.Pen := clBlack; + + OcilloScope.SetBackGround(True, BackImageRes.Picture.Graphic); + OcilloScope.Pen := clBlack; + + Spectrum.SetBackGround(True, BackImageRes.Picture.Graphic); + Spectrum.Pen := clBlack; +end; + +procedure TFormPlayer.RadioModeClick(Sender: TObject); +begin + CircleScope.Mode := RadioMode.ItemIndex; + OcilloScope.Mode := RadioMode.ItemIndex; + Spectrum.Mode := RadioMode.ItemIndex; +end; + +procedure TFormPlayer.TrackOffChange(Sender: TObject); +begin + CircleScope.Offset := TrackOff.Position; + OcilloScope.Offset := TrackOff.Position; + Spectrum.Height := TrackOff.Position; +end; + +procedure TFormPlayer.TrackResChange(Sender: TObject); +begin + CircleScope.Res := TrackRes.Position; + OcilloScope.Res := TrackRes.Position; + Spectrum.Res := TrackRes.Position; +end; + +procedure TFormPlayer.TrackRadChange(Sender: TObject); +begin + CircleScope.Radius := TrackRad.Position; +end; + +procedure TFormPlayer.PanelBkgClick(Sender: TObject); +begin + ColorDialog.Color := PanelBkg.Color; + if not ColorDialog.Execute then Exit; + PanelBkg.Color := ColorDialog.Color; + CircleScope.BackColor := ColorDialog.Color; + OcilloScope.BackColor := ColorDialog.Color; + Spectrum.BackColor := ColorDialog.Color; +end; + +procedure TFormPlayer.PanelPenClick(Sender: TObject); +begin + ColorDialog.Color := PanelPen.Color; + if not ColorDialog.Execute then Exit; + PanelPen.Color := ColorDialog.Color; + CircleScope.Pen := ColorDialog.Color; + OcilloScope.Pen := ColorDialog.Color; + Spectrum.Pen := ColorDialog.Color; +end; + +procedure TFormPlayer.SpecTrackWidthChange(Sender: TObject); +begin + Spectrum.Width := SpecTrackWidth.Position; +end; + +procedure TFormPlayer.PanelPeakColorClick(Sender: TObject); +begin + ColorDialog.Color := PanelPeakColor.Color; + if not ColorDialog.Execute then Exit; + PanelPeakColor.Color := ColorDialog.Color; + Spectrum.Peak := ColorDialog.Color; +end; + +procedure TFormPlayer.Button3Click(Sender: TObject); +begin + CircleScope.SetBackGround(False, BackImageRes.Picture.Graphic); + CircleScope.Pen := PanelPen.Color; + + OcilloScope.SetBackGround(False, BackImageRes.Picture.Graphic); + OcilloScope.Pen := PanelPen.Color; + + Spectrum.SetBackGround(False, BackImageRes.Picture.Graphic); + Spectrum.Pen := PanelPen.Color; +end; + +procedure TFormPlayer.CheckSpecPeaksClick(Sender: TObject); +begin +Spectrum.DrawPeak := CheckSpecPeaks.Checked; +end; + +procedure TFormPlayer.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Bass_Free; +end; + +procedure TFormPlayer.SpinLineFallClick(Sender: TObject; Button: TUDBtnType); +begin + Spectrum.LineFallOff := SpinLineFall.Position; +end; + +procedure TFormPlayer.SpinPeakFallClick(Sender: TObject; Button: TUDBtnType); +begin + Spectrum.PeakFallOff := SpinPeakFall.Position; +end; + +end. diff --git a/bass-sys/bass24/delphi/SampleVis/osc_vis.pas b/bass-sys/bass24/delphi/SampleVis/osc_vis.pas new file mode 100644 index 0000000..fd97a4a --- /dev/null +++ b/bass-sys/bass24/delphi/SampleVis/osc_vis.pas @@ -0,0 +1,108 @@ +unit osc_vis; +{ Oscilloscope Visualyzation by Alessandro Cappellozza + version 0.8 05/2002 + http://digilander.iol.it/Kappe/audioobject +} + +interface + uses Windows, Dialogs, Graphics, SysUtils, CommonTypes, Classes; + + type TOcilloScope = Class(TObject) + private + VisBuff : TBitmap; + BackBmp : TBitmap; + + BkgColor : TColor; + ScopeOff : Integer; + PenColor : TColor; + DrawType : Integer; + DrawRes : Integer; + FrmClear : Boolean; + UseBkg : Boolean; + + public + Constructor Create (Width, Height : Integer); + procedure Draw(HWND : THandle; WaveData : TWaveData; X, Y : Integer); + procedure SetBackGround (Active : Boolean; BkgCanvas : TGraphic); + + property BackColor : TColor read BkgColor write BkgColor; + property Offset : Integer read ScopeOff write ScopeOff; + property Pen : TColor read PenColor write PenColor; + property Mode : Integer read DrawType write DrawType; + property Res : Integer read DrawRes write DrawRes; + property FrameClear : Boolean read FrmClear write FrmClear; + end; + + var OcilloScope : TOcilloScope; + +implementation + + Constructor TOcilloScope.Create(Width, Height : Integer); + begin + VisBuff := TBitmap.Create; + BackBmp := TBitmap.Create; + + VisBuff.Width := Width; + VisBuff.Height := Height; + BackBmp.Width := Width; + BackBmp.Height := Height; + + BkgColor := clBlack; + ScopeOff := 50; + PenColor := clWhite; + DrawType := 0; + DrawRes := 1; + FrmClear := True; + UseBkg := False; + end; + + procedure TOcilloScope.SetBackGround (Active : Boolean; BkgCanvas : TGraphic); + begin + UseBkg := Active; + BackBmp.Canvas.Draw(0, 0, BkgCanvas); + end; + + procedure TOcilloScope.Draw(HWND : THandle; WaveData : TWaveData; X, Y : Integer); + var i, YPos : LongInt; R, L : SmallInt; + begin + if FrmClear then begin + VisBuff.Canvas.Pen.Color := BkgColor; + VisBuff.Canvas.Brush.Color := BkgColor; + if UseBkg then + BitBlt(VisBuff.Canvas.Handle, // Destination + 0, 0, // X, Y (target pos) + VisBuff.Width, VisBuff.Height, // Size to copy + BackBmp.Canvas.handle, // Source + 0, 0, // X, Y (source pos) + SrcCopy) // plain copy + else + VisBuff.Canvas.Rectangle(0, 0, VisBuff.Width, VisBuff.Height) // only if no background + end; + + VisBuff.Canvas.Pen.Color := PenColor; + R := SmallInt(LOWORD(WaveData[0])); + L := SmallInt(HIWORD(WaveData[0])); + YPos := Trunc(((R + L) / (2 * 65535)) * ScopeOff) ; + VisBuff.Canvas.MoveTo(X , Y + YPos); + + for i := 1 to 256 do begin + R := SmallInt(Loword(WaveData[i * DrawRes])); + L := SmallInt(HIword(WaveData[i * DrawRes])); + YPos := Trunc(((R + L) / (2 * 65535)) * ScopeOff) ; + + case DrawType of + 0 : VisBuff.Canvas.lineto(X + i, Y + YPos); + + 1 : begin + VisBuff.Canvas.MoveTo(X + i, Y); + VisBuff.Canvas.lineto(X + i, Y + YPos); + end; + + 2 : VisBuff.Canvas.Pixels[X + i, Y + YPos] := PenColor; + end; + end; + + BitBlt(HWND, 0, 0, VisBuff.Width, VisBuff.Height, VisBuff.Canvas.Handle, 0, 0, srccopy) + end; +end. + diff --git a/bass-sys/bass24/delphi/SampleVis/samplevis.dpr b/bass-sys/bass24/delphi/SampleVis/samplevis.dpr new file mode 100644 index 0000000..2aee04d --- /dev/null +++ b/bass-sys/bass24/delphi/SampleVis/samplevis.dpr @@ -0,0 +1,16 @@ +program samplevis; + +uses + Forms, + main in 'main.pas' {FormPlayer}, + circle_vis in 'circle_vis.pas', + CommonTypes in 'CommonTypes.pas', + osc_vis in 'osc_vis.pas', + spectrum_vis in 'spectrum_vis.pas', + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.CreateForm(TFormPlayer, FormPlayer); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/SampleVis/spectrum_vis.pas b/bass-sys/bass24/delphi/SampleVis/spectrum_vis.pas new file mode 100644 index 0000000..5d0283d --- /dev/null +++ b/bass-sys/bass24/delphi/SampleVis/spectrum_vis.pas @@ -0,0 +1,131 @@ +unit spectrum_vis; +{ Spectrum Visualyzation by Alessandro Cappellozza + version 0.8 05/2002 + http://digilander.iol.it/Kappe/audioobject +} + +interface + uses Windows, Dialogs, Graphics, SysUtils, CommonTypes, Classes; + + type TSpectrum = Class(TObject) + private + VisBuff : TBitmap; + BackBmp : TBitmap; + + BkgColor : TColor; + SpecHeight : Integer; + PenColor : TColor; + PeakColor: TColor; + DrawType : Integer; + DrawRes : Integer; + FrmClear : Boolean; + UseBkg : Boolean; + PeakFall : Integer; + LineFall : Integer; + ColWidth : Integer; + ShowPeak : Boolean; + + FFTPeacks : array [0..128] of Integer; + FFTFallOff : array [0..128] of Integer; + + public + Constructor Create (Width, Height : Integer); + procedure Draw(HWND : THandle; FFTData : TFFTData; X, Y : Integer); + procedure SetBackGround (Active : Boolean; BkgCanvas : TGraphic); + + property BackColor : TColor read BkgColor write BkgColor; + property Height : Integer read SpecHeight write SpecHeight; + property Width : Integer read ColWidth write ColWidth; + property Pen : TColor read PenColor write PenColor; + property Peak : TColor read PeakColor write PeakColor; + property Mode : Integer read DrawType write DrawType; + property Res : Integer read DrawRes write DrawRes; + property FrameClear : Boolean read FrmClear write FrmClear; + property PeakFallOff: Integer read PeakFall write PeakFall; + property LineFallOff: Integer read LineFall write LineFall; + property DrawPeak : Boolean read ShowPeak write ShowPeak; + end; + + var Spectrum : TSpectrum; + +implementation + + Constructor TSpectrum.Create(Width, Height : Integer); + begin + VisBuff := TBitmap.Create; + BackBmp := TBitmap.Create; + + VisBuff.Width := Width; + VisBuff.Height := Height; + BackBmp.Width := Width; + BackBmp.Height := Height; + + BkgColor := clBlack; + SpecHeight := 100; + PenColor := clWhite; + PeakColor := clYellow; + DrawType := 0; + DrawRes := 1; + FrmClear := True; + UseBkg := False; + PeakFall := 1; + LineFall := 3; + ColWidth := 5; + ShowPeak := True; + end; + + procedure TSpectrum.SetBackGround (Active : Boolean; BkgCanvas : TGraphic); + begin + UseBkg := Active; + BackBmp.Canvas.Draw(0, 0, BkgCanvas); + end; + + procedure TSpectrum.Draw(HWND : THandle; FFTData : TFFTData; X, Y : Integer); + var i, YPos : LongInt; YVal : Single; + begin + + if FrmClear then begin + VisBuff.Canvas.Pen.Color := BkgColor; + VisBuff.Canvas.Brush.Color := BkgColor; + VisBuff.Canvas.Rectangle(0, 0, VisBuff.Width, VisBuff.Height); + if UseBkg then VisBuff.Canvas.CopyRect(Rect(0, 0, BackBmp.Width, BackBmp.Height), BackBmp.Canvas, Rect(0, 0, BackBmp.Width, BackBmp.Height)); + end; + + VisBuff.Canvas.Pen.Color := PenColor; + for i := 0 to 128 do begin + YVal := Abs(FFTData[(i * DrawRes) + 5]); + YPos := Trunc((YVal) * 500); + if YPos > Height then YPos := SpecHeight; + + if YPos >= FFTPeacks[i] then FFTPeacks[i] := YPos + else FFTPeacks[i] := FFTPeacks[i] - PeakFall; + + if YPos >= FFTFallOff[i] then FFTFallOff[i] := YPos + else FFTFallOff[i] := FFTFallOff[i] - LineFall; + + if (VisBuff.Height - FFTPeacks[i]) > VisBuff.Height then FFTPeacks[i] := 0; + if (VisBuff.Height - FFTFallOff[i]) > VisBuff.Height then FFTFallOff[i] := 0; + + case DrawType of + 0 : begin + VisBuff.Canvas.MoveTo(X + i, Y + VisBuff.Height); + VisBuff.Canvas.LineTo(X + i, Y + VisBuff.Height - FFTFallOff[i]); + if ShowPeak then VisBuff.Canvas.Pixels[X + i, Y + VisBuff.Height - FFTPeacks[i]] := Pen; + end; + + 1 : begin + if ShowPeak then VisBuff.Canvas.Pen.Color := PeakColor; + if ShowPeak then VisBuff.Canvas.MoveTo(X + i * (ColWidth + 1), Y + VisBuff.Height - FFTPeacks[i]); + if ShowPeak then VisBuff.Canvas.LineTo(X + i * (ColWidth + 1) + ColWidth, Y + VisBuff.Height - FFTPeacks[i]); + + VisBuff.Canvas.Pen.Color := PenColor; + VisBuff.Canvas.Brush.Color := PenColor; + VisBuff.Canvas.Rectangle(X + i * (ColWidth + 1), Y + VisBuff.Height - FFTFallOff[i], X + i * (ColWidth + 1) + ColWidth, Y + VisBuff.Height); + end; + end; + end; + + BitBlt(HWND, 0, 0, VisBuff.Width, VisBuff.Height, VisBuff.Canvas.Handle, 0, 0, srccopy) + end; +end. + diff --git a/bass-sys/bass24/delphi/Speakers/Speakers.dpr b/bass-sys/bass24/delphi/Speakers/Speakers.dpr new file mode 100644 index 0000000..7e57401 --- /dev/null +++ b/bass-sys/bass24/delphi/Speakers/Speakers.dpr @@ -0,0 +1,12 @@ +program Speakers; + +uses + Forms, + Unit1 in 'Unit1.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/Speakers/Unit1.dfm b/bass-sys/bass24/delphi/Speakers/Unit1.dfm new file mode 100644 index 0000000..b8ebe02 --- /dev/null +++ b/bass-sys/bass24/delphi/Speakers/Unit1.dfm @@ -0,0 +1,124 @@ +object Form1: TForm1 + Left = 193 + Top = 107 + BorderStyle = bsDialog + Caption = 'BASS multi-speaker example' + ClientHeight = 196 + ClientWidth = 345 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 7 + Top = 0 + Width = 330 + Height = 45 + Caption = '1 - front' + TabOrder = 0 + object Button1: TButton + Left = 7 + Top = 14 + Width = 270 + Height = 23 + Caption = 'click here to open a file...' + TabOrder = 0 + OnClick = Button1Click + end + end + object GroupBox2: TGroupBox + Left = 7 + Top = 48 + Width = 330 + Height = 45 + Caption = '2 - rear' + TabOrder = 1 + object Button2: TButton + Tag = 1 + Left = 7 + Top = 14 + Width = 270 + Height = 23 + Caption = 'click here to open a file...' + TabOrder = 0 + OnClick = Button1Click + end + end + object GroupBox3: TGroupBox + Left = 7 + Top = 96 + Width = 330 + Height = 45 + Caption = '3 - center/LFE' + TabOrder = 2 + object Button3: TButton + Tag = 2 + Left = 7 + Top = 14 + Width = 270 + Height = 23 + Caption = 'click here to open a file...' + TabOrder = 0 + OnClick = Button1Click + end + end + object GroupBox4: TGroupBox + Left = 7 + Top = 144 + Width = 330 + Height = 45 + Caption = '4 - rear center' + TabOrder = 3 + object Button4: TButton + Tag = 3 + Left = 7 + Top = 14 + Width = 270 + Height = 23 + Caption = 'click here to open a file...' + TabOrder = 0 + OnClick = Button1Click + end + end + object Button5: TButton + Left = 288 + Top = 38 + Width = 41 + Height = 23 + Caption = 'Swap' + TabOrder = 4 + OnClick = Button5Click + end + object Button6: TButton + Tag = 1 + Left = 288 + Top = 86 + Width = 41 + Height = 23 + Caption = 'Swap' + TabOrder = 5 + OnClick = Button5Click + end + object Button7: TButton + Tag = 2 + Left = 288 + Top = 134 + Width = 41 + Height = 23 + Caption = 'Swap' + TabOrder = 6 + OnClick = Button5Click + end + object OpenDialog1: TOpenDialog + Filter = + 'Streamable files|*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif|All files|*' + + '.*' + end +end diff --git a/bass-sys/bass24/delphi/Speakers/Unit1.pas b/bass-sys/bass24/delphi/Speakers/Unit1.pas new file mode 100644 index 0000000..3ea6d25 --- /dev/null +++ b/bass-sys/bass24/delphi/Speakers/Unit1.pas @@ -0,0 +1,165 @@ +unit Unit1; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Bass; + +type + TForm1 = class(TForm) + GroupBox1: TGroupBox; + Button1: TButton; + GroupBox2: TGroupBox; + Button2: TButton; + GroupBox3: TGroupBox; + Button3: TButton; + GroupBox4: TGroupBox; + Button4: TButton; + OpenDialog1: TOpenDialog; + Button5: TButton; + Button6: TButton; + Button7: TButton; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure Button5Click(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + Form1: TForm1; + + flags: array[0..3] of DWORD = (BASS_SPEAKER_FRONT, BASS_SPEAKER_REAR, BASS_SPEAKER_CENLFE, BASS_SPEAKER_REAR2); + chan: array[0..3] of HSTREAM; + +implementation + +{$R *.dfm} + +procedure TForm1.FormCreate(Sender: TObject); +var + i: BASS_INFO; +begin + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then + begin + MessageBox(0,'An incorrect version of BASS.DLL was loaded',0,MB_ICONERROR); + Halt; + end; + + // initialize BASS - default device + if (not BASS_Init(-1, 44100, 0, Handle, nil)) then + begin + MessageBox(0, 'Can''t initialize device', 0, 0); + Halt; + end; + + // check how many speakers the device supports + BASS_GetInfo(i); + if (i.speakers < 4) then // no extra speakers detected, enable them anyway? + begin + if (MessageBox(0, 'Do you wish to enable "speaker assignment" anyway?', 'No extra speakers detected', MB_ICONQUESTION or MB_YESNO) = IDYES) then + begin + // reinitialize BASS - forcing speaker assignment + BASS_Free; + if (not BASS_Init(-1, 44100, BASS_DEVICE_SPEAKERS, Handle, nil)) then + begin + MessageBox(0, 'Can''t initialize device', 0, 0); + Halt; + end; + BASS_GetInfo(i); // get info again + end; + end; + + if (i.speakers < 8) then + begin + Button4.Enabled := False; + Button7.Enabled := False; + end; + if (i.speakers < 6) then + begin + Button3.Enabled := False; + Button6.Enabled := False; + end; + if (i.speakers < 4) then + begin + Button2.Enabled := False; + Button5.Enabled := False; + end; +end; + +procedure TForm1.FormDestroy(Sender: TObject); +begin + BASS_Free; +end; + +procedure TForm1.Button1Click(Sender: TObject); +var + speaker: Integer; +begin + speaker := TButton(Sender).Tag; + if (not OpenDialog1.Execute) then + Exit; + + BASS_StreamFree(chan[speaker]); // free old stream before opening new + chan[speaker] := BASS_StreamCreateFile(False, PChar(OpenDialog1.FileName), 0, 0, flags[speaker] or BASS_SAMPLE_LOOP {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if (chan[speaker] = 0) then + begin + TButton(Sender).Caption := 'click here to open a file...'; + MessageBox(0, 'Can''t play the file', 0, 0); + Exit; + end; + + TButton(Sender).Caption := OpenDialog1.FileName; + BASS_ChannelPlay(chan[speaker], False); +end; + +procedure TForm1.Button5Click(Sender: TObject); +var + i: BASS_CHANNELINFO; + speaker: Integer; + temp: HSTREAM; + temp1, temp2: String; +begin + speaker := TButton(Sender).Tag; + + // swap handles + temp := chan[speaker]; + chan[speaker] := chan[speaker+1]; + chan[speaker+1] := temp; + + // swap text + case speaker of + 0: // swap 1 and 2 + begin + temp1 := Button1.Caption; + temp2 := Button2.Caption; + Button1.Caption := temp2; + Button2.Caption := temp1; + end; + 1: // swap 2 and 3 + begin + temp1 := Button2.Caption; + temp2 := Button3.Caption; + Button2.Caption := temp2; + Button3.Caption := temp1; + end; + 2: // swap 3 and 4 + begin + temp1 := Button3.Caption; + temp2 := Button4.Caption; + Button3.Caption := temp2; + Button4.Caption := temp1; + end; + end; + + // update speaker flags + BASS_ChannelFlags(chan[speaker],flags[speaker],BASS_SPEAKER_FRONT); + BASS_ChannelFlags(chan[speaker+1],flags[speaker+1],BASS_SPEAKER_FRONT); +end; + +end. diff --git a/bass-sys/bass24/delphi/StreamTest/STMain.dfm b/bass-sys/bass24/delphi/StreamTest/STMain.dfm new file mode 100644 index 0000000..9d3c6cc Binary files /dev/null and b/bass-sys/bass24/delphi/StreamTest/STMain.dfm differ diff --git a/bass-sys/bass24/delphi/StreamTest/STMain.pas b/bass-sys/bass24/delphi/StreamTest/STMain.pas new file mode 100644 index 0000000..6438633 --- /dev/null +++ b/bass-sys/bass24/delphi/StreamTest/STMain.pas @@ -0,0 +1,162 @@ +unit STMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, BASS; + +type + TForm1 = class(TForm) + Button1: TButton; + Button2: TButton; + Button3: TButton; + GroupBox1: TGroupBox; + ScrollBar1: TScrollBar; + Label1: TLabel; + Label2: TLabel; + ScrollBar2: TScrollBar; + Label3: TLabel; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + Button4: TButton; + Label7: TLabel; + Label8: TLabel; + procedure Button4Click(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure Button2Click(Sender: TObject); + procedure Button3Click(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure ScrollBar1Change(Sender: TObject); + procedure ScrollBar2Change(Sender: TObject); + private + { Private-Deklarationen } + SineStream: HSTREAM; + procedure Error(msg: string); + public + { Public-Deklarationen } + end; + +var + Form1: TForm1; + SineCount, Frequency, Amplitude: Real; + +implementation + +{$R *.DFM} + +function MakeSine(handle: HSTREAM; buffer: Pointer; length: DWORD; user: Pointer): DWORD; stdcall; +var + buf: ^WORD; + i, len: Integer; +begin + buf := buffer; + len := length div 2; + // write the sine function to the output stream + for i := 0 to len - 1 do begin + buf^ := Trunc(Sin(SineCount * PI) * Amplitude); + Inc(buf); + SineCount := SineCount + (Frequency / 44100); + end; + Result := length; +end; + +procedure TForm1.Error(msg: string); +var + s: string; +begin + // add the error code to the output string + s := msg + #13#10 + '(error code: ' + IntToStr(BASS_ErrorGetCode) + ')'; + MessageBox(handle, PChar(s), 0, 0); +end; + +procedure TForm1.Button4Click(Sender: TObject); +begin + Close; +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + // enable the BASS Init button + Button1.Enabled := TRUE; +end; + +procedure TForm1.Button1Click(Sender: TObject); +begin + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then + begin + MessageBox(0,'An incorrect version of BASS.DLL was loaded',0,MB_ICONERROR); + Halt; + end; + // Initialize BASS with the default device + if not BASS_Init(-1, 44100, 0, handle, nil) then begin + Error('Could not initialize BASS'); + Exit; + end; + // if all successful, enable the create stream button + Button1.Enabled := FALSE; + Button2.Enabled := TRUE; +end; + +procedure TForm1.Button2Click(Sender: TObject); +begin + (* + create a stream with a sample rate of 44100Hz + the max. output rate is sample rate / 2 + i.e. we have a 22050Hz stream! + however, we'll set the max. output frequency + of the sine wave lower becouse the human + ear isn't able to hear waves above 16KHz... + *) + SineStream := BASS_StreamCreate(44100, 2, 0, @MakeSine, 0); + if (SineStream = 0) then begin + Error('Could not create user stream'); + Exit; + end; + // if successfully called, enable the play stream button + Button2.Enabled := FALSE; + Button3.Enabled := TRUE; +end; + +procedure TForm1.Button3Click(Sender: TObject); +begin + // reset the sine counter + SineCount := 0; + // initialize the amplitude and the frequency + Frequency := ScrollBar1.Position; + Amplitude := ScrollBar2.Position; + if not BASS_ChannelPlay(SineStream, False) then begin + Error('Could not start stream playback'); + Exit; + end; + // enable the potentiometers + Button3.Enabled := FALSE; + GroupBox1.Enabled := TRUE; +end; + +procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); +begin + // release it + // the stream will be released automatically + BASS_Free; +end; + +procedure TForm1.ScrollBar1Change(Sender: TObject); +begin + // update the output frequency + Frequency := ScrollBar1.Position; + Label7.Caption := IntToStr(ScrollBar1.Position) + 'Hz'; +end; + +procedure TForm1.ScrollBar2Change(Sender: TObject); +begin + // update the output amplitude + Amplitude := ScrollBar2.Position; + Label8.Caption := IntToStr(ScrollBar2.Position * 100 div 32767) + '%'; +end; + + +end. diff --git a/bass-sys/bass24/delphi/StreamTest/StreamTest.dpr b/bass-sys/bass24/delphi/StreamTest/StreamTest.dpr new file mode 100644 index 0000000..b17caef --- /dev/null +++ b/bass-sys/bass24/delphi/StreamTest/StreamTest.dpr @@ -0,0 +1,18 @@ +{ +BASS simple stream test, copyright (c) Titus Miloi. +===================================================== +Other source: STMain.pas; STMain.dfm +} +program StreamTest; + +uses + Forms, + STMain in 'STMain.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.Title := 'BASS - Stream Demo'; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/bass.bpg b/bass-sys/bass24/delphi/bass.bpg new file mode 100644 index 0000000..7486cb0 --- /dev/null +++ b/bass-sys/bass24/delphi/bass.bpg @@ -0,0 +1,79 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = D3Test.exe BassTest.exe ConTest.exe custloop.exe DspTest.exe \ + FXtest.exe list.exe livefx.exe modtest.exe Multi.exe netradio.exe plugins.exe \ + RecordTest.exe samplevis.exe Speakers.exe StreamTest.exe synth.exe writewav.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +D3Test.exe: 3dTest\D3Test.dpr + $(DCC) + +BassTest.exe: BassTest\BassTest.dpr + $(DCC) + +ConTest.exe: ConTest\ConTest.dpr + $(DCC) + +custloop.exe: custloop\custloop.dpr + $(DCC) + +DspTest.exe: DspTest\DspTest.dpr + $(DCC) + +FXtest.exe: fxtest\FXtest.dpr + $(DCC) + +devlist.exe: devlist\devlist.dpr + $(DCC) + +livefx.exe: livefx\livefx.dpr + $(DCC) + +livespec.exe: livespec\livespec.dpr + $(DCC) + +modtest.exe: modtest\modtest.dpr + $(DCC) + +Multi.exe: multi\Multi.dpr + $(DCC) + +netradio.exe: netradio\netradio.dpr + $(DCC) + +plugins.exe: plugins\plugins.dpr + $(DCC) + +RecordTest.exe: RecordTest\RecordTest.dpr + $(DCC) + +samplevis.exe: SampleVis\samplevis.dpr + $(DCC) + +Speakers.exe: Speakers\Speakers.dpr + $(DCC) + +spectrum.exe: spectrum\spectrum.dpr + $(DCC) + +StreamTest.exe: StreamTest\StreamTest.dpr + $(DCC) + +synth.exe: synth\synth.dpr + $(DCC) + +writewav.exe: writewav\writewav.dpr + $(DCC) + + diff --git a/bass-sys/bass24/delphi/bass.pas b/bass-sys/bass24/delphi/bass.pas new file mode 100644 index 0000000..ac9d187 --- /dev/null +++ b/bass-sys/bass24/delphi/bass.pas @@ -0,0 +1,1047 @@ +{ + BASS 2.4 Delphi unit + Copyright (c) 1999-2019 Un4seen Developments Ltd. + + See the BASS.CHM file for more detailed documentation + + How to install + -------------- + Copy BASS.PAS to the \LIB subdirectory of your Delphi path or your project dir + + NOTE: Delphi users should use the BASS_UNICODE flag where possible +} + +unit BASS; + +interface + +{$IFDEF MSWINDOWS} +uses + Windows; +{$ENDIF} + +const + BASSVERSION = $204; // API version + BASSVERSIONTEXT = '2.4'; + + // Use these to test for error from functions that return a DWORD or QWORD + DW_ERROR = Cardinal(-1); // -1 (DWORD) + QW_ERROR = Int64(-1); // -1 (QWORD) + + // Error codes returned by BASS_ErrorGetCode() + BASS_OK = 0; // all is OK + BASS_ERROR_MEM = 1; // memory error + BASS_ERROR_FILEOPEN = 2; // can't open the file + BASS_ERROR_DRIVER = 3; // can't find a free sound driver + BASS_ERROR_BUFLOST = 4; // the sample buffer was lost + BASS_ERROR_HANDLE = 5; // invalid handle + BASS_ERROR_FORMAT = 6; // unsupported sample format + BASS_ERROR_POSITION = 7; // invalid position + BASS_ERROR_INIT = 8; // BASS_Init has not been successfully called + BASS_ERROR_START = 9; // BASS_Start has not been successfully called + BASS_ERROR_ALREADY = 14; // already initialized/paused/whatever + BASS_ERROR_NOTAUDIO = 17; // file does not contain audio + BASS_ERROR_NOCHAN = 18; // can't get a free channel + BASS_ERROR_ILLTYPE = 19; // an illegal type was specified + BASS_ERROR_ILLPARAM = 20; // an illegal parameter was specified + BASS_ERROR_NO3D = 21; // no 3D support + BASS_ERROR_NOEAX = 22; // no EAX support + BASS_ERROR_DEVICE = 23; // illegal device number + BASS_ERROR_NOPLAY = 24; // not playing + BASS_ERROR_FREQ = 25; // illegal sample rate + BASS_ERROR_NOTFILE = 27; // the stream is not a file stream + BASS_ERROR_NOHW = 29; // no hardware voices available + BASS_ERROR_EMPTY = 31; // the MOD music has no sequence data + BASS_ERROR_NONET = 32; // no internet connection could be opened + BASS_ERROR_CREATE = 33; // couldn't create the file + BASS_ERROR_NOFX = 34; // effects are not available + BASS_ERROR_NOTAVAIL = 37; // requested data/action is not available + BASS_ERROR_DECODE = 38; // the channel is/isn't a "decoding channel" + BASS_ERROR_DX = 39; // a sufficient DirectX version is not installed + BASS_ERROR_TIMEOUT = 40; // connection timedout + BASS_ERROR_FILEFORM = 41; // unsupported file format + BASS_ERROR_SPEAKER = 42; // unavailable speaker + BASS_ERROR_VERSION = 43; // invalid BASS version (used by add-ons) + BASS_ERROR_CODEC = 44; // codec is not available/supported + BASS_ERROR_ENDED = 45; // the channel/file has ended + BASS_ERROR_BUSY = 46; // the device is busy + BASS_ERROR_UNSTREAMABLE = 47; // unstreamable file + BASS_ERROR_UNKNOWN = -1; // some other mystery problem + + // BASS_SetConfig options + BASS_CONFIG_BUFFER = 0; + BASS_CONFIG_UPDATEPERIOD = 1; + BASS_CONFIG_GVOL_SAMPLE = 4; + BASS_CONFIG_GVOL_STREAM = 5; + BASS_CONFIG_GVOL_MUSIC = 6; + BASS_CONFIG_CURVE_VOL = 7; + BASS_CONFIG_CURVE_PAN = 8; + BASS_CONFIG_FLOATDSP = 9; + BASS_CONFIG_3DALGORITHM = 10; + BASS_CONFIG_NET_TIMEOUT = 11; + BASS_CONFIG_NET_BUFFER = 12; + BASS_CONFIG_PAUSE_NOPLAY = 13; + BASS_CONFIG_NET_PREBUF = 15; + BASS_CONFIG_NET_PASSIVE = 18; + BASS_CONFIG_REC_BUFFER = 19; + BASS_CONFIG_NET_PLAYLIST = 21; + BASS_CONFIG_MUSIC_VIRTUAL = 22; + BASS_CONFIG_VERIFY = 23; + BASS_CONFIG_UPDATETHREADS = 24; + BASS_CONFIG_DEV_BUFFER = 27; + BASS_CONFIG_REC_LOOPBACK = 28; + BASS_CONFIG_VISTA_TRUEPOS = 30; + BASS_CONFIG_IOS_SESSION = 34; + BASS_CONFIG_IOS_MIXAUDIO = 34; + BASS_CONFIG_DEV_DEFAULT = 36; + BASS_CONFIG_NET_READTIMEOUT = 37; + BASS_CONFIG_VISTA_SPEAKERS = 38; + BASS_CONFIG_IOS_SPEAKER = 39; + BASS_CONFIG_MF_DISABLE = 40; + BASS_CONFIG_HANDLES = 41; + BASS_CONFIG_UNICODE = 42; + BASS_CONFIG_SRC = 43; + BASS_CONFIG_SRC_SAMPLE = 44; + BASS_CONFIG_ASYNCFILE_BUFFER = 45; + BASS_CONFIG_OGG_PRESCAN = 47; + BASS_CONFIG_MF_VIDEO = 48; + BASS_CONFIG_AIRPLAY = 49; + BASS_CONFIG_DEV_NONSTOP = 50; + BASS_CONFIG_IOS_NOCATEGORY = 51; + BASS_CONFIG_VERIFY_NET = 52; + BASS_CONFIG_DEV_PERIOD = 53; + BASS_CONFIG_FLOAT = 54; + BASS_CONFIG_NET_SEEK = 56; + BASS_CONFIG_AM_DISABLE = 58; + BASS_CONFIG_NET_PLAYLIST_DEPTH = 59; + BASS_CONFIG_NET_PREBUF_WAIT = 60; + BASS_CONFIG_ANDROID_SESSIONID = 62; + BASS_CONFIG_WASAPI_PERSIST = 65; + BASS_CONFIG_REC_WASAPI = 66; + BASS_CONFIG_ANDROID_AAUDIO = 67; + + // BASS_SetConfigPtr options + BASS_CONFIG_NET_AGENT = 16; + BASS_CONFIG_NET_PROXY = 17; + BASS_CONFIG_LIBSSL = 64; + + // BASS_CONFIG_IOS_SESSION flags + BASS_IOS_SESSION_MIX = 1; + BASS_IOS_SESSION_DUCK = 2; + BASS_IOS_SESSION_AMBIENT = 4; + BASS_IOS_SESSION_SPEAKER = 8; + BASS_IOS_SESSION_DISABLE = 16; + + // BASS_Init flags + BASS_DEVICE_8BITS = 1; // 8 bit + BASS_DEVICE_MONO = 2; // mono + BASS_DEVICE_3D = 4; // enable 3D functionality + BASS_DEVICE_16BITS = 8; // limit output to 16 bit + BASS_DEVICE_LATENCY = $100; // calculate device latency (BASS_INFO struct) + BASS_DEVICE_CPSPEAKERS = $400; // detect speakers via Windows control panel + BASS_DEVICE_SPEAKERS = $800; // force enabling of speaker assignment + BASS_DEVICE_NOSPEAKER = $1000; // ignore speaker arrangement + BASS_DEVICE_DMIX = $2000; // use ALSA "dmix" plugin + BASS_DEVICE_FREQ = $4000; // set device sample rate + BASS_DEVICE_STEREO = $8000; // limit output to stereo + BASS_DEVICE_AUDIOTRACK = $20000; // use AudioTrack output + BASS_DEVICE_DSOUND = $40000; // use DirectSound output + + // DirectSound interfaces (for use with BASS_GetDSoundObject) + BASS_OBJECT_DS = 1; // IDirectSound + BASS_OBJECT_DS3DL = 2; // IDirectSound3DListener + + // BASS_DEVICEINFO flags + BASS_DEVICE_ENABLED = 1; + BASS_DEVICE_DEFAULT = 2; + BASS_DEVICE_INIT = 4; + BASS_DEVICE_LOOPBACK = 8; + + BASS_DEVICE_TYPE_MASK = $ff000000; + BASS_DEVICE_TYPE_NETWORK = $01000000; + BASS_DEVICE_TYPE_SPEAKERS = $02000000; + BASS_DEVICE_TYPE_LINE = $03000000; + BASS_DEVICE_TYPE_HEADPHONES = $04000000; + BASS_DEVICE_TYPE_MICROPHONE = $05000000; + BASS_DEVICE_TYPE_HEADSET = $06000000; + BASS_DEVICE_TYPE_HANDSET = $07000000; + BASS_DEVICE_TYPE_DIGITAL = $08000000; + BASS_DEVICE_TYPE_SPDIF = $09000000; + BASS_DEVICE_TYPE_HDMI = $0a000000; + BASS_DEVICE_TYPE_DISPLAYPORT = $40000000; + + // BASS_GetDeviceInfo flags + BASS_DEVICES_AIRPLAY = $1000000; + + // BASS_INFO flags (from DSOUND.H) + DSCAPS_CONTINUOUSRATE = $00000010; // supports all sample rates between min/maxrate + DSCAPS_EMULDRIVER = $00000020; // device does NOT have hardware DirectSound support + DSCAPS_CERTIFIED = $00000040; // device driver has been certified by Microsoft + DSCAPS_SECONDARYMONO = $00000100; // mono + DSCAPS_SECONDARYSTEREO = $00000200; // stereo + DSCAPS_SECONDARY8BIT = $00000400; // 8 bit + DSCAPS_SECONDARY16BIT = $00000800; // 16 bit + + // BASS_RECORDINFO flags (from DSOUND.H) + DSCCAPS_EMULDRIVER = DSCAPS_EMULDRIVER; // device does NOT have hardware DirectSound recording support + DSCCAPS_CERTIFIED = DSCAPS_CERTIFIED; // device driver has been certified by Microsoft + + // defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H) + WAVE_FORMAT_1M08 = $00000001; // 11.025 kHz, Mono, 8-bit + WAVE_FORMAT_1S08 = $00000002; // 11.025 kHz, Stereo, 8-bit + WAVE_FORMAT_1M16 = $00000004; // 11.025 kHz, Mono, 16-bit + WAVE_FORMAT_1S16 = $00000008; // 11.025 kHz, Stereo, 16-bit + WAVE_FORMAT_2M08 = $00000010; // 22.05 kHz, Mono, 8-bit + WAVE_FORMAT_2S08 = $00000020; // 22.05 kHz, Stereo, 8-bit + WAVE_FORMAT_2M16 = $00000040; // 22.05 kHz, Mono, 16-bit + WAVE_FORMAT_2S16 = $00000080; // 22.05 kHz, Stereo, 16-bit + WAVE_FORMAT_4M08 = $00000100; // 44.1 kHz, Mono, 8-bit + WAVE_FORMAT_4S08 = $00000200; // 44.1 kHz, Stereo, 8-bit + WAVE_FORMAT_4M16 = $00000400; // 44.1 kHz, Mono, 16-bit + WAVE_FORMAT_4S16 = $00000800; // 44.1 kHz, Stereo, 16-bit + + BASS_SAMPLE_8BITS = 1; // 8 bit + BASS_SAMPLE_FLOAT = 256; // 32 bit floating-point + BASS_SAMPLE_MONO = 2; // mono + BASS_SAMPLE_LOOP = 4; // looped + BASS_SAMPLE_3D = 8; // 3D functionality + BASS_SAMPLE_SOFTWARE = 16; // not using hardware mixing + BASS_SAMPLE_MUTEMAX = 32; // mute at max distance (3D only) + BASS_SAMPLE_VAM = 64; // DX7 voice allocation & management + BASS_SAMPLE_FX = 128; // old implementation of DX8 effects + BASS_SAMPLE_OVER_VOL = $10000; // override lowest volume + BASS_SAMPLE_OVER_POS = $20000; // override longest playing + BASS_SAMPLE_OVER_DIST = $30000; // override furthest from listener (3D only) + + BASS_STREAM_PRESCAN = $20000; // enable pin-point seeking/length (MP3/MP2/MP1) + BASS_STREAM_AUTOFREE = $40000; // automatically free the stream when it stop/ends + BASS_STREAM_RESTRATE = $80000; // restrict the download rate of internet file streams + BASS_STREAM_BLOCK = $100000;// download/play internet file stream in small blocks + BASS_STREAM_DECODE = $200000;// don't play the stream, only decode (BASS_ChannelGetData) + BASS_STREAM_STATUS = $800000;// give server status info (HTTP/ICY tags) in DOWNLOADPROC + + BASS_MP3_IGNOREDELAY = $200; // ignore LAME/Xing/VBRI/iTunes delay & padding info + BASS_MP3_SETPOS = BASS_STREAM_PRESCAN; + + BASS_MUSIC_FLOAT = BASS_SAMPLE_FLOAT; + BASS_MUSIC_MONO = BASS_SAMPLE_MONO; + BASS_MUSIC_LOOP = BASS_SAMPLE_LOOP; + BASS_MUSIC_3D = BASS_SAMPLE_3D; + BASS_MUSIC_FX = BASS_SAMPLE_FX; + BASS_MUSIC_AUTOFREE = BASS_STREAM_AUTOFREE; + BASS_MUSIC_DECODE = BASS_STREAM_DECODE; + BASS_MUSIC_PRESCAN = BASS_STREAM_PRESCAN; // calculate playback length + BASS_MUSIC_CALCLEN = BASS_MUSIC_PRESCAN; + BASS_MUSIC_RAMP = $200; // normal ramping + BASS_MUSIC_RAMPS = $400; // sensitive ramping + BASS_MUSIC_SURROUND = $800; // surround sound + BASS_MUSIC_SURROUND2 = $1000; // surround sound (mode 2) + BASS_MUSIC_FT2PAN = $2000; // apply FastTracker 2 panning to XM files + BASS_MUSIC_FT2MOD = $2000; // play .MOD as FastTracker 2 does + BASS_MUSIC_PT1MOD = $4000; // play .MOD as ProTracker 1 does + BASS_MUSIC_NONINTER = $10000; // non-interpolated sample mixing + BASS_MUSIC_SINCINTER = $800000; // sinc interpolated sample mixing + BASS_MUSIC_POSRESET = $8000; // stop all notes when moving position + BASS_MUSIC_POSRESETEX = $400000; // stop all notes and reset bmp/etc when moving position + BASS_MUSIC_STOPBACK = $80000; // stop the music on a backwards jump effect + BASS_MUSIC_NOSAMPLE = $100000; // don't load the samples + + // Speaker assignment flags + BASS_SPEAKER_FRONT = $1000000; // front speakers + BASS_SPEAKER_REAR = $2000000; // rear/side speakers + BASS_SPEAKER_CENLFE = $3000000; // center & LFE speakers (5.1) + BASS_SPEAKER_REAR2 = $4000000; // rear center speakers (7.1) + BASS_SPEAKER_LEFT = $10000000; // modifier: left + BASS_SPEAKER_RIGHT = $20000000; // modifier: right + BASS_SPEAKER_FRONTLEFT = BASS_SPEAKER_FRONT or BASS_SPEAKER_LEFT; + BASS_SPEAKER_FRONTRIGHT = BASS_SPEAKER_FRONT or BASS_SPEAKER_RIGHT; + BASS_SPEAKER_REARLEFT = BASS_SPEAKER_REAR or BASS_SPEAKER_LEFT; + BASS_SPEAKER_REARRIGHT = BASS_SPEAKER_REAR or BASS_SPEAKER_RIGHT; + BASS_SPEAKER_CENTER = BASS_SPEAKER_CENLFE or BASS_SPEAKER_LEFT; + BASS_SPEAKER_LFE = BASS_SPEAKER_CENLFE or BASS_SPEAKER_RIGHT; + BASS_SPEAKER_REAR2LEFT = BASS_SPEAKER_REAR2 or BASS_SPEAKER_LEFT; + BASS_SPEAKER_REAR2RIGHT = BASS_SPEAKER_REAR2 or BASS_SPEAKER_RIGHT; + + BASS_ASYNCFILE = $40000000; + BASS_UNICODE = $80000000; + + BASS_RECORD_PAUSE = $8000; // start recording paused + + // DX7 voice allocation & management flags + BASS_VAM_HARDWARE = 1; + BASS_VAM_SOFTWARE = 2; + BASS_VAM_TERM_TIME = 4; + BASS_VAM_TERM_DIST = 8; + BASS_VAM_TERM_PRIO = 16; + + BASS_ORIGRES_FLOAT = $10000; + + // BASS_CHANNELINFO types + BASS_CTYPE_SAMPLE = 1; + BASS_CTYPE_RECORD = 2; + BASS_CTYPE_STREAM = $10000; + BASS_CTYPE_STREAM_VORBIS = $10002; + BASS_CTYPE_STREAM_OGG = $10002; + BASS_CTYPE_STREAM_MP1 = $10003; + BASS_CTYPE_STREAM_MP2 = $10004; + BASS_CTYPE_STREAM_MP3 = $10005; + BASS_CTYPE_STREAM_AIFF = $10006; + BASS_CTYPE_STREAM_CA = $10007; + BASS_CTYPE_STREAM_MF = $10008; + BASS_CTYPE_STREAM_AM = $10009; + BASS_CTYPE_STREAM_DUMMY = $18000; + BASS_CTYPE_STREAM_DEVICE = $18001; + BASS_CTYPE_STREAM_WAV = $40000; // WAVE flag, LOWORD=codec + BASS_CTYPE_STREAM_WAV_PCM = $50001; + BASS_CTYPE_STREAM_WAV_FLOAT = $50003; + BASS_CTYPE_MUSIC_MOD = $20000; + BASS_CTYPE_MUSIC_MTM = $20001; + BASS_CTYPE_MUSIC_S3M = $20002; + BASS_CTYPE_MUSIC_XM = $20003; + BASS_CTYPE_MUSIC_IT = $20004; + BASS_CTYPE_MUSIC_MO3 = $00100; // MO3 flag + + // 3D channel modes + BASS_3DMODE_NORMAL = 0; // normal 3D processing + BASS_3DMODE_RELATIVE = 1; // position is relative to the listener + BASS_3DMODE_OFF = 2; // no 3D processing + + // software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM) + BASS_3DALG_DEFAULT = 0; + BASS_3DALG_OFF = 1; + BASS_3DALG_FULL = 2; + BASS_3DALG_LIGHT = 3; + + // EAX environments, use with BASS_SetEAXParameters + EAX_ENVIRONMENT_GENERIC = 0; + EAX_ENVIRONMENT_PADDEDCELL = 1; + EAX_ENVIRONMENT_ROOM = 2; + EAX_ENVIRONMENT_BATHROOM = 3; + EAX_ENVIRONMENT_LIVINGROOM = 4; + EAX_ENVIRONMENT_STONEROOM = 5; + EAX_ENVIRONMENT_AUDITORIUM = 6; + EAX_ENVIRONMENT_CONCERTHALL = 7; + EAX_ENVIRONMENT_CAVE = 8; + EAX_ENVIRONMENT_ARENA = 9; + EAX_ENVIRONMENT_HANGAR = 10; + EAX_ENVIRONMENT_CARPETEDHALLWAY = 11; + EAX_ENVIRONMENT_HALLWAY = 12; + EAX_ENVIRONMENT_STONECORRIDOR = 13; + EAX_ENVIRONMENT_ALLEY = 14; + EAX_ENVIRONMENT_FOREST = 15; + EAX_ENVIRONMENT_CITY = 16; + EAX_ENVIRONMENT_MOUNTAINS = 17; + EAX_ENVIRONMENT_QUARRY = 18; + EAX_ENVIRONMENT_PLAIN = 19; + EAX_ENVIRONMENT_PARKINGLOT = 20; + EAX_ENVIRONMENT_SEWERPIPE = 21; + EAX_ENVIRONMENT_UNDERWATER = 22; + EAX_ENVIRONMENT_DRUGGED = 23; + EAX_ENVIRONMENT_DIZZY = 24; + EAX_ENVIRONMENT_PSYCHOTIC = 25; + // total number of environments + EAX_ENVIRONMENT_COUNT = 26; + + BASS_STREAMPROC_END = $80000000; // end of user stream flag + + // BASS_StreamCreateFileUser file systems + STREAMFILE_NOBUFFER = 0; + STREAMFILE_BUFFER = 1; + STREAMFILE_BUFFERPUSH = 2; + + // BASS_StreamPutFileData options + BASS_FILEDATA_END = 0; // end & close the file + + // BASS_StreamGetFilePosition modes + BASS_FILEPOS_CURRENT = 0; + BASS_FILEPOS_DECODE = BASS_FILEPOS_CURRENT; + BASS_FILEPOS_DOWNLOAD = 1; + BASS_FILEPOS_END = 2; + BASS_FILEPOS_START = 3; + BASS_FILEPOS_CONNECTED = 4; + BASS_FILEPOS_BUFFER = 5; + BASS_FILEPOS_SOCKET = 6; + BASS_FILEPOS_ASYNCBUF = 7; + BASS_FILEPOS_SIZE = 8; + BASS_FILEPOS_BUFFERING = 9; + + // BASS_ChannelSetSync types + BASS_SYNC_POS = 0; + BASS_SYNC_END = 2; + BASS_SYNC_META = 4; + BASS_SYNC_SLIDE = 5; + BASS_SYNC_STALL = 6; + BASS_SYNC_DOWNLOAD = 7; + BASS_SYNC_FREE = 8; + BASS_SYNC_SETPOS = 11; + BASS_SYNC_MUSICPOS = 10; + BASS_SYNC_MUSICINST = 1; + BASS_SYNC_MUSICFX = 3; + BASS_SYNC_OGG_CHANGE = 12; + BASS_SYNC_DEV_FAIL = 14; + BASS_SYNC_DEV_FORMAT = 15; + BASS_SYNC_THREAD = $20000000; // flag: call sync in other thread + BASS_SYNC_MIXTIME = $40000000; // flag: sync at mixtime, else at playtime + BASS_SYNC_ONETIME = $80000000; // flag: sync only once, else continuously + + // BASS_ChannelIsActive return values + BASS_ACTIVE_STOPPED = 0; + BASS_ACTIVE_PLAYING = 1; + BASS_ACTIVE_STALLED = 2; + BASS_ACTIVE_PAUSED = 3; + BASS_ACTIVE_PAUSED_DEVICE = 4; + + // Channel attributes + BASS_ATTRIB_FREQ = 1; + BASS_ATTRIB_VOL = 2; + BASS_ATTRIB_PAN = 3; + BASS_ATTRIB_EAXMIX = 4; + BASS_ATTRIB_NOBUFFER = 5; + BASS_ATTRIB_VBR = 6; + BASS_ATTRIB_CPU = 7; + BASS_ATTRIB_SRC = 8; + BASS_ATTRIB_NET_RESUME = 9; + BASS_ATTRIB_SCANINFO = 10; + BASS_ATTRIB_NORAMP = 11; + BASS_ATTRIB_BITRATE = 12; + BASS_ATTRIB_BUFFER = 13; + BASS_ATTRIB_GRANULE = 14; + BASS_ATTRIB_MUSIC_AMPLIFY = $100; + BASS_ATTRIB_MUSIC_PANSEP = $101; + BASS_ATTRIB_MUSIC_PSCALER = $102; + BASS_ATTRIB_MUSIC_BPM = $103; + BASS_ATTRIB_MUSIC_SPEED = $104; + BASS_ATTRIB_MUSIC_VOL_GLOBAL = $105; + BASS_ATTRIB_MUSIC_ACTIVE = $106; + BASS_ATTRIB_MUSIC_VOL_CHAN = $200; // + channel # + BASS_ATTRIB_MUSIC_VOL_INST = $300; // + instrument # + + // BASS_ChannelSlideAttribute flags + BASS_SLIDE_LOG = $1000000; + + // BASS_ChannelGetData flags + BASS_DATA_AVAILABLE = 0; // query how much data is buffered + BASS_DATA_FIXED = $20000000; // flag: return 8.24 fixed-point data + BASS_DATA_FLOAT = $40000000; // flag: return floating-point sample data + BASS_DATA_FFT256 = $80000000; // 256 sample FFT + BASS_DATA_FFT512 = $80000001; // 512 FFT + BASS_DATA_FFT1024 = $80000002; // 1024 FFT + BASS_DATA_FFT2048 = $80000003; // 2048 FFT + BASS_DATA_FFT4096 = $80000004; // 4096 FFT + BASS_DATA_FFT8192 = $80000005; // 8192 FFT + BASS_DATA_FFT16384 = $80000006; // 16384 FFT + BASS_DATA_FFT32768 = $80000007; // 32768 FFT + BASS_DATA_FFT_INDIVIDUAL = $10; // FFT flag: FFT for each channel, else all combined + BASS_DATA_FFT_NOWINDOW = $20; // FFT flag: no Hanning window + BASS_DATA_FFT_REMOVEDC = $40; // FFT flag: pre-remove DC bias + BASS_DATA_FFT_COMPLEX = $80; // FFT flag: return complex data + BASS_DATA_FFT_NYQUIST = $100; // FFT flag: return extra Nyquist value + + // BASS_ChannelGetLevelEx flags + BASS_LEVEL_MONO = 1; + BASS_LEVEL_STEREO = 2; + BASS_LEVEL_RMS = 4; + BASS_LEVEL_VOLPAN = 8; + + // BASS_ChannelGetTags types : what's returned + BASS_TAG_ID3 = 0; // ID3v1 tags : TAG_ID3 structure + BASS_TAG_ID3V2 = 1; // ID3v2 tags : variable length block + BASS_TAG_OGG = 2; // OGG comments : series of null-terminated UTF-8 strings + BASS_TAG_HTTP = 3; // HTTP headers : series of null-terminated ANSI strings + BASS_TAG_ICY = 4; // ICY headers : series of null-terminated ANSI strings + BASS_TAG_META = 5; // ICY metadata : ANSI string + BASS_TAG_APE = 6; // APEv2 tags : series of null-terminated UTF-8 strings + BASS_TAG_MP4 = 7; // MP4/iTunes metadata : series of null-terminated UTF-8 strings + BASS_TAG_WMA = 8; // WMA tags : series of null-terminated UTF-8 strings + BASS_TAG_VENDOR = 9; // OGG encoder : UTF-8 string + BASS_TAG_LYRICS3 = 10; // Lyric3v2 tag : ASCII string + BASS_TAG_CA_CODEC = 11; // CoreAudio codec info : TAG_CA_CODEC structure + BASS_TAG_MF = 13; // Media Foundation tags : series of null-terminated UTF-8 strings + BASS_TAG_WAVEFORMAT = 14; // WAVE format : WAVEFORMATEEX structure + BASS_TAG_AM_MIME = 15; // Android Media MIME type : ASCII string + BASS_TAG_AM_NAME = 16; // Android Media codec name : ASCII string + BASS_TAG_RIFF_INFO = $100; // RIFF "INFO" tags : series of null-terminated ANSI strings + BASS_TAG_RIFF_BEXT = $101; // RIFF/BWF "bext" tags : TAG_BEXT structure + BASS_TAG_RIFF_CART = $102; // RIFF/BWF "cart" tags : TAG_CART structure + BASS_TAG_RIFF_DISP = $103; // RIFF "DISP" text tag : ANSI string + BASS_TAG_RIFF_CUE = $104; // RIFF "cue " chunk : TAG_CUE structure + BASS_TAG_RIFF_SMPL = $105; // RIFF "smpl" chunk : TAG_SMPL structure + BASS_TAG_APE_BINARY = $1000; // + index #, binary APEv2 tag : TAG_APE_BINARY structure + BASS_TAG_MUSIC_NAME = $10000; // MOD music name : ANSI string + BASS_TAG_MUSIC_MESSAGE = $10001; // MOD message : ANSI string + BASS_TAG_MUSIC_ORDERS = $10002; // MOD order list : BYTE array of pattern numbers + BASS_TAG_MUSIC_AUTH = $10003; // MOD author : UTF-8 string + BASS_TAG_MUSIC_INST = $10100; // + instrument #, MOD instrument name : ANSI string + BASS_TAG_MUSIC_SAMPLE = $10300; // + sample #, MOD sample name : ANSI string + + // BASS_ChannelGetLength/GetPosition/SetPosition modes + BASS_POS_BYTE = 0; // byte position + BASS_POS_MUSIC_ORDER = 1; // order.row position, MAKELONG(order,row) + BASS_POS_OGG = 3; // OGG bitstream number + BASS_POS_RESET = $2000000; // flag: reset user file buffers + BASS_POS_RELATIVE = $4000000; // flag: seek relative to the current position + BASS_POS_INEXACT = $8000000; // flag: allow seeking to inexact position + BASS_POS_DECODE = $10000000; // flag: get the decoding (not playing) position + BASS_POS_DECODETO = $20000000; // flag: decode to the position instead of seeking + BASS_POS_SCAN = $40000000; // flag: scan to the position + + // BASS_ChannelSetDevice/GetDevice option + BASS_NODEVICE = $20000; + + // BASS_RecordSetInput flags + BASS_INPUT_OFF = $10000; + BASS_INPUT_ON = $20000; + + BASS_INPUT_TYPE_MASK = $FF000000; + BASS_INPUT_TYPE_UNDEF = $00000000; + BASS_INPUT_TYPE_DIGITAL = $01000000; + BASS_INPUT_TYPE_LINE = $02000000; + BASS_INPUT_TYPE_MIC = $03000000; + BASS_INPUT_TYPE_SYNTH = $04000000; + BASS_INPUT_TYPE_CD = $05000000; + BASS_INPUT_TYPE_PHONE = $06000000; + BASS_INPUT_TYPE_SPEAKER = $07000000; + BASS_INPUT_TYPE_WAVE = $08000000; + BASS_INPUT_TYPE_AUX = $09000000; + BASS_INPUT_TYPE_ANALOG = $0A000000; + + // BASS_ChannelSetFX effect types + BASS_FX_DX8_CHORUS = 0; + BASS_FX_DX8_COMPRESSOR = 1; + BASS_FX_DX8_DISTORTION = 2; + BASS_FX_DX8_ECHO = 3; + BASS_FX_DX8_FLANGER = 4; + BASS_FX_DX8_GARGLE = 5; + BASS_FX_DX8_I3DL2REVERB = 6; + BASS_FX_DX8_PARAMEQ = 7; + BASS_FX_DX8_REVERB = 8; + BASS_FX_VOLUME = 9; + + BASS_DX8_PHASE_NEG_180 = 0; + BASS_DX8_PHASE_NEG_90 = 1; + BASS_DX8_PHASE_ZERO = 2; + BASS_DX8_PHASE_90 = 3; + BASS_DX8_PHASE_180 = 4; + +type + DWORD = Cardinal; + BOOL = LongBool; + QWORD = Int64; + + HMUSIC = DWORD; // MOD music handle + HSAMPLE = DWORD; // sample handle + HCHANNEL = DWORD; // playing sample's channel handle + HSTREAM = DWORD; // sample stream handle + HRECORD = DWORD; // recording handle + HSYNC = DWORD; // synchronizer handle + HDSP = DWORD; // DSP handle + HFX = DWORD; // DX8 effect handle + HPLUGIN = DWORD; // Plugin handle + + // Device info structure + BASS_DEVICEINFO = record + name: PAnsiChar; // description + driver: PAnsiChar; // driver + flags: DWORD; + end; + + BASS_INFO = record + flags: DWORD; // device capabilities (DSCAPS_xxx flags) + hwsize: DWORD; // size of total device hardware memory + hwfree: DWORD; // size of free device hardware memory + freesam: DWORD; // number of free sample slots in the hardware + free3d: DWORD; // number of free 3D sample slots in the hardware + minrate: DWORD; // min sample rate supported by the hardware + maxrate: DWORD; // max sample rate supported by the hardware + eax: BOOL; // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used) + minbuf: DWORD; // recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY) + dsver: DWORD; // DirectSound version + latency: DWORD; // delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY) + initflags: DWORD; // BASS_Init "flags" parameter + speakers: DWORD; // number of speakers available + freq: DWORD; // current output rate + end; + + // Recording device info structure + BASS_RECORDINFO = record + flags: DWORD; // device capabilities (DSCCAPS_xxx flags) + formats: DWORD; // supported standard formats (WAVE_FORMAT_xxx flags) + inputs: DWORD; // number of inputs + singlein: BOOL; // only 1 input can be set at a time + freq: DWORD; // current input rate + end; + + // Sample info structure + BASS_SAMPLE = record + freq: DWORD; // default playback rate + volume: Single; // default volume (0-100) + pan: Single; // default pan (-100=left, 0=middle, 100=right) + flags: DWORD; // BASS_SAMPLE_xxx flags + length: DWORD; // length (in samples, not bytes) + max: DWORD; // maximum simultaneous playbacks + origres: DWORD; // original resolution + chans: DWORD; // number of channels + mingap: DWORD; // minimum gap (ms) between creating channels + mode3d: DWORD; // BASS_3DMODE_xxx mode + mindist: Single; // minimum distance + maxdist: Single; // maximum distance + iangle: DWORD; // angle of inside projection cone + oangle: DWORD; // angle of outside projection cone + outvol: Single; // delta-volume outside the projection cone + vam: DWORD; // voice allocation/management flags (BASS_VAM_xxx) + priority: DWORD; // priority (0=lowest, $ffffffff=highest) + end; + + // Channel info structure + BASS_CHANNELINFO = record + freq: DWORD; // default playback rate + chans: DWORD; // channels + flags: DWORD; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags + ctype: DWORD; // type of channel + origres: DWORD; // original resolution + plugin: HPLUGIN; // plugin + sample: HSAMPLE; // sample + {$IFDEF CPUX64} + padding: DWORD; + {$ENDIF} + filename: PChar; // filename + end; + + BASS_PLUGINFORM = record + ctype: DWORD; // channel type + {$IFDEF CPUX64} + padding: DWORD; + {$ENDIF} + name: PAnsiChar; // format description + exts: PAnsiChar; // file extension filter (*.ext1;*.ext2;etc...) + end; + PBASS_PLUGINFORMS = ^TBASS_PLUGINFORMS; + TBASS_PLUGINFORMS = array[0..maxInt div sizeOf(BASS_PLUGINFORM) - 1] of BASS_PLUGINFORM; + + PBASS_PLUGININFO = ^BASS_PLUGININFO; + BASS_PLUGININFO = record + version: DWORD; // version (same form as BASS_GetVersion) + formatc: DWORD; // number of formats + formats: PBASS_PLUGINFORMS; // the array of formats + end; + + // 3D vector (for 3D positions/velocities/orientations) + BASS_3DVECTOR = record + x: Single; // +=right, -=left + y: Single; // +=up, -=down + z: Single; // +=front, -=behind + end; + + // User file stream callback functions + FILECLOSEPROC = procedure(user: Pointer); {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + FILELENPROC = function(user: Pointer): QWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + FILEREADPROC = function(buffer: Pointer; length: DWORD; user: Pointer): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + FILESEEKPROC = function(offset: QWORD; user: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + + BASS_FILEPROCS = record + close: FILECLOSEPROC; + length: FILELENPROC; + read: FILEREADPROC; + seek: FILESEEKPROC; + end; + + // ID3v1 tag structure + PTAG_ID3 = ^TAG_ID3; + TAG_ID3 = record + id: Array[0..2] of AnsiChar; + title: Array[0..29] of AnsiChar; + artist: Array[0..29] of AnsiChar; + album: Array[0..29] of AnsiChar; + year: Array[0..3] of AnsiChar; + comment: Array[0..29] of AnsiChar; + genre: Byte; + end; + + // Binary APEv2 tag structure + PTAG_APE_BINARY = ^TAG_APE_BINARY; + TAG_APE_BINARY = record + key: PAnsiChar; + data: PAnsiChar; + length: DWORD; + end; + + // BWF "bext" tag structure + PTAG_BEXT = ^TAG_BEXT; + TAG_BEXT = packed record + Description: Array[0..255] of AnsiChar; // description + Originator: Array[0..31] of AnsiChar; // name of the originator + OriginatorReference: Array[0..31] of AnsiChar; // reference of the originator + OriginationDate: Array[0..9] of AnsiChar; // date of creation (yyyy-mm-dd) + OriginationTime: Array[0..7] of AnsiChar; // time of creation (hh-mm-ss) + TimeReference: QWORD; // first sample count since midnight (little-endian) + Version: Word; // BWF version (little-endian) + UMID: Array[0..63] of Byte; // SMPTE UMID + Reserved: Array[0..189] of Byte; + CodingHistory: AnsiChar; // history + end; + + BASS_DX8_CHORUS = record + fWetDryMix: Single; + fDepth: Single; + fFeedback: Single; + fFrequency: Single; + lWaveform: DWORD; // 0=triangle, 1=sine + fDelay: Single; + lPhase: DWORD; // BASS_DX8_PHASE_xxx + end; + + BASS_DX8_COMPRESSOR = record + fGain: Single; + fAttack: Single; + fRelease: Single; + fThreshold: Single; + fRatio: Single; + fPredelay: Single; + end; + + BASS_DX8_DISTORTION = record + fGain: Single; + fEdge: Single; + fPostEQCenterFrequency: Single; + fPostEQBandwidth: Single; + fPreLowpassCutoff: Single; + end; + + BASS_DX8_ECHO = record + fWetDryMix: Single; + fFeedback: Single; + fLeftDelay: Single; + fRightDelay: Single; + lPanDelay: BOOL; + end; + + BASS_DX8_FLANGER = record + fWetDryMix: Single; + fDepth: Single; + fFeedback: Single; + fFrequency: Single; + lWaveform: DWORD; // 0=triangle, 1=sine + fDelay: Single; + lPhase: DWORD; // BASS_DX8_PHASE_xxx + end; + + BASS_DX8_GARGLE = record + dwRateHz: DWORD; // Rate of modulation in hz + dwWaveShape: DWORD; // 0=triangle, 1=square + end; + + BASS_DX8_I3DL2REVERB = record + lRoom: Integer; // [-10000, 0] default: -1000 mB + lRoomHF: Integer; // [-10000, 0] default: 0 mB + flRoomRolloffFactor: Single; // [0.0, 10.0] default: 0.0 + flDecayTime: Single; // [0.1, 20.0] default: 1.49s + flDecayHFRatio: Single; // [0.1, 2.0] default: 0.83 + lReflections: Integer; // [-10000, 1000] default: -2602 mB + flReflectionsDelay: Single; // [0.0, 0.3] default: 0.007 s + lReverb: Integer; // [-10000, 2000] default: 200 mB + flReverbDelay: Single; // [0.0, 0.1] default: 0.011 s + flDiffusion: Single; // [0.0, 100.0] default: 100.0 % + flDensity: Single; // [0.0, 100.0] default: 100.0 % + flHFReference: Single; // [20.0, 20000.0] default: 5000.0 Hz + end; + + BASS_DX8_PARAMEQ = record + fCenter: Single; + fBandwidth: Single; + fGain: Single; + end; + + BASS_DX8_REVERB = record + fInGain: Single; // [-96.0,0.0] default: 0.0 dB + fReverbMix: Single; // [-96.0,0.0] default: 0.0 db + fReverbTime: Single; // [0.001,3000.0] default: 1000.0 ms + fHighFreqRTRatio: Single; // [0.001,0.999] default: 0.001 + end; + + BASS_FX_VOLUME_PARAM = record + fTarget: Single; + fCurrent: Single; + fTime: Single; + lCurve: DWORD; + end; + + // callback function types + STREAMPROC = function(handle: HSTREAM; buffer: Pointer; length: DWORD; user: Pointer): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + { + User stream callback function. + handle : The stream that needs writing + buffer : Buffer to write the samples in + length : Number of bytes to write + user : The 'user' parameter value given when calling BASS_StreamCreate + RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end + the stream. + } + +const + // special STREAMPROCs + STREAMPROC_DUMMY = Pointer(0); // "dummy" stream + STREAMPROC_PUSH = Pointer(-1); // push stream + STREAMPROC_DEVICE = Pointer(-2); // device mix stream + STREAMPROC_DEVICE_3D = Pointer(-3); // device 3D mix stream + +type + DOWNLOADPROC = procedure(buffer: Pointer; length: DWORD; user: Pointer); {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + { + Internet stream download callback function. + buffer : Buffer containing the downloaded data... NULL=end of download + length : Number of bytes in the buffer + user : The 'user' parameter value given when calling BASS_StreamCreateURL + } + + SYNCPROC = procedure(handle: HSYNC; channel, data: DWORD; user: Pointer); {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + { + Sync callback function. + handle : The sync that has occured + channel: Channel that the sync occured in + data : Additional data associated with the sync's occurance + user : The 'user' parameter given when calling BASS_ChannelSetSync + } + + DSPPROC = procedure(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: Pointer); {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + { + DSP callback function. + handle : The DSP handle + channel: Channel that the DSP is being applied to + buffer : Buffer to apply the DSP to + length : Number of bytes in the buffer + user : The 'user' parameter given when calling BASS_ChannelSetDSP + } + + RECORDPROC = function(handle: HRECORD; buffer: Pointer; length: DWORD; user: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; + { + Recording callback function. + handle : The recording handle + buffer : Buffer containing the recorded sample data + length : Number of bytes + user : The 'user' parameter value given when calling BASS_RecordStart + RETURN : TRUE = continue recording, FALSE = stop + } + + +// Functions +const +{$IFDEF MSWINDOWS} + bassdll = 'bass.dll'; +{$ENDIF} +{$IFDEF LINUX} + bassdll = 'libbass.so'; +{$ENDIF} +{$IFDEF ANDROID} + bassdll = 'libbass.so'; +{$ENDIF} +{$IFDEF MACOS} + {$IFDEF IOS} + bassdll = 'libbass.a'; + {$ELSE} + bassdll = 'libbass.dylib'; + {$ENDIF} +{$ENDIF} + +function BASS_SetConfig(option, value: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetConfig(option: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SetConfigPtr(option: DWORD; value: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetConfigPtr(option: DWORD): Pointer; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetVersion: DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ErrorGetCode: Integer; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetDeviceInfo(device: DWORD; var info: BASS_DEVICEINFO): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +{$IFDEF MSWINDOWS} +function BASS_Init(device: Integer; freq, flags: DWORD; win: HWND; clsid: PGUID): BOOL; stdcall; external bassdll; +{$ELSE} +function BASS_Init(device: Integer; freq, flags: DWORD; win: Pointer; clsid: Pointer): BOOL; cdecl; external bassdll; +{$ENDIF} +function BASS_SetDevice(device: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetDevice: DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Free: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +{$IFDEF MSWINDOWS} +function BASS_GetDSoundObject(obj: DWORD): Pointer; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +{$ENDIF} +function BASS_GetInfo(var info: BASS_INFO): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Update(length: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetCPU: Single; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Start: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Stop: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Pause: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_IsStarted: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SetVolume(volume: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetVolume: Single; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_PluginLoad(filename: PChar; flags: DWORD): HPLUGIN; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_PluginFree(handle: HPLUGIN): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_PluginGetInfo(handle: HPLUGIN): PBASS_PLUGININFO; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_Set3DFactors(distf, rollf, doppf: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Get3DFactors(var distf, rollf, doppf: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Set3DPosition(var pos, vel, front, top: BASS_3DVECTOR): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_Get3DPosition(var pos, vel, front, top: BASS_3DVECTOR): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +procedure BASS_Apply3D; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +{$IFDEF MSWINDOWS} +function BASS_SetEAXParameters(env: Integer; vol, decay, damp: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_GetEAXParameters(var env: DWORD; var vol, decay, damp: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +{$ENDIF} + +function BASS_MusicLoad(mem: BOOL; f: Pointer; offset: QWORD; length, flags, freq: DWORD): HMUSIC; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_MusicFree(handle: HMUSIC): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_SampleLoad(mem: BOOL; f: Pointer; offset: QWORD; length, max, flags: DWORD): HSAMPLE; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleCreate(length, freq, chans, max, flags: DWORD): HSAMPLE; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleFree(handle: HSAMPLE): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleSetData(handle: HSAMPLE; buffer: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleGetData(handle: HSAMPLE; buffer: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleGetInfo(handle: HSAMPLE; var info: BASS_SAMPLE): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleSetInfo(handle: HSAMPLE; var info: BASS_SAMPLE): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleGetChannel(handle: HSAMPLE; onlynew: BOOL): HCHANNEL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleGetChannels(handle: HSAMPLE; channels: Pointer): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_SampleStop(handle: HSAMPLE): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_StreamCreate(freq, chans, flags: DWORD; proc: STREAMPROC; user: Pointer): HSTREAM; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamCreateFile(mem: BOOL; f: Pointer; offset, length: QWORD; flags: DWORD): HSTREAM; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamCreateURL(url: PChar; offset: DWORD; flags: DWORD; proc: DOWNLOADPROC; user: Pointer):HSTREAM; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamCreateFileUser(system, flags: DWORD; var procs: BASS_FILEPROCS; user: Pointer): HSTREAM; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamFree(handle: HSTREAM): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamGetFilePosition(handle: HSTREAM; mode: DWORD): QWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamPutData(handle: HSTREAM; buffer: Pointer; length: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_StreamPutFileData(handle: HSTREAM; buffer: Pointer; length: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_RecordGetDeviceInfo(device: DWORD; var info: BASS_DEVICEINFO): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordInit(device: Integer):BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordSetDevice(device: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordGetDevice: DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordFree: BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordGetInfo(var info: BASS_RECORDINFO): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordGetInputName(input: Integer): PAnsiChar; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordSetInput(input: Integer; flags: DWORD; volume: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordGetInput(input: Integer; var volume: Single): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_RecordStart(freq, chans, flags: DWORD; proc: RECORDPROC; user: Pointer): HRECORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_ChannelBytes2Seconds(handle: DWORD; pos: QWORD): Double; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelSeconds2Bytes(handle: DWORD; pos: Double): QWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelGetDevice(handle: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetDevice(handle, device: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelIsActive(handle: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelGetInfo(handle: DWORD; var info: BASS_CHANNELINFO):BOOL;{$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelGetTags(handle: HSTREAM; tags: DWORD): PAnsiChar; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelFlags(handle, flags, mask: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelUpdate(handle, length: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelLock(handle: DWORD; lock: BOOL): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelStop(handle: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelPause(handle: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetAttribute(handle, attrib: DWORD; value: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetAttribute(handle, attrib: DWORD; var value: Single): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSlideAttribute(handle, attrib: DWORD; value: Single; time: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelIsSliding(handle, attrib: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelSetAttributeEx(handle, attrib: DWORD; value: Pointer; size: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelGetAttributeEx(handle, attrib: DWORD; value: Pointer; size: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};external bassdll; +function BASS_ChannelSet3DAttributes(handle: DWORD; mode: Integer; min, max: Single; iangle, oangle, outvol: Integer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGet3DAttributes(handle: DWORD; var mode: DWORD; var min, max: Single; var iangle, oangle, outvol: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSet3DPosition(handle: DWORD; var pos, orient, vel: BASS_3DVECTOR): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGet3DPosition(handle: DWORD; var pos, orient, vel: BASS_3DVECTOR): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetLength(handle, mode: DWORD): QWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetPosition(handle: DWORD; pos: QWORD; mode: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetPosition(handle, mode: DWORD): QWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetLevel(handle: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetLevelEx(handle: DWORD; levels: PSingle; length: Single; flags: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelGetData(handle: DWORD; buffer: Pointer; length: DWORD): DWORD; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetSync(handle: DWORD; type_: DWORD; param: QWORD; proc: SYNCPROC; user: Pointer): HSYNC; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelRemoveSync(handle: DWORD; sync: HSYNC): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetDSP(handle: DWORD; proc: DSPPROC; user: Pointer; priority: Integer): HDSP; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelRemoveDSP(handle: DWORD; dsp: HDSP): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetLink(handle, chan: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelRemoveLink(handle, chan: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelSetFX(handle, type_: DWORD; priority: Integer): HFX; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_ChannelRemoveFX(handle: DWORD; fx: HFX): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + +function BASS_FXSetParameters(handle: HFX; par: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_FXGetParameters(handle: HFX; par: Pointer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_FXReset(handle: HFX): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; +function BASS_FXSetPriority(handle: HFX; priority: Integer): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll; + + +function BASS_SPEAKER_N(n: DWORD): DWORD; +{$IFDEF MSWINDOWS} +function BASS_SetEAXPreset(env: Integer): BOOL; +{ + This function is defined in the implementation part of this unit. + It is not part of BASS.DLL but an extra function which makes it easier + to set the predefined EAX environments. + env : a EAX_ENVIRONMENT_xxx constant +} +{$ENDIF} + + +implementation + +function BASS_SPEAKER_N(n: DWORD): DWORD; +begin + Result := n shl 24; +end; + +{$IFDEF MSWINDOWS} +function BASS_SetEAXPreset(env: Integer): BOOL; +begin + case (env) of + EAX_ENVIRONMENT_GENERIC: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_GENERIC, 0.5, 1.493, 0.5); + EAX_ENVIRONMENT_PADDEDCELL: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_PADDEDCELL, 0.25, 0.1, 0); + EAX_ENVIRONMENT_ROOM: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_ROOM, 0.417, 0.4, 0.666); + EAX_ENVIRONMENT_BATHROOM: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_BATHROOM, 0.653, 1.499, 0.166); + EAX_ENVIRONMENT_LIVINGROOM: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_LIVINGROOM, 0.208, 0.478, 0); + EAX_ENVIRONMENT_STONEROOM: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_STONEROOM, 0.5, 2.309, 0.888); + EAX_ENVIRONMENT_AUDITORIUM: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_AUDITORIUM, 0.403, 4.279, 0.5); + EAX_ENVIRONMENT_CONCERTHALL: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_CONCERTHALL, 0.5, 3.961, 0.5); + EAX_ENVIRONMENT_CAVE: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_CAVE, 0.5, 2.886, 1.304); + EAX_ENVIRONMENT_ARENA: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_ARENA, 0.361, 7.284, 0.332); + EAX_ENVIRONMENT_HANGAR: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_HANGAR, 0.5, 10.0, 0.3); + EAX_ENVIRONMENT_CARPETEDHALLWAY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_CARPETEDHALLWAY, 0.153, 0.259, 2.0); + EAX_ENVIRONMENT_HALLWAY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_HALLWAY, 0.361, 1.493, 0); + EAX_ENVIRONMENT_STONECORRIDOR: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_STONECORRIDOR, 0.444, 2.697, 0.638); + EAX_ENVIRONMENT_ALLEY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_ALLEY, 0.25, 1.752, 0.776); + EAX_ENVIRONMENT_FOREST: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_FOREST, 0.111, 3.145, 0.472); + EAX_ENVIRONMENT_CITY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_CITY, 0.111, 2.767, 0.224); + EAX_ENVIRONMENT_MOUNTAINS: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_MOUNTAINS, 0.194, 7.841, 0.472); + EAX_ENVIRONMENT_QUARRY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_QUARRY, 1, 1.499, 0.5); + EAX_ENVIRONMENT_PLAIN: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_PLAIN, 0.097, 2.767, 0.224); + EAX_ENVIRONMENT_PARKINGLOT: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_PARKINGLOT, 0.208, 1.652, 1.5); + EAX_ENVIRONMENT_SEWERPIPE: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_SEWERPIPE, 0.652, 2.886, 0.25); + EAX_ENVIRONMENT_UNDERWATER: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_UNDERWATER, 1, 1.499, 0); + EAX_ENVIRONMENT_DRUGGED: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_DRUGGED, 0.875, 8.392, 1.388); + EAX_ENVIRONMENT_DIZZY: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_DIZZY, 0.139, 17.234, 0.666); + EAX_ENVIRONMENT_PSYCHOTIC: + Result := BASS_SetEAXParameters(EAX_ENVIRONMENT_PSYCHOTIC, 0.486, 7.563, 0.806); + else + Result := FALSE; + end; +end; +{$ENDIF} + +end. + diff --git a/bass-sys/bass24/delphi/custloop/Unit1.dfm b/bass-sys/bass24/delphi/custloop/Unit1.dfm new file mode 100644 index 0000000..0421e44 --- /dev/null +++ b/bass-sys/bass24/delphi/custloop/Unit1.dfm @@ -0,0 +1,50 @@ +object Form1: TForm1 + Left = 192 + Top = 103 + BorderStyle = bsDialog + Caption = + 'BASS custom looping example (left-click to set loop start, right' + + '-click to set end)' + ClientHeight = 200 + ClientWidth = 253 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + OnKeyDown = FormKeyDown + OnMouseDown = FormMouseDown + OnMouseMove = FormMouseMove + OnMouseUp = FormMouseUp + PixelsPerInch = 96 + TextHeight = 13 + object PB: TPaintBox + Left = 0 + Top = 0 + Width = 253 + Height = 200 + Align = alClient + OnMouseDown = FormMouseDown + OnMouseMove = FormMouseMove + OnMouseUp = FormMouseUp + OnPaint = PBPaint + end + object OpenDialog1: TOpenDialog + Filter = + 'Playable files|*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif;*.mo3;*.it;*.' + + 'xm;*.s3m;*.mtm;*.mod;*.umx|All files (*.*)|*.*' + Title = 'Select a file to play' + Left = 8 + Top = 8 + end + object Timer1: TTimer + Enabled = False + OnTimer = Timer1Timer + Left = 48 + Top = 8 + end +end diff --git a/bass-sys/bass24/delphi/custloop/Unit1.pas b/bass-sys/bass24/delphi/custloop/Unit1.pas new file mode 100644 index 0000000..11edd84 --- /dev/null +++ b/bass-sys/bass24/delphi/custloop/Unit1.pas @@ -0,0 +1,356 @@ +unit Unit1; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Math, StdCtrls, Bass, ExtCtrls; + +type + TForm1 = class(TForm) + OpenDialog1: TOpenDialog; + Timer1: TTimer; + PB: TPaintBox; + procedure FormCreate(Sender: TObject); + procedure Timer1Timer(Sender: TObject); + procedure FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); + procedure FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure PBPaint(Sender: TObject); + procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + private + function PlayFile: boolean; + procedure ErrorPop(str: string); + procedure SetLoopStart(position: qword); + procedure SetLoopEnd(position: qword); + procedure ScanPeaks2(decoder: HSTREAM); + procedure DrawSpectrum; + procedure DrawTime_Line(position: QWORD; y : integer; cl : TColor); + public + end; + +type TScanThread = class(TThread) + private + Fdecoder : HSTREAM; + protected + procedure Execute; override; + public + constructor Create(decoder:HSTREAM); +end; + +procedure LoopSyncProc(handle: HSYNC; channel, data: DWORD; user: Pointer); stdcall; + +var + Form1: TForm1; + lsync : HSYNC; // looping synchronizer handle + chan : HSTREAM; // sample stream handle + chan2: HSTREAM; + loop : array[0..1] of DWORD; + killscan : boolean; + bpp : dword; // stream bytes per pixel + wavebufL : array of smallint; + wavebufR : array of smallint; + mousedwn : integer; + Buffer: TBitmap; + +implementation + +{$R *.dfm} + +//------------------------------------------------------------------------------ + +procedure TForm1.FormCreate(Sender: TObject); +begin + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then + begin + MessageBox(0,'An incorrect version of BASS.DLL was loaded', nil, MB_ICONERROR); + Halt; + end; + + //assigning layout properties + ClientHeight := 201; + ClientWidth := 600; + Top := 100; + Left := 100; + Buffer := TBitmap.Create; + Buffer.Width:= PB.Width; + Buffer.Height:= PB.Height; + PB.Parent.DoubleBuffered := true; + + //set array size + setlength(wavebufL,ClientWidth); + setlength(wavebufR,ClientWidth); + + //init vars + loop[0] := 0; + loop[1] := 0; + + //init BASS + if not BASS_Init(-1,44100,0,Application.Handle,nil) then + ErrorPop('Can''t initialize device'); + + //init timer for updating + Timer1.Interval := 20; //ms + Timer1.Enabled := true; + + //main start play function + if not PlayFile then + begin + BASS_Free(); + Application.Terminate; + end; +end; + +function TForm1.PlayFile : boolean; +var + filename : string; + data : array[0..2000] of SmallInt; + i : integer; +begin + result := false; + if OpenDialog1.Execute then + begin + filename := OpenDialog1.Filename; + BringWindowToTop(Form1.Handle); + SetForegroundWindow(Form1.Handle); + + //creating stream + chan := BASS_StreamCreateFile(FALSE,pchar(filename),0,0,0 {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if chan = 0 then + begin + chan := BASS_MusicLoad(False, pchar(filename), 0, 0, BASS_MUSIC_RAMPS or BASS_MUSIC_POSRESET or BASS_MUSIC_PRESCAN {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}, 1); + if (chan = 0) then + begin + ErrorPop('Can''t play file'); + Exit; + end; + end; + + //playing stream and setting global vars + for i:=0 to length(data)-1 do data[0] := 0; + bpp := BASS_ChannelGetLength(chan,BASS_POS_BYTE) div ClientWidth; // stream bytes per pixel + if (bpp < BASS_ChannelSeconds2Bytes(chan,0.02)) then // minimum 20ms per pixel (BASS_ChannelGetLevel scans 20ms) + bpp := BASS_ChannelSeconds2Bytes(chan,0.02); + BASS_ChannelSetSync(chan,BASS_SYNC_END or BASS_SYNC_MIXTIME,0,LoopSyncProc, nil); // set sync to loop at end + BASS_ChannelPlay(chan,FALSE); // start playing + + //getting peak levels in seperate thread, stream handle as parameter + chan2 := BASS_StreamCreateFile(FALSE,pchar(filename),0,0,BASS_STREAM_DECODE {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if (chan2 = 0) then chan2 := BASS_MusicLoad(FALSE,pchar(filename),0,0,BASS_MUSIC_DECODE {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF},1); + TScanThread.Create(chan2); // start scanning peaks in a new thread + result := true; + end; +end; + +procedure TForm1.DrawSpectrum; +var + i,ht : integer; +begin + //clear background + Buffer.Canvas.Brush.Color := clBlack; + Buffer.Canvas.FillRect(Rect(0,0,Buffer.Width,Buffer.Height)); + + //draw peaks + ht := ClientHeight div 2; + for i:=0 to length(wavebufL)-1 do + begin + Buffer.Canvas.MoveTo(i,ht); + Buffer.Canvas.Pen.Color := clLime; + Buffer.Canvas.LineTo(i,ht-trunc((wavebufL[i]/32768)*ht)); + Buffer.Canvas.Pen.Color := clLime; + Buffer.Canvas.MoveTo(i,ht+2); + Buffer.Canvas.LineTo(i,ht+2+trunc((wavebufR[i]/32768)*ht)); + end; +end; + +procedure TForm1.DrawTime_Line(position : QWORD; y : integer; cl : TColor); +var + sectime : integer; + str : string; + x : integer; +begin + sectime := trunc(BASS_ChannelBytes2Seconds(chan,position)); + x := position div bpp; + + //format time + str := ''; + if (sectime mod 60 < 10) then str := '0'; + str := str+inttostr(sectime mod 60); + str := inttostr(sectime div 60)+':'+str; + + //drawline + Buffer.Canvas.Pen.Color := cl; + Buffer.Canvas.MoveTo(x,0); + Buffer.Canvas.LineTo(x,ClientHeight); + + //drawtext + Buffer.Canvas.Font.Color := cl; + Buffer.Canvas.Font.Style := [fsBold]; + if x > ClientWidth-20 then + dec(x,40); + SetBkMode(Buffer.Canvas.Handle,TRANSPARENT); + Buffer.Canvas.TextOut(x+2,y,str); +end; + +procedure TForm1.ErrorPop(str:string); +begin + //show last BASS errorcode when no argument is given, else show given text. + if str = '' then + Showmessage('Error code: '+inttostr(BASS_ErrorGetCode())) + else + Showmessage(str); + Application.Terminate; +end; + +procedure TForm1.SetLoopStart(position : qword); +begin + loop[0] := position; +end; + +procedure TForm1.SetLoopEnd(position : qword); +begin + loop[1] := position; + BASS_ChannelRemoveSync(chan,lsync); // remove old sync + lsync := BASS_ChannelSetSync(chan,BASS_SYNC_POS or BASS_SYNC_MIXTIME,loop[1],LoopSyncProc, nil); // set new sync +end; + +procedure LoopSyncProc(handle: HSYNC; channel, data: DWORD; user: Pointer); stdcall; +begin + if not BASS_ChannelSetPosition(channel,loop[0],BASS_POS_BYTE) then // try seeking to loop start + BASS_ChannelSetPosition(channel,0,BASS_POS_BYTE); // failed, go to start of file instead +end; + +procedure TForm1.ScanPeaks2(decoder : HSTREAM); +var + cpos,level : DWord; + peak : array[0..1] of DWORD; + position : DWORD; + counter : integer; +begin + cpos := 0; + peak[0] := 0; + peak[1] := 0; + counter := 0; + + while not killscan do + begin + level := BASS_ChannelGetLevel(decoder); // scan peaks + if (peak[0] BASS_ACTIVE_PLAYING then + begin + position := cardinal(-1); // reached the end + end else + position := BASS_ChannelGetPosition(decoder,BASS_POS_BYTE) div bpp; + + if position > cpos then + begin + inc(counter); + if counter <= length(wavebufL)-1 then + begin + wavebufL[counter] := peak[0]; + wavebufR[counter] := peak[1]; + end; + + if (position >= dword(ClientWidth)) then + break; + cpos := position; + end; + + + peak[0] := 0; + peak[1] := 0; + end; + BASS_StreamFree(decoder); // free the decoder +end; + +//------------------------------------------------------------------------------ + +{ TScanThread } + +constructor TScanThread.Create(decoder: HSTREAM); +begin + inherited create(false); + Priority := tpNormal; + FreeOnTerminate := true; + FDecoder := decoder; +end; + +procedure TScanThread.Execute; +begin + inherited; + Form1.ScanPeaks2(FDecoder); + Terminate; +end; + +//------------------------------------------------------------------------------ + +procedure TForm1.Timer1Timer(Sender: TObject); +begin + if bpp = 0 then exit; + DrawSpectrum; // draw peak waveform + DrawTime_Line(loop[0],12,TColor($FFFF00)); // loop start + DrawTime_Line(loop[1],24,TColor($00FFFF)); // loop end + DrawTime_Line(BASS_ChannelGetPosition(chan,BASS_POS_BYTE),0,TColor($FFFFFF)); // current pos + PB.Refresh; +end; + +procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + if Button = mbLeft then + begin + mousedwn := 1; + SetLoopStart(dword(x)*bpp) + end + else if Button = mbRight then + begin + mousedwn := 2; + SetLoopEnd(dword(x)*bpp); + end; +end; + +procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, + Y: Integer); +begin + if mousedwn = 0 then + exit; + if mousedwn = 1 then + SetLoopStart(dword(x)*bpp) + else if mousedwn = 2 then + SetLoopEnd(dword(x)*bpp); +end; + +procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + mousedwn := 0; +end; + +procedure TForm1.PBPaint(Sender: TObject); +begin + if bpp = 0 then exit; + PB.Canvas.Draw(0,0,Buffer); +end; + +procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if key = 27 then + Application.Terminate; +end; + +procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); +begin + Timer1.Enabled := false; + bpp := 0; + killscan := true; + Buffer.Free; + BASS_Free(); +end; + +end. diff --git a/bass-sys/bass24/delphi/custloop/custloop.dpr b/bass-sys/bass24/delphi/custloop/custloop.dpr new file mode 100644 index 0000000..e85a9e4 --- /dev/null +++ b/bass-sys/bass24/delphi/custloop/custloop.dpr @@ -0,0 +1,12 @@ +program custloop; + +uses + Forms, + Unit1 in 'Unit1.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/devlist/devlist.dpr b/bass-sys/bass24/delphi/devlist/devlist.dpr new file mode 100644 index 0000000..0ad6588 --- /dev/null +++ b/bass-sys/bass24/delphi/devlist/devlist.dpr @@ -0,0 +1,95 @@ +{ + BASS device list example + Copyright (c) 2014 Un4seen Developments Ltd. + + C++ to Delphi with use API adapted by Evgeny Melnikov + Required Delphi 7 or above +} + +program List; + +{$APPTYPE CONSOLE} + +uses + Bass in '..\Bass.pas'; + +procedure DisplayDeviceInfo(di : BASS_DEVICEINFO); +var + St : String; +begin + Write(di.name, #13#10#9, 'driver: ', di.driver, #13#10#9'type: '); + case (di.flags and BASS_DEVICE_TYPE_MASK) of + BASS_DEVICE_TYPE_NETWORK : + St := 'Remote Network'; + + BASS_DEVICE_TYPE_SPEAKERS : + St := 'Speakers'; + + BASS_DEVICE_TYPE_LINE : + St := 'Line'; + + BASS_DEVICE_TYPE_HEADPHONES : + St := 'Headphones'; + + BASS_DEVICE_TYPE_MICROPHONE : + St := 'Microphone'; + + BASS_DEVICE_TYPE_HEADSET : + St := 'Headset'; + + BASS_DEVICE_TYPE_HANDSET : + St := 'Handset'; + + BASS_DEVICE_TYPE_DIGITAL : + St := 'Digital'; + + BASS_DEVICE_TYPE_SPDIF : + St := 'SPDIF'; + + BASS_DEVICE_TYPE_HDMI : + St := 'HDMI'; + + BASS_DEVICE_TYPE_DISPLAYPORT : + St := 'DisplayPort'; + else + St := 'Unknown'; + end; + + St := St + #13#10#9'flags:'; + if (di.flags and BASS_DEVICE_LOOPBACK) = BASS_DEVICE_LOOPBACK then + St := St + ' loopback'; + if (di.flags and BASS_DEVICE_ENABLED) = BASS_DEVICE_ENABLED then + St := St + ' enabled'; + if (di.flags and BASS_DEVICE_DEFAULT) = BASS_DEVICE_DEFAULT then + St := St + ' default'; + WriteLn(St, ' (', di.flags, ')'); +end; + +procedure Main; +var + di : BASS_DEVICEINFO; + i : Integer; +begin + WriteLn('Output Devices'); + i := 1; + while BASS_GetDeviceInfo(i, di) do + begin + Write(i, ': '); + DisplayDeviceInfo(di); + inc(i); + end; + + WriteLn(#13#10'Input Devices'); + + i := 0; + while BASS_RecordGetDeviceInfo(i, di) do + begin + Write(i, ': '); + DisplayDeviceInfo(di); + inc(i); + end; +end; + +begin + Main; +end. diff --git a/bass-sys/bass24/delphi/fxtest/FXtest.dpr b/bass-sys/bass24/delphi/fxtest/FXtest.dpr new file mode 100644 index 0000000..3d91561 --- /dev/null +++ b/bass-sys/bass24/delphi/fxtest/FXtest.dpr @@ -0,0 +1,12 @@ +program FXtest; + +uses + Forms, + test in 'test.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/fxtest/test.dfm b/bass-sys/bass24/delphi/fxtest/test.dfm new file mode 100644 index 0000000..f4a4491 --- /dev/null +++ b/bass-sys/bass24/delphi/fxtest/test.dfm @@ -0,0 +1,142 @@ +object Form1: TForm1 + Left = 238 + Top = 110 + Width = 206 + Height = 230 + Caption = 'BASS FX Demo' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 16 + Top = 176 + Width = 25 + Height = 13 + Alignment = taCenter + AutoSize = False + Caption = '125' + Transparent = True + end + object Label2: TLabel + Left = 56 + Top = 176 + Width = 25 + Height = 17 + Alignment = taCenter + AutoSize = False + Caption = '1000' + Transparent = True + end + object Label3: TLabel + Left = 96 + Top = 176 + Width = 25 + Height = 17 + Alignment = taCenter + AutoSize = False + Caption = '8000' + Transparent = True + end + object Label5: TLabel + Left = 152 + Top = 176 + Width = 25 + Height = 17 + Alignment = taCenter + AutoSize = False + Caption = '0' + Transparent = True + end + object Label4: TLabel + Left = 24 + Top = 56 + Width = 97 + Height = 17 + Alignment = taCenter + AutoSize = False + Caption = 'Equalizer' + Transparent = True + end + object Label6: TLabel + Left = 140 + Top = 56 + Width = 49 + Height = 17 + Alignment = taCenter + AutoSize = False + Caption = 'Reverb' + Transparent = True + end + object Button1: TButton + Left = 16 + Top = 8 + Width = 169 + Height = 41 + Caption = 'Click here to Open and Play' + TabOrder = 0 + WordWrap = True + OnClick = Button1Click + end + object TrackBar1: TTrackBar + Left = 16 + Top = 72 + Width = 33 + Height = 105 + Max = 30 + Orientation = trVertical + Position = 15 + TabOrder = 1 + OnChange = TrackBar1Change + end + object TrackBar2: TTrackBar + Tag = 1 + Left = 56 + Top = 72 + Width = 33 + Height = 105 + Max = 30 + Orientation = trVertical + Position = 15 + TabOrder = 2 + OnChange = TrackBar2Change + end + object TrackBar3: TTrackBar + Tag = 2 + Left = 96 + Top = 72 + Width = 33 + Height = 105 + Max = 30 + Orientation = trVertical + Position = 15 + TabOrder = 3 + OnChange = TrackBar3Change + end + object TrackBar4: TTrackBar + Tag = 3 + Left = 152 + Top = 72 + Width = 33 + Height = 105 + Max = 20 + Orientation = trVertical + Position = 20 + TabOrder = 4 + OnChange = TrackBar4Change + end + object OpenDialog1: TOpenDialog + Filter = + 'Playable files|*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif|All files|*' + + '.*' + Options = [ofPathMustExist, ofFileMustExist, ofEnableSizing] + Top = 72 + end +end diff --git a/bass-sys/bass24/delphi/fxtest/test.pas b/bass-sys/bass24/delphi/fxtest/test.pas new file mode 100644 index 0000000..9834bc4 --- /dev/null +++ b/bass-sys/bass24/delphi/fxtest/test.pas @@ -0,0 +1,157 @@ +unit test; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + ComCtrls, StdCtrls, Bass; + +type + TForm1 = class(TForm) + Button1: TButton; + TrackBar1: TTrackBar; + TrackBar2: TTrackBar; + TrackBar3: TTrackBar; + TrackBar4: TTrackBar; + OpenDialog1: TOpenDialog; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label5: TLabel; + Label4: TLabel; + Label6: TLabel; + procedure Button1Click(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure TrackBar1Change(Sender: TObject); + procedure TrackBar2Change(Sender: TObject); + procedure TrackBar3Change(Sender: TObject); + procedure TrackBar4Change(Sender: TObject); + private + { Private declarations } + chan: DWORD; + public + { Public declarations } + end; + +var + Form1: TForm1; + p: BASS_DX8_PARAMEQ; + pR: BASS_DX8_REVERB; + fx: array[1..4] of integer; + +implementation + +{$R *.dfm} + +procedure TForm1.Button1Click(Sender: TObject); +var + p1: BASS_CHANNELINFO; +begin + If OpenDialog1.Execute then begin + // free both MOD and stream, it must be one of them! :) + BASS_MusicFree(chan); + BASS_StreamFree(chan); + chan := BASS_StreamCreateFile(FALSE, PChar(OpenDialog1.FileName), 0, 0, BASS_SAMPLE_FX or BASS_SAMPLE_LOOP {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if (chan = 0) then + chan := BASS_MusicLoad(FALSE, PChar(OpenDialog1.FileName), 0, 0, BASS_MUSIC_LOOP or BASS_MUSIC_RAMP or BASS_SAMPLE_FX {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF},1); + if (chan = 0) then + begin + // not a WAV/MP3 or MOD + Button1.Caption := 'Can''t play the file! Please select another.'; + Exit; + end; + if (p1.flags and BASS_SAMPLE_8BITS) > 0 then + begin + // not 16-bit stereo + Button1.Caption := '16-bit stereo sources only. Please select another.'; + BASS_MusicFree(chan); + BASS_StreamFree(chan); + Exit; + end; + Button1.Caption := OpenDialog1.FileName; + fx[1] := BASS_ChannelSetFX(chan, BASS_FX_DX8_PARAMEQ, 1); + fx[2] := BASS_ChannelSetFX(chan, BASS_FX_DX8_PARAMEQ, 1); + fx[3] := BASS_ChannelSetFX(chan, BASS_FX_DX8_PARAMEQ, 1); + fx[4] := BASS_ChannelSetFX(chan, BASS_FX_DX8_REVERB, 1); + // Set equalizer to flat and reverb off to start + p.fGain := 0; + p.fBandwidth := 18; + p.fCenter := 125; + BASS_FXSetParameters(fx[1], @p); + p.fCenter := 1000; + BASS_FXSetParameters(fx[2], @p); + p.fCenter := 8000; + BASS_FXSetParameters(fx[3], @p); + BASS_FXGetParameters(fx[4], @pR); + pR.fReverbMix := -96; + pR.fReverbTime := 1200; + pR.fHighFreqRTRatio := 0.1; + BASS_FXSetParameters(fx[4], @pR); + // play both MOD and stream, it must be one of them! :) + BASS_ChannelPlay(chan, False); + end; +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + // check the correct BASS was loaded + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then + begin + MessageBox(0,'An incorrect version of BASS.DLL was loaded',0,MB_ICONERROR); + Halt; + end; + // setup output - default device, 44100hz, stereo, 16 bits + if not BASS_Init(-1, 44100, 0, handle, nil) then + begin + Application.MessageBox('Can''t initialize device','Bass Initialize problem'); + Halt; + end + else + BASS_Start; + // Adjust buffer size to balance 'clicks' vs. response time, slower computers need bigger + BASS_SetConfig(BASS_CONFIG_BUFFER,1000); +end; + +procedure TForm1.FormDestroy(Sender: TObject); +begin + Bass_Stop(); + BASS_StreamFree(chan); + BASS_MusicFree(chan); + BASS_Free(); +end; + +procedure TForm1.TrackBar1Change(Sender: TObject); +begin + BASS_FXGetParameters(fx[1], @p); + p.fgain := 15-TrackBar1.position; + BASS_FXSetParameters(fx[1], @p); +end; + +procedure TForm1.TrackBar2Change(Sender: TObject); +begin + BASS_FXGetParameters(fx[2], @p); + p.fgain := 15-TrackBar2.position; + BASS_FXSetParameters(fx[2], @p); +end; + +procedure TForm1.TrackBar3Change(Sender: TObject); +begin + BASS_FXGetParameters(fx[3], @p); + p.fgain := 15-TrackBar3.position; + BASS_FXSetParameters(fx[3], @p); +end; + +procedure TForm1.TrackBar4Change(Sender: TObject); +var + v: integer; +begin + v := TrackBar4.position; + BASS_FXGetParameters(fx[4], @pR); + // give exponential quality to trackbar as Bass more sensitive near 0 + pR.fReverbMix := -0.012*v*v*v; // gives -96 when bar at 20 + BASS_FXSetParameters(fx[4], @pR); + Label5.Caption := inttostr(20-TrackBar4.position); +end; + +end. diff --git a/bass-sys/bass24/delphi/livefx/Unit1.dfm b/bass-sys/bass24/delphi/livefx/Unit1.dfm new file mode 100644 index 0000000..f23d4f3 --- /dev/null +++ b/bass-sys/bass24/delphi/livefx/Unit1.dfm @@ -0,0 +1,98 @@ +object Form1: TForm1 + Left = 304 + Top = 224 + BorderStyle = bsToolWindow + Caption = 'BASS full-duplex recording test with effects' + ClientHeight = 56 + ClientWidth = 384 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 168 + Top = 8 + Width = 44 + Height = 13 + Caption = 'Latency :' + end + object ComboBox1: TComboBox + Left = 8 + Top = 16 + Width = 145 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = ComboBox1Change + end + object CheckBox1: TCheckBox + Left = 312 + Top = 32 + Width = 65 + Height = 17 + Caption = 'Reverb' + TabOrder = 1 + OnClick = CheckBox1Click + end + object CheckBox2: TCheckBox + Left = 232 + Top = 8 + Width = 65 + Height = 17 + Caption = 'Chorus' + TabOrder = 2 + OnClick = CheckBox2Click + end + object CheckBox3: TCheckBox + Left = 312 + Top = 8 + Width = 65 + Height = 17 + Caption = 'Flanger' + TabOrder = 3 + OnClick = CheckBox3Click + end + object CheckBox4: TCheckBox + Left = 232 + Top = 32 + Width = 65 + Height = 17 + Caption = 'Gargle' + TabOrder = 4 + OnClick = CheckBox4Click + end + object TrackBar1: TTrackBar + Left = 8 + Top = 40 + Width = 145 + Height = 17 + Max = 100 + Orientation = trHorizontal + Frequency = 1 + Position = 0 + SelEnd = 0 + SelStart = 0 + TabOrder = 5 + ThumbLength = 10 + TickMarks = tmBoth + TickStyle = tsNone + OnChange = TrackBar1Change + end + object p_latency: TPanel + Left = 160 + Top = 32 + Width = 57 + Height = 17 + BevelOuter = bvLowered + TabOrder = 6 + end +end diff --git a/bass-sys/bass24/delphi/livefx/Unit1.pas b/bass-sys/bass24/delphi/livefx/Unit1.pas new file mode 100644 index 0000000..099596e --- /dev/null +++ b/bass-sys/bass24/delphi/livefx/Unit1.pas @@ -0,0 +1,220 @@ +// BASS Full-duplex test + +// C++ to Delphi Translation by Chris Trsken +//Thanks to Ian Luck for some help +unit Unit1; + +interface + +uses + Windows,Messages,Forms,bass, Controls, ExtCtrls, ComCtrls, StdCtrls, + sysutils, Classes; + +type + TForm1 = class(TForm) + ComboBox1: TComboBox; + CheckBox1: TCheckBox; + CheckBox2: TCheckBox; + CheckBox3: TCheckBox; + CheckBox4: TCheckBox; + Label1: TLabel; + TrackBar1: TTrackBar; + p_latency: TPanel; + procedure ComboBox1Change(Sender: TObject); + procedure CheckBox1Click(Sender: TObject); + procedure CheckBox2Click(Sender: TObject); + procedure CheckBox3Click(Sender: TObject); + procedure CheckBox4Click(Sender: TObject); + procedure TrackBar1Change(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + procedure WndProc(var Msg: TMessage); override; + end; + +var + Form1: TForm1; + rchan: HRECORD; // recording channel + pchan: HStream; + fx: array[1..4] of HFX; + chunk: integer; + latency: integer = 0; // Current latency + win: hwnd; + hTimer: DWORD; +implementation + +{$R *.dfm} + + + +procedure Error(es: string); +begin + MessageBox(win, PChar(es + #13#10 + '(error code: ' + IntToStr(BASS_ErrorGetCode) + + ')'), nil, 0); +end; + +function RecordingCallback(Handle: HRECORD; buffer: Pointer; length: DWORD; user: Pointer): boolean; stdcall; +begin + BASS_StreamPutData(pchan, buffer, length); // feed recorded data to output stream + Result := True; // continue recording +end; + + +procedure TForm1.CheckBox1Click(Sender: TObject); +begin + if CheckBox1.Checked = true then + fx[1] := BASS_ChannelSetFX(pchan, BASS_FX_DX8_REVERB, 0) + else + BASS_ChannelRemoveFX(pchan, fx[1]); +end; + +procedure TForm1.CheckBox2Click(Sender: TObject); +begin + if CheckBox2.Checked = true then + fx[2] := BASS_ChannelSetFX(pchan, BASS_FX_DX8_CHORUS, 0) + else + BASS_ChannelRemoveFX(pchan, fx[2]); +end; + +procedure TForm1.CheckBox3Click(Sender: TObject); +begin + if CheckBox3.Checked = true then + fx[3] := BASS_ChannelSetFX(pchan, BASS_FX_DX8_FLANGER, 0) + else + BASS_ChannelRemoveFX(pchan, fx[3]); +end; + +procedure TForm1.CheckBox4Click(Sender: TObject); +begin + if CheckBox4.Checked = true then + fx[4] := BASS_ChannelSetFX(pchan, BASS_FX_DX8_GARGLE, 0) + else + BASS_ChannelRemoveFX(pchan, fx[4]); +end; + + +procedure TForm1.FormCreate(Sender: TObject); +var + bi: bass_Info; + a: Integer; + dName: PAnsiChar; + r_Init: boolean; + AVolume: Single; + prebuf: DWORD; +begin + win := handle; + MessageBox(win, PChar('Do not set the input to "WAVE" or "What you hear"(etc...) with' + + #13#10 + 'the level set high, as that is likely to result in nasty feedback.'), + PChar('Feedback warning'), $00000030); + + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then begin + MessageBox(0, 'An incorrect version of BASS.DLL was loaded', nil, MB_ICONERROR); + Halt; + end; + + // setup output - get device latency + if not BASS_Init(-1, 44100, BASS_DEVICE_LATENCY, win, nil) then begin + Error('Can''t initialize device'); + Exit; + end; + + BASS_GetInfo(bi); + with checkbox1,checkbox2,checkbox3,checkbox4 do + enabled := bi.dsver >= 8; + pchan := BASS_StreamCreate(44100, 2, 0, STREAMPROC_PUSH, nil); //Playing Channel + + // start recording with 10ms period + + r_init := BASS_RecordInit(-1); + rchan := BASS_RecordStart(44100, 2, MakeLong(0, 10), @RecordingCallback, nil); // Recording Channel + if (not R_Init) or (rchan = 0) then begin + Bass_Free(); + Error('Can''t initialize recording device'); + Halt; + end; + + // Populate the list + a := 0; + dName := BASS_RecordGetInputName(a); + while dName <> nil do begin + ComboBox1.Items.Add(StrPas(dName)); + // is this one currently "on"? + if (BASS_RecordGetInput(a, AVolume) and BASS_INPUT_OFF) = 0 then + ComboBox1.ItemIndex := a; + Inc(a); + dName := BASS_RecordGetInputName(a); + end; + ComboBox1Change(Self); // display info + BASS_RecordGetInput(ComboBox1.ItemIndex, AVolume); + TrackBar1.Position := Trunc(AVolume * 100); // set the level slider + + // prebuffer at least "minbuf" amount of data before starting playback + prebuf := BASS_ChannelSeconds2Bytes(pchan, bi.minbuf / 1000); + while (BASS_ChannelGetData(pchan, nil, BASS_DATA_AVAILABLE) < prebuf) do + sleep(1); + + BASS_ChannelPlay(pchan, False); // Start Playing + hTimer := SetTimer(win, 1, 250, nil); // Start the latency winapi timer + // our winapi Timer, we starting the timer without a callback so that we must + // catch the WM_TIMER Message + +end; + +procedure TForm1.ComboBox1Change(Sender: TObject); +var + i: Integer; + r: Boolean; + AVolume: Single; +begin + // enable the selected input + r := True; + i := 0; + // first disable all inputs, then... + while r do begin + r := BASS_RecordSetInput(i, BASS_INPUT_OFF, -1); + Inc(i); + end; + // ...enable the selected. + BASS_RecordSetInput(ComboBox1.ItemIndex, BASS_INPUT_ON, -1); + BASS_RecordGetInput(ComboBox1.ItemIndex, AVolume); + TrackBar1.Position := Trunc(AVolume * 100); +end; + +procedure TForm1.TrackBar1Change(Sender: TObject); +begin + if not (BASS_RecordSetInput(ComboBox1.ItemIndex, 0, + TrackBar1.Position / 100)) then + BASS_RecordSetInput(-1, 0, TrackBar1.Position / 100); +end; + +procedure TForm1.WndProc(var Msg: TMessage); +begin + inherited; + case Msg.Msg of + WM_TIMER: + begin + // display current latency (input+output buffer level) + latency := (latency * 3 + BASS_ChannelGetData(pchan, nil, + BASS_DATA_AVAILABLE) + BASS_ChannelGetData(rchan, nil, + BASS_DATA_AVAILABLE)) div 4; + p_latency.Caption := FormatFloat('0', + BASS_ChannelBytes2Seconds(pchan, latency) * 1000); + end; + end; +end; + +procedure TForm1.FormDestroy(Sender: TObject); +begin + if hTimer <> 0 then + KillTimer(win, 1); + BASS_RecordFree(); + BASS_Free(); +end; + + + +end. + diff --git a/bass-sys/bass24/delphi/livefx/livefx.dpr b/bass-sys/bass24/delphi/livefx/livefx.dpr new file mode 100644 index 0000000..e26e326 --- /dev/null +++ b/bass-sys/bass24/delphi/livefx/livefx.dpr @@ -0,0 +1,12 @@ +program livefx; + +uses + Forms, + Unit1 in 'Unit1.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/livespec/livespec.dpr b/bass-sys/bass24/delphi/livespec/livespec.dpr new file mode 100644 index 0000000..278066d --- /dev/null +++ b/bass-sys/bass24/delphi/livespec/livespec.dpr @@ -0,0 +1,470 @@ +{ + BASS "live" spectrum analyser example + Copyright (c) 2002-2008 Un4seen Developments Ltd. + + C++ to Delphi with use API adapted by Evgeny Melnikov + Required Delphi 5 or above + + http://dsoft1961.narod.ru + mail angvelem@gmail.com +} + +program livespec; + +uses + Windows, Messages, MMSystem, Bass in '..\bass.pas'; + +const + SPECWIDTH = 368; // display width + SPECHEIGHT = 127; // height (changing requires palette adjustments too) + BANDS = 28; + szAppName = 'BASS-Spectrum'; + +var + Window : HWND = 0; + WndGlobal : HWND = 0; + Msg : TMsg; + WndClass : TWndClassEX; + + PosX, PosY : Integer; + SizeX, SizeY : Integer; + + Timer : DWORD = 0; + Channel : HRECORD; // recording channel + + SpecDC : HDC = 0; + SpecBmp : HBITMAP = 0; + SpecBuf : Pointer; + SpecMode : Integer = 0; + SpecPos : Integer = 0; // spectrum mode (and marker pos for 2nd mode) + quietcount : DWORD = 0; + + BI : PBITMAPINFO; + pal : array[Byte] of TRGBQUAD; + +{$DEFINE ScaleSqrt} + +//------------------ Auxiliary functions ------------------- + +function Format(const Format : String; const Args : array of const ) : String; +var + I : Integer; + FormatBuffer : array[0..High(Word)] of Char; + Arr, Arr1 : PDWORD; + PP : PDWORD; +begin + Arr := NIL; + if High(Args) >= 0 then + GetMem(Arr, (High(Args) + 1) * SizeOf(Pointer)); + Arr1 := Arr; + for I := 0 to High(Args) do + begin + PP := @Args[I]; + PP := Pointer(PP^); + Arr1^ := DWORD(PP); + inc(Arr1); + end; + I := wvsprintf(@FormatBuffer[0], PChar(Format), PChar(Arr)); + SetLength(Result, I); + Result := FormatBuffer; + if Arr <> NIL then + FreeMem(Arr); +end; + +//--------------------------------------------------------- + +function IntPower(const Base : Extended; const Exponent : Integer) : Extended; +asm + mov ecx, eax + cdq + fld1 { Result := 1 } + xor eax, edx + sub eax, edx { eax := Abs(Exponent) } + jz @@3 + fld Base + jmp @@2 +@@1: fmul ST, ST { X := Base * Base } +@@2: shr eax,1 + jnc @@1 + fmul ST(1),ST { Result := Result * X } + jnz @@1 + fstp st { pop X from FPU stack } + cmp ecx, 0 + jge @@3 + fld1 + fdivrp { Result := 1 / Result } +@@3: + fwait +end; + +//--------------------------------------------------------- + +function Power(const Base, Exponent : Extended) : Extended; +begin + if Exponent = 0.0 then + Result := 1.0 { n**0 = 1 } + else if (Base = 0.0) and (Exponent > 0.0) then + Result := 0.0 { 0**n = 0, n > 0 } + else if (Frac(Exponent) = 0.0) and (Abs(Exponent) <= MaxInt) then + Result := IntPower(Base, Integer(Trunc(Exponent))) + else + Result := Exp(Exponent * Ln(Base)) +end; + +//--------------------------------------------------------- +// Log.10(X) := Log.2(X) * Log.10(2) + +function Log10(const X : Extended) : Extended; +asm + FLDLG2 { Log base ten of 2 } + FLD X + FYL2X + FWAIT +end; + +//========================================================== +//========================================================== + +// display error messages +procedure Error(const es : String); +begin + MessageBox(WndGlobal, PChar(Format('%s' + #13#10 + '(error code: %d)', [es, BASS_ErrorGetCode])), 'Error', MB_OK or MB_ICONERROR); +end; + +//--------------------------------------------------------- +// update the spectrum display - the interesting bit :) + +procedure UpdateSpectrum(uTimerID, uMsg, dwUser, dw1, dw2 : Integer); stdcall; +type + TSpecBuf = array[0..0] of Byte; + TBuf = array of SmallInt; +var + DC : HDC; + X, Y, Y1, + V, B0, B1, + SC : Integer; + Sum : Single; + aRect : TRect; + fft : array[0..1023] of Single; + Buf : TBuf; + SBuf : ^TSpecBuf absolute SpecBuf; +begin + if SpecMode = 3 then // waveform + begin + FillChar(SpecBuf^, SPECWIDTH * SPECHEIGHT, 0); + SetLength(Buf, SPECWIDTH); + BASS_ChannelGetData(Channel, Buf, SizeOf(SmallInt) * SPECWIDTH); // get the sample data + + Y := 0; + for X := 0 to SPECWIDTH - 1 do + begin + V := (32767 - Buf[X]) * SPECHEIGHT div 65536; // invert and scale to fit display + if X = 0 then + Y := V; + repeat // draw line from previous sample... + if Y < V then + inc(Y) + else if Y > V then + dec(Y); + SBuf[Y * SPECWIDTH + X] := abs(Y - SPECHEIGHT div 2) * 2 + 1; + until Y = V; + end; + end + else + begin + BASS_ChannelGetData(Channel, @fft, BASS_DATA_FFT2048); // get the FFT data + case SpecMode of + 0 : // "normal" FFT + begin + FillChar(SpecBuf^, SPECWIDTH * SPECHEIGHT, 0); + + Y1 := 0; + for X := 0 to (SPECWIDTH div 2) - 1 do + begin +{$IFDEF ScaleSqrt} + Y := Trunc(sqrt(fft[X + 1]) * 3 * SPECHEIGHT - 4); // scale it (sqrt to make low values more visible) +{$ELSE} + Y := Trunc(fft[x + 1] * 10 * SPECHEIGHT); // scale it (linearly) +{$ENDIF} + if Y > SPECHEIGHT then + Y := SPECHEIGHT; // cap it + + Y1 := (Y + Y1) div 2; + if (X > 0) and (Y1 > 0) then // interpolate from previous to make the display smoother + while (Y1 >= 0) do + begin + SBuf[Y1 * SPECWIDTH + X * 2 - 1] := Y1 + 1; + dec(Y1); + end; + + Y1 := Y; + while (Y >= 0) do + begin + SBuf[Y * SPECWIDTH + X * 2] := Y + 1; // draw level + dec(Y); + end; + end; + end; + 1 : // logarithmic, acumulate & average bins + begin + B0 := 0; + FillChar(SpecBuf^, SPECWIDTH * SPECHEIGHT, 0); + for X := 0 to BANDS - 1 do + begin + Sum := 0; + B1 := Trunc(Power(2, X * 10.0 / (BANDS - 1))); + if B1 > 1023 then + B1 := 1023; + if B1 <= B0 then + B1 := B0 + 1; // make sure it uses at least 1 FFT bin + SC := 10 + B1 - B0; + + while B0 < B1 do + begin + Sum := Sum + fft[1 + B0]; + inc(B0); + end; + + Y := Trunc((sqrt(Sum / log10(SC)) * 1.7 * SPECHEIGHT) - 4); // scale it + if Y > SPECHEIGHT then + Y := SPECHEIGHT; // cap it + + while (Y >= 0) do + begin + FillChar(SBuf[Y * SPECWIDTH + X * (SPECWIDTH div BANDS)], Trunc(0.9 * (SPECWIDTH / BANDS)), Y + 1); // draw bar + dec(Y); + end; + end; + end; + 2 : // "3D" + begin + for X := 0 to SPECHEIGHT - 1 do + begin + Y := Trunc(sqrt(fft[X + 1]) * 3 * 127); // scale it (sqrt to make low values more visible) + if Y > 127 then + Y := 127; // cap it + SBuf[X * SPECWIDTH + SpecPos] := 128 + Y; // plot it + end; + // move marker onto next position + SpecPos := (SpecPos + 1) mod SPECWIDTH; + for X := 0 to SPECHEIGHT - 1 do + SBuf[X * SPECWIDTH + SpecPos] := 255; + end; + end; + end; + // update the display + DC := GetDC(WndGlobal); + try + BitBlt(DC, 0, 0, SPECWIDTH, SPECHEIGHT, SpecDC, 0, 0, SRCCOPY); + if LOWORD(BASS_ChannelGetLevel(Channel)) < 500 then + begin // check if it's quiet + inc(QuietCount); + if (QuietCount > 40) and (QuietCount and 16 > 0) then + begin // it's been quiet for over a second + SetRect(aRect, 0, 0, SPECWIDTH, SPECHEIGHT); + SetTextColor(DC, $ffffff); + SetBkMode(DC, TRANSPARENT); + DrawText(DC, 'make some noise!', -1, aRect, DT_CENTER or DT_VCENTER or DT_SINGLELINE); + end; + end + else + QuietCount := 0; // not quiet + finally + ReleaseDC(Window, DC); + end; +end; + +//--------------------------------------------------------- +// Recording callback - not doing anything with the data + +function DuffRecording(handle : HRECORD; const Buffer : Pointer; Length : DWORD; user : Pointer) : Boolean; stdcall; +begin + Result := True; // continue recording +end; + +//--------------------------------------------------------- + +procedure InitApp(Wnd : HWND); +var + I : Integer; +begin + WndGlobal := Wnd; + + // initialize BASS recording (default device) + if not BASS_RecordInit(-1) then + begin + Error('Can''t initialize device'); + Halt; + end; + + // start recording (44100hz mono 16-bit) + Channel := BASS_RecordStart(44100, 1, 0, @DuffRecording, NIL); + if Channel = 0 then + begin + Error('Can''t start recording'); + Halt; + end; + + // create bitmap to draw spectrum in - 8 bit for easy updating :) + GetMem(BI, SizeOf(TBitmapInfo) + 256 * SizeOf(TRGBQuad)); + try + with BI^.bmiHeader do // fill structure with parameter bitmap + begin + biSize := SizeOf(BI.bmiHeader); + biWidth := SPECWIDTH; + biHeight := SPECHEIGHT; // upside down (line 0=bottom) + biPlanes := 1; + biBitCount := 8; + biClrImportant := 256; + biClrUsed := 256; + end; + + // setup palette + for I := 1 to 127 do + begin + pal[I].rgbGreen := 256 - 2 * I; + pal[I].rgbRed := 2 * I; + end; + + for I := 0 to 31 do + begin + pal[128 + I].rgbBlue := 8 * I; + pal[128 + 32 + I].rgbBlue := 255; + pal[128 + 32 + I].rgbRed := 8 * I; + pal[128 + 64 + I].rgbRed := 255; + pal[128 + 64 + I].rgbBlue := 8 * (31 - I); + pal[128 + 64 + I].rgbGreen := 8 * I; + pal[128 + 96 + I].rgbRed := 255; + pal[128 + 96 + I].rgbGreen := 255; + pal[128 + 96 + I].rgbBlue := 8 * I; + end; + + // Move palette in BI + Move(Pal, BI^.bmiColors, 256 * SizeOf(TRGBQuad)); + + // create the bitmap + SpecBmp := CreateDIBSection(0, BI^, DIB_RGB_COLORS, SpecBuf, 0, 0); + SpecDC := CreateCompatibleDC(0); + SelectObject(SpecDC, SpecBmp); + finally + FreeMem(BI); + end; + + // setup update timer (40hz) + timer := timeSetEvent(25, 25, @UpdateSpectrum, 0, TIME_PERIODIC); +end; + +//--------------------------------------------------------- +// window procedure + +function SpectrumWindowProc(Wnd : HWND; Msg : Integer; wParam, lParam : Longint) : Integer; stdcall; +var + Ps : TPAINTSTRUCT; + DC : HDC; +begin + Result := 0; + + case Msg of + WM_CREATE : InitApp(Wnd); + + WM_PAINT : + if GetUpdateRect(Wnd, PRect(NIL)^, False) then + begin + DC := BeginPaint(Wnd, Ps); + if DC = 0 then + begin + Result := 0; + Exit; + end; + + BitBlt(DC, 0, 0, SPECWIDTH, SPECHEIGHT, SpecDC, 0, 0, SRCCOPY); + EndPaint(Wnd, Ps); + Result := 0; + Exit; + end; + + WM_LBUTTONUP : + begin + SpecMode := (SpecMode + 1) mod 4; // swap spectrum mode + if SpecMode = 2 then + SpecPos := 0; + FillChar(SpecBuf^, SPECWIDTH * SPECHEIGHT, 0); // clear display + Result := 0; + Exit; + end; + + WM_CLOSE : + begin + DestroyWindow(Wnd); + end; + + WM_DESTROY : + begin + if timer <> 0 then + timeKillEvent(timer); + BASS_RecordFree; + if SpecDC <> 0 then + DeleteDC(SpecDC); + if SpecBmp <> 0 then + DeleteObject(specbmp); + PostQuitMessage(0); + Exit; + end; + end; + Result := DefWindowProc(Wnd, Msg, wParam, lParam); +end; + +//--------------------------------------------------------- + +begin + Window := FindWindow(szAppName, NIL); + if Window <> 0 then + begin + if IsIconic(Window) then + ShowWindow(Window, SW_RESTORE); + SetForegroundWindow(Window); + Halt(254); + end; + + // check the correct BASS was loaded + if HIWORD(BASS_GetVersion) <> BASSVERSION then + begin + MessageBox(0, 'An incorrect version of BASS.DLL was loaded', '', MB_ICONERROR); + Exit; + end; + + // register window class and create the window + FillChar(WndClass, SizeOf(TWndClassEx), 0); + WndClass.cbSize := SizeOf(TWndClassEx); + WndClass.style := CS_HREDRAW or CS_VREDRAW; + WndClass.lpfnWndProc := @SpectrumWindowProc; + WndClass.cbClsExtra := 0; + WndClass.cbWndExtra := 0; + WndClass.hInstance := hInstance; + WndClass.hCursor := LoadCursor(0, IDC_ARROW); + WndClass.hbrBackGround := GetSysColorBrush(COLOR_BTNFACE); + WndClass.lpszClassName := szAppName; + + if RegisterClassEx(WndClass) = 0 then + Halt(255); + + SizeX := SPECWIDTH + 2 * GetSystemMetrics(SM_CXDLGFRAME); + SizeY := SPECHEIGHT + 2 * GetSystemMetrics(SM_CYDLGFRAME) + GetSystemMetrics(SM_CYCAPTION); + + PosX := (GetSystemMetrics(SM_CXSCREEN) - SizeX) div 2; + PosY := (GetSystemMetrics(SM_CYSCREEN) - SizeY) div 2; + + Window := CreateWindowEx(0, szAppName, 'BASS "live" spectrum (click to toggle mode)', + WS_POPUPWINDOW or WS_CAPTION, + PosX, PosY, SizeX, SizeY, 0, 0, hInstance, NIL); + + ShowWindow(Window, SW_SHOWNORMAL); + + while (GetMessage(Msg, 0, 0, 0)) do + begin + TranslateMessage(Msg); + DispatchMessage(Msg); + end; + + Halt(Msg.wParam); +end. diff --git a/bass-sys/bass24/delphi/modtest/modtest.dpr b/bass-sys/bass24/delphi/modtest/modtest.dpr new file mode 100644 index 0000000..e55c818 --- /dev/null +++ b/bass-sys/bass24/delphi/modtest/modtest.dpr @@ -0,0 +1,267 @@ +{ + BASS MOD music test + Copyright (c) 1999-2014 Un4seen Developments Ltd. + + C++ to Delphi with use API adapted by Evgeny Melnikov + Required Delphi 7 or above +} + +program modtest; + +uses + Windows, Messages, CommCtrl, CommDlg, Bass in '..\Bass.pas'; + +const + szFiles = 'Modules - mo3/xm/mod/s3m/it/mtm/umx'#0'*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx'#0 + + 'All files'#0'*.*'#0#0; + szOpen = 'Select a file to play'; + +var + win : HWND; + music : DWORD; // the HMUSIC channel + ofn : OPENFILENAME; + FileName : array[0..MAX_PATH - 1] of Char; + +{$R 'modtest.res' 'modtest.rc'} + +//------------------ Auxiliary functions ------------------- + +function Format(const Format : String; const Args : array of const ) : String; +var + I : Integer; + FormatBuffer : array[0..High(Word)] of Char; + Arr, Arr1 : PDWORD; + PP : PDWORD; +begin + Arr := NIL; + if High(Args) >= 0 then + GetMem(Arr, (High(Args) + 1) * SizeOf(Pointer)); + Arr1 := Arr; + for I := 0 to High(Args) do + begin + PP := @Args[I]; + PP := Pointer(PP^); + Arr1^ := DWORD(PP); + inc(Arr1); + end; + I := wvsprintf(@FormatBuffer[0], PChar(Format), PChar(Arr)); + SetLength(Result, I); + Result := FormatBuffer; + if Arr <> NIL then + FreeMem(Arr); +end; + +//--------------------------------------------------------- + +// display error messages +procedure Error(const es : String); +begin + MessageBox(win, PChar(Format('%s' + #13#10 + '(error code: %d)', [es, BASS_ErrorGetCode])), 'Error', MB_OK or MB_ICONERROR); +end; + +//--------------------------------------------------------- + +function GetFlags : DWORD; +begin + Result := BASS_MUSIC_POSRESET; // stop notes when seeking + + case SendDlgItemMessage(win, 21, CB_GETCURSEL, 0, 0) of + 0 : Result := Result or BASS_MUSIC_NONINTER; // no interpolation + 2 : Result := Result or BASS_MUSIC_SINCINTER; // sinc interpolation + end; + + case SendDlgItemMessage(win, 22, CB_GETCURSEL, 0, 0) of + 1 : Result := Result or BASS_MUSIC_RAMP; // ramping + 2 : Result := Result or BASS_MUSIC_RAMPS; // "sensitive" ramping + end; + + case SendDlgItemMessage(win, 23, CB_GETCURSEL, 0, 0) of + 1 : Result := Result or BASS_MUSIC_SURROUND; // surround + 2 : Result := Result or BASS_MUSIC_SURROUND2; // "mode2" + end; + +{$IFDEF UNICODE} + Result := Result or BASS_UNICODE; +{$ENDIF} +end; + +//--------------------------------------------------------- + +procedure OnTimer; +var + St : String; + Pos : QWORD; +begin + Pos := BASS_ChannelGetPosition(music, BASS_POS_MUSIC_ORDER); + if Pos <> QWORD(-1) then + begin + SendDlgItemMessage(win, 20, TBM_SETPOS, 1, LOWORD(Pos)); + St := Format('%03d.%03d', [LOWORD(Pos), HIWORD(Pos)]); + SendDlgItemMessage(win, 15, WM_SETTEXT, 0, Integer(PChar(St))); + end; +end; + +//--------------------------------------------------------- + +procedure InitApp(Wnd : HWND); +begin + win := Wnd; + + // initialize default output device + if not BASS_Init(-1, 44100, 0, Wnd, NIL) then + begin + Error('Can''t initialize device'); + DestroyWindow(Wnd); + Halt; + end; + + // get a playable file + FillChar(ofn, SizeOf(OPENFILENAME), 0); + FillChar(FileName, SizeOf(FileName), 0); + + ofn.lStructSize := SizeOf(OPENFILENAME); + ofn.hwndOwner := Wnd; + ofn.hInstance := hInstance; + ofn.lpstrTitle := szOpen; + ofn.lpstrFile := FileName; + ofn.lpstrFilter := szFiles; + ofn.nMaxFile := MAX_PATH; + ofn.Flags := OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_EXPLORER; + + SendDlgItemMessage(Wnd, 21, CB_ADDSTRING, 0, Integer(PChar('off'))); + SendDlgItemMessage(Wnd, 21, CB_ADDSTRING, 0, Integer(PChar('linear'))); + SendDlgItemMessage(Wnd, 21, CB_ADDSTRING, 0, Integer(PChar('sinc'))); + SendDlgItemMessage(Wnd, 21, CB_SETCURSEL, 1, 0); + SendDlgItemMessage(Wnd, 22, CB_ADDSTRING, 0, Integer(PChar('off'))); + SendDlgItemMessage(Wnd, 22, CB_ADDSTRING, 0, Integer(PChar('normal'))); + SendDlgItemMessage(Wnd, 22, CB_ADDSTRING, 0, Integer(PChar('sensitive'))); + SendDlgItemMessage(Wnd, 22, CB_SETCURSEL, 2, 0); + SendDlgItemMessage(Wnd, 23, CB_ADDSTRING, 0, Integer(PChar('off'))); + SendDlgItemMessage(Wnd, 23, CB_ADDSTRING, 0, Integer(PChar('mode1'))); + SendDlgItemMessage(Wnd, 23, CB_ADDSTRING, 0, Integer(PChar('mode2'))); + SendDlgItemMessage(Wnd, 23, CB_SETCURSEL, 0, 0); + + SetTimer(Wnd, 1, 100, NIL); +end; + +//--------------------------------------------------------- + +function DialogProc(hWndDlg : HWND; Msg, wParam, lParam : Longint) : Integer; stdcall; +var + Len : DWORD; + info : BASS_CHANNELINFO; + channels, + Pos : Integer; + cType, + St : String; + Tag : PAnsiChar; + sTag, + mo3 : AnsiString; +begin + Result := 0; + case Msg of + WM_INITDIALOG : + begin + InitApp(hWndDlg); + Result := 1; + Exit; + end; + + WM_TIMER : OnTimer; // update display + + WM_COMMAND : + case LOWORD(wParam) of + 10 : + begin + if GetOpenFileName(ofn) then + begin + St := FileName; + BASS_MusicFree(music); // free the current music + music := BASS_MusicLoad(False, PChar(St), 0, 0, GetFlags, 1); // load the new music + if music <> 0 then // success + begin + Len := BASS_ChannelGetLength(music, BASS_POS_MUSIC_ORDER); // get the order length + SendDlgItemMessage(hWndDlg, 10, WM_SETTEXT, 0, Integer(@FileName)); + begin + channels := 0; + while BASS_ChannelGetAttributeEx(music, BASS_ATTRIB_MUSIC_VOL_CHAN + channels, NIL, 0) > 0 do + inc(channels); // count channels + + BASS_ChannelGetInfo(music, info); + + cType := ''; + case (info.ctype and not BASS_CTYPE_MUSIC_MO3) of + BASS_CTYPE_MUSIC_MOD : cType := 'MOD'; + + BASS_CTYPE_MUSIC_MTM : cType := 'MTM'; + + BASS_CTYPE_MUSIC_S3M : cType := 'S3M'; + + BASS_CTYPE_MUSIC_XM : cType := 'XM'; + + BASS_CTYPE_MUSIC_IT : cType := 'IT'; + end; + + Tag := BASS_ChannelGetTags(music, BASS_TAG_MUSIC_NAME); + sTag := Tag; + mo3 := ''; + if info.ctype and BASS_CTYPE_MUSIC_MO3 = BASS_CTYPE_MUSIC_MO3 then + mo3 := ' (MO3)'; + St := Format('name: %s, format: %dch %s%s', [String(sTag), channels, String(cType), String(mo3)]); + SendDlgItemMessage(hWndDlg, 11, WM_SETTEXT, 0, Integer(PChar(St))); + end; + SendDlgItemMessage(hWndDlg, 20, TBM_SETRANGEMAX, 1, Len - 1); // update scroller range + BASS_ChannelPlay(music, False); // start it + end + else + begin // failed + SendDlgItemMessage(hWndDlg, 10, WM_SETTEXT, 0, Integer(PChar('click here to open a file...'))); + SendDlgItemMessage(hWndDlg, 11, WM_SETTEXT, 0, Integer(NIL)); + SendDlgItemMessage(hWndDlg, 15, WM_SETTEXT, 0, Integer(NIL)); + Error('Can''t play the file'); + end; + end; + end; + + 12 : + if BASS_ChannelIsActive(music) = BASS_ACTIVE_PLAYING then + BASS_ChannelPause(music) + else + BASS_ChannelPlay(music, False); + + 21..23 : BASS_ChannelFlags(music, GetFlags, DWORD(-1)); // update flags + + IDCANCEL : DestroyWindow(hWndDlg); + end; + + WM_HSCROLL : + if (lparam > 0) and (LOWORD(wParam) <> SB_THUMBPOSITION) and (LOWORD(wParam) <> SB_ENDSCROLL) then + begin + Pos := SendMessage(lParam, TBM_GETPOS, 0, 0); + BASS_ChannelSetPosition(music, pos, BASS_POS_MUSIC_ORDER); // set the position + end; + + WM_CLOSE : DestroyWindow(hWndDlg); + + WM_DESTROY : + begin + BASS_Free; + PostQuitMessage(0); + Exit; + end; + end; +end; + +//--------------------------------------------------------- + +begin + // check the correct BASS was loaded + if HIWORD(BASS_GetVersion) <> BASSVERSION then + begin + MessageBox(0, 'An incorrect version of BASS.DLL was loaded', 'Error', MB_OK or MB_ICONERROR); + Halt(BASS_ERROR_VERSION); + end; + + // display the window + DialogBox(hInstance, MakeIntResource(1000), 0, @DialogProc); +end. diff --git a/bass-sys/bass24/delphi/modtest/modtest.rc b/bass-sys/bass24/delphi/modtest/modtest.rc new file mode 100644 index 0000000..67b6f93 --- /dev/null +++ b/bass-sys/bass24/delphi/modtest/modtest.rc @@ -0,0 +1,19 @@ + +1000 DIALOG 0, 0, 200, 88 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS MOD music test" +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "click here to open a file...", 10, 5, 5, 190, 14 + CTEXT "", 11, 5, 21, 190, 8 + CTEXT "", 15, 20, 34, 45, 10, SS_SUNKEN + PUSHBUTTON "Play / Pause", 12, 120, 33, 60, 12 + CONTROL "Slider1", 20, "msctls_trackbar32", TBS_BOTH | TBS_NOTICKS | WS_TABSTOP, + 5, 48, 190, 12 + CTEXT "Interpolation", -1, 22, 61, 45, 8 + COMBOBOX 21, 22, 70, 45, 70, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CTEXT "Ramping", -1, 77, 61, 45, 8 + COMBOBOX 22, 77, 70, 45, 70, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CTEXT "Surround", -1, 132, 61, 45, 8 + COMBOBOX 23, 132, 70, 45, 70, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +END diff --git a/bass-sys/bass24/delphi/multi/Multi.dpr b/bass-sys/bass24/delphi/multi/Multi.dpr new file mode 100644 index 0000000..fa21f0d --- /dev/null +++ b/bass-sys/bass24/delphi/multi/Multi.dpr @@ -0,0 +1,308 @@ +{ + BASS multiple output example + Copyright (c) 2001-2008 Un4seen Developments Ltd. + + C++ to Delphi with use API adapted by Evgeny Melnikov + Required Delphi 7 or above +} + +program Multi; + +uses + Windows, Messages, CommCtrl, CommDlg, Bass in '..\Bass.pas'; + +const + szFiles = 'streamable files'#0'*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif'#0 + + 'All files'#0'*.*'#0#0; + szOpen = 'Select a file to play'; + +var + win : HWND; + ofn : OPENFILENAME; + FileName : array[0..MAX_PATH - 1] of Char; + + outdev : array[0..1] of DWORD; // output devices + latency : array[0..1] of DWORD; // latencies + chan : array[0..1] of HSTREAM; // the streams + +{$R 'multi.res' 'multi.rc'} + +//------------------ Auxiliary functions ------------------- + +function Format(const Format : String; const Args : array of const ) : String; +var + I : Integer; + FormatBuffer : array[0..High(Word)] of Char; + Arr, Arr1 : PDWORD; + PP : PDWORD; +begin + Arr := NIL; + if High(Args) >= 0 then + GetMem(Arr, (High(Args) + 1) * SizeOf(Pointer)); + Arr1 := Arr; + for I := 0 to High(Args) do + begin + PP := @Args[I]; + PP := Pointer(PP^); + Arr1^ := DWORD(PP); + inc(Arr1); + end; + I := wvsprintf(@FormatBuffer[0], PChar(Format), PChar(Arr)); + SetLength(Result, I); + Result := FormatBuffer; + if Arr <> NIL then + FreeMem(Arr); +end; + +//--------------------------------------------------------- + +// display error messages +procedure Error(const es : String); +begin + MessageBox(win, PChar(Format('%s' + #13#10 + '(error code: %d)', [es, BASS_ErrorGetCode])), 'Error', MB_OK or MB_ICONERROR); +end; + +//--------------------------------------------------------- + +// Cloning DSP function +procedure CloneDSP(Handle : HDSP; channel : DWORD; buffer : Pointer; Length : DWORD; user : Pointer); stdcall; +begin + BASS_StreamPutData(HSTREAM(user), buffer, Length); // user = clone +end; + +//--------------------------------------------------------- + +procedure InitApp(Wnd : HWND); +var + info : BASS_INFO; + di : BASS_DEVICEINFO; + St : AnsiString; +begin + win := Wnd; + + // get a playable file + FillChar(ofn, SizeOf(OPENFILENAME), 0); + FillChar(FileName, SizeOf(FileName), 0); + + ofn.lStructSize := SizeOf(OPENFILENAME); + ofn.hwndOwner := Wnd; + ofn.hInstance := hInstance; + ofn.lpstrTitle := szOpen; + ofn.lpstrFile := FileName; + ofn.lpstrFilter := szFiles; + ofn.nMaxFile := MAX_PATH; + ofn.Flags := OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_EXPLORER; + + // initialize output devices + if not BASS_Init(outdev[0], 44100, BASS_DEVICE_LATENCY, Wnd, NIL) then + begin + Error('Can''t initialize device 1'); + DestroyWindow(Wnd); + end; + + BASS_GetInfo(info); + latency[0] := info.latency; + + if not BASS_Init(outdev[1], 44100, BASS_DEVICE_LATENCY, Wnd, NIL) then + begin + Error('Can''t initialize device 2'); + DestroyWindow(Wnd); + end; + + BASS_GetInfo(info); + latency[1] := info.latency; + + BASS_GetDeviceInfo(outdev[0], di); + St := di.name; + SendDlgItemMessage(Wnd, 20, WM_SETTEXT, 0, Integer(PChar(String(St)))); + BASS_GetDeviceInfo(outdev[1], di); + St := di.name; + SendDlgItemMessage(Wnd, 21, WM_SETTEXT, 0, Integer(PChar(String(St)))); +end; + +//--------------------------------------------------------- + +function DialogProc(hWndDlg : HWND; Msg, wParam, lParam : Longint) : Integer; stdcall; +type + TBuf = array of Byte; +var + info : BASS_CHANNELINFO; + devn, + devnx : Integer; + c, d : DWORD; + temp : HSTREAM; + St : String; + Buf : TBuf; + Buf1 : array[0..MAX_PATH - 1] of AnsiChar; + Buf2 : array[0..MAX_PATH - 1] of AnsiChar; +begin + Result := 0; + case Msg of + WM_INITDIALOG : + begin + InitApp(hWndDlg); + Result := 1; + Exit; + end; + + WM_COMMAND : + case LOWORD(wParam) of + 10, 11 : // open a file to play on device #1 or device #2 + begin + devn := LOWORD(wParam) - 10; + if GetOpenFileName(ofn) then + begin + St := FileName; + BASS_StreamFree(chan[devn]); // free old stream + BASS_SetDevice(outdev[devn]); // set the device to create stream on + chan[devn] := BASS_StreamCreateFile(False, PChar(St), 0, 0, BASS_SAMPLE_LOOP {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if chan[devn] = 0 then + begin + SendDlgItemMessage(hWndDlg, 10 + devn, WM_SETTEXT, 0, Integer(PChar('click here to open a file...'))); + Error('Can''t play the file'); + Exit; + end; + BASS_ChannelPlay(chan[devn], False); // play new stream + SendDlgItemMessage(hWndDlg, 10 + devn, WM_SETTEXT, 0, Integer(PChar(St))); + end; + end; + + 15, 16 : // clone on device #1 or device #2 + begin + devn := LOWORD(wParam) - 15; + devnx := devn xor 1; + if not BASS_ChannelGetInfo(chan[devnx], info) then + begin + Error('Nothing to clone'); + Exit; + end; + + BASS_StreamFree(chan[devn]); // free old stream + BASS_SetDevice(outdev[devn]); // set the device to create stream on + + chan[devn] := BASS_StreamCreate(info.freq, info.chans, info.flags, STREAMPROC_PUSH, NIL); + if chan[devn] = 0 then + begin // create a "push" stream + SendDlgItemMessage(hWndDlg, 10 + devn, WM_SETTEXT, 0, Integer(PChar('click here to open a file...'))); + Error('Can''t create clone'); + Exit; + end; + + BASS_ChannelLock(chan[devnx], True); // lock source stream to synchonise buffer contents + BASS_ChannelSetDSP(chan[devnx], @CloneDSP, Pointer(chan[devn]), 0); // set DSP to feed data to clone + + // copy buffered data to clone + d := BASS_ChannelSeconds2Bytes(chan[devn], latency[devn] / 1000); // playback delay + c := BASS_ChannelGetData(chan[devnx], NIL, BASS_DATA_AVAILABLE); + SetLength(Buf, c); + c := BASS_ChannelGetData(chan[devnx], buf, c); + if c > d then + BASS_StreamPutData(chan[devn], Pointer(DWORD(buf) + d), c - d); + + BASS_ChannelLock(chan[devnx], False); // unlock source stream + BASS_ChannelPlay(chan[devn], False); // play clone + SendDlgItemMessage(hWndDlg, 10 + devn, WM_SETTEXT, 0, Integer(PChar('clone'))); + end; + + 30 : // swap channel devices + begin + // swap handles + temp := chan[0]; + chan[0] := chan[1]; + chan[1] := temp; + + // swap text + SendDlgItemMessage(hWndDlg, 10, WM_GETTEXT, SizeOf(Buf1), Integer(@Buf1[0])); + SendDlgItemMessage(hWndDlg, 11, WM_GETTEXT, SizeOf(Buf2), Integer(@Buf2[0])); + SendDlgItemMessage(hWndDlg, 10, WM_SETTEXT, 0, Integer(@Buf2[0])); + SendDlgItemMessage(hWndDlg, 11, WM_SETTEXT, 0, Integer(@Buf1[0])); + + // update the channel devices + BASS_ChannelSetDevice(chan[0], outdev[0]); + BASS_ChannelSetDevice(chan[1], outdev[1]); + end; + + IDCANCEL : DestroyWindow(hWndDlg); + end; + + WM_CLOSE : DestroyWindow(hWndDlg); + + WM_DESTROY : + begin + // release both devices + BASS_SetDevice(outdev[0]); + BASS_Free; + BASS_SetDevice(outdev[1]); + BASS_Free; + end; + end; +end; + +//--------------------------------------------------------- + +// Simple device selector dialog stuff begins here +function DeviceDialogProc(hWndDlg : HWND; Msg, wParam, lParam : Longint) : Integer; stdcall; +var + i, idx, + Device : Integer; + di : BASS_DEVICEINFO; + St : String; + St1 : AnsiString; +begin + Result := 0; + case Msg of + WM_INITDIALOG : + begin + St := Format('Select output device #%d', [lParam]); + SetWindowText(hWndDlg, PChar(St)); + // device 1 = 1st real device + i := 1; + while BASS_GetDeviceInfo(I, di) do + begin + if di.flags and BASS_DEVICE_ENABLED = BASS_DEVICE_ENABLED then // enabled, so add it... + begin + St1 := di.name; + idx := SendDlgItemMessage(hWndDlg, 10, LB_ADDSTRING, 0, Integer(PChar(String(St1)))); + SendDlgItemMessage(hWndDlg, 10, LB_SETITEMDATA, idx, i); // store device # + end; + inc(i); + end; + SendDlgItemMessage(hWndDlg, 10, LB_SETCURSEL, 0, 0); + Result := 1; + Exit; + end; + + WM_COMMAND : + case LOWORD(wParam) of + 10 : + if HIWORD(wParam) <> LBN_DBLCLK then + Exit; + + IDOK : + begin + Device := SendDlgItemMessage(hWndDlg, 10, LB_GETCURSEL, 0, 0); + Device := SendDlgItemMessage(hWndDlg, 10, LB_GETITEMDATA, Device, 0); // get device # + EndDialog(hWndDlg, Device); + end; + end; + end; +end; +// Device selector stuff ends here + +//--------------------------------------------------------- + +begin + // check the correct BASS was loaded + if HIWORD(BASS_GetVersion) <> BASSVERSION then + begin + MessageBox(0, 'An incorrect version of BASS.DLL was loaded', 'Error', MB_OK or MB_ICONERROR); + Halt(BASS_ERROR_VERSION); + end; + + // Let the user choose the output devices + outdev[0] := DialogBoxParam(hInstance, MakeIntResource(2000), 0, @DeviceDialogproc, 1); + outdev[1] := DialogBoxParam(hInstance, MakeIntResource(2000), 0, @DeviceDialogproc, 2); + + // display the window + DialogBox(hInstance, MakeIntResource(1000), 0, @DialogProc); +end. diff --git a/bass-sys/bass24/delphi/multi/multi.rc b/bass-sys/bass24/delphi/multi/multi.rc new file mode 100644 index 0000000..2ec584e --- /dev/null +++ b/bass-sys/bass24/delphi/multi/multi.rc @@ -0,0 +1,23 @@ + +1000 DIALOG 0, 0, 260, 68 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "BASS multiple output example" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "", 20, 5, 2, 250, 29 + PUSHBUTTON "click here to open a file...", 10, 10, 11, 180, 14 + GROUPBOX "", 21, 5, 35, 250, 29 + PUSHBUTTON "click here to open a file...", 11, 10, 44, 180, 14 + PUSHBUTTON "clone #2", 15, 195, 11, 40, 14 + PUSHBUTTON "clone #1", 16, 195, 44, 40, 14 + PUSHBUTTON "swap", 30, 225, 27, 25, 14 +END + +2000 DIALOG 115, 100, 170, 60 +STYLE WS_POPUP | DS_CENTER | WS_VISIBLE | WS_CAPTION +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX 10, 5, 5, 160, 35, LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK", IDOK, 100, 44, 60, 12 +END + diff --git a/bass-sys/bass24/delphi/netradio/Unit1.dfm b/bass-sys/bass24/delphi/netradio/Unit1.dfm new file mode 100644 index 0000000..d273321 --- /dev/null +++ b/bass-sys/bass24/delphi/netradio/Unit1.dfm @@ -0,0 +1,221 @@ +object Form1: TForm1 + Left = 192 + Top = 109 + BorderStyle = bsToolWindow + Caption = 'BASS internet radio tuner' + ClientHeight = 262 + ClientWidth = 277 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 277 + Height = 262 + Align = alClient + TabOrder = 0 + object GroupBox1: TGroupBox + Left = 8 + Top = 0 + Width = 265 + Height = 73 + Caption = 'Presets' + TabOrder = 0 + object Label1: TLabel + Left = 8 + Top = 24 + Width = 52 + Height = 13 + Caption = 'Broadband' + end + object Label2: TLabel + Left = 8 + Top = 48 + Width = 35 + Height = 13 + Caption = 'Modem' + end + object Button1: TButton + Left = 64 + Top = 14 + Width = 33 + Height = 25 + Caption = '1' + TabOrder = 0 + OnClick = Button1Click + end + object Button2: TButton + Tag = 2 + Left = 104 + Top = 14 + Width = 33 + Height = 25 + Caption = '2' + TabOrder = 1 + OnClick = Button1Click + end + object Button3: TButton + Tag = 4 + Left = 144 + Top = 14 + Width = 33 + Height = 25 + Caption = '3' + TabOrder = 2 + OnClick = Button1Click + end + object Button4: TButton + Tag = 6 + Left = 184 + Top = 14 + Width = 33 + Height = 25 + Caption = '4' + TabOrder = 3 + OnClick = Button1Click + end + object Button5: TButton + Tag = 8 + Left = 224 + Top = 14 + Width = 33 + Height = 25 + Caption = '5' + TabOrder = 4 + OnClick = Button1Click + end + object Button6: TButton + Tag = 1 + Left = 64 + Top = 41 + Width = 33 + Height = 25 + Caption = '1' + TabOrder = 5 + OnClick = Button1Click + end + object Button7: TButton + Tag = 3 + Left = 104 + Top = 41 + Width = 33 + Height = 25 + Caption = '2' + TabOrder = 6 + OnClick = Button1Click + end + object Button8: TButton + Tag = 5 + Left = 144 + Top = 41 + Width = 33 + Height = 25 + Caption = '3' + TabOrder = 7 + OnClick = Button1Click + end + object Button9: TButton + Tag = 7 + Left = 184 + Top = 41 + Width = 33 + Height = 25 + Caption = '4' + TabOrder = 8 + OnClick = Button1Click + end + object Button10: TButton + Tag = 9 + Left = 224 + Top = 41 + Width = 33 + Height = 25 + Caption = '5' + TabOrder = 9 + OnClick = Button1Click + end + end + object GroupBox2: TGroupBox + Left = 8 + Top = 76 + Width = 265 + Height = 101 + Caption = 'Currently playing' + TabOrder = 1 + object Label3: TLabel + Left = 11 + Top = 16 + Width = 245 + Height = 25 + Alignment = taCenter + AutoSize = False + ShowAccelChar = False + WordWrap = True + end + object Label4: TLabel + Left = 8 + Top = 40 + Width = 241 + Height = 41 + Alignment = taCenter + AutoSize = False + Caption = 'not playing' + ShowAccelChar = False + WordWrap = True + end + object Label5: TLabel + Left = 8 + Top = 80 + Width = 249 + Height = 13 + Alignment = taCenter + AutoSize = False + ShowAccelChar = False + WordWrap = True + end + end + object GroupBox3: TGroupBox + Left = 8 + Top = 176 + Width = 265 + Height = 81 + Caption = 'Proxy server' + TabOrder = 2 + object Label6: TLabel + Left = 10 + Top = 40 + Width = 112 + Height = 13 + Caption = '(user:pass@]server:port' + end + object ed_ProxyServer: TEdit + Left = 8 + Top = 16 + Width = 249 + Height = 21 + MaxLength = 100 + ParentShowHint = False + ShowHint = True + TabOrder = 0 + end + object cbDirectConnection: TCheckBox + Left = 8 + Top = 60 + Width = 113 + Height = 17 + Caption = 'Direct connection' + TabOrder = 1 + end + end + end +end diff --git a/bass-sys/bass24/delphi/netradio/Unit1.pas b/bass-sys/bass24/delphi/netradio/Unit1.pas new file mode 100644 index 0000000..d178959 --- /dev/null +++ b/bass-sys/bass24/delphi/netradio/Unit1.pas @@ -0,0 +1,230 @@ +unit Unit1; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Bass, ExtCtrls; + +const + WM_INFO_UPDATE = WM_USER + 101; + +type + + TForm1 = class(TForm) + Panel1: TPanel; + GroupBox1: TGroupBox; + Label1: TLabel; + Label2: TLabel; + Button1: TButton; + Button2: TButton; + Button3: TButton; + Button4: TButton; + Button5: TButton; + Button6: TButton; + Button7: TButton; + Button8: TButton; + Button9: TButton; + Button10: TButton; + GroupBox2: TGroupBox; + Label3: TLabel; + Label4: TLabel; + Label5: TLabel; + GroupBox3: TGroupBox; + Label6: TLabel; + ed_ProxyServer: TEdit; + cbDirectConnection: TCheckBox; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure Button1Click(Sender: TObject); + private + { Private declarations } + + public + { Public declarations } + procedure WndProc(var Msg: TMessage); override; + + + end; + +var + Form1: TForm1; + + cthread: DWORD = 0; + chan: HSTREAM = 0; + win: hwnd; +implementation + +const + urls: array[0..9] of AnsiString = ( // preset stream URLs + 'http://www.radioparadise.com/m3u/mp3-128.m3u', 'http://www.radioparadise.com/m3u/mp3-32.m3u', + 'http://icecast.timlradio.co.uk/vr160.ogg', 'http://icecast.timlradio.co.uk/vr32.ogg', + 'http://icecast.timlradio.co.uk/a8160.ogg', 'http://icecast.timlradio.co.uk/a832.ogg', + 'http://somafm.com/secretagent.pls', 'http://somafm.com/secretagent24.pls', + 'http://somafm.com/suburbsofgoa.pls', 'http://somafm.com/suburbsofgoa24.pls' + ); + +{$R *.dfm} + + { display error messages } + +procedure Error(es: string); +begin + MessageBox(win, PChar(es + #13#10 + '(error code: ' + IntToStr(BASS_ErrorGetCode) + + ')'), nil, 0); +end; + +{ update stream title from metadata } + +procedure DoMeta(); +var + meta: PAnsiChar; + p: Integer; +begin + meta := BASS_ChannelGetTags(chan, BASS_TAG_META); + if (meta <> nil) then + begin + p := Pos('StreamTitle=', String(AnsiString(meta))); + if (p = 0) then + Exit; + p := p + 13; + SendMessage(win, WM_INFO_UPDATE, 7, DWORD(PAnsiChar(AnsiString(Copy(meta, p, Pos(';', String(meta)) - p - 1))))); + end; +end; + +procedure MetaSync(handle: HSYNC; channel, data: DWORD; user: Pointer); stdcall; +begin + DoMeta(); +end; + +procedure StatusProc(buffer: Pointer; len: DWORD; user: Pointer); stdcall; +begin + if (buffer <> nil) and (len = 0) then + SendMessage(win, WM_INFO_UPDATE, 8, DWORD(PAnsiChar(buffer))); +end; + +function OpenURL(url: PAnsiChar): Integer; +var + icy: PAnsiChar; + Len, Progress: DWORD; +begin + Result := 0; + BASS_StreamFree(chan); // close old stream + progress := 0; + SendMessage(win, WM_INFO_UPDATE, 0, 0); // reset the Labels and trying connecting + + chan := BASS_StreamCreateURL(url, 0, BASS_STREAM_BLOCK or BASS_STREAM_STATUS or BASS_STREAM_AUTOFREE, @StatusProc, nil); + if (chan = 0) then + begin + //lets catch the error here inside the Thread + // and send it to the WndProc + SendMessage(win, WM_INFO_UPDATE, 1, Bass_ErrorGetCode()); // Oops Error + end + else + begin + // Progress + repeat + len := BASS_StreamGetFilePosition(chan, BASS_FILEPOS_END); + if (len = DW_Error) then + break; // something's gone wrong! (eg. BASS_Free called) + progress := BASS_StreamGetFilePosition(chan, BASS_FILEPOS_BUFFER) * 100 div len; + // percentage of buffer filled + SendMessage(win, WM_INFO_UPDATE, 2, progress); // show the Progess value in the label + until + (progress > 75) or (BASS_StreamGetFilePosition(chan, BASS_FILEPOS_CONNECTED) = 0); // over 75% full (or end of download) + + // get the broadcast name and bitrate + icy := BASS_ChannelGetTags(chan, BASS_TAG_ICY); + if (icy = nil) then + icy := BASS_ChannelGetTags(chan, BASS_TAG_HTTP); // no ICY tags, try HTTP + if (icy <> nil) then + while (icy^ <> #0) do + begin + if (Copy(icy, 1, 9) = 'icy-name:') then + SendMessage(win, WM_INFO_UPDATE, 3, DWORD(PAnsiChar(Copy(icy, 10, MaxInt)))) + else if (Copy(icy, 1, 7) = 'icy-br:') then + SendMessage(win, WM_INFO_UPDATE, 4, DWORD(PAnsiChar('bitrate: ' + Copy(icy, 8, MaxInt)))); + icy := icy + Length(icy) + 1; + end; + // get the stream title and set sync for subsequent titles + DoMeta(); + BASS_ChannelSetSync(chan, BASS_SYNC_META, 0, @MetaSync, nil); + // play it! + BASS_ChannelPlay(chan, FALSE); + end; + cthread := 0; +end; + + +procedure TForm1.WndProc(var Msg: TMessage); +// to be threadsave we are passing all Canvas Stuff(e.g. Labels) to this messages +begin + inherited; + if Msg.Msg = WM_INFO_UPDATE then + case msg.WParam of + 0: + begin + Label4.Caption := 'connecting...'; + Label3.Caption := ''; + Label5.Caption := ''; + end; + 1: + begin + Label4.Caption := 'not playing'; + //Error('Can''t play the stream'); + MessageBox(win, PChar('Can''t play the stream' + #13#10 + '(error code: ' + + IntToStr(msg.LParam)+')'), nil, 0); + + end; + 2: Label4.Caption := Format('buffering... %d%%', [msg.LParam]); + 3: Label4.Caption := String(PAnsiChar(msg.LParam)); + 4: Label5.Caption := String(PAnsiChar(msg.LParam)); + 5: Label5.Caption := String(PAnsiChar(msg.LParam)); + 6: Label3.Caption := String(PAnsiChar(msg.LParam)); + 7: Label3.Caption := String(PAnsiChar(msg.LParam)); + 8: Label5.Caption := String(PAnsiChar(msg.LParam)); + end; +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + // check the correct BASS was loaded + win := handle; + if (HIWORD(BASS_GetVersion) <> BASSVERSION) then + begin + MessageBox(0, 'An incorrect version of BASS.DLL was loaded', nil, MB_ICONERROR); + Halt; + end; + if (not BASS_Init(-1, 44100, 0, Handle, nil)) then + begin + Error('Can''t initialize device'); + Halt; + end; + BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1); // enable playlist processing + BASS_SetConfig(BASS_CONFIG_NET_PREBUF, 0); // minimize automatic pre-buffering, so we can do it (and display it) instead + +end; + +procedure TForm1.FormDestroy(Sender: TObject); +begin + BASS_Free; +end; + +procedure TForm1.Button1Click(Sender: TObject); +var + ThreadId: Cardinal; +begin + if (cthread <> 0) then + MessageBeep(0) + else + begin + if cbDirectConnection.Checked then + BASS_SetConfigPtr(BASS_CONFIG_NET_PROXY, nil); // disable proxy + else + BASS_SetConfigPtr(BASS_CONFIG_NET_PROXY, ed_ProxyServer.Text) // set proxy server + // open URL in a new thread (so that main thread is free) + cthread := BeginThread(nil, 0, @OpenURL, PAnsiChar(urls[TButton(Sender).Tag]), 0, ThreadId); + end; +end; + +end. \ No newline at end of file diff --git a/bass-sys/bass24/delphi/netradio/netradio.dpr b/bass-sys/bass24/delphi/netradio/netradio.dpr new file mode 100644 index 0000000..d7f0b02 --- /dev/null +++ b/bass-sys/bass24/delphi/netradio/netradio.dpr @@ -0,0 +1,12 @@ +program netradio; + +uses + Forms, + Unit1 in 'Unit1.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/plugins/Unit1.dfm b/bass-sys/bass24/delphi/plugins/Unit1.dfm new file mode 100644 index 0000000..d26ac92 --- /dev/null +++ b/bass-sys/bass24/delphi/plugins/Unit1.dfm @@ -0,0 +1,91 @@ +object Form1: TForm1 + Left = 435 + Top = 272 + BorderStyle = bsDialog + Caption = 'Bass Plugin Demo' + ClientHeight = 181 + ClientWidth = 400 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 400 + Height = 181 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object lblInfo: TLabel + Left = 8 + Top = 134 + Width = 3 + Height = 13 + end + object GroupBox1: TGroupBox + Left = 0 + Top = 0 + Width = 393 + Height = 97 + TabOrder = 0 + object ListView_PlugIns: TListView + Left = 8 + Top = 16 + Width = 377 + Height = 73 + Columns = < + item + Caption = 'Loaded Plugin ' + MaxWidth = 90 + MinWidth = 90 + Width = 90 + end + item + Caption = 'Supported Formats' + MaxWidth = 280 + MinWidth = 280 + Width = 280 + end> + ColumnClick = False + GridLines = True + ReadOnly = True + TabOrder = 0 + ViewStyle = vsReport + end + end + object Button1: TButton + Left = 8 + Top = 104 + Width = 385 + Height = 25 + Caption = 'cklick here to open a file' + TabOrder = 1 + OnClick = Button1Click + end + object ScrollBar1: TScrollBar + Left = 8 + Top = 154 + Width = 385 + Height = 16 + PageSize = 0 + TabOrder = 2 + OnScroll = ScrollBar1Scroll + end + end + object open1: TOpenDialog + end + object Timer1: TTimer + Enabled = False + Interval = 500 + OnTimer = Timer1Timer + Left = 32 + end +end diff --git a/bass-sys/bass24/delphi/plugins/Unit1.pas b/bass-sys/bass24/delphi/plugins/Unit1.pas new file mode 100644 index 0000000..932dda2 --- /dev/null +++ b/bass-sys/bass24/delphi/plugins/Unit1.pas @@ -0,0 +1,196 @@ +unit Unit1; +{======================================================================== + Plugin Delphi Demo (translated from C PluginDemo Copyright by Ian Luck) + by (Chris Troesken)(cst-tech@foni.net)http:www.cst-development.de + + + Plugin Demo the shows how to get the Info about the supported loaded Plugins + * Requires: BASS.DLL available @ www.un4seen.com +========================================================================} + + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + bass, ExtCtrls, StdCtrls, ComCtrls, Dialogs; + +type + TForm1 = class(TForm) + Panel1: TPanel; + GroupBox1: TGroupBox; + Button1: TButton; + open1: TOpenDialog; + lblInfo: TLabel; + ListView_PlugIns: TListView; + Timer1: TTimer; + ScrollBar1: TScrollBar; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure Timer1Timer(Sender: TObject); + procedure ScrollBar1Scroll(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); + private + { Private-Deklarationen } + Sliding: boolean; + procedure Error(const Text: string); + function GetCTypeString(ctype: DWORD; plugin: HPLUGIN): string; + public + { Public-Deklarationen } + end; + +var + Form1: TForm1; + Chan: HStream; + +implementation + +{$R *.dfm} + +function ProgDir: string; +begin + result := ExtractFilePath(ParamStr(0)); +end; + +function TForm1.GetCTypeString(ctype: DWORD; plugin: HPLUGIN): string; +var + pInfo: ^BASS_PLUGININFO; + a: integer; +begin + if plugin <> 0 then + begin +// pInfo := BASS_PluginGetInfo(plugin); + pInfo := pointer(BASS_PluginGetInfo(plugin)); + for a := 0 to PInfo.formatc - 1 do + if pInfo.Formats[a].ctype = cType then + Result := pInfo.Formats[a].name; + end; + // check built-in stream formats... + case cType of + BASS_CTYPE_STREAM_OGG: Result := Result + '"Ogg Vorbis"'; + BASS_CTYPE_STREAM_MP1: Result := Result + '"MPEG layer 1"'; + BASS_CTYPE_STREAM_MP2: Result := Result + '"MPEG layer 2"'; + BASS_CTYPE_STREAM_MP3: Result := Result + '"MPEG layer 3"'; + BASS_CTYPE_STREAM_AIFF: Result := Result + '"Audio IFF"'; + BASS_CTYPE_STREAM_WAV_PCM: Result := Result + '"PCM WAVE"'; + BASS_CTYPE_STREAM_WAV_FLOAT: Result := Result + '"Floating-point WAVE"'; + BASS_CTYPE_STREAM_WAV: Result := Result + '"Wave"'; + end; +end; + +procedure TForm1.Error(const Text: string); +begin + MessageBox(Handle, PChar(Text + ' Errorcode = ' + + inttostr(Bass_ErrorGetCode)), PChar('Error'), 16); +end; + +procedure TForm1.FormCreate(Sender: TObject); +var + fd: TWin32FindData; + fh: THandle; + plug: HPLUGIN; + Info: ^Bass_PluginInfo; + s: string; + a: integer; + ListItem: TListItem; +begin + if not Bass_Init(-1, 44100, 0, handle, nil) then + begin + Error('Can''t initialize device'); + Application.Terminate; + end; + // Set The OpenDialog Filter to the Bass build In Formats + Open1.Filter := + 'BASS built-in *.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif)\0*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif' + '|' + + '*.mp3;*.mp2;*.mp1;*.ogg;*.wav*;*.aif'; + + // get the Modules from the currentDirectory + fh := FindFirstFile(PChar(ProgDir + 'bass*.dll'), fd); + if (fh <> INVALID_HANDLE_VALUE) then + try + repeat + plug := BASS_PluginLoad(fd.cFileName, 0 {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if Plug <> 0 then + begin +// Info := BASS_PluginGetInfo(Plug); // get plugin info to add to the file selector filter... + Info := pointer(BASS_PluginGetInfo(Plug)); // get plugin info to add to the file selector filter... + for a := 0 to Info.formatc - 1 do + begin + // Set The OpenDialog additional, to the supported PlugIn Formats + open1.Filter := Open1.Filter + '|' + Info.Formats[a].name + ' ' + '(' + + Info.Formats[a].exts + ') , ' + fd.cFileName + '|' + Info.Formats[a].exts; + // Lets Show in the Listview the supported Formats + + if (Info.Formats[a].name <> nil) then + if (a = 0) then + s :=Info.Formats[a].name + else + s := s + ',' + Info.Formats[a].name; + end; + ListItem := ListView_PlugIns.Items.Add; + ListItem.Caption := fd.cFileName; + ListItem.SubItems.Add(s); + end; + until FindNextFile(fh, fd) = false; + finally + Windows.FindClose(fh); + end; + + if Listview_PlugIns.Items.Count = 0 then + begin + ListItem := ListView_PlugIns.Items.Add; + ListItem.SubItems.Add('no plugins found - visit the BASS webpage to get some'); + end; +end; + +procedure TForm1.FormDestroy(Sender: TObject); +begin + Bass_Free(); + BASS_PluginFree(0); +end; + +procedure TForm1.Button1Click(Sender: TObject); +var + Info: Bass_ChannelInfo; +begin + if open1.Execute then + begin + Timer1.Enabled := false; + Bass_StreamFree(Chan); + Chan := Bass_StreamCreateFile(false, PChar(open1.FileName), 0, 0, BASS_SAMPLE_LOOP {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if CHan <> 0 then + begin + BASS_ChannelGetInfo(chan, info); + Button1.Caption := open1.FileName; + lblInfo.Caption := 'channel type = ' + inttostr(info.ctype) + ' ' + + getCTypeString(info.ctype, info.plugin); + Scrollbar1.Max := round(BASS_ChannelBytes2Seconds(chan, BASS_ChannelGetLength(chan, BASS_POS_BYTE))); + Bass_ChannelPlay(Chan, false); + Timer1.Enabled := true; + + end + else + begin + Button1.Caption := 'Click here to open a file'; + Error('Can''t play the file'); + end; + end; +end; + +procedure TForm1.Timer1Timer(Sender: TObject); +begin + if not Sliding then + Scrollbar1.Position := round(BASS_ChannelBytes2Seconds(chan, BASS_ChannelGetPosition(chan, BASS_POS_BYTE))); +end; + +procedure TForm1.ScrollBar1Scroll(Sender: TObject; ScrollCode: TScrollCode; + var ScrollPos: Integer); +begin + Sliding := Scrollcode <> scEndScroll; + if ScrollCode = scEndScroll then + BASS_ChannelSetPosition(chan, BASS_ChannelSeconds2Bytes(chan, Scrollbar1.position), BASS_POS_BYTE); +end; + +end. + diff --git a/bass-sys/bass24/delphi/plugins/plugins.dpr b/bass-sys/bass24/delphi/plugins/plugins.dpr new file mode 100644 index 0000000..0bf481f --- /dev/null +++ b/bass-sys/bass24/delphi/plugins/plugins.dpr @@ -0,0 +1,12 @@ +program plugins; + +uses + Forms, + Unit1 in 'Unit1.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/delphi/spectrum/COMMON.INC b/bass-sys/bass24/delphi/spectrum/COMMON.INC new file mode 100644 index 0000000..aca41da --- /dev/null +++ b/bass-sys/bass24/delphi/spectrum/COMMON.INC @@ -0,0 +1,40 @@ +{$IFDEF VER100} { Borland Delphi 3.0 } + {$DEFINE D3} +{$ENDIF} +{$IFDEF VER120} { Borland Delphi 4.0 } + {$DEFINE D3} + {$DEFINE D4} +{$ENDIF} +{$IFDEF VER130} { Borland Delphi 5.0 } + {$DEFINE D3} + {$DEFINE D4} + {$DEFINE D5} +{$ENDIF} +{$IFDEF VER140} { Borland Delphi 6.0 } + {$DEFINE D3} + {$DEFINE D4} + {$DEFINE D5} + {$DEFINE D6} +{$ENDIF} +{$IFDEF VER150} { Borland Delphi 7.0 } + {$DEFINE D3} + {$DEFINE D4} + {$DEFINE D5} + {$DEFINE D6} + {$DEFINE D7} +{$ENDIF} +{$IFDEF VER180} { Borland Delphi 2006 } + {$DEFINE D3} + {$DEFINE D4} + {$DEFINE D5} + {$DEFINE D6} + {$DEFINE D7} + {$DEFINE D10} +{$ENDIF} + +{$IFDEF D7} + {$WARN SYMBOL_PLATFORM OFF} + {$WARN UNSAFE_TYPE OFF} + {$WARN UNSAFE_CODE OFF} +{$ENDIF} + diff --git a/bass-sys/bass24/delphi/spectrum/Unit1.pas b/bass-sys/bass24/delphi/spectrum/Unit1.pas new file mode 100644 index 0000000..ef02023 --- /dev/null +++ b/bass-sys/bass24/delphi/spectrum/Unit1.pas @@ -0,0 +1,555 @@ +// BASS spectrum analyser example, copyright (c) 2002-2006 Ian Luck. +// +// C++ to Delphi adapted by Evgeny Melnikov +// +// http://dsoft1961.narod.ru +// mail angvelem@gmail.com + +unit Unit1; + +{$I Common.inc} + +{$IFDEF D7} + {$WARN SYMBOL_PLATFORM OFF} +{$ENDIF} + +interface + +uses + Windows, Messages, CommDlg, MMSystem, Bass; + +const + SPECWIDTH = 368; // display width + SPECHEIGHT = 127; // height (changing requires palette adjustments too) + BANDS = 28; + szAppName = 'BASS-Spectrum'; + + BASSErCodes : array[-1..44] of String = ( + 'Some other mystery error', + 'All is OK', + 'Memory error', + 'Can''t open the file', + 'Can''t find a free sound driver', + 'The sample buffer was lost', + 'Invalid handle', + 'Unsupported sample format', + 'Invalid playback position', + 'BASS_Init has not been successfully called', + 'BASS_Start has not been successfully called', + 'Unknown error', + 'Unknown error', + 'Unknown error', + 'Unknown error', + 'Already initialized/paused/whatever', + 'Unknown error', + 'Not paused', + 'Unknown error', + 'Can''t get a free channel', + 'An illegal type was specified', + 'An illegal parameter was specified', + 'No 3D support', + 'No EAX support', + 'Illegal device number', + 'Not playing', + 'Illegal sample rate', + 'Unknown error', + 'The stream is not a file stream', + 'Unknown error', + 'No hardware voices available', + 'Unknown error', + 'The MOD music has no sequence data', + 'No internet connection could be opened', + 'Couldn''t create the file', + 'Effects are not enabled', + 'The channel is playing', + 'Unknown error', + 'Requested data is not available', + 'The channel is a "decoding channel"', + 'A sufficient DirectX version is not installed', + 'Connection timedout', + 'Unsupported file format', + 'Unavailable speaker', + 'Invalid BASS version (used by add-ons)', + 'Codec is not available/supported'); + +var + Window : HWND = 0; + Msg : TMsg; + WndClass : TWndClassEX; + + PosX, PosY : Integer; + SizeX, SizeY : Integer; + + Timer : DWORD = 0; + Chan : DWORD; + + SpecDC : HDC = 0; + SpecBmp : HBITMAP = 0; + SpecBuf : Pointer; + SpecMode : Integer = 0; + SpecPos : Integer = 0; // spectrum mode (and marker pos for 2nd mode) + + BI : TBITMAPINFO; + pal : array[Byte] of TRGBQUAD; + +procedure WinMain; + +implementation + +var + Win32Platform : Integer = 0; + Win32MajorVersion : Integer = 0; + Win32MinorVersion : Integer = 0; + Win32BuildNumber : Integer = 0; + Win32CSDVersion : string = ''; + +//--------------------------------------------------------- + +function IntPower(const Base: Extended; const Exponent: Integer): Extended; +asm + mov ecx, eax + cdq + fld1 { Result := 1 } + xor eax, edx + sub eax, edx { eax := Abs(Exponent) } + jz @@3 + fld Base + jmp @@2 +@@1: fmul ST, ST { X := Base * Base } +@@2: shr eax,1 + jnc @@1 + fmul ST(1),ST { Result := Result * X } + jnz @@1 + fstp st { pop X from FPU stack } + cmp ecx, 0 + jge @@3 + fld1 + fdivrp { Result := 1 / Result } +@@3: + fwait +end; + +//--------------------------------------------------------- + +function Power(const Base, Exponent: Extended): Extended; +begin + if Exponent = 0.0 then + Result := 1.0 { n**0 = 1 } + else if (Base = 0.0) and (Exponent > 0.0) then + Result := 0.0 { 0**n = 0, n > 0 } + else if (Frac(Exponent) = 0.0) and (Abs(Exponent) <= MaxInt) then + Result := IntPower(Base, Integer(Trunc(Exponent))) + else + Result := Exp(Exponent * Ln(Base)) +end; + +//--------------------------------------------------------- +// Log.10(X) := Log.2(X) * Log.10(2) + +function Log10(const X : Extended) : Extended; +asm + FLDLG2 { Log base ten of 2 } + FLD X + FYL2X + FWAIT +end; + +//--------------------------------------------------------- + +function IntToStr(I : Integer) : String; +begin + Str(I, Result); +end; + +//--------------------------------------------------------- + +procedure GetOSInfo; +var + OSVersionInfo : TOSVersionInfo; +begin + OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo); + if GetVersionEx(OSVersionInfo) then + with OSVersionInfo do + begin + Win32Platform := dwPlatformId; + Win32MajorVersion := dwMajorVersion; + Win32MinorVersion := dwMinorVersion; + Win32BuildNumber := dwBuildNumber; + Win32CSDVersion := szCSDVersion; + end; +end; + +//--------------------------------------------------------- +// display error messages + +procedure Error(St : String); +var + ErrCode : Integer; + Mes : String; +begin + ErrCode := BASS_ErrorGetCode; + if ErrCode > 44 then + ErrCode := 10; + + Mes := St + #13#10 + BASSErCodes[ErrCode] + #13#10 + '(Error code: ' + IntToStr(ErrCode) + ')'; + MessageBox(0, PChar(Mes), '', MB_ICONERROR or MB_OK); +end; + +//--------------------------------------------------------- +// select a file to play, and play it + +function PlayFile(Wnd : HWND) : Boolean; +var + FileName : array[0..MAX_PATH - 1] of Char; + ofn : TOPENFILENAME; + TempFileName : String; +begin + Result := False; + FillChar(ofn, SizeOf(ofn), 0); + FillChar(FileName, SizeOf(FileName), 0); +{$IFDEF D7} + if (Win32MajorVersion >= 5) and (Win32Platform = VER_PLATFORM_WIN32_NT) or { Win2k } + ((Win32Platform = VER_PLATFORM_WIN32_WINDOWS) and (Win32MajorVersion >= 4) and (Win32MinorVersion >= 90)) then { WinME } + ofn.lStructSize := SizeOf(TOpenFilename) + else + ofn.lStructSize := SizeOf(TOpenFilename) - (SizeOf(DWORD) shl 1) - SizeOf(Pointer); { subtract size of added fields } +{$ELSE} + ofn.lStructSize := SizeOf(TOpenFilename); +{$ENDIF} + ofn.hwndOwner := Window; + ofn.hInstance := hInstance; + ofn.lpstrTitle := 'Select a file to play'; + ofn.lpstrFile := FileName; + ofn.lpstrFilter := 'playable files'#0'*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif'#0'All files'#0'*.*'#0#0; + ofn.nMaxFile := MAX_PATH; + ofn.Flags := OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_EXPLORER; + + if not GetOpenFileName(ofn) then + Exit; + + TempFileName := FileName; + chan := BASS_StreamCreateFile(False, PChar(TempFileName), 0, 0, BASS_SAMPLE_LOOP {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + if (chan = 0) then + begin + chan := BASS_MusicLoad(False, PChar(TempFileName), 0, 0, BASS_MUSIC_RAMP or BASS_SAMPLE_LOOP {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}, 1); + if (chan = 0) then + begin + Error('Can''t play file'); // Can't load the file + Exit; + end; + end; + + BASS_ChannelPlay(chan, False); + Result := True; +end; + +//--------------------------------------------------------- +// update the spectrum display - the interesting bit :) + +procedure UpdateSpectrum(uTimerID, uMsg, dwUser, dw1, dw2 : Integer); stdcall; +type + TSingleArray = array of Single; +var + DC : HDC; + X, Y, Z, + I, J, sc : Integer; + Sum : Single; + fft : array[0..1023] of Single; // get the FFT data + ci : BASS_CHANNELINFO; + Buf : TSingleArray; +begin + if SpecMode = 3 then // waveform + begin + FillChar(SpecBuf^, SPECWIDTH * SPECHEIGHT, 0); + BASS_ChannelGetInfo(chan, ci); // get number of channels + SetLength(Buf, ci.chans * SPECWIDTH); + Y := 0; + BASS_ChannelGetData(chan, buf, (ci.chans * SPECWIDTH * SizeOf(Single)) or BASS_DATA_FLOAT); // get the sample data (floating-point to avoid 8 & 16 bit processing) + for I := 0 to ci.chans - 1 do + begin + for X := 0 to SPECWIDTH - 1 do + begin + Z := Trunc((1 - Buf[X * Integer(ci.chans) + I]) * SPECHEIGHT / 2); // invert and scale to fit display + if Z < 0 then + Z := 0 + else if Z >= SPECHEIGHT then + Z := SPECHEIGHT - 1; + if X = 0 then + Y := Z; + repeat // draw line from previous sample... + if Y < Z then + inc(Y) + else if Y > Z then + dec(Y); + if (I and 1) = 1 then + Byte(Pointer(Longint(SpecBuf) + Y * SPECWIDTH + X)^) := 127 + else + Byte(Pointer(Longint(SpecBuf) + Y * SPECWIDTH + X)^) := 1; + until Y = Z; + end; + end; + end + else + begin + BASS_ChannelGetData(chan, @fft, BASS_DATA_FFT2048); + case SpecMode of + 0 : // "normal" FFT + begin + FillChar(SpecBuf^, SPECWIDTH * SPECHEIGHT, 0); + Z := 0; + for X := 0 to pred(SPECWIDTH) div 2 do + begin + Y := Trunc(sqrt(fft[X + 1]) * 3 * SPECHEIGHT - 4); // scale it (sqrt to make low values more visible) +// Y := Trunc(fft[X + 1] * 10 * SPECHEIGHT); // scale it (linearly) + if Y > SPECHEIGHT then + Y := SPECHEIGHT; // cap it + + if (X > 0) and (Z = (Y + Z) div 2) then // interpolate from previous to make the display smoother + while (Z >= 0) do + begin + Byte(Pointer(Longint(SpecBuf) + Z * SPECWIDTH + X * 2 - 1)^) := Z + 1; + dec(Z); + end; + + Z := Y; + while (Y >= 0) do + begin + Byte(Pointer(Longint(SpecBuf) + Y * SPECWIDTH + X * 2)^) := Y + 1; // draw level + dec(Y); + end; + end; + end; + 1 : // logarithmic, acumulate & average bins + begin + I := 0; + FillChar(SpecBuf^, SPECWIDTH * SPECHEIGHT, 0); + for X := 0 to BANDS - 1 do + begin + Sum := 0; + J := Trunc(Power(2, X * 10.0 / (BANDS - 1))); + if J > 1023 then + J := 1023; + if J <= I then + J := I + 1; // make sure it uses at least 1 FFT bin + sc := 10 + J - I; + + while I < J do + begin + Sum := Sum + fft[1 + I]; + inc(I); + end; + + Y := Trunc((sqrt(Sum / log10(sc)) * 1.7 * SPECHEIGHT) - 4); // scale it + if Y > SPECHEIGHT then + Y := SPECHEIGHT; // cap it + while (Y >= 0) do + begin + FillChar(Pointer(Longint(SpecBuf) + Y * SPECWIDTH + X * (SPECWIDTH div BANDS))^, SPECWIDTH div BANDS - 2, Y + 1); // draw bar + dec(Y); + end; + end; + end; + 2 : // "3D" + begin + for X := 0 to SPECHEIGHT - 1 do + begin + Y := Trunc(sqrt(fft[x + 1]) * 3 * 127); // scale it (sqrt to make low values more visible) + if Y > 127 then + Y := 127; // cap it + Byte(Pointer(Longint(SpecBuf) + X * SPECWIDTH + SpecPos)^) := 128 + Y; // plot it + end; + // move marker onto next position + SpecPos := (SpecPos + 1) mod SPECWIDTH; + for X := 0 to SPECHEIGHT do + Byte(Pointer(Longint(SpecBuf) + X * SPECWIDTH + SpecPos)^) := 255; + end; + end; + end; + // update the display + DC := GetDC(Window); + try + BitBlt(DC, 0, 0, SPECWIDTH, SPECHEIGHT, SpecDC, 0, 0, SRCCOPY); + finally + ReleaseDC(Window, DC); + end; +end; + +//--------------------------------------------------------- +// window procedure + +function SpectrumWindowProc(Wnd : HWND; Msg : Integer; wParam, lParam : Longint): Integer; stdcall; +var + Ps : TPAINTSTRUCT; + DC : HDC; + I : Integer; +begin + Result := 0; + + case Msg of + WM_CREATE : + begin + GetOSInfo; + + // initialize BASS + if not BASS_Init(-1, 44100, 0, Wnd, NIL) then + begin + Error('Can''t initialize device'); + Result := -1; + Exit; + end; + + if not PlayFile(Wnd) then // start a file playing + begin + BASS_Free; + Result := -1; + Exit; + end; + + // create bitmap to draw spectrum in - 8 bit for easy updating :) + FillChar(BI, SizeOf(BI), 0); + with BI.bmiHeader do // fill structure with parameter bitmap + begin + biSize := SizeOf(BI.bmiHeader); + biWidth := SPECWIDTH; + biHeight := SPECHEIGHT; // upside down (line 0=bottom) + biPlanes := 1; + biBitCount := 8; + biClrImportant := 256; + biClrUsed := 256; + end; + + // setup palette + for I := 0 to 127 do + begin + pal[I].rgbGreen := 255 - 2 * I; + pal[I].rgbRed := 2 * I; + end; + + for I := 0 to 31 do + begin + pal[128 + I].rgbBlue := 8 * I; + pal[128 + 32 + I].rgbBlue := 255; + pal[128 + 32 + I].rgbRed := 8 * I; + pal[128 + 64 + I].rgbRed := 255; + pal[128 + 64 + I].rgbBlue := 8 * (31 - I); + pal[128 + 64 + I].rgbGreen := 8 * I; + pal[128 + 96 + I].rgbRed := 255; + pal[128 + 96 + I].rgbGreen := 255; + pal[128 + 96 + I].rgbBlue := 8 * I; + end; + + // create the bitmap + SpecBmp := CreateDIBSection(0, BI, DIB_RGB_COLORS, SpecBuf, 0, 0); + SpecDC := CreateCompatibleDC(0); + SelectObject(SpecDC, SpecBmp); + + // setup update timer (40hz) + timer := timeSetEvent(25, 25, @UpdateSpectrum, 0, TIME_PERIODIC); + end; + + WM_PAINT : + if GetUpdateRect(Wnd, PRect(NIL)^, False) then + begin + DC := BeginPaint(Wnd, Ps); + if DC = 0 then + begin + Result := 0; + Exit; + end; + + BitBlt(DC, 0, 0, SPECWIDTH, SPECHEIGHT, SpecDC, 0, 0, SRCCOPY); + EndPaint(Wnd, Ps); + Result := 0; + Exit; + end; + + WM_LBUTTONUP : + begin + SpecMode := (SpecMode + 1) mod 4; // swap spectrum mode + if SpecMode = 2 then + SpecPos := 0; + FillChar(SpecBuf^, SPECWIDTH * SPECHEIGHT, 0); // clear display + Result := 0; + Exit; + end; + + WM_CLOSE : + begin + DestroyWindow(Wnd); + end; + + WM_DESTROY : + begin + if timer <> 0 then + timeKillEvent(timer); + BASS_Free; + if SpecDC <> 0 then + DeleteDC(SpecDC); + if SpecBmp <> 0 then + DeleteObject(specbmp); + PostQuitMessage(0); + Exit; + end; + end; + Result := DefWindowProc(Wnd, Msg, wParam, lParam); +end; + +//--------------------------------------------------------- + +procedure WinMain; +begin + Window := FindWindow(szAppName, NIL); + if Window <> 0 then + begin + if IsIconic(Window) then + ShowWindow(Window, SW_RESTORE); + SetForegroundWindow(Window); + Halt(254); + end; + + // check the correct BASS was loaded + if HIWORD(BASS_GetVersion) <> BASSVERSION then + begin + MessageBox(0, 'An incorrect version of BASS.DLL was loaded', '', MB_ICONERROR); + Exit; + end; + + // register window class and create the window + FillChar(WndClass, SizeOf(TWndClassEx), 0); + WndClass.cbSize := SizeOf(TWndClassEx); + WndClass.style := CS_HREDRAW or CS_VREDRAW; + WndClass.lpfnWndProc := @SpectrumWindowProc; + WndClass.cbClsExtra := 0; + WndClass.cbWndExtra := 0; + WndClass.hInstance := hInstance; + WndClass.hCursor := LoadCursor(0, IDC_ARROW); + WndClass.hbrBackGround := GetSysColorBrush(COLOR_BTNFACE); + WndClass.lpszClassName := szAppName; + + if RegisterClassEx(WndClass) = 0 then + Halt(255); + + SizeX := SPECWIDTH + 2 * GetSystemMetrics(SM_CXDLGFRAME); + SizeY := SPECHEIGHT + 2 * GetSystemMetrics(SM_CYDLGFRAME) + GetSystemMetrics(SM_CYCAPTION); + + PosX := (GetSystemMetrics(SM_CXSCREEN) - SizeX) div 2; + PosY := (GetSystemMetrics(SM_CYSCREEN) - SizeY) div 2; + + Window := CreateWindowEx(0, szAppName, 'BASS spectrum example (click to toggle mode)', + WS_POPUPWINDOW or WS_CAPTION, + PosX, PosY, SizeX, SizeY, 0, 0, hInstance, NIL); + + ShowWindow(Window, SW_SHOWNORMAL); + + while (GetMessage(Msg, 0, 0, 0)) do + begin + TranslateMessage(Msg); + DispatchMessage(Msg); + end; + + Halt(Msg.wParam); +end; + +begin + WinMain; +end. diff --git a/bass-sys/bass24/delphi/spectrum/spectrum.dpr b/bass-sys/bass24/delphi/spectrum/spectrum.dpr new file mode 100644 index 0000000..c7b748f --- /dev/null +++ b/bass-sys/bass24/delphi/spectrum/spectrum.dpr @@ -0,0 +1,9 @@ +program spectrum; + +uses + Unit1, + Bass in '..\Bass.pas'; + +begin + WinMain; +end. \ No newline at end of file diff --git a/bass-sys/bass24/delphi/synth/synth.dpr b/bass-sys/bass24/delphi/synth/synth.dpr new file mode 100644 index 0000000..3ac804e --- /dev/null +++ b/bass-sys/bass24/delphi/synth/synth.dpr @@ -0,0 +1,289 @@ +{ + BASS simple synth + Copyright (c) 2001-2008 Un4seen Developments Ltd. + + C++ to Delphi with use API adapted by Evgeny Melnikov + Required Delphi 5 or above + + http://dsoft1961.narod.ru + mail angvelem@gmail.com +} + +program synth; + +{$APPTYPE CONSOLE} + +uses + Windows, Bass in '../bass.pas'; + +const + PI = 3.14159265358979323846; + TABLESIZE = 2048; + KEYS = 20; + MAXVOL = 4000; // higher value = longer fadeout + akey : array[0..KEYS - 1] of Word = ( + ord('Q'), ord('2'), ord('W'), ord('3'), ord('E'), + ord('R'), ord('5'), ord('T'), ord('6'), ord('Y'), + ord('7'), ord('U'), ord('I'), ord('9'), ord('O'), + ord('0'), ord('P'), 219, 187, 221); + +var + info : BASS_INFO; + SineTable : array[0..TABLESIZE - 1] of Integer; // sine table + aVol : array[0..KEYS - 1] of Integer = ( // keys' volume & pos + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); + aPos : array[0..KEYS - 1] of Integer = ( + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); + +//------------------ Auxiliary functions ------------------- + +function Format(const Format : String; const Args : array of const ) : String; +var + I : Integer; + FormatBuffer : array[0..High(Word)] of Char; + Arr, Arr1 : PDWORD; + PP : PDWORD; +begin + Arr := NIL; + if High(Args) >= 0 then + GetMem(Arr, (High(Args) + 1) * SizeOf(Pointer)); + Arr1 := Arr; + for I := 0 to High(Args) do + begin + PP := @Args[I]; + PP := Pointer(PP^); + Arr1^ := DWORD(PP); + inc(Arr1); + end; + I := wvsprintf(@FormatBuffer[0], PChar(Format), PChar(Arr)); + SetLength(Result, I); + Result := FormatBuffer; + if Arr <> NIL then + FreeMem(Arr); +end; + +//--------------------------------------------------------- + +function IntPower(const Base : Extended; const Exponent : Integer) : Extended; +asm + mov ecx, eax + cdq + fld1 { Result := 1 } + xor eax, edx + sub eax, edx { eax := Abs(Exponent) } + jz @@3 + fld Base + jmp @@2 +@@1: fmul ST, ST { X := Base * Base } +@@2: shr eax,1 + jnc @@1 + fmul ST(1),ST { Result := Result * X } + jnz @@1 + fstp st { pop X from FPU stack } + cmp ecx, 0 + jge @@3 + fld1 + fdivrp { Result := 1 / Result } +@@3: + fwait +end; + +//--------------------------------------------------------- + +function Power(const Base, Exponent : Extended) : Extended; +begin + if Exponent = 0.0 then + Result := 1.0 { n**0 = 1 } + else if (Base = 0.0) and (Exponent > 0.0) then + Result := 0.0 { 0**n = 0, n > 0 } + else if (Frac(Exponent) = 0.0) and (Abs(Exponent) <= MaxInt) then + Result := IntPower(Base, Integer(Trunc(Exponent))) + else + Result := Exp(Exponent * Ln(Base)) +end; + +//========================================================== +//========================================================== + +// display error messages +procedure Error(Text : String); +begin + WriteLn(Format('Error(%d): %s', [BASS_ErrorGetCode, Text])); + BASS_Free; + ExitProcess(0); +end; + +//--------------------------------------------------------- + +// stream writer +function WriteStream(Handle : HSTREAM; Buffer : Pointer; Len : DWORD; User : Pointer) : DWORD; stdcall; +type + BufArray = array[0..0] of SmallInt; +var + I, J, K : Integer; + f : Single; + Buf : ^BufArray absolute Buffer; +begin + FillChar(Buffer^, Len, 0); + for I := 0 to KEYS - 1 do + begin + if aVol[I] = 0 then + Continue; + f := Power(2.0, (I + 3) / 12.0) * TABLESIZE * 440.0 / info.freq; + for K := 0 to (Len div 4 - 1) do + begin + if aVol[I] = 0 then + Continue; + inc(aPos[I]); + J := Round(SineTable[Round(aPos[I] * f) and pred(TABLESIZE)] * aVol[I] / MAXVOL); + inc(J, Buf[K * 2]); + if J > 32767 then + J := 32767 + else if J < -32768 then + J := -32768; + // left and right channels are the same + Buf[K * 2 + 1] := J; + Buf[K * 2] := J; + if aVol[I] < MAXVOL then + dec(aVol[I]); + end; + end; + Result := Len; +end; + +//--------------------------------------------------------- + +var + Stream : HSTREAM; + KeyIn : INPUT_RECORD; + bKey : Integer; + I, BufLen : DWORD; + J : HFX; + St : String; + fx : array[0..8] of HFX = (0, 0, 0, 0, 0, 0, 0, 0, 0); // effect handles + +const + fxname : array[0..8] of String = ( + 'CHORUS', 'COMPRESSOR', 'DISTORTION', + 'ECHO', 'FLANGER', 'GARGLE', + 'I3DL2REVERB','PARAMEQ', 'REVERB'); + +begin + WriteLn('BASS Simple Sinewave Synth'); + WriteLn('--------------------------'); + + // check the correct BASS was loaded + if HIWORD(BASS_GetVersion) <> BASSVERSION then + begin + WriteLn('An incorrect version of BASS.DLL was loaded'); + Exit; + end; + + // 10ms update period + BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 10); + + // setup output - get latency + if not BASS_Init(-1, 44100, BASS_DEVICE_LATENCY, 0, NIL) then + Error('Can''t initialize device'); + + // build sine table + for I := 0 to TABLESIZE - 1 do + SineTable[I] := Round((sin(2.0 * PI * I / TABLESIZE) * 7000.0)); + + BASS_GetInfo(info); + // default buffer size = update period + 'minbuf' + BASS_SetConfig(BASS_CONFIG_BUFFER, 10 + info.minbuf); + BufLen := BASS_GetConfig(BASS_CONFIG_BUFFER); + // if the device's output rate is unknown default to 44100 Hz + if info.freq = 0 then info.freq := 44100; + // create a stream, stereo so that effects sound nice + Stream := BASS_StreamCreate(info.freq, 2, 0, @WriteStream, NIL); + + WriteLn(Format('device latency: %dms', [info.latency])); + WriteLn(Format('device minbuf: %dms', [info.minbuf])); + if info.dsver < 8 then + St := 'disabled' + else + St := 'enabled'; + WriteLn(Format('ds version: %d (effects %s)', [info.dsver, St])); + WriteLn('press these keys to play:'#13#10); + WriteLn(' 2 3 5 6 7 9 0 ='); + WriteLn(' Q W ER T Y UI O P[ ]'#13#10); + WriteLn('press -/+ to de/increase the buffer'); + WriteLn('press spacebar to quit'#13#10); + if info.dsver >= 8 then // DX8 effects available + WriteLn('press F1-F9 to toggle effects'#13#10); + Write(Format('using a %dms buffer'#13, [BufLen])); + + BASS_ChannelPlay(Stream, False); + + while (ReadConsoleInput(GetStdHandle(STD_INPUT_HANDLE), KeyIn, 1, I)) do + begin + if KeyIn.EventType <> KEY_EVENT then + Continue; + + if KeyIn.Event.KeyEvent.wVirtualKeyCode = VK_SPACE then + Break; + + if KeyIn.Event.KeyEvent.bKeyDown then + begin + case KeyIn.Event.KeyEvent.wVirtualKeyCode of + VK_SUBTRACT, + VK_ADD : + begin + // recreate stream with smaller/larger buffer + BASS_StreamFree(Stream); + if KeyIn.Event.KeyEvent.wVirtualKeyCode = VK_SUBTRACT then + // smaller buffer + BASS_SetConfig(BASS_CONFIG_BUFFER, BufLen - 1) + else + // larger buffer + BASS_SetConfig(BASS_CONFIG_BUFFER, BufLen + 1); + BufLen := BASS_GetConfig(BASS_CONFIG_BUFFER); + Write(Format('using a %dms buffer'#9#9#13, [BufLen])); + Stream := BASS_StreamCreate(info.freq, 2, 0, @WriteStream, NIL); + // set effects on the new stream + for I := 0 to 8 do + if fx[I] > 0 then + fx[I] := BASS_ChannelSetFX(Stream, BASS_FX_DX8_CHORUS + I, 0); + BASS_ChannelPlay(Stream, False); + end; + + VK_F1..VK_F9 : + begin + I := KeyIn.Event.KeyEvent.wVirtualKeyCode - VK_F1; + if fx[I] > 0 then + begin + BASS_ChannelRemoveFX(Stream, fx[I]); + fx[I] := 0; + Write(Format('effect %s = OFF'#9#9#13, [fxname[I]])); + end + else + begin + // set the effect, not bothering with parameters (use defaults) + J := BASS_ChannelSetFX(Stream, BASS_FX_DX8_CHORUS + I, 0); + if J > 0 then + begin + fx[I] := J; + Write(Format('effect %s = ON'#9#9#13, [fxname[I]])); + end; + end; + end; + end; + end; + + for bKey := 0 to KEYS - 1 do + if KeyIn.Event.KeyEvent.wVirtualKeyCode = aKey[bKey] then + begin + if KeyIn.Event.KeyEvent.bKeyDown and (aVol[bKey] <> MAXVOL) then + begin + aPos[bKey] := 0; + aVol[bKey] := MAXVOL; // start key + end + else if not KeyIn.Event.KeyEvent.bKeyDown and (aVol[bKey] > 0) then + dec(aVol[bKey]); // trigger key fadeout +// Break; + end; + end; + BASS_Free; +end. diff --git a/bass-sys/bass24/delphi/writewav/UnitMain.dfm b/bass-sys/bass24/delphi/writewav/UnitMain.dfm new file mode 100644 index 0000000..33fd932 Binary files /dev/null and b/bass-sys/bass24/delphi/writewav/UnitMain.dfm differ diff --git a/bass-sys/bass24/delphi/writewav/UnitMain.pas b/bass-sys/bass24/delphi/writewav/UnitMain.pas new file mode 100644 index 0000000..16fa8b4 --- /dev/null +++ b/bass-sys/bass24/delphi/writewav/UnitMain.pas @@ -0,0 +1,168 @@ +{ + Source code under Bass license + by Alessandro Cappellozza + + http://digilander.libero.it/Kappe + mail acappellozza@ieee.org + + Notice + It is designed for mp3 but work on other streams (ogg, and so on) + } + +unit UnitMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + Bass, StdCtrls, ComCtrls, ExtCtrls; + +type + TForm1 = class(TForm) + EditFileName: TEdit; + EditDest: TEdit; + btnOpen: TButton; + BtnDecode: TButton; + OpenDialog: TOpenDialog; + btnCancel: TButton; + ProgressBar: TProgressBar; + LabelOp: TLabel; + Label1: TLabel; + Label2: TLabel; + Bevel1: TBevel; + Bevel2: TBevel; + Label3: TLabel; + procedure FormCreate(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure BtnDecodeClick(Sender: TObject); + procedure btnOpenClick(Sender: TObject); + procedure btnCancelClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + procedure DecodeFile(OutPath, SourceFileName : String); + end; + +var + Form1: TForm1; + PercentDone : Integer; + CancelOp : Boolean; + +implementation + +{$R *.dfm} + +procedure TForm1.DecodeFile(OutPath, SourceFileName : String); +var + chan: DWORD; + frq: Single; + buf : array [0..10000] of BYTE; + BytesRead : integer; + temp : AnsiString; + i : longint; + RecStream : TFileStream; + nChannels : Word; // number of channels (i.e. mono, stereo, etc.) + nSamplesPerSec : DWORD; // sample rate + nAvgBytesPerSec : DWORD; + nBlockAlign : Word; + wBitsPerSample : Word; // number of bits per sample of mono data + FileName : String; + chaninfo: BASS_CHANNELINFO; +begin + + chan := BASS_StreamCreateFile(FALSE, PChar(SourceFileName), 0, 0, BASS_STREAM_DECODE {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF}); + + CancelOp := False; + LabelOp.Caption := 'Opening file ...'; + + BASS_ChannelGetInfo(chan, chaninfo); + nChannels := chaninfo.chans; + if (chaninfo.flags and BASS_SAMPLE_8BITS > 0) then + wBitsPerSample := 8 + else + wBitsPerSample := 16; + + nBlockAlign := nChannels * wBitsPerSample div 8; + BASS_ChannelGetAttribute(chan, BASS_ATTRIB_FREQ, frq); + nSamplesPerSec := Trunc(frq); + nAvgBytesPerSec := nSamplesPerSec * nBlockAlign; + + FileName := ExtractFileName(SourceFileName); + FileName := Copy(FileName, 1, Length(FileName) - Length(ExtractFileExt(FileName))); + RecStream := TFileStream.Create(OutPath + FileName + '.wav', fmCreate); + + // Write header portion of wave file + temp := 'RIFF'; RecStream.write(temp[1], length(temp)); + temp := #0#0#0#0; RecStream.write(temp[1], length(temp)); // File size: to be updated + temp := 'WAVE'; RecStream.write(temp[1], length(temp)); + temp := 'fmt '; RecStream.write(temp[1], length(temp)); + temp := #$10#0#0#0; RecStream.write(temp[1], length(temp)); // Fixed + temp := #1#0; RecStream.write(temp[1], length(temp)); // PCM format + if nChannels = 1 then + temp := #1#0 + else + temp := #2#0; + RecStream.write(temp[1], length(temp)); + RecStream.write(nSamplesPerSec, 2); + temp := #0#0; RecStream.write(temp[1], length(temp)); // SampleRate is given as dWord + RecStream.write(nAvgBytesPerSec, 4); + RecStream.write(nBlockAlign, 2); + RecStream.write(wBitsPerSample, 2); + temp := 'data'; RecStream.write(temp[1],length(temp)); + temp := #0#0#0#0; RecStream.write(temp[1],length(temp)); // Data size: to be updated + while (BASS_ChannelIsActive(chan) > 0) do + begin + BytesRead := BASS_ChannelGetData(chan, @buf, 10000); + RecStream.Write(buf, BytesRead); + Application.ProcessMessages; + if CancelOp then Break; + PercentDone := Trunc(100 * (BASS_ChannelGetPosition(Chan, BASS_POS_BYTE) / BASS_ChannelGetLength(chan, BASS_POS_BYTE))); + ProgressBar.Position := PercentDone; + LabelOp.Caption := 'Done ' + IntToStr(PercentDone) + '%'; + end; + BASS_StreamFree(chan); // free the stream + + LabelOp.Caption := 'Closing file ...'; +// complete WAV header +// Rewrite some fields of header + i := RecStream.Size - 8; // size of file + RecStream.Position := 4; + RecStream.write(i, 4); + i := i - $24; // size of data + RecStream.Position := 40; + RecStream.write(i, 4); + RecStream.Free; + LabelOp.Caption := 'Done'; +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + BASS_Init(-1, 44100, 0, Application.Handle, nil); +end; + +procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); +begin +Bass_Free; +end; + +procedure TForm1.BtnDecodeClick(Sender: TObject); +begin + DecodeFile(EditDest.Text, EditFileName.Text); +end; + +procedure TForm1.btnOpenClick(Sender: TObject); +begin + if not OpenDialog.Execute then exit; + EditFileName.text := OpenDialog.FileName; + EditDest.Text := ExtractFileDir(OpenDialog.FileName); + if EditDest.Text[Length(EditDest.Text)] <> '\' then EditDest.Text := EditDest.Text + '\'; +end; + +procedure TForm1.btnCancelClick(Sender: TObject); +begin + CancelOp := True; +end; + +end. + \ No newline at end of file diff --git a/bass-sys/bass24/delphi/writewav/writewav.dpr b/bass-sys/bass24/delphi/writewav/writewav.dpr new file mode 100644 index 0000000..655cd64 --- /dev/null +++ b/bass-sys/bass24/delphi/writewav/writewav.dpr @@ -0,0 +1,12 @@ +program writewav; + +uses + Forms, + UnitMain in 'UnitMain.pas' {Form1}, + Bass in '..\Bass.pas'; + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. diff --git a/bass-sys/bass24/mp3-free/bass.dll b/bass-sys/bass24/mp3-free/bass.dll new file mode 100644 index 0000000..8011494 Binary files /dev/null and b/bass-sys/bass24/mp3-free/bass.dll differ diff --git a/bass-sys/bass24/vb/3Dtest/frm3Dtest.frm b/bass-sys/bass24/vb/3Dtest/frm3Dtest.frm new file mode 100644 index 0000000..7d1e103 --- /dev/null +++ b/bass-sys/bass24/vb/3Dtest/frm3Dtest.frm @@ -0,0 +1,538 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Begin VB.Form frm3Dtest + BorderStyle = 1 'Fixed Single + Caption = "BASS - 3D Test" + ClientHeight = 4005 + ClientLeft = 45 + ClientTop = 330 + ClientWidth = 5415 + LinkTopic = "Form1" + MaxButton = 0 'False + ScaleHeight = 4005 + ScaleWidth = 5415 + StartUpPosition = 2 'CenterScreen + Begin VB.Frame Frame6 + Caption = "Doppler factor" + Height = 495 + Left = 2640 + TabIndex = 12 + Top = 3360 + Width = 2655 + Begin VB.HScrollBar ID_Doppler + Height = 135 + Left = 120 + Max = 20 + TabIndex = 14 + Top = 240 + Value = 10 + Width = 2415 + End + End + Begin VB.Frame Frame5 + Caption = "Rolloff factor" + Height = 495 + Left = 2640 + TabIndex = 11 + Top = 2760 + Width = 2655 + Begin VB.HScrollBar ID_Rolloff + Height = 135 + Left = 120 + Max = 20 + TabIndex = 13 + Top = 240 + Value = 10 + Width = 2415 + End + End + Begin VB.Frame Frame4 + Height = 2655 + Left = 2640 + TabIndex = 3 + Top = 0 + Width = 2655 + Begin VB.PictureBox picDisplay + FillStyle = 0 'Solid + Height = 2295 + Left = 120 + ScaleHeight = 149 + ScaleMode = 3 'Pixel + ScaleWidth = 157 + TabIndex = 4 + Top = 240 + Width = 2415 + End + End + Begin VB.Frame Frame1 + Caption = "Channels (sample/music)" + Height = 2295 + Left = 120 + TabIndex = 2 + Top = 0 + Width = 2415 + Begin VB.Timer tmr3D + Enabled = 0 'False + Interval = 50 + Left = 1800 + Top = 840 + End + Begin MSComDlg.CommonDialog DLG + Left = 1800 + Top = 360 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.CommandButton cmdStop + Caption = "Stop" + Enabled = 0 'False + Height = 300 + Left = 1320 + TabIndex = 9 + Top = 1920 + Width = 975 + End + Begin VB.CommandButton cmdPlay + Caption = "Play" + Enabled = 0 'False + Height = 300 + Left = 120 + TabIndex = 8 + Top = 1920 + Width = 975 + End + Begin VB.CommandButton cmdRemove + Caption = "Remove" + Enabled = 0 'False + Height = 300 + Left = 1320 + TabIndex = 7 + Top = 1560 + Width = 975 + End + Begin VB.CommandButton cmdAdd + Caption = "Add ..." + Height = 300 + Left = 120 + TabIndex = 6 + Top = 1560 + Width = 975 + End + Begin VB.ListBox lstChannels + Height = 1230 + Left = 120 + TabIndex = 5 + Top = 240 + Width = 2175 + End + End + Begin VB.Frame Frame2 + Caption = "Movement" + ClipControls = 0 'False + Height = 765 + Left = 120 + TabIndex = 1 + Top = 2280 + Width = 2415 + Begin VB.CommandButton btnReset + Caption = "reset" + Enabled = 0 'False + Height = 255 + Left = 1680 + TabIndex = 19 + Top = 310 + Width = 615 + End + Begin VB.TextBox txtX + Enabled = 0 'False + Height = 285 + Left = 360 + MaxLength = 2 + TabIndex = 16 + Top = 300 + Width = 375 + End + Begin VB.TextBox txtZ + Enabled = 0 'False + Height = 285 + Left = 1080 + MaxLength = 2 + TabIndex = 15 + Top = 300 + Width = 375 + End + Begin VB.Label lblZ + AutoSize = -1 'True + Caption = "z:" + Height = 195 + Left = 840 + TabIndex = 18 + Top = 310 + Width = 120 + End + Begin VB.Label lblX + AutoSize = -1 'True + Caption = "x:" + Height = 195 + Left = 120 + TabIndex = 17 + Top = 310 + Width = 120 + End + End + Begin VB.Frame Frame3 + Caption = "EAX Environment" + ClipControls = 0 'False + Height = 735 + Left = 120 + TabIndex = 0 + Top = 3120 + Width = 2415 + Begin VB.ComboBox cmbEAX + BackColor = &H00FFFFFF& + Enabled = 0 'False + Height = 315 + Left = 120 + Style = 2 'Dropdown List + TabIndex = 10 + Top = 240 + Width = 2175 + End + End +End +Attribute VB_Name = "frm3Dtest" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'///////////////////////////////////////////////////////////// +' BASS 3D test, copyright (c) 1999 Adam Hoult. +' +' Updated: 2003-2007 by (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other source: frmDevice.frm +' +' Originally translated from - 3dtest.c - example of Ian Luck +'///////////////////////////////////////////////////////////// + +Option Explicit + +' channel (sample/music) info structure +Private Type channel + channel As Long ' the channel + pos As BASS_3DVECTOR ' position + vel As BASS_3DVECTOR ' velocity +End Type + +Dim chans() As channel ' array of channels +Dim chanc As Long ' number of Channels +Dim chan As Long ' current Channel + +Const TIMERPERIOD = 50 ' timer period (ms) +Const MAXDIST = 50 ' maximum distance of the channels (m) +Const SPEED = 12 ' speed of the channels' movement (m/s) + +' display error messages +Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + With cmbEAX + .AddItem "Off" + .AddItem "Generic" + .AddItem "Padded Cell" + .AddItem "Room" + .AddItem "Bathroom" + .AddItem "Living Room" + .AddItem "Stone Room" + .AddItem "Auditorium" + .AddItem "Concert Hall" + .AddItem "Cave" + .AddItem "Arena" + .AddItem "Hangar" + .AddItem "Carpeted Hallway" + .AddItem "Hallway" + .AddItem "Stone Corridor" + .AddItem "Alley" + .AddItem "Forest" + .AddItem "City" + .AddItem "Mountains" + .AddItem "Quarry" + .AddItem "Plain" + .AddItem "Parking Lot" + .AddItem "Sewer Pipe" + .AddItem "Under Water" + .AddItem "Drugged" + .AddItem "Dizzy" + .AddItem "Psychotic" + .ListIndex = 0 + End With + + chanc = 0 + chan = -1 + + ' Show the main window + Me.Show + + ' Initialize the default output device with 3D support + If (BASS_Init(-1, 44100, BASS_DEVICE_3D, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize output device") + End + End If + + ' Use meters as distance unit, real world rolloff, real doppler effect + Call BASS_Set3DFactors(1, 1, 1) + + ' Turn EAX off (volume=0), if error then EAX is not supported + If BASS_SetEAXParameters(-1, 0, -1, -1) Then cmbEAX.Enabled = True + + Call UpdateButtons + tmr3D.Enabled = True +End Sub + +Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) + Call BASS_Free + Erase chans +End Sub + +Sub Update() + Dim c As Integer, X As Integer, Y As Integer, cx As Integer, cy As Integer + + cx = picDisplay.ScaleWidth / 2 + cy = picDisplay.ScaleHeight / 2 + + ' Clear the display + picDisplay.Cls + + ' Draw Center Circle + picDisplay.FillColor = RGB(100, 100, 100) + picDisplay.Circle (cx - 4, cy - 4), 4, RGB(0, 0, 0) + + For c = 0 To chanc - 1 + ' If the channel is playing, then update it's position + If BASS_ChannelIsActive(chans(c).channel) = BASS_ACTIVE_PLAYING Then + ' Check if channel has reached the max distance + If chans(c).pos.z >= MAXDIST Or chans(c).pos.z <= -MAXDIST Then chans(c).vel.z = -chans(c).vel.z + If chans(c).pos.X >= MAXDIST Or chans(c).pos.X <= -MAXDIST Then chans(c).vel.X = -chans(c).vel.X + + ' Update channel position + chans(c).pos.z = chans(c).pos.z + chans(c).vel.z * TIMERPERIOD / 1000 + chans(c).pos.X = chans(c).pos.X + chans(c).vel.X * TIMERPERIOD / 1000 + Call BASS_ChannelSet3DPosition(chans(c).channel, chans(c).pos, 0, chans(c).vel) + End If + ' Draw the channel position indicator + X = cx + Int((cx - 7) * chans(c).pos.X / MAXDIST) + Y = cy - Int((cy - 7) * chans(c).pos.z / MAXDIST) + + If chan = c Then + picDisplay.FillColor = RGB(255, 0, 0) + Else + picDisplay.FillColor = RGB(150, 0, 0) + End If + picDisplay.Circle (X - 4, Y - 4), 4, RGB(0, 0, 0) + Next c + + ' Apply 3d changes + Call BASS_Apply3D +End Sub + +' Update the button states +Sub UpdateButtons() + ' Disable/enable controls depending on chanc + cmdRemove.Enabled = IIf(chan = -1, False, True) + cmdPlay.Enabled = IIf(chan = -1, False, True) + cmdStop.Enabled = IIf(chan = -1, False, True) + txtX.Enabled = IIf(chan = -1, False, True) + txtZ.Enabled = IIf(chan = -1, False, True) + btnReset.Enabled = IIf(chan = -1, False, True) + + If (chan <> -1) Then + txtX.Text = Abs(Int(chans(chan).vel.X)) + txtZ.Text = Abs(Int(chans(chan).vel.z)) + End If +End Sub + +Private Sub cmbEAX_Click() + ' Change the EAX Environment depending on which is selected + Select Case cmbEAX.ListIndex + Case 0: BASS_SetEAXParameters -1, 0, -1, -1 + Case 1: BASS_SetEAXPreset EAX_ENVIRONMENT_GENERIC + Case 2: BASS_SetEAXPreset EAX_ENVIRONMENT_PADDEDCELL + Case 3: BASS_SetEAXPreset EAX_ENVIRONMENT_ROOM + Case 4: BASS_SetEAXPreset EAX_ENVIRONMENT_BATHROOM + Case 5: BASS_SetEAXPreset EAX_ENVIRONMENT_LIVINGROOM + Case 6: BASS_SetEAXPreset EAX_ENVIRONMENT_STONEROOM + Case 7: BASS_SetEAXPreset EAX_ENVIRONMENT_AUDITORIUM + Case 8: BASS_SetEAXPreset EAX_ENVIRONMENT_CONCERTHALL + Case 9: BASS_SetEAXPreset EAX_ENVIRONMENT_CAVE + Case 10: BASS_SetEAXPreset EAX_ENVIRONMENT_ARENA + Case 11: BASS_SetEAXPreset EAX_ENVIRONMENT_HANGAR + Case 12: BASS_SetEAXPreset EAX_ENVIRONMENT_CARPETEDHALLWAY + Case 13: BASS_SetEAXPreset EAX_ENVIRONMENT_HALLWAY + Case 14: BASS_SetEAXPreset EAX_ENVIRONMENT_STONECORRIDOR + Case 15: BASS_SetEAXPreset EAX_ENVIRONMENT_ALLEY + Case 16: BASS_SetEAXPreset EAX_ENVIRONMENT_FOREST + Case 17: BASS_SetEAXPreset EAX_ENVIRONMENT_CITY + Case 18: BASS_SetEAXPreset EAX_ENVIRONMENT_MOUNTAINS + Case 19: BASS_SetEAXPreset EAX_ENVIRONMENT_QUARRY + Case 20: BASS_SetEAXPreset EAX_ENVIRONMENT_PLAIN + Case 21: BASS_SetEAXPreset EAX_ENVIRONMENT_PARKINGLOT + Case 22: BASS_SetEAXPreset EAX_ENVIRONMENT_SEWERPIPE + Case 23: BASS_SetEAXPreset EAX_ENVIRONMENT_UNDERWATER + Case 24: BASS_SetEAXPreset EAX_ENVIRONMENT_DRUGGED + Case 25: BASS_SetEAXPreset EAX_ENVIRONMENT_DIZZY + Case 26: BASS_SetEAXPreset EAX_ENVIRONMENT_PSYCHOTIC + End Select +End Sub + +Private Sub cmdAdd_Click() + On Local Error Resume Next + + DLG.filename = "" + DLG.CancelError = True + DLG.flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + DLG.Filter = "wav/aif/mo3/xm/mod/s3m/it/mtm/umx|*.wav;*.aif;*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx|All Files (*.*)|*.*|" + DLG.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + Dim newchan As Long + + ' Load a music or sample from "DLG.FileName" + newchan = BASS_MusicLoad(BASSFALSE, StrPtr(DLG.filename), 0, 0, BASS_MUSIC_RAMP Or BASS_MUSIC_LOOP Or BASS_SAMPLE_3D, 1) + If newchan = 0 Then newchan = BASS_SampleLoad(BASSFALSE, StrPtr(DLG.filename), 0, 0, 1, BASS_SAMPLE_LOOP Or BASS_SAMPLE_3D) + + If newchan Then + ReDim Preserve chans(chanc) As channel + chans(chanc).channel = newchan + lstChannels.AddItem GetFileName(DLG.filename) + Call BASS_SampleGetChannel(newchan, BASSFALSE) ' initialize sample channel + chanc = chanc + 1 + Else + Call Error_("Can't load file (note samples must be mono)") + End If +End Sub + +' Play the select sample/music +Private Sub cmdPlay_Click() + Call BASS_ChannelPlay(chans(chan).channel, BASSFALSE) +End Sub + +Private Sub cmdRemove_Click() + Call BASS_SampleFree(chans(chan).channel) + Call BASS_MusicFree(chans(chan).channel) + + ' remove the item from the array + Dim TempChans() As channel, Counter As Integer + ReDim TempChans(chanc) As channel + + Counter = 0 + + Dim i As Integer + + For i = 0 To chanc - 1 + If i <> chan Then + TempChans(Counter) = chans(i) + Counter = Counter + 1 + End If + Next i + + chanc = chanc - 1 + + ReDim chans(chanc) As channel + + For i = 0 To chanc - 1 + chans(i) = TempChans(i) + Next i + + Erase TempChans + + lstChannels.RemoveItem lstChannels.ListIndex + chan = -1 + Call UpdateButtons +End Sub + +' stop playing music/sample +Private Sub cmdStop_Click() + Call BASS_ChannelPause(chans(chan).channel) +End Sub + +' Change the rolloff factor +Private Sub ID_Rolloff_Scroll() + Call BASS_Set3DFactors(-1#, 2# ^ ((ID_Rolloff.value - 10) / 5#), -1#) +End Sub + +' Change the doppler factor +Private Sub ID_Doppler_Scroll() + Call BASS_Set3DFactors(-1#, -1#, 2# ^ ((ID_Doppler.value - 10) / 5#)) +End Sub + +' Change the selected channel +Private Sub lstChannels_Click() + chan = lstChannels.ListIndex + Call UpdateButtons +End Sub + +' X velocity +Private Sub txtX_Change() + Dim v As Integer + v = Val(txtX.Text) + If (Abs(Int(chans(chan).vel.X)) <> v) Then chans(chan).vel.X = v +End Sub + +Private Sub txtX_KeyPress(keyascii As Integer) + keyascii = numbersOnly(keyascii) +End Sub + +' Z velocity +Private Sub txtZ_Change() + Dim v As Integer + v = Val(txtZ.Text) + If (Abs(Int(chans(chan).vel.z)) <> v) Then chans(chan).vel.z = v +End Sub + +Private Sub txtZ_KeyPress(keyascii As Integer) + keyascii = numbersOnly(keyascii) +End Sub + +Private Sub tmr3D_Timer() + Call Update +End Sub + +' reset the position and velocity to 0 +Private Sub btnReset_Click() + Dim tmp As BASS_3DVECTOR ' VB's default value is 0 ;) + chans(chan).pos = tmp + chans(chan).vel = tmp + Call UpdateButtons +End Sub + +'-------------------- +' useful function :) +'-------------------- + +' get file name from file path +Public Function GetFileName(ByVal fp As String) As String + GetFileName = Mid(fp, InStrRev(fp, "\") + 1) +End Function + +' checks if keyascii is a number or a backspace +Public Function numbersOnly(ByVal keyascii As Integer) As Integer + If (keyascii < vbKey0 Or keyascii > vbKey9) Then keyascii = IIf(keyascii = vbKeyBack, keyascii, 0) + numbersOnly = keyascii +End Function diff --git a/bass-sys/bass24/vb/3Dtest/prj3Dtest.vbp b/bass-sys/bass24/vb/3Dtest/prj3Dtest.vbp new file mode 100644 index 0000000..6091a45 --- /dev/null +++ b/bass-sys/bass24/vb/3Dtest/prj3Dtest.vbp @@ -0,0 +1,37 @@ +Type=Exe +Module=modBass; ..\Bass.bas +Form=frm3Dtest.frm +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +IconForm="frm3Dtest" +Startup="frm3Dtest" +HelpFile="" +Title="prj3Dtest" +ExeName32="prj3Dtest.exe" +Command32="" +Name="prj3Dtest" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="Daedalus Developments (updated by (: JOBnik! :) Arthur Aminov, ISRAEL)" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/BASStest/frmBassTest.frm b/bass-sys/bass24/vb/BASStest/frmBassTest.frm new file mode 100644 index 0000000..645849e --- /dev/null +++ b/bass-sys/bass24/vb/BASStest/frmBassTest.frm @@ -0,0 +1,546 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx" +Begin VB.Form frmBassTest + BorderStyle = 1 'Fixed Single + Caption = "BASS - simple playback test" + ClientHeight = 3135 + ClientLeft = 10425 + ClientTop = 3825 + ClientWidth = 7830 + LinkTopic = "Form1" + MaxButton = 0 'False + ScaleHeight = 3135 + ScaleWidth = 7830 + Begin MSComctlLib.Slider sldVol + Height = 195 + Left = 4560 + TabIndex = 23 + Top = 2760 + Width = 1995 + _ExtentX = 3519 + _ExtentY = 344 + _Version = 393216 + LargeChange = 10 + Max = 100 + SelStart = 100 + TickFrequency = 10 + Value = 100 + End + Begin VB.CommandButton cmdResumeAll + Caption = "Resume" + Height = 375 + Left = 3120 + TabIndex = 14 + Top = 2580 + Width = 1215 + End + Begin VB.CommandButton cmdStopAll + Caption = "Stop Output" + Height = 375 + Left = 1320 + TabIndex = 13 + Top = 2580 + Width = 1695 + End + Begin VB.Timer tmrBass + Enabled = 0 'False + Interval = 250 + Left = 600 + Top = 2550 + End + Begin VB.Frame frameStream + Caption = "Stream" + Height = 2415 + Left = 120 + TabIndex = 12 + Top = 0 + Width = 2415 + Begin MSComctlLib.Slider sldVolGlStr + Height = 195 + Left = 150 + TabIndex = 25 + Top = 2160 + Width = 2115 + _ExtentX = 3731 + _ExtentY = 344 + _Version = 393216 + LargeChange = 1000 + SmallChange = 100 + Max = 10000 + SelStart = 10000 + TickFrequency = 1000 + Value = 10000 + End + Begin VB.CommandButton cmdStreamRemove + Caption = "Remove" + Height = 375 + Left = 1200 + TabIndex = 18 + Top = 1560 + Width = 1095 + End + Begin VB.CommandButton cmdStreamRestart + Caption = "Restart" + Height = 375 + Left = 1560 + TabIndex = 20 + Top = 1200 + Width = 735 + End + Begin VB.CommandButton cmdStreamAdd + Caption = "Add ..." + Height = 375 + Left = 120 + TabIndex = 19 + Top = 1560 + Width = 1095 + End + Begin VB.CommandButton cmdStreamStop + Caption = "Stop" + Height = 375 + Left = 840 + TabIndex = 21 + Top = 1200 + Width = 735 + End + Begin VB.ListBox lstStream + Height = 840 + Left = 120 + TabIndex = 17 + Top = 240 + Width = 2175 + End + Begin VB.CommandButton cmdStreamPlay + Caption = "Play" + Height = 375 + Left = 120 + TabIndex = 22 + Top = 1200 + Width = 735 + End + Begin VB.Label Label2 + Caption = "global volume" + Height = 195 + Left = 180 + TabIndex = 26 + Top = 1965 + Width = 1455 + End + End + Begin VB.Frame frameSamples + Caption = "Sample" + Height = 2415 + Left = 5160 + TabIndex = 7 + Top = 0 + Width = 2415 + Begin VB.CommandButton cmdSampleRemove + Caption = "Remove" + Height = 375 + Left = 1200 + TabIndex = 11 + Top = 1560 + Width = 1095 + End + Begin VB.CommandButton cmdSampleAdd + Caption = "Add ..." + Height = 375 + Left = 120 + TabIndex = 10 + Top = 1560 + Width = 1095 + End + Begin VB.ListBox lstSamples + Height = 840 + Left = 120 + TabIndex = 9 + Top = 240 + Width = 2175 + End + Begin VB.CommandButton cmdSamplePlay + Caption = "Play" + Height = 375 + Left = 120 + TabIndex = 8 + Top = 1200 + Width = 2175 + End + Begin MSComctlLib.Slider sldVolglSam + Height = 195 + Left = 180 + TabIndex = 29 + Top = 2160 + Width = 2115 + _ExtentX = 3731 + _ExtentY = 344 + _Version = 393216 + LargeChange = 1000 + SmallChange = 100 + Max = 10000 + SelStart = 10000 + TickFrequency = 1000 + Value = 10000 + End + Begin VB.Label Label4 + Caption = "global volume" + Height = 195 + Left = 240 + TabIndex = 30 + Top = 1965 + Width = 1455 + End + End + Begin MSComDlg.CommonDialog DLG + Left = 120 + Top = 2520 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.Frame frameMusic + Caption = "MOD Music" + Height = 2415 + Left = 2640 + TabIndex = 0 + Top = 0 + Width = 2415 + Begin VB.CommandButton cmdMusicRemove + Caption = "Remove" + Height = 375 + Left = 1200 + TabIndex = 6 + Top = 1560 + Width = 1095 + End + Begin VB.CommandButton cmdMusicAdd + Caption = "Add ..." + Height = 375 + Left = 120 + TabIndex = 5 + Top = 1560 + Width = 1095 + End + Begin VB.CommandButton cmdMusicRestart + Caption = "Restart" + Height = 375 + Left = 1560 + TabIndex = 4 + Top = 1200 + Width = 735 + End + Begin VB.CommandButton cmdMusicStop + Caption = "Stop" + Height = 375 + Left = 840 + TabIndex = 3 + Top = 1200 + Width = 735 + End + Begin VB.CommandButton cmdMusicPlay + Caption = "Play" + Height = 375 + Left = 120 + TabIndex = 2 + Top = 1200 + Width = 735 + End + Begin VB.ListBox lstMusic + Height = 840 + Left = 120 + TabIndex = 1 + Top = 240 + Width = 2175 + End + Begin MSComctlLib.Slider sldVolGlMus + Height = 195 + Left = 150 + TabIndex = 27 + Top = 2160 + Width = 2115 + _ExtentX = 3731 + _ExtentY = 344 + _Version = 393216 + LargeChange = 1000 + SmallChange = 100 + Max = 10000 + SelStart = 10000 + TickFrequency = 1000 + Value = 10000 + End + Begin VB.Label Label3 + Caption = "global volume" + Height = 195 + Left = 210 + TabIndex = 28 + Top = 1965 + Width = 1455 + End + End + Begin VB.Label Label1 + AutoSize = -1 'True + Caption = "Volume" + Height = 195 + Left = 5280 + TabIndex = 24 + Top = 2580 + Width = 525 + End + Begin VB.Label lblCPUP + AutoSize = -1 'True + BackStyle = 0 'Transparent + Caption = "CPU%" + Height = 195 + Left = 6780 + TabIndex = 16 + Top = 2700 + Width = 450 + End + Begin VB.Label lblCPU + Alignment = 2 'Center + AutoSize = -1 'True + Caption = "0.0" + Height = 195 + Left = 7320 + TabIndex = 15 + Top = 2700 + Width = 240 + End +End +Attribute VB_Name = "frmBassTest" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'***************************************************************** +'* BASS Simple test (rev .1), copyright (c) 1999 Adam Hoult. * +'* * +'* Updated: 2003-2007 by (: JOBnik! :) [Arthur Aminov, ISRAEL] * +'* [http://www.jobnik.org] * +'* [ jobnik@jobnik.org ] * +'* * +'* Originally translated from - basstest.c - example of Ian Luck * +'***************************************************************** + +Option Explicit + +' display error messages +Public Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & "(error code: " & BASS_ErrorGetCode() & ")", vbExclamation, "Error") +End Sub + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' Initialize output - default device, 44100hz, stereo, 16 bits + If BASS_Init(-1, 44100, 0, Me.hWnd, 0) = BASSFALSE Then + Call Error_("Can't initialize digital sound system") + End + End If + + ' Start the timer + tmrBass.Enabled = True + + DLG.filename = "" + DLG.CancelError = True + DLG.flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly +End Sub + +Private Sub Form_Unload(Cancel As Integer) + ' stop timer + tmrBass.Enabled = False + + ' Close sound system and release everything + Call BASS_Free +End Sub + +' Pause output +Private Sub cmdStopAll_Click() + Call BASS_Pause +End Sub + +' Resume output +Private Sub cmdResumeAll_Click() + Call BASS_Start +End Sub + +Private Sub cmdStreamAdd_Click() + On Local Error Resume Next ' incase Cancel is pressed + + DLG.Filter = "Streamable Files (wav/aif/mp3/mp2/mp1/ogg)|*.wav;*.aif;*.mp3;*.mp2;*.mp1;*.ogg|All Files (*.*)|*.*|" + DLG.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + Dim StreamHandle As Long + + StreamHandle = BASS_StreamCreateFile(BASSFALSE, StrPtr(DLG.filename), 0, 0, 0) + + If StreamHandle = 0 Then + Call Error_("Can't open stream") + Else + lstStream.AddItem GetFileName(DLG.filename) + lstStream.ItemData(lstStream.ListCount - 1) = StreamHandle + End If +End Sub + +' Free the selected stream resource +' Remove the selected list +Private Sub cmdStreamRemove_Click() + If (lstStream.ListIndex >= 0) Then + Call BASS_StreamFree(lstStream.ItemData(lstStream.ListIndex)) + lstStream.RemoveItem lstStream.ListIndex + End If +End Sub + +' Play the stream (continue from current position) +Private Sub cmdStreamPlay_Click() + If (lstStream.ListIndex >= 0) Then _ + If (BASS_ChannelPlay(lstStream.ItemData(lstStream.ListIndex), BASSFALSE) = 0) Then _ + Call Error_("Can't play stream") +End Sub + +' Stop the stream +Private Sub cmdStreamStop_Click() + If (lstStream.ListIndex >= 0) Then _ + Call BASS_ChannelStop(lstStream.ItemData(lstStream.ListIndex)) +End Sub + +' Play the stream from the start +Private Sub cmdStreamRestart_Click() + If (lstStream.ListIndex >= 0) Then _ + Call BASS_ChannelPlay(lstStream.ItemData(lstStream.ListIndex), BASSTRUE) +End Sub + +Private Sub cmdMusicAdd_Click() + On Local Error Resume Next + + DLG.Filter = "MOD Music Files (mo3/xm/mod/s3m/it/mtm/umx)|*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx|All Files (*.*)|*.*|" + DLG.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + Dim ModHandle As Long + + ' Load a music from "DLG.FileName" and make it use ramping + ModHandle = BASS_MusicLoad(BASSFALSE, StrPtr(DLG.filename), 0, 0, BASS_MUSIC_RAMPS, 1) + + If ModHandle = 0 Then + Call Error_("Can't Load Music") + Else + lstMusic.AddItem GetFileName(DLG.filename) + lstMusic.ItemData(lstMusic.ListCount - 1) = ModHandle + End If +End Sub + +' Free the selected mod resource +' Remove the selected list +Private Sub cmdMusicRemove_Click() + If (lstMusic.ListIndex >= 0) Then + Call BASS_MusicFree(lstMusic.ItemData(lstMusic.ListIndex)) + lstMusic.RemoveItem lstMusic.ListIndex + End If +End Sub + +' Play the music (continue from current position) +Private Sub cmdMusicPlay_Click() + If (lstMusic.ListIndex >= 0) Then _ + If (BASS_ChannelPlay(lstMusic.ItemData(lstMusic.ListIndex), BASSFALSE) = 0) Then _ + Call Error_("Can't play music") +End Sub + +' Stop the music +Private Sub cmdMusicStop_Click() + If (lstMusic.ListIndex >= 0) Then _ + Call BASS_ChannelStop(lstMusic.ItemData(lstMusic.ListIndex)) +End Sub + +' Play the music from the start +Private Sub cmdMusicRestart_Click() + If (lstMusic.ListIndex >= 0) Then _ + Call BASS_ChannelPlay(lstMusic.ItemData(lstMusic.ListIndex), BASSTRUE) +End Sub + +Private Sub cmdSampleAdd_Click() + On Local Error Resume Next + + DLG.Filter = "Sample files (wav/aif)|*.wav;*.aif|All Files (*.*)|*.*|" + DLG.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + Dim SampleHandle As Long + + ' Load a sample from "DLG.FileName" and give it a max of 3 simultaneous + ' playings using playback position as override decider + SampleHandle = BASS_SampleLoad(BASSFALSE, StrPtr(DLG.filename), 0, 0, 3, BASS_SAMPLE_OVER_POS) + + If SampleHandle = 0 Then + Call Error_("Can't Load Sample") + Else + lstSamples.AddItem GetFileName(DLG.filename) + lstSamples.ItemData(lstSamples.ListCount - 1) = SampleHandle + End If +End Sub + +' Play the sample at default rate, volume=50%, random pan position +Private Sub cmdSamplePlay_Click() + If (lstSamples.ListIndex >= 0) Then + Dim ch As Long + ch = BASS_SampleGetChannel(lstSamples.ItemData(lstSamples.ListIndex), BASSFALSE) + Call BASS_ChannelSetAttribute(ch, BASS_ATTRIB_VOL, 0.5) + Call BASS_ChannelSetAttribute(ch, BASS_ATTRIB_PAN, ((201 * Rnd) - 100) / 100) + If (BASS_ChannelPlay(ch, BASSFALSE) = 0) Then Error_ ("Can't play sample") + End If +End Sub + +' Free the selected sample resource +' Remove the selected list item +Private Sub cmdSampleRemove_Click() + If (lstSamples.ListIndex >= 0) Then + Call BASS_SampleFree(lstSamples.ItemData(lstSamples.ListIndex)) + lstSamples.RemoveItem lstSamples.ListIndex + End If +End Sub + +Private Sub sldVol_Scroll() + Call BASS_SetVolume(sldVol.value / 100) +End Sub + +Private Sub sldVolGlMus_Scroll() + Call BASS_SetConfig(BASS_CONFIG_GVOL_MUSIC, sldVolGlMus.value) +End Sub + +Private Sub sldVolglSam_Scroll() + Call BASS_SetConfig(BASS_CONFIG_GVOL_SAMPLE, sldVolglSam.value) +End Sub + +Private Sub sldVolGlStr_Scroll() + Call BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, sldVolGlStr.value) +End Sub + +' Main timer, to update all info needed. +Private Sub tmrBass_Timer() + ' update the CPU usage % display + lblCPU.Caption = Format(BASS_GetCPU, "0.00") +End Sub + +'-------------------- +' useful function :) +'-------------------- + +'get file name from file path +Public Function GetFileName(ByVal fp As String) As String + GetFileName = Mid(fp, InStrRev(fp, "\") + 1) +End Function diff --git a/bass-sys/bass24/vb/BASStest/prjBassTest.vbp b/bass-sys/bass24/vb/BASStest/prjBassTest.vbp new file mode 100644 index 0000000..5f2f55e --- /dev/null +++ b/bass-sys/bass24/vb/BASStest/prjBassTest.vbp @@ -0,0 +1,40 @@ +Type=Exe +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; COMDLG32.OCX +Module=modBass; ..\Bass.bas +Form=frmBassTest.frm +Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX +IconForm="frmBassTest" +Startup="frmBassTest" +HelpFile="" +Title="prjBassTest" +ExeName32="prjBassTest.exe" +Command32="" +Name="prjBassTest" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionComments="BASS - Simple Test" +VersionCompanyName="Daedalus Developments (updated by (: JOBnik! :) Arthur Aminov, ISRAEL)" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/CustLoop/frmCustLoop.frm b/bass-sys/bass24/vb/CustLoop/frmCustLoop.frm new file mode 100644 index 0000000..853c11b --- /dev/null +++ b/bass-sys/bass24/vb/CustLoop/frmCustLoop.frm @@ -0,0 +1,116 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Begin VB.Form frmCustLoop + AutoRedraw = -1 'True + BorderStyle = 3 'Fixed Dialog + Caption = "BASS custom looping example (left-click to set loop start, right-click to set end)" + ClientHeight = 3015 + ClientLeft = 45 + ClientTop = 330 + ClientWidth = 9000 + BeginProperty Font + Name = "MS Sans Serif" + Size = 9.75 + Charset = 177 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 201 + ScaleMode = 3 'Pixel + ScaleWidth = 600 + StartUpPosition = 2 'CenterScreen + Begin VB.Timer tmrCustLoop + Enabled = 0 'False + Interval = 100 + Left = 7800 + Top = 2400 + End + Begin MSComDlg.CommonDialog cmdCustLoop + Left = 8400 + Top = 2400 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End +End +Attribute VB_Name = "frmCustLoop" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'///////////////////////////////////////////////////////////////////////////////// +' frmCustLoop.frm - Copyright (c) 2004-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' Other source: modCustLoop.bas +' +' BASS custom looping example +' Originally translated from - custloop.c - Example of Ian Luck +'///////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + Call ChDrive(App.Path) + Call ChDir(App.Path) + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' initialize BASS + If (BASS_Init(-1, 44100, 0, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize device") + End + End If + + If (Not PlayFile) Then ' start a file playing + Call BASS_Free + End + End If +End Sub + +Private Sub Form_Unload(Cancel As Integer) + killscan = True + tmrCustLoop.Enabled = False + Call BASS_Free + End +End Sub + +Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + If (Button = vbLeftButton) Then ' set loop start + Call SetLoopStart(X * bpp) + Call DrawTimeLine(Me.hdc, loop_(0), &HFFFF00, 12) ' loop start + ElseIf (Button = vbRightButton) Then ' set loop end + Call SetLoopEnd(X * bpp) + Call DrawTimeLine(Me.hdc, loop_(1), vbYellow, 24) ' loop end + End If +End Sub + +Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) + If ((X >= 0) And (X < WIDTH_)) Then + If (Button = vbLeftButton) Then + Call SetLoopStart(X * bpp) + ElseIf (Button = vbRightButton) Then + Call SetLoopEnd(X * bpp) + End If + End If +End Sub + +Private Sub tmrCustLoop_Timer() + With Me + ' draw buffered peak waveform + Call SetDIBitsToDevice(.hdc, 0, 0, WIDTH_, HEIGHT_, 0, 0, 0, HEIGHT_, wavebuf(-(WIDTH_ / 2)), bh, 0) + Call DrawTimeLine(.hdc, BASS_ChannelGetPosition(chan, BASS_POS_BYTE), &HFFFFFF, 0) ' current pos + Call DrawTimeLine(.hdc, loop_(0), &HFFFF00, 12) ' loop start + Call DrawTimeLine(.hdc, loop_(1), vbYellow, 24) ' loop end + End With +End Sub diff --git a/bass-sys/bass24/vb/CustLoop/modCustLoop.bas b/bass-sys/bass24/vb/CustLoop/modCustLoop.bas new file mode 100644 index 0000000..bd1b52c --- /dev/null +++ b/bass-sys/bass24/vb/CustLoop/modCustLoop.bas @@ -0,0 +1,195 @@ +Attribute VB_Name = "modCustLoop" +'///////////////////////////////////////////////////////////////////////////////// +' modCustLoop.bas - Copyright (c) 2004-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' Other source: frmCustLoop.frm +' +' BASS custom looping example +' Originally translated from - custloop.c - Example of Ian Luck +'///////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Public Const BI_RGB = 0& +Public Const DIB_RGB_COLORS = 0& ' color table in RGBs + +Public Type BITMAPINFOHEADER + biSize As Long + biWidth As Long + biHeight As Long + biPlanes As Integer + biBitCount As Integer + biCompression As Long + biSizeImage As Long + biXPelsPerMeter As Long + biYPelsPerMeter As Long + biClrUsed As Long + biClrImportant As Long +End Type + +Public Type RGBQUAD + rgbBlue As Byte + rgbGreen As Byte + rgbRed As Byte + rgbReserved As Byte +End Type + +Public Type BITMAPINFO + bmiHeader As BITMAPINFOHEADER + bmiColors(255) As RGBQUAD +End Type + +Public Declare Function SetDIBitsToDevice Lib "gdi32.dll" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, Bits As Any, BitsInfo As BITMAPINFO, ByVal wUsage As Long) As Long + +Public Const TRANSPARENT = 1 +Public Const TA_LEFT = 0 +Public Const TA_RIGHT = 2 + +Public Declare Function SetTextColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long +Public Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long +Public Declare Function SetTextAlign Lib "gdi32" (ByVal hdc As Long, ByVal wFlags As Long) As Long +Public Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long + +Public Const WIDTH_ = 600 ' display width +Public Const HEIGHT_ = 201 ' height (odd number for centre line) +Public bpp As Long ' stream bytes per pixel +Public loop_(2) As Long ' loop start & end +Public lsync As Long ' looping sync +Public killscan As Boolean + +Public wavebuf() As Byte ' wave buffer +Public chan As Long ' stream/music handle + +Public bh As BITMAPINFO ' bitmap header + +' display error messages +Public Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Sub LoopSyncProc(ByVal handle As Long, ByVal channel As Long, ByVal data As Long, ByVal user As Long) + If (BASS_ChannelSetPosition(channel, loop_(0), BASS_POS_BYTE) = 0) Then ' try seeking to loop start + Call BASS_ChannelSetPosition(channel, 0, BASS_POS_BYTE) ' failed, go to start of file instead + End If +End Sub + +Sub SetLoopStart(ByVal pos As Long) + loop_(0) = pos +End Sub + +Sub SetLoopEnd(ByVal pos As Long) + loop_(1) = pos + Call BASS_ChannelRemoveSync(chan, lsync) ' remove old sync + lsync = BASS_ChannelSetSync(chan, BASS_SYNC_POS Or BASS_SYNC_MIXTIME, loop_(1), AddressOf LoopSyncProc, 0) ' set new sync +End Sub + +' scan the peaks +Sub ScanPeaks(ByVal decoder As Long) + ReDim wavebuf(-120600 To 120600) As Byte ' set 'n clear the buffer (600 x 201 = 120600) + Dim cpos As Long, peak(2) As Long + + Do While (Not killscan) + Dim Level As Long, pos As Long + Level = BASS_ChannelGetLevel(decoder) ' scan peaks + pos = BASS_ChannelGetPosition(decoder, BASS_POS_BYTE) / bpp + If (peak(0) < LoWord(Level)) Then peak(0) = LoWord(Level) ' set left peak + If (peak(1) < HiWord(Level)) Then peak(1) = HiWord(Level) ' set right peak + If (BASS_ChannelIsActive(decoder) = 0) Then + pos = -1 ' reached the end + Else + pos = BASS_ChannelGetPosition(decoder, BASS_POS_BYTE) / bpp + End If + If (pos > cpos) Then + Dim a As Long + For a = 0 To (peak(0) * (HEIGHT_ / 2) / 32768) - 1 + ' draw left peak + wavebuf(IIf((HEIGHT_ / 2 - 1 - a) * WIDTH_ + cpos > 120600, 120600, (HEIGHT_ / 2 - 1 - a) * WIDTH_ + cpos)) = 1 + a + Next a + For a = 0 To (peak(1) * (HEIGHT_ / 2) / 32768) - 1 + ' draw right peak + wavebuf(IIf((HEIGHT_ / 2 + 1 + a) * WIDTH_ + cpos > 120600, 120600, (HEIGHT_ / 2 + 1 + a) * WIDTH_ + cpos)) = 1 + a + Next a + If (pos >= WIDTH_) Then Exit Do ' gone off end of display + cpos = pos + peak(0) = 0 + peak(1) = 0 + End If + DoEvents + Loop + Call BASS_StreamFree(decoder) ' free the decoder +End Sub + +' select a file to play, and start scanning it +Function PlayFile() As Boolean + On Local Error Resume Next ' if Cancel pressed... + + With frmCustLoop.cmdCustLoop + .CancelError = True + .flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + .DialogTitle = "Select a file to play" + .Filter = "Playable files|*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif;*.mo3;*.it;*.xm;*.s3m;*.mtm;*.mod;*.umx|All files|*.*" + .ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Function + + chan = BASS_StreamCreateFile(BASSFALSE, StrPtr(.filename), 0, 0, 0) + If (chan = 0) Then chan = BASS_MusicLoad(BASSFALSE, StrPtr(.filename), 0, 0, BASS_MUSIC_RAMPS Or BASS_MUSIC_POSRESET Or BASS_MUSIC_PRESCAN, 1) + + If (chan = 0) Then + Call Error_("Can't play file") + PlayFile = False ' Can't load the file + Exit Function + End If + + frmCustLoop.Show ' show form + + With bh.bmiHeader + .biSize = Len(bh.bmiHeader) + .biWidth = WIDTH_ + .biHeight = -HEIGHT_ + .biPlanes = 1 + .biBitCount = 8 + .biClrUsed = HEIGHT_ / 2 + 1 + .biClrImportant = HEIGHT_ / 2 + 1 + End With + + ' setup palette + Dim a As Byte + + For a = 1 To HEIGHT_ / 2 + bh.bmiColors(a).rgbRed = (255 * a) / (HEIGHT_ / 2) + bh.bmiColors(a).rgbGreen = 255 - bh.bmiColors(a).rgbRed + Next a + + bpp = BASS_ChannelGetLength(chan, BASS_POS_BYTE) / WIDTH_ ' bytes per pixel + If (bpp < BASS_ChannelSeconds2Bytes(chan, 0.02)) Then ' minimum 20ms per pixel (BASS_ChannelGetLevel scans 20ms) + bpp = BASS_ChannelSeconds2Bytes(chan, 0.02) + End If + lsync = BASS_ChannelSetSync(chan, BASS_SYNC_END Or BASS_SYNC_MIXTIME, 0, AddressOf LoopSyncProc, 0) ' set sync to loop at end + Call BASS_ChannelPlay(chan, BASSFALSE) ' start playing + frmCustLoop.tmrCustLoop.Enabled = True ' timer's interval is 100ms (10Hz) + + Dim chan2 As Long + chan2 = BASS_StreamCreateFile(BASSFALSE, StrPtr(.filename), 0, 0, BASS_STREAM_DECODE) + If (chan2 = 0) Then chan2 = BASS_MusicLoad(BASSFALSE, StrPtr(.filename), 0, 0, BASS_MUSIC_DECODE, 1) + Call ScanPeaks(chan2) ' start scanning peaks + End With + PlayFile = True +End Function + +Sub DrawTimeLine(ByVal dc As Long, ByVal pos As Long, ByVal col As Long, ByVal Y As Long) + Dim wpos As Long + wpos = pos / bpp + Dim time As Long + time = BASS_ChannelBytes2Seconds(chan, pos) + Dim text As String + text = time \ 60 & ":" & Format(time Mod 60, "00") + frmCustLoop.CurrentX = wpos + frmCustLoop.Line (wpos, 0)-(wpos, HEIGHT_ - 1), col + Call SetTextColor(dc, col) + Call SetBkMode(dc, TRANSPARENT) + Call SetTextAlign(dc, IIf(wpos >= WIDTH_ / 2, TA_RIGHT, TA_LEFT)) + Call TextOut(dc, wpos, Y, text, Len(text)) +End Sub diff --git a/bass-sys/bass24/vb/CustLoop/prjCustLoop.vbp b/bass-sys/bass24/vb/CustLoop/prjCustLoop.vbp new file mode 100644 index 0000000..1d67fe8 --- /dev/null +++ b/bass-sys/bass24/vb/CustLoop/prjCustLoop.vbp @@ -0,0 +1,40 @@ +Type=Exe +Form=frmCustLoop.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Module=modCustLoop; modCustLoop.bas +Module=modBass; ..\Bass.bas +IconForm="frmCustLoop" +Startup="frmCustLoop" +HelpFile="" +Title="prjCustLoop" +ExeName32="prjCustLoop.exe" +Command32="" +Name="prjCustLoop" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/DSPtest/frmDSPtest.frm b/bass-sys/bass24/vb/DSPtest/frmDSPtest.frm new file mode 100644 index 0000000..5d2806f --- /dev/null +++ b/bass-sys/bass24/vb/DSPtest/frmDSPtest.frm @@ -0,0 +1,221 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Begin VB.Form frmDSPtest + BorderStyle = 3 'Fixed Dialog + Caption = "BASS simple DSP test" + ClientHeight = 1185 + ClientLeft = 45 + ClientTop = 435 + ClientWidth = 4515 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 1185 + ScaleWidth = 4515 + StartUpPosition = 2 'CenterScreen + Begin VB.CheckBox chkSwap + Caption = "swap" + Height = 315 + Left = 3360 + TabIndex = 4 + Top = 720 + Width = 855 + End + Begin VB.CheckBox chkFlange + Caption = "flanger" + Height = 315 + Left = 2280 + TabIndex = 3 + Top = 720 + Width = 855 + End + Begin VB.CheckBox chkEcho + Caption = "echo" + Height = 315 + Left = 1200 + TabIndex = 2 + Top = 720 + Width = 735 + End + Begin MSComDlg.CommonDialog cmd + Left = 3960 + Top = 0 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.CheckBox chkRotate + Caption = "rotate" + Height = 315 + Left = 240 + TabIndex = 1 + Top = 720 + Width = 735 + End + Begin VB.CommandButton cmdOpen + Caption = "click here to open a file..." + Height = 375 + Left = 120 + TabIndex = 0 + Top = 120 + Width = 4335 + End +End +Attribute VB_Name = "frmDSPtest" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'//////////////////////////////////////////////////////////////////////////////// +' frmDSPtest.frm - Copyright (c) 2003-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other source: modDSPtest.bas +' +' BASS simple DSP test +' Originally translated from - dsptest.c - Example of Ian Luck +'//////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +' display error messages +Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' enable floating-point DSP + Call BASS_SetConfig(BASS_CONFIG_FLOATDSP, BASSTRUE) + + ' initialize - default device + If (BASS_Init(-1, 44100, 0, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize device") + Unload Me + End If + + ' check for floating-point capability + floatable = BASS_StreamCreate(44100, 2, BASS_SAMPLE_FLOAT, 0, 0) + If (floatable) Then ' woohoo! + Call BASS_StreamFree(floatable) + floatable = BASS_SAMPLE_FLOAT + End If + + rotdsp = 0 + echdsp = 0 + fladsp = 0 + swpdsp = 0 +End Sub + +Private Sub Form_Unload(Cancel As Integer) + Call BASS_Free +End Sub + +' toggle "rotate" +Private Sub chkRotate_Click() + If (chkRotate.value = vbChecked) Then + rotpos = 0.7853981 + rotdsp = BASS_ChannelSetDSP(chan, AddressOf Rotate, 0, 3) + Else + Call BASS_ChannelRemoveDSP(chan, rotdsp) + End If +End Sub + +' toggle "echo" +Private Sub chkEcho_Click() + If (chkEcho.value = vbChecked) Then + echpos = 0 + echdsp = BASS_ChannelSetDSP(chan, AddressOf Echo, 0, 2) + Else + Call BASS_ChannelRemoveDSP(chan, echdsp) + End If +End Sub + +' toggle "flanger" +Private Sub chkFlange_Click() + If (chkFlange.value = vbChecked) Then + flapos = 0 + flas = FLABUFLEN / 2 + flasinc = 0.002 + fladsp = BASS_ChannelSetDSP(chan, AddressOf Flange, 0, 1) + Else + Call BASS_ChannelRemoveDSP(chan, fladsp) + End If +End Sub + +' toggle "swapper" +Private Sub chkSwap_Click() + If (chkSwap.value = vbChecked) Then + swpdsp = BASS_ChannelSetDSP(chan, AddressOf Swapper, 0, 0) + Else + Call BASS_ChannelRemoveDSP(chan, swpdsp) + End If +End Sub + +Private Sub cmdOpen_Click() + On Local Error Resume Next ' if Cancel pressed... + + cmd.CancelError = True + cmd.flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + cmd.DialogTitle = "Open" + cmd.Filter = "playable files|*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif|All files|*.*" + cmd.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + ' free both MOD and stream, it must be one of them! :) + Call BASS_MusicFree(chan) + Call BASS_StreamFree(chan) + + chan = BASS_StreamCreateFile(BASSFALSE, StrPtr(cmd.filename), 0, 0, BASS_SAMPLE_LOOP Or floatable) + If (chan = 0) Then chan = BASS_MusicLoad(BASSFALSE, StrPtr(cmd.filename), 0, 0, BASS_MUSIC_LOOP Or BASS_MUSIC_RAMPS Or floatable, 1) + + ' whatever it is, it ain't playable + If (chan = 0) Then + cmdOpen.Caption = "click here to open a file..." + Call Error_("Can't play the file") + Exit Sub + End If + + Dim info As BASS_CHANNELINFO + Call BASS_ChannelGetInfo(chan, info) + + If (info.chans <> 2) Then ' only stereo is allowed + cmdOpen.Caption = "click here to open a file..." + Call BASS_MusicFree(chan) + Call BASS_StreamFree(chan) + Call Error_("only stereo sources are supported") + Exit Sub + End If + + cmdOpen.Caption = GetFileName(cmd.filename) + + ' setup DSPs on new channel + chkRotate_Click + chkEcho_Click + chkFlange_Click + chkSwap_Click + + ' play it! + Call BASS_ChannelPlay(chan, BASSFALSE) +End Sub + +'-------------------- +' useful function :) +'-------------------- + +' get file name from file path +Public Function GetFileName(ByVal fp As String) As String + GetFileName = Mid(fp, InStrRev(fp, "\") + 1) +End Function diff --git a/bass-sys/bass24/vb/DSPtest/modDSPtest.bas b/bass-sys/bass24/vb/DSPtest/modDSPtest.bas new file mode 100644 index 0000000..6d7e095 --- /dev/null +++ b/bass-sys/bass24/vb/DSPtest/modDSPtest.bas @@ -0,0 +1,144 @@ +Attribute VB_Name = "modDSPtest" +'//////////////////////////////////////////////////////////////////////////////// +' modDSPtest.bas - Copyright (c) 2003-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' Other source: frmDSPtest.frm +' +' BASS simple DSP test +' Originally translated from - dsptest.c - Example of Ian Luck +'//////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal length As Long) + +Public floatable As Long ' floating-point channel support? +Public chan As Long ' the channel... HMUSIC or HSTREAM + +Public Const PI = 3.1415927 + +'********************************************************************************************** +' GLOBAL DSP Variables +'********************************************************************************************** + +' "rotate" +Public rotdsp As Long ' DSP handle +Public rotpos As Single ' cur.pos + +' "echo" +Public echdsp As Long ' DSP handle +Public Const ECHBUFLEN = 1200 ' buffer length +Public echbuf(ECHBUFLEN, 2) As Single ' buffer +Public echpos As Long ' cur.pos + +' "flanger" +Public fladsp As Long ' DSP handle +Public Const FLABUFLEN = 350 ' buffer length +Public flabuf(FLABUFLEN, 2) As Single ' buffer +Public flapos As Long ' cur.pos +Public flas As Single, flasinc As Single ' sweep pos/increment + +' "swapper" +Public swpdsp As Long ' DSP handle + +Function fmod(ByVal a As Single, b As Single) As Single + fmod = a - Fix(a / b) * b +End Function + + +'********************************************************************************************** +' DSP Functions +'********************************************************************************************** + +' "rotate" +Public Sub Rotate(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) + Dim d() As Single, a As Long + ReDim d(length / 4) As Single + + Call CopyMemory(d(0), ByVal buffer, length) + + For a = 0 To (length / 4) - 1 Step 2 + d(a) = d(a) * CSng(Abs(Sin(rotpos))) + d(a + 1) = d(a + 1) * CSng(Abs(Cos(rotpos))) + rotpos = fmod(rotpos + 0.00003, PI) + Next a + + Call CopyMemory(ByVal buffer, d(0), length) +End Sub + +' "echo" +Public Sub Echo(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) + Dim d() As Single, a As Long + ReDim d(length / 4) As Single + + Call CopyMemory(d(0), ByVal buffer, length) + + For a = 0 To (length / 4) - 1 Step 2 + Dim l As Single, r As Single + l = d(a) + (echbuf(echpos, 1) / 2) + r = d(a + 1) + (echbuf(echpos, 0) / 2) +#If 1 Then ' 0=echo, 1=basic "bathroom" reverb + echbuf(echpos, 0) = l + d(a) = l + echbuf(echpos, 1) = r + d(a + 1) = r +#Else + echbuf(echpos, 0) = d(a) + echbuf(echpos, 1) = d(a + 1) + d(a) = l + d(a + 1) = r +#End If + echpos = echpos + 1 + If (echpos = ECHBUFLEN) Then echpos = 0 + Next a + + Call CopyMemory(ByVal buffer, d(0), length) +End Sub + +' "flanger" +Public Sub Flange(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) + Dim d() As Single, a As Long + ReDim d(length / 4) As Single + + Call CopyMemory(d(0), ByVal buffer, length) + + For a = 0 To (length / 4) - 1 Step 2 + Dim p1 As Long, p2 As Long + p1 = (flapos + Int(flas)) Mod FLABUFLEN + p2 = (p1 + 1) Mod FLABUFLEN + Dim f As Single, s As Single + f = fmod(flas, 1) + + s = d(a) + ((flabuf(p1, 0) * (1 - f)) + (flabuf(p2, 0) * f)) + flabuf(flapos, 0) = d(a) + d(a) = s + + s = d(a + 1) + ((flabuf(p1, 1) * (1 - f)) + (flabuf(p2, 1) * f)) + flabuf(flapos, 1) = d(a + 1) + d(a + 1) = s + + flapos = flapos + 1 + If (flapos = FLABUFLEN) Then flapos = 0 + flas = flas + flasinc + If ((flas < 0#) Or (flas > FLABUFLEN)) Then flasinc = -flasinc + Next a + + Call CopyMemory(ByVal buffer, d(0), length) +End Sub + +' "swap between channels" +Public Sub Swapper(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) + Dim d() As Single, tmp As Single, a As Long + ReDim d(length / 4) As Single + + Call CopyMemory(d(0), ByVal buffer, length) + + For a = 0 To (length / 4) - 1 Step 2 + tmp = d(a) + d(a) = d(a + 1) + d(a + 1) = tmp + Next a + + Call CopyMemory(ByVal buffer, d(0), length) +End Sub diff --git a/bass-sys/bass24/vb/DSPtest/prjDSPtest.vbp b/bass-sys/bass24/vb/DSPtest/prjDSPtest.vbp new file mode 100644 index 0000000..2813af1 --- /dev/null +++ b/bass-sys/bass24/vb/DSPtest/prjDSPtest.vbp @@ -0,0 +1,40 @@ +Type=Exe +Form=frmDSPtest.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Module=modBass; ..\Bass.bas +Module=modDSPtest; modDSPtest.bas +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +IconForm="frmDSPtest" +Startup="frmDSPtest" +HelpFile="" +Title="prjDSPtest" +ExeName32="prjDSPtest.exe" +Command32="" +Name="prjDSPtest" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/FXtest/frmFXtest.frm b/bass-sys/bass24/vb/FXtest/frmFXtest.frm new file mode 100644 index 0000000..64b305d --- /dev/null +++ b/bass-sys/bass24/vb/FXtest/frmFXtest.frm @@ -0,0 +1,294 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX" +Begin VB.Form frmFXtest + BorderStyle = 3 'Fixed Dialog + Caption = "BASS DX8 effects test" + ClientHeight = 2025 + ClientLeft = 45 + ClientTop = 405 + ClientWidth = 4455 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 2025 + ScaleWidth = 4455 + ShowInTaskbar = 0 'False + StartUpPosition = 2 'CenterScreen + Begin MSComctlLib.Slider sldEQR + Height = 1095 + Index = 0 + Left = 360 + TabIndex = 5 + Top = 600 + Width = 675 + _ExtentX = 1191 + _ExtentY = 1931 + _Version = 393216 + Orientation = 1 + Max = 20 + TickStyle = 2 + TickFrequency = 0 + Value = 10 + End + Begin MSComDlg.CommonDialog CMD + Left = 3720 + Top = 2160 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.CommandButton cmdOpenFP + Caption = "click here to open a file..." + Height = 375 + Left = 120 + Style = 1 'Graphical + TabIndex = 0 + Top = 120 + Width = 4215 + End + Begin MSComctlLib.Slider sldEQR + Height = 1095 + Index = 1 + Left = 1200 + TabIndex = 6 + Top = 600 + Width = 675 + _ExtentX = 1191 + _ExtentY = 1931 + _Version = 393216 + Orientation = 1 + Max = 20 + TickStyle = 2 + TickFrequency = 0 + Value = 10 + End + Begin MSComctlLib.Slider sldEQR + Height = 1095 + Index = 2 + Left = 2040 + TabIndex = 7 + Top = 600 + Width = 675 + _ExtentX = 1191 + _ExtentY = 1931 + _Version = 393216 + Orientation = 1 + Max = 20 + SelStart = 10 + TickStyle = 2 + TickFrequency = 0 + Value = 10 + End + Begin MSComctlLib.Slider sldEQR + Height = 1095 + Index = 3 + Left = 3240 + TabIndex = 8 + Top = 600 + Width = 675 + _ExtentX = 1191 + _ExtentY = 1931 + _Version = 393216 + Orientation = 1 + Max = 20 + SelStart = 20 + TickStyle = 2 + TickFrequency = 0 + Value = 20 + End + Begin VB.Label lblEQR + AutoSize = -1 'True + Caption = "reverb" + Height = 195 + Index = 3 + Left = 3360 + TabIndex = 4 + Top = 1770 + Width = 450 + End + Begin VB.Label lblEQR + AutoSize = -1 'True + Caption = "8 khz" + Height = 195 + Index = 2 + Left = 2160 + TabIndex = 3 + Top = 1770 + Width = 480 + End + Begin VB.Label lblEQR + AutoSize = -1 'True + Caption = "1 khz" + Height = 195 + Index = 1 + Left = 1320 + TabIndex = 2 + Top = 1770 + Width = 390 + End + Begin VB.Label lblEQR + AutoSize = -1 'True + Caption = "125 hz" + Height = 195 + Index = 0 + Left = 480 + TabIndex = 1 + Top = 1770 + Width = 480 + End +End +Attribute VB_Name = "frmFXtest" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'/////////////////////////////////////////////////////////////////////////////// +' frmFXtest.frm - Copyright (c) 2001-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' BASS DX8 effects test +' Originally translated from - fxtest.c - example of Ian Luck +'/////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Dim chan As Long ' channel handle +Dim fx(3) As Long ' 3 eq band + reverb + +' display error messages +Public Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Private Sub Form_Initialize() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' setup output - default device + If (BASS_Init(-1, 44100, 0, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize device") + End + End If + + ' check that DX8 features are available + Dim bi As BASS_INFO + Call BASS_GetInfo(bi) + If (bi.dsver < 8) Then + Call BASS_Free + Call Error_("DirectX 8 is not installed") + End + End If +End Sub + +Private Sub Form_Unload(Cancel As Integer) + Call BASS_Free +End Sub + +Public Sub UpdateFX(ByVal b As Integer) + Dim v As Integer + + v = sldEQR(b).value + + If (b < 3) Then + Dim p As BASS_DX8_PARAMEQ + Call BASS_FXGetParameters(fx(b), p) + p.fGain = 10# - v + Call BASS_FXSetParameters(fx(b), p) + Else + Dim p1 As BASS_DX8_REVERB + Call BASS_FXGetParameters(fx(b), p1) + p1.fReverbMix = -0.012 * v * v * v + Call BASS_FXSetParameters(fx(b), p1) + End If +End Sub + + +Private Sub cmdOpenFP_Click() + On Local Error Resume Next ' incase Cancel is pressed + + CMD.filename = "" + CMD.CancelError = True + CMD.flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + CMD.Filter = "playable files|*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif|All Files|*.*|" + CMD.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + ' free both MOD and stream, it must be one of them! :) + Call BASS_MusicFree(chan) + Call BASS_StreamFree(chan) + +#If 1 Then ' with FX flag + + chan = BASS_StreamCreateFile(BASSFALSE, StrPtr(CMD.filename), 0, 0, BASS_SAMPLE_LOOP Or BASS_SAMPLE_FX) + If (chan = 0) Then chan = BASS_MusicLoad(BASSFALSE, StrPtr(CMD.filename), 0, 0, BASS_MUSIC_LOOP Or BASS_MUSIC_RAMP Or BASS_SAMPLE_FX, 1) + +#Else ' without FX flag + + chan = BASS_StreamCreateFile(BASSFALSE, StrPtr(CMD.filename), 0, 0, BASS_SAMPLE_LOOP) + If (chan = 0) Then chan = BASS_MusicLoad(BASSFALSE, StrPtr(CMD.filename), 0, 0, BASS_MUSIC_LOOP Or BASS_MUSIC_RAMP, 1) + +#End If + + If (chan = 0) Then ' whatever it is, it ain't playable + cmdOpenFP.Caption = "click here to open a file..." + Call Error_("Can't play the file") + Exit Sub + End If + + cmdOpenFP.Caption = GetFileName(CMD.filename) + + ' setup the effects + Dim p As BASS_DX8_PARAMEQ + + fx(0) = BASS_ChannelSetFX(chan, BASS_FX_DX8_PARAMEQ, 0) ' bass + fx(1) = BASS_ChannelSetFX(chan, BASS_FX_DX8_PARAMEQ, 0) ' mid + fx(2) = BASS_ChannelSetFX(chan, BASS_FX_DX8_PARAMEQ, 0) ' treble + fx(3) = BASS_ChannelSetFX(chan, BASS_FX_DX8_REVERB, 0) ' reverb + + p.fGain = 0 + p.fBandwidth = 18 + + p.fCenter = 125 ' bass [125hz] + Call BASS_FXSetParameters(fx(0), p) + + p.fCenter = 1000 ' mid [1khz] + Call BASS_FXSetParameters(fx(1), p) + + p.fCenter = 8000 ' treble [8khz] + Call BASS_FXSetParameters(fx(2), p) + + ' you can add more EQ bands with changing: + ' p.fCenter = N [Hz] N>=80 and N<=16000 + + Call UpdateFX(0) ' bass + Call UpdateFX(1) ' mid + Call UpdateFX(2) ' treble + Call UpdateFX(3) ' reverb + + Call BASS_ChannelPlay(chan, BASSFALSE) +End Sub + +Private Sub sldEQR_Scroll(index As Integer) + sldEQR(index).Text = IIf(index < 3, 10 - sldEQR(index).value, 20 - sldEQR(index).value) + Call UpdateFX(index) +End Sub + +'-------------------- +' useful function :) +'-------------------- + +' get file name from file path +Public Function GetFileName(ByVal fp As String) As String + GetFileName = Mid(fp, InStrRev(fp, "\") + 1) +End Function diff --git a/bass-sys/bass24/vb/FXtest/prjFXtest.vbp b/bass-sys/bass24/vb/FXtest/prjFXtest.vbp new file mode 100644 index 0000000..dc35a6d --- /dev/null +++ b/bass-sys/bass24/vb/FXtest/prjFXtest.vbp @@ -0,0 +1,40 @@ +Type=Exe +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Form=frmFXtest.frm +Module=modBass; ..\Bass.bas +Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX +IconForm="frmFXtest" +Startup="frmFXtest" +HelpFile="" +Title="FXtest" +ExeName32="prjFXtest.exe" +Command32="" +Name="prjFXtest" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/LiveFX/frmLiveFX.frm b/bass-sys/bass24/vb/LiveFX/frmLiveFX.frm new file mode 100644 index 0000000..98966a2 --- /dev/null +++ b/bass-sys/bass24/vb/LiveFX/frmLiveFX.frm @@ -0,0 +1,204 @@ +VERSION 5.00 +Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx" +Begin VB.Form frmLiveFX + BorderStyle = 3 'Fixed Dialog + Caption = "BASS full-duplex recording test with effects" + ClientHeight = 795 + ClientLeft = 45 + ClientTop = 435 + ClientWidth = 4965 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 795 + ScaleWidth = 4965 + StartUpPosition = 2 'CenterScreen + Begin VB.Timer tmrLiveFX + Enabled = 0 'False + Interval = 250 + Left = 3600 + Top = 360 + End + Begin VB.CheckBox chkFlanger + Caption = "Flanger" + Height = 195 + Left = 3960 + TabIndex = 7 + Top = 480 + Width = 975 + End + Begin VB.CheckBox chkReverb + Caption = "Reverb" + Height = 195 + Left = 3960 + TabIndex = 6 + Top = 120 + Width = 975 + End + Begin VB.CheckBox chkGargle + Caption = "Gargle" + Height = 195 + Left = 2880 + TabIndex = 5 + Top = 480 + Width = 975 + End + Begin VB.CheckBox chkChorus + Caption = "Chorus" + Height = 195 + Left = 2880 + TabIndex = 4 + Top = 120 + Width = 975 + End + Begin VB.ComboBox cmbSelChange + Height = 315 + Left = 120 + Style = 2 'Dropdown List + TabIndex = 0 + Top = 120 + Width = 1455 + End + Begin MSComctlLib.Slider sLevel + Height = 315 + Left = 0 + TabIndex = 1 + Top = 480 + Width = 1695 + _ExtentX = 2990 + _ExtentY = 556 + _Version = 393216 + Max = 100 + TickStyle = 3 + End + Begin VB.Label lblLatency + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Height = 315 + Left = 1800 + TabIndex = 3 + Top = 320 + Width = 885 + End + Begin VB.Label lblLtc + Alignment = 2 'Center + AutoSize = -1 'True + Caption = "latency" + Height = 195 + Left = 1800 + TabIndex = 2 + Top = 40 + Width = 885 + End +End +Attribute VB_Name = "frmLiveFX" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'/////////////////////////////////////////////////////////////////////////////// +' frmLiveFX.frm - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other source: modLiveFX.bas +' +' BASS full-duplex recording test with effects +' Originally translated from - livefx.c - Example of Ian Luck +'/////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + Call MsgBox("Do not set the input to 'WAVE' / 'What you hear' (etc...) with" & vbCrLf & _ + "the level set high, as that is likely to result in nasty feedback.", vbExclamation, "Feedback warning") + + If (Not Initialize) Then Unload Me + tmrLiveFX.Enabled = True +End Sub + +Private Sub Form_Unload(Cancel As Integer) + tmrLiveFX.Enabled = False + ' release it all + Call BASS_RecordFree + Call BASS_Free + End +End Sub + +Private Sub chkChorus_Click() + If (fx(0)) Then + Call BASS_ChannelRemoveFX(chan, fx(0)) + fx(0) = 0 + Else + fx(0) = BASS_ChannelSetFX(chan, BASS_FX_DX8_CHORUS, 0) + End If +End Sub + +Private Sub chkGargle_Click() + If (fx(1)) Then + Call BASS_ChannelRemoveFX(chan, fx(1)) + fx(1) = 0 + Else + fx(1) = BASS_ChannelSetFX(chan, BASS_FX_DX8_GARGLE, 0) + End If +End Sub + +Private Sub chkReverb_Click() + If (fx(2)) Then + Call BASS_ChannelRemoveFX(chan, fx(2)) + fx(2) = 0 + Else + fx(2) = BASS_ChannelSetFX(chan, BASS_FX_DX8_REVERB, 0) + End If +End Sub + +Private Sub chkFlanger_Click() + If (fx(3)) Then + Call BASS_ChannelRemoveFX(chan, fx(3)) + fx(3) = 0 + Else + fx(3) = BASS_ChannelSetFX(chan, BASS_FX_DX8_FLANGER, 0) + End If +End Sub + +' input selection changed +Private Sub cmbSelChange_Click() + Dim i As Integer + Dim level As Single + + input_ = cmbSelChange.ListIndex ' get the selection + + For i = 0 To cmbSelChange.ListCount - 1 + Call BASS_RecordSetInput(i, BASS_INPUT_OFF, -1) ' 1st disable all inputs, then... + Next i + + Call BASS_RecordSetInput(input_, BASS_INPUT_ON, -1) ' enable the selected input + Call BASS_RecordGetInput(input_, level) ' get the level + sLevel.value = level * 100 +End Sub + +' set input source level +Private Sub sLevel_Scroll() + Dim level As Single + level = sLevel.value / 100 + If (BASS_RecordSetInput(input_, 0, level) = 0) Then ' failed to set input level + Call BASS_RecordSetInput(-1, 0, level) ' try master level instead + End If +End Sub + +Private Sub tmrLiveFX_Timer() + ' display current latency (input+output buffer level) + latency = (latency * 3 + BASS_ChannelGetData(chan, 0, BASS_DATA_AVAILABLE) _ + + BASS_ChannelGetData(rchan, 0, BASS_DATA_AVAILABLE)) / 4 + lblLatency.Caption = CInt(latency * 1000 / 176400) +End Sub diff --git a/bass-sys/bass24/vb/LiveFX/modLiveFX.bas b/bass-sys/bass24/vb/LiveFX/modLiveFX.bas new file mode 100644 index 0000000..e4b8a39 --- /dev/null +++ b/bass-sys/bass24/vb/LiveFX/modLiveFX.bas @@ -0,0 +1,92 @@ +Attribute VB_Name = "modLiveFX" +'/////////////////////////////////////////////////////////////////////////////// +' modLiveFX.bas - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other source: frmLiveFX.frm +' +' BASS full-duplex recording test with effects +' Originally translated from - livefx.c - Example of Ian Luck +'/////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Declare Sub FillMemory Lib "kernel32.dll" Alias "RtlFillMemory" (Destination As Any, ByVal length As Long, ByVal Fill As Byte) +Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long) + +Public rchan As Long ' recording channel +Public chan As Long ' playback stream +Public fx(4) As Long ' FX handles +Public chunk As Long ' recording chunk size +Public input_ As Long ' current input source +Public latency As Long ' current latency + +' Display error message +Public Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Public Function RecordingCallback(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long + Call BASS_StreamPutData(chan, ByVal buffer, length) ' feed recorded data to output stream + RecordingCallback = BASSTRUE ' continue recording +End Function + +Static Function Initialize() As Boolean + Dim bi As BASS_INFO + + ' initialize output, get latency + If (BASS_Init(-1, 44100, BASS_DEVICE_LATENCY, frmLiveFX.hWnd, 0) = 0) Then + Call Error_("Can't initialize output") + Initialize = False + Exit Function + End If + + Call BASS_GetInfo(bi) + If (bi.dsver < 8) Then ' no DX8, so disable effect buttons + With frmLiveFX + .chkChorus.Enabled = False + .chkFlanger.Enabled = False + .chkGargle.Enabled = False + .chkReverb.Enabled = False + End With + End If + + ' create a stream to play the recording + chan = BASS_StreamCreate(44100, 2, 0, STREAMPROC_PUSH, 0) + + ' start recording with 10ms period + Dim rinit As Long + rinit = BASS_RecordInit(-1) + rchan = BASS_RecordStart(44100, 2, MakeLong(0, 10), AddressOf RecordingCallback, 0) + If (rinit = 0 Or rchan = 0) Then + Call BASS_RecordFree + Call BASS_Free + Call Error_("Can't initialize recording") + Initialize = False + Exit Function + End If + + ' get list of inputs + Dim c As Integer + Dim level As Single + While BASS_RecordGetInputName(c) <> 0 + frmLiveFX.cmbSelChange.AddItem VBStrFromAnsiPtr(BASS_RecordGetInputName(c)) + If (BASS_RecordGetInput(c, level) And BASS_INPUT_OFF) = 0 Then + frmLiveFX.cmbSelChange.ListIndex = c ' this 1 is currently "on" + input_ = c + frmLiveFX.sLevel.SelStart = level * 100 ' set level slider + End If + c = c + 1 + Wend + + ' prebuffer at least "minbuf" amount of data before starting playback + Dim prebuf As Long + prebuf = BASS_ChannelSeconds2Bytes(chan, CSng(bi.minbuf) / 1000) + While BASS_ChannelGetData(chan, 0, BASS_DATA_AVAILABLE) < prebuf + Call Sleep(1) + Wend + Call BASS_ChannelPlay(chan, BASSFALSE) + + Initialize = True +End Function diff --git a/bass-sys/bass24/vb/LiveFX/prjLiveFX.vbp b/bass-sys/bass24/vb/LiveFX/prjLiveFX.vbp new file mode 100644 index 0000000..b2670a6 --- /dev/null +++ b/bass-sys/bass24/vb/LiveFX/prjLiveFX.vbp @@ -0,0 +1,40 @@ +Type=Exe +Module=modBass; ..\Bass.bas +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Form=frmLiveFX.frm +Module=modLiveFX; modLiveFX.bas +Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX +IconForm="frmLiveFX" +Startup="frmLiveFX" +HelpFile="" +Title="prjLiveFX" +ExeName32="prjLiveFX.exe" +Command32="" +Name="prjLiveFX" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/LiveSpec/frmLiveSpec.frm b/bass-sys/bass24/vb/LiveSpec/frmLiveSpec.frm new file mode 100644 index 0000000..c716be9 --- /dev/null +++ b/bass-sys/bass24/vb/LiveSpec/frmLiveSpec.frm @@ -0,0 +1,127 @@ +VERSION 5.00 +Begin VB.Form frmLiveSpec + BorderStyle = 3 'Fixed Dialog + Caption = "BASS ""live"" spectrum (click to toggle mode)" + ClientHeight = 1905 + ClientLeft = 45 + ClientTop = 330 + ClientWidth = 5520 + BeginProperty Font + Name = "Arial" + Size = 9.75 + Charset = 177 + Weight = 700 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 127 + ScaleMode = 3 'Pixel + ScaleWidth = 368 + StartUpPosition = 2 'CenterScreen + Begin VB.Timer tmrLiveSpec + Enabled = 0 'False + Interval = 25 + Left = 5040 + Top = 1440 + End +End +Attribute VB_Name = "frmLiveSpec" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'///////////////////////////////////////////////////////////////////////////////// +' frmLiveSpec.frm - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' Other source: modLiveSpec.bas +' +' BASS "Live" spectrum analyser example +' Originally translated from - livespec.c - Example of Ian Luck +'///////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +' display error messages +Public Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' initialize BASS recording (default device) + If (BASS_RecordInit(-1) = 0) Then + Call Error_("Can't initialize device") + End + End If + + ' start recording (44100hz mono 16-bit) + chan = BASS_RecordStart(44100, 1, 0, AddressOf DuffRecording, 0) + If chan = 0 Then + Call Error_("Can't start recording") + End + End If + + specpos = 0 + specmode = 0 + + ' create bitmap to draw spectrum in - 8 bit for easy updating :) + With bh.bmiHeader + .biSize = Len(bh.bmiHeader) + .biWidth = SPECWIDTH + .biHeight = SPECHEIGHT ' upside down (line 0=bottom) + .biPlanes = 1 + .biBitCount = 8 + .biClrUsed = 256 + .biClrImportant = 256 + End With + + Dim a As Byte + + ' setup palette + For a = 1 To 127 + bh.bmiColors(a).rgbGreen = 256 - 2 * a + bh.bmiColors(a).rgbRed = 2 * a + Next a + For a = 0 To 31 + bh.bmiColors(128 + a).rgbBlue = 8 * a + bh.bmiColors(128 + 32 + a).rgbBlue = 255 + bh.bmiColors(128 + 32 + a).rgbRed = 8 * a + bh.bmiColors(128 + 64 + a).rgbRed = 255 + bh.bmiColors(128 + 64 + a).rgbBlue = 8 * (31 - a) + bh.bmiColors(128 + 64 + a).rgbGreen = 8 * a + bh.bmiColors(128 + 96 + a).rgbRed = 255 + bh.bmiColors(128 + 96 + a).rgbGreen = 255 + bh.bmiColors(128 + 96 + a).rgbBlue = 8 * a + Next a + + ' update timer 25ms (40hz) + tmrLiveSpec.Enabled = True +End Sub + +Private Sub Form_Unload(Cancel As Integer) + tmrLiveSpec.Enabled = False + Call BASS_RecordFree +End Sub + +Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) + specmode = (specmode + 1) Mod 4 ' swap spectrum mode + ReDim specbuf(SPECWIDTH * (SPECHEIGHT + 1)) As Byte ' clear display +End Sub + +Private Sub tmrLiveSpec_Timer() + Call UpdateSpectrum +End Sub diff --git a/bass-sys/bass24/vb/LiveSpec/modLiveSpec.bas b/bass-sys/bass24/vb/LiveSpec/modLiveSpec.bas new file mode 100644 index 0000000..37b76ad --- /dev/null +++ b/bass-sys/bass24/vb/LiveSpec/modLiveSpec.bas @@ -0,0 +1,177 @@ +Attribute VB_Name = "modLiveSpec" +'///////////////////////////////////////////////////////////////////////////////// +' modLiveSpec.bas - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' Other source: frmLiveSpec.frm +' +' BASS "Live" spectrum analyser example +' Originally translated from - livespec.c - Example of Ian Luck +'///////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Public Const BI_RGB = 0& +Public Const DIB_RGB_COLORS = 0& 'color table in RGBs + +Public Type BITMAPINFOHEADER + biSize As Long + biWidth As Long + biHeight As Long + biPlanes As Integer + biBitCount As Integer + biCompression As Long + biSizeImage As Long + biXPelsPerMeter As Long + biYPelsPerMeter As Long + biClrUsed As Long + biClrImportant As Long +End Type + +Public Type RGBQUAD + rgbBlue As Byte + rgbGreen As Byte + rgbRed As Byte + rgbReserved As Byte +End Type + +Public Type BITMAPINFO + bmiHeader As BITMAPINFOHEADER + bmiColors(255) As RGBQUAD +End Type + +Declare Sub FillMemory Lib "kernel32.dll" Alias "RtlFillMemory" (Destination As Any, ByVal length As Long, ByVal Fill As Byte) +Public Declare Function SetDIBitsToDevice Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, Bits As Any, BitsInfo As BITMAPINFO, ByVal wUsage As Long) As Long + +Public Const SPECWIDTH As Long = 368 ' display width +Public Const SPECHEIGHT As Long = 127 ' height (changing requires palette adjustments too) +Public specmode As Integer, specpos As Integer ' spectrum mode (and marker pos for 2nd mode) +Public specbuf() As Byte ' a pointer + +Public chan As Long ' recording channel + +Public bh As BITMAPINFO ' bitmap header + +' MATH Functions +Public Function Sqrt(ByVal num As Double) As Double + Sqrt = num ^ 0.5 +End Function + +Function Log10(ByVal X As Double) As Double + Log10 = Log(X) / Log(10#) +End Function + +' update the spectrum display - the interesting bit :) +Public Sub UpdateSpectrum() + Static quietcount As Integer + Dim X As Long, Y As Long, Y1 As Long + + If (specmode = 3) Then ' waveform + Dim buf(SPECWIDTH) As Integer + ReDim specbuf(CLng(SPECWIDTH) * (SPECHEIGHT + 1)) As Byte ' clear display + + Call BASS_ChannelGetData(chan, buf(0), SPECWIDTH * LenB(buf(0))) ' get the sample data + For X = 0 To SPECWIDTH - 1 + Dim v As Long + v = (32767 - CLng(buf(X))) * SPECHEIGHT / 65536 ' invert and scale to fit display + If (X = 0) Then Y = v + Do ' draw line from previous sample... + If (Y < v) Then + Y = Y + 1 + ElseIf (Y > v) Then + Y = Y - 1 + End If + specbuf(Y * SPECWIDTH + X) = Abs(Y - SPECHEIGHT / 2) * 2 + 1 + Loop While (Y <> v) + Next X + Else + Dim fft(1024) As Single ' get the FFT data + Call BASS_ChannelGetData(chan, fft(0), BASS_DATA_FFT2048) + + If (specmode = 0) Then ' "normal" FFT + ReDim specbuf(SPECWIDTH * (SPECHEIGHT + 1)) As Byte ' clear display + For X = 0 To (SPECWIDTH / 2) - 1 +#If 1 Then + Y = Sqrt(fft(X + 1)) * 3 * SPECHEIGHT - 4 ' scale it (sqrt to make low values more visible) +#Else + Y = fft(X + 1) * 10 * SPECHEIGHT ' scale it (linearly) +#End If + If (Y > SPECHEIGHT) Then Y = SPECHEIGHT 'cap it + If (X) Then ' interpolate from previous to make the display smoother + Y1 = (Y + Y1) / 2 + Y1 = Y1 - 1 + While (Y1 >= 0) + specbuf(Y1 * SPECWIDTH + X * 2 - 1) = Y1 + 1 + Y1 = Y1 - 1 + Wend + End If + Y1 = Y + Y = Y - 1 + While (Y >= 0) + specbuf(Y * SPECWIDTH + X * 2) = Y + 1 ' draw level + Y = Y - 1 + Wend + Next X + ElseIf (specmode = 1) Then ' logarithmic, acumulate & average bins + ReDim specbuf(SPECWIDTH * (SPECHEIGHT + 1)) As Byte ' clear display + Dim b0 As Long, BANDS As Integer + b0 = 0 + BANDS = 28 + Dim sc As Long, b1 As Long + Dim sum As Single + For X = 0 To BANDS - 1 + sum = 0 + b1 = 2 ^ (X * 10# / (BANDS - 1)) + If (b1 > 1023) Then b1 = 1023 + If (b1 <= b0) Then b1 = b0 + 1 ' make sure it uses at least 1 FFT bin + sc = 10 + b1 - b0 + Do + sum = sum + fft(1 + b0) + b0 = b0 + 1 + Loop While b0 < b1 + Y = (Sqrt(sum / Log10(sc)) * 1.7 * SPECHEIGHT) - 4 ' scale it + If (Y > SPECHEIGHT) Then Y = SPECHEIGHT ' cap it + Y = Y - 1 + While (Y >= 0) + Call FillMemory(specbuf(Y * SPECWIDTH + X * Int(SPECWIDTH / BANDS)), SPECWIDTH / BANDS - 2, Y + 1) + Y = Y - 1 + Wend + Next X + Else ' "3D" + For X = 0 To SPECHEIGHT - 1 + Y = Sqrt(fft(X + 1)) * 3 * 127 ' scale it (sqrt to make low values more visible) + If (Y > 127) Then Y = 127 ' cap it + specbuf(X * SPECWIDTH + specpos) = 128 + Y ' plot level + Next X + ' move marker onto next position + specpos = (specpos + 1) Mod SPECWIDTH + For X = 0 To SPECHEIGHT - 1 + specbuf(X * SPECWIDTH + specpos) = 255 + Next X + End If + End If + + ' update the display + ' to display in a PictureBox, simply change the .hDC to Picture1.hDC :) + Call SetDIBitsToDevice(frmLiveSpec.hdc, 0, 0, SPECWIDTH, SPECHEIGHT, 0, 0, 0, SPECHEIGHT, specbuf(0), bh, 0) + If (LoWord(BASS_ChannelGetLevel(chan)) < 500) Then ' check if it's quiet + quietcount = quietcount + 1 + If (quietcount > 40 And (quietcount And 16)) Then ' it's been quiet for over a second + Dim sNoise As String + sNoise = "make some noise!" + With frmLiveSpec + .ForeColor = &HFFFFFF + .CurrentX = (SPECWIDTH - .TextWidth(sNoise)) / 2 + .CurrentY = (SPECHEIGHT - .TextHeight(sNoise)) / 2 + frmLiveSpec.Print sNoise + End With + End If + Else + quietcount = 0 ' not quiet + End If +End Sub + +' Recording callback - not doing anything with the data +Public Function DuffRecording(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Integer + DuffRecording = BASSTRUE 'continue recording +End Function diff --git a/bass-sys/bass24/vb/LiveSpec/prjLiveSpec.vbp b/bass-sys/bass24/vb/LiveSpec/prjLiveSpec.vbp new file mode 100644 index 0000000..16680c3 --- /dev/null +++ b/bass-sys/bass24/vb/LiveSpec/prjLiveSpec.vbp @@ -0,0 +1,39 @@ +Type=Exe +Form=frmLiveSpec.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Module=modBass; ..\Bass.bas +Module=modLiveSpec; modLiveSpec.bas +IconForm="frmLiveSpec" +Startup="frmLiveSpec" +HelpFile="" +Title="prjLiveSpec" +ExeName32="prjLiveSpec.exe" +Command32="" +Name="prjLiveSpec" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/Memory/SYNCtest.bas b/bass-sys/bass24/vb/Memory/SYNCtest.bas new file mode 100644 index 0000000..7b85027 --- /dev/null +++ b/bass-sys/bass24/vb/Memory/SYNCtest.bas @@ -0,0 +1,89 @@ +Attribute VB_Name = "SYNCtest" +'////////////////////////////////////////////////////////////////////////////// +' SYNCtest.bas - Copyright (c) 2001-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other sources: frmMemory.frm & CBASS_TIME.cls +' +' * Updates: +' . Now uses only VB functions without any Memory APIs +' . Threading +' +' SYNC callback example... +'////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Public Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long + +' THREADING +Public cthread As Long +Public Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, ByVal lpParameter As Long, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long +Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long + +Public chan As Long ' stream or music handle +Public SyncEnd As Long ' sync at end handle + +Public DataStore() As Byte ' data array +Public bassTime As cbass_time ' Class module Handle + +' display error messages +Public Sub Error_(ByVal es As String) + Call MessageBox(frmMemory.hwnd, es & vbCrLf & "(error code: " & BASS_ErrorGetCode() & ")", "Error", vbExclamation) +End Sub + +Public Sub MemoryFileThread(ByVal DataLength As Long) + If (DataLength) Then + ' free old stream (if any) and create new one + Call BASS_StreamFree(chan) + Call BASS_MusicFree(chan) + + ' reallocate data array + ReDim DataStore(DataLength) As Byte + + ' insert all the file data into a byte array + Get 100, 1, DataStore + + ' close file handle + Close #100 + + ' read data from memory location (our data array) + chan = BASS_StreamCreateFile(BASSTRUE, VarPtr(DataStore(0)), 0, DataLength, BASS_SAMPLE_LOOP) + If (chan = 0) Then chan = BASS_MusicLoad(BASSTRUE, VarPtr(DataStore(0)), 0, DataLength, BASS_MUSIC_LOOP Or BASS_MUSIC_RAMP Or BASS_MUSIC_PRESCAN, 1) + + If (chan = 0) Then + ' free stream and music (if any) + Call BASS_StreamFree(chan) + Call BASS_MusicFree(chan) + + ' free memory + Erase DataStore() + + Call Error_("Couldn't Get Data from Memory") + frmMemory.cmdOpenPlay.Caption = "Click here to open a file && play it" + Else + Call frmMemory.chkSYNC_Click + + frmMemory.cmdOpenPlay.Caption = "Playing... click to choose another file" + + Call BASS_ChannelPlay(chan, BASSFALSE) + frmMemory.tmrBASS.Enabled = True + + With bassTime + frmMemory.lblDur.Caption = "Total duration: " & Format(.GetDuration(chan), "0.0") & " seconds / " & .GetTime(.GetDuration(chan)) + frmMemory.lblFreq.Caption = "Frequency: " & .GetFrequency(chan) & " Hz, " & .GetBits(chan) & " bits, " & .GetMode(chan) + frmMemory.lblBPS.Caption = "Bytes/s: " & .GetBytesPerSecond(chan) + frmMemory.lblBitsPS.Caption = "Kbp/s: " & .GetBitsPerSecond(chan, DataLength) & " [average kbp/s for vbr mp3s]" + End With + End If + End If + + ' close thread + Call CloseHandle(cthread) + cthread = 0 +End Sub + +Public Sub SyncEndTest(ByVal handle As Long, ByVal channel As Long, ByVal data As Long, ByVal user As Long) + Call MessageBox(frmMemory.hwnd, "End...", "SYNCtest", vbInformation) +End Sub diff --git a/bass-sys/bass24/vb/Memory/cbass_time.cls b/bass-sys/bass24/vb/Memory/cbass_time.cls new file mode 100644 index 0000000..9707835 --- /dev/null +++ b/bass-sys/bass24/vb/Memory/cbass_time.cls @@ -0,0 +1,107 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True + Persistable = 0 'NotPersistable + DataBindingBehavior = 0 'vbNone + DataSourceBehavior = 0 'vbNone + MTSTransactionMode = 0 'NotAnMTSObject +END +Attribute VB_Name = "cbass_time" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = True +Attribute VB_PredeclaredId = False +Attribute VB_Exposed = False +'//////////////////////////////////////////////////////////////////////////////// +' cbass_time.cls - Copyright (c) 2001-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other sources: frmMemory.frm & SYNCtest.bas +' +' This VB class module, shows how to get: +' * Total playing time, in seconds, of any stream/music +' * Playing position in seconds +' * A function that will convert total seconds into: +' Hours:Minutes:Seconds [01:25:50] +' * and much more... :) +' +' * Some functions are based on Ian Lucks 'C' examples! +'//////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Dim info As BASS_CHANNELINFO + +' Returns - Total duration from seconds as Time format: HH:MM:SS +Public Function GetTime(ByVal seconds As Long) As String + Dim hour As Single, min As Single, sec As Single + + hour = seconds / 60 / 60 + sec = seconds Mod 60 + min = (hour - Int(hour)) * 60 + + GetTime = Format(Int(hour), "00") & ":" & Format(Int(min), "00") & ":" & Format(Int(sec), "00") +End Function + +' Returns - Playing position in seconds +Public Function GetPlayingPos(ByVal handle As Long) As Single + GetPlayingPos = BASS_ChannelBytes2Seconds(handle, BASS_ChannelGetPosition(handle, BASS_POS_BYTE)) +End Function + +' Returns - Total duration in seconds +Public Function GetDuration(ByVal handle As Long) As Single + GetDuration = BASS_ChannelBytes2Seconds(handle, BASS_ChannelGetLength(handle, BASS_POS_BYTE)) +End Function + +' Returns - Bytes Per Second +Public Function GetBytesPerSecond(ByVal handle As Long) As Long + Dim bps As Long + + Call BASS_ChannelGetInfo(handle, info) ' stereo/mono, 8/16 bit flags + + bps = info.freq * info.chans + If (info.flags And BASS_SAMPLE_8BITS) = 0 Then bps = bps * 2 + + GetBytesPerSecond = bps +End Function + +' Returns - Kilo Bits Per Second +Public Function GetBitsPerSecond(ByVal handle As Long, ByVal FileLength As Long) As Long + GetBitsPerSecond = CInt(((FileLength * 8) / GetDuration(handle)) / 1000) +End Function + +' Returns - 'Stereo'/'Mono' or 'MultiChannel' +Public Function GetMode(ByVal handle As Long) As String + Call BASS_ChannelGetInfo(handle, info) + Select Case info.chans + Case 1: GetMode = "Mono" + Case 2: GetMode = "Stereo" + Case Else: GetMode = info.chans & " MultiChannel" + End Select +End Function + +' Returns - 8/16/32-float bits +Public Function GetBits(ByVal handle As Long) As Byte + Call BASS_ChannelGetInfo(handle, info) + If (info.flags And BASS_SAMPLE_8BITS) Then + GetBits = 8 + ElseIf (info.flags And BASS_SAMPLE_FLOAT) Then + GetBits = 32 + Else + GetBits = 16 + End If +End Function + +' Returns - Sample Rate [Frequency] +Public Function GetFrequency(ByVal handle As Long) As Long + Dim freq As Single + Call BASS_ChannelGetAttribute(handle, BASS_ATTRIB_FREQ, freq) + GetFrequency = freq +End Function + +' Returns - DirectX version +Public Function GetDXver() As Byte + Dim bi As BASS_INFO + Call BASS_GetInfo(bi) + GetDXver = bi.dsver +End Function diff --git a/bass-sys/bass24/vb/Memory/frmMemory.frm b/bass-sys/bass24/vb/Memory/frmMemory.frm new file mode 100644 index 0000000..b18b4da --- /dev/null +++ b/bass-sys/bass24/vb/Memory/frmMemory.frm @@ -0,0 +1,291 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Begin VB.Form frmMemory + BorderStyle = 3 'Fixed Dialog + Caption = "(: JOBnik! :) - Playing from Memory" + ClientHeight = 3300 + ClientLeft = 45 + ClientTop = 360 + ClientWidth = 4215 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 3300 + ScaleWidth = 4215 + StartUpPosition = 2 'CenterScreen + Begin VB.CheckBox chkSYNC + Caption = "SYNC @ END {will show an API MessageBox}" + Height = 255 + Left = 120 + TabIndex = 6 + Top = 3000 + Width = 3975 + End + Begin VB.Frame Frame1 + Height = 3015 + Left = 0 + TabIndex = 0 + Top = -80 + Width = 4215 + Begin VB.CommandButton cmdOpenPlay + Caption = "Click here to open a file && play it" + Height = 495 + Left = 120 + TabIndex = 1 + Top = 1440 + Width = 3975 + End + Begin VB.Timer tmrBASS + Enabled = 0 'False + Interval = 100 + Left = 2880 + Top = 840 + End + Begin MSComDlg.CommonDialog cmd + Left = 3480 + Top = 840 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.Label lblBitsPS + AutoSize = -1 'True + Caption = "Kbp/s:" + Height = 195 + Left = 120 + TabIndex = 10 + Top = 2760 + Width = 480 + End + Begin VB.Label lblBPS + AutoSize = -1 'True + Caption = "Bytes/s:" + Height = 195 + Left = 120 + TabIndex = 9 + Top = 2520 + Width = 585 + End + Begin VB.Label lblFreq + AutoSize = -1 'True + Caption = "Frequency:" + Height = 195 + Left = 120 + TabIndex = 8 + Top = 2280 + Width = 795 + End + Begin VB.Label lblDXVer + AutoSize = -1 'True + Caption = "DX Version:" + Height = 195 + Left = 120 + TabIndex = 7 + Top = 2040 + Width = 840 + End + Begin VB.Label lblFilePath + AutoSize = -1 'True + Caption = "File:" + Height = 195 + Left = 120 + TabIndex = 5 + Top = 240 + Width = 285 + End + Begin VB.Label lblDur + AutoSize = -1 'True + Caption = "Total duration: 0.0 seconds / 00:00:00" + Height = 195 + Left = 120 + TabIndex = 4 + Top = 600 + Width = 2730 + End + Begin VB.Label lblPos + AutoSize = -1 'True + Caption = "Playing position: 0.0 seconds" + Height = 195 + Left = 120 + TabIndex = 3 + Top = 840 + Width = 2055 + End + Begin VB.Label lblMins + AutoSize = -1 'True + Caption = "Time: 00:00:00" + Height = 195 + Left = 120 + TabIndex = 2 + Top = 1080 + Width = 1065 + End + End +End +Attribute VB_Name = "frmMemory" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'/////////////////////////////////////////////////////////////////////////////// +' frmMemory.frm - Copyright (c) 2001-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other sources: CBASS_TIME.cls & SYNCtest.bas +' +' (: JOBnik! :) - Playing from Memory +' * Updates: +' . Now uses only VB functions without any Memory APIs +' . Threading +' * Based on 'C' example by Ian Luck +'/////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long + +Private Sub Form_Initialize() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' Start digital output + If (BASS_Init(-1, 44100, 0, Me.hwnd, 0) = 0) Then + Call Error_("Couldn't Initialize Digital Output") + End + End If + + Set bassTime = New cbass_time + lblDXVer.Caption = "DX Version: " & bassTime.GetDXver + + cthread = 0 +End Sub + +' this function will check if you're running in IDE or EXE modes +' VB will crash if you're closing the app while (cthread<>0) in IDE, +' but won't crash if in EXE mode +Public Function isIDEmode() As Boolean + Dim sFileName As String, lCount As Long + + sFileName = String(255, 0) + lCount = GetModuleFileName(App.hInstance, sFileName, 255) + sFileName = UCase(GetFileName(Mid(sFileName, 1, lCount))) + + isIDEmode = (sFileName = "VB6.EXE") +End Function + +Private Sub Form_Unload(Cancel As Integer) + If (isIDEmode And cthread) Then + ' IDE Version + Cancel = True ' disable closing app to avoid crash + Else + ' Compiled Version or (cthread = 0) close app is available + ' free it all + Call BASS_Free + Erase DataStore() + Set bassTime = Nothing + End + End If +End Sub + +Private Sub cmdOpenPlay_Click() + Dim DataLength As Long + + On Local Error Resume Next ' if Cancel was pressed + + If (cthread) Then ' already creating + Call Beep + Else + cmd.filename = "" + cmd.CancelError = True + cmd.flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + cmd.Filter = "playable files|*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.mp1;*.mp2;*.mp3;*.wav;*.ogg;*.aif|All files|*.*" + cmd.ShowOpen + + ' if cancel was pressed, exit sub + If Err.Number = 32755 Then Exit Sub + + tmrBASS.Enabled = False + + lblFilePath.Caption = "File: " & GetFileName(cmd.filename) + cmdOpenPlay.Caption = "Loading file..." + + ' make a new thread, copy file into memory and play it :) + Dim threadid As Long + + ' open file for reading + Open cmd.filename For Binary As #100 + DataLength = FileLen(cmd.filename) + + ' free old stream (if any) and create new one + Call BASS_StreamFree(chan) + Call BASS_MusicFree(chan) + + ' reallocate data array + ReDim DataStore(DataLength) As Byte + + ' insert all the file data into a byte array + Get 100, 1, DataStore + + ' close file handle + Close #100 + + ' read data from memory location (our data array) + chan = BASS_StreamCreateFile(BASSTRUE, VarPtr(DataStore(0)), 0, DataLength, BASS_SAMPLE_LOOP) + If (chan = 0) Then chan = BASS_MusicLoad(BASSTRUE, VarPtr(DataStore(0)), 0, DataLength, BASS_MUSIC_LOOP Or BASS_MUSIC_RAMP Or BASS_MUSIC_PRESCAN, 1) + + If (chan = 0) Then + ' free memory + Erase DataStore() + + Call Error_("Couldn't Play File") + frmMemory.cmdOpenPlay.Caption = "Click here to open a file && play it" + Else + Call frmMemory.chkSYNC_Click + + frmMemory.cmdOpenPlay.Caption = "Playing... click to choose another file" + + Call BASS_ChannelPlay(chan, BASSFALSE) + frmMemory.tmrBASS.Enabled = True + + With bassTime + frmMemory.lblDur.Caption = "Total duration: " & Format(.GetDuration(chan), "0.0") & " seconds / " & .GetTime(.GetDuration(chan)) + frmMemory.lblFreq.Caption = "Frequency: " & .GetFrequency(chan) & " Hz, " & .GetBits(chan) & " bits, " & .GetMode(chan) + frmMemory.lblBPS.Caption = "Bytes/s: " & .GetBytesPerSecond(chan) + frmMemory.lblBitsPS.Caption = "Kbp/s: " & .GetBitsPerSecond(chan, DataLength) & " [average kbp/s for vbr mp3s]" + End With + End If + + End If +End Sub + +Public Sub chkSYNC_Click() + If chkSYNC.value = vbChecked Then + SyncEnd = BASS_ChannelSetSync(chan, BASS_SYNC_END, 0, AddressOf SYNCtest.SyncEndTest, 0) + Else + Call BASS_ChannelRemoveSync(chan, SyncEnd) + End If +End Sub + +Private Sub tmrBASS_Timer() + With bassTime + lblPos.Caption = "Playing position: " & Format(.GetPlayingPos(chan), "0.0") & " seconds" + lblMins.Caption = "Time: " & .GetTime(.GetDuration(chan) - .GetPlayingPos(chan)) + End With +End Sub + +'-------------------- +' useful function :) +'-------------------- + +' get file name from file path +Public Function GetFileName(ByVal fp As String) As String + GetFileName = Mid(fp, InStrRev(fp, "\") + 1) +End Function diff --git a/bass-sys/bass24/vb/Memory/prjMemory.vbp b/bass-sys/bass24/vb/Memory/prjMemory.vbp new file mode 100644 index 0000000..f53288b --- /dev/null +++ b/bass-sys/bass24/vb/Memory/prjMemory.vbp @@ -0,0 +1,43 @@ +Type=Exe +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Form=frmMemory.frm +Module=modBass; ..\Bass.bas +Module=SYNCtest; SYNCtest.bas +Class=cbass_time; cbass_time.cls +IconForm="frmMemory" +Startup="frmMemory" +HelpFile="" +Title="prjMemory" +ExeName32="prjMemory.exe" +Command32="" +Name="prjMemory" +HelpContextID="0" +Description="Plays Media File From Memory Using Bass.Dll" +CompatibleMode="0" +MajorVer=2 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionComments="Play audio file from memory using BASS.DLL" +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/Multi/frmDevice.frm b/bass-sys/bass24/vb/Multi/frmDevice.frm new file mode 100644 index 0000000..356fd65 --- /dev/null +++ b/bass-sys/bass24/vb/Multi/frmDevice.frm @@ -0,0 +1,78 @@ +VERSION 5.00 +Begin VB.Form frmDevice + BorderStyle = 1 'Fixed Single + Caption = " " + ClientHeight = 1500 + ClientLeft = 5160 + ClientTop = 4530 + ClientWidth = 3855 + ControlBox = 0 'False + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 1500 + ScaleWidth = 3855 + Begin VB.CommandButton btnOK + Caption = "OK" + Default = -1 'True + Height = 300 + Left = 2280 + TabIndex = 1 + Top = 1080 + Width = 1335 + End + Begin VB.ListBox lstDevices + Height = 840 + Left = 120 + TabIndex = 0 + Top = 120 + Width = 3615 + End +End +Attribute VB_Name = "frmDevice" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'/////////////////////////////////////////////////////////////////////////////// +' frmDevice.frm - Copyright (c) 2003-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' Other sources: frmMulti.frm and modMulti.bas +' +' BASS output device selector +' Originally translated from - multi.c - example of Ian Luck +'/////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Public device As Long ' selected device + +Public Sub SelectDevice(ByVal dev As Long) + Dim c As Integer + Dim i As BASS_DEVICEINFO + + c = 1 ' device 1 = 1st real device + Me.Caption = "Select output device #" & dev + While BASS_GetDeviceInfo(c, i) + If (i.flags And BASS_DEVICE_ENABLED) Then ' enabled, so add it... + lstDevices.AddItem VBStrFromAnsiPtr(i.name) + lstDevices.ItemData(lstDevices.NewIndex) = c 'store device # + End If + c = c + 1 + Wend + + If (lstDevices.ListCount) Then lstDevices.Selected(0) = True +End Sub + +Private Sub btnOK_Click() + Unload Me +End Sub + +Private Sub lstDevices_DblClick() + Call btnOK_Click +End Sub + +Private Sub Form_Unload(Cancel As Integer) + device = lstDevices.ItemData(lstDevices.ListIndex) 'get device # +End Sub diff --git a/bass-sys/bass24/vb/Multi/frmMulti.frm b/bass-sys/bass24/vb/Multi/frmMulti.frm new file mode 100644 index 0000000..f18033e --- /dev/null +++ b/bass-sys/bass24/vb/Multi/frmMulti.frm @@ -0,0 +1,244 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Begin VB.Form frmMulti + BorderStyle = 3 'Fixed Dialog + Caption = "BASS multiple output example" + ClientHeight = 1635 + ClientLeft = 45 + ClientTop = 435 + ClientWidth = 6030 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 1635 + ScaleWidth = 6030 + StartUpPosition = 2 'CenterScreen + Begin VB.CommandButton cmdSwap + Caption = "swap" + Height = 375 + Left = 5040 + TabIndex = 4 + Top = 660 + Width = 615 + End + Begin VB.Frame frameMulti + Caption = " device 1 " + Height = 735 + Index = 0 + Left = 120 + TabIndex = 0 + Top = 0 + Width = 5775 + Begin VB.CommandButton cmdClone + Caption = "clone #2" + Height = 375 + Index = 0 + Left = 4200 + TabIndex = 5 + Top = 240 + Width = 975 + End + Begin VB.CommandButton cmdOpen + Caption = "click here to open a file..." + Height = 375 + Index = 0 + Left = 120 + TabIndex = 1 + Top = 240 + Width = 3975 + End + End + Begin MSComDlg.CommonDialog cmd + Left = 3720 + Top = 960 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.Frame frameMulti + Caption = " device 2 " + Height = 735 + Index = 1 + Left = 120 + TabIndex = 2 + Top = 840 + Width = 5775 + Begin VB.CommandButton cmdClone + Caption = "clone #1" + Height = 375 + Index = 1 + Left = 4200 + TabIndex = 6 + Top = 240 + Width = 975 + End + Begin VB.CommandButton cmdOpen + Caption = "click here to open a file..." + Height = 375 + Index = 1 + Left = 120 + TabIndex = 3 + Top = 240 + Width = 3975 + End + End +End +Attribute VB_Name = "frmMulti" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'////////////////////////////////////////////////////////////////////////////// +' frmMulti.frm - Copyright (c) 2003-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' Other sources: frmDevice.frm and modMulti.bas +' +' BASS Multiple output example +' Originally translated from - multi.c - Example of Ian Luck +'////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Dim outdev(2) As Long ' output devices +Dim chan(2) As Long ' the streams + +' display error messages +Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & vbCrLf & "Error Code : " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' Let the user choose the output devices + With frmDevice + .SelectDevice 1 + .Show vbModal, Me + outdev(0) = .device + .SelectDevice 2 + .Show vbModal, Me + outdev(1) = .device + End With + + ' setup output devices + If (BASS_Init(outdev(0), 44100, 0, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize device 1") + Unload Me + End If + + If (BASS_Init(outdev(1), 44100, 0, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize device 2") + Unload Me + End If + + Dim i As BASS_DEVICEINFO + + Call BASS_GetDeviceInfo(outdev(0), i) + frameMulti(0).Caption = " " & VBStrFromAnsiPtr(i.name) & " " + + Call BASS_GetDeviceInfo(outdev(1), i) + frameMulti(1).Caption = " " & VBStrFromAnsiPtr(i.name) & " " +End Sub + +Private Sub Form_Unload(Cancel As Integer) + ' release both devices + Call BASS_SetDevice(outdev(0)) + Call BASS_Free + Call BASS_SetDevice(outdev(1)) + Call BASS_Free + End +End Sub + +Private Sub cmdOpen_Click(index As Integer) + On Local Error Resume Next ' if Cancel pressed... + + ' open a file to play on selected device + cmd.CancelError = True + cmd.flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + cmd.DialogTitle = "Open" + cmd.Filter = "streamable files|*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif|All files|*.*" + cmd.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + Call BASS_StreamFree(chan(index)) + Call BASS_SetDevice(outdev(index)) ' set the device to create stream on + + chan(index) = BASS_StreamCreateFile(BASSFALSE, StrPtr(cmd.filename), 0, 0, BASS_SAMPLE_LOOP) + + If (chan(index) = 0) Then + cmdOpen(index).Caption = "click here to open a file..." + Call Error_("Can't play the file") + Exit Sub + End If + + Call BASS_ChannelPlay(chan(index), BASSFALSE) ' play new stream + cmdOpen(index).Caption = cmd.filename +End Sub + +' swap channel devices +Private Sub cmdSwap_Click() + ' swap handles + Dim temp As Long + temp = chan(0) + chan(0) = chan(1) + chan(1) = temp + + ' swap text + Dim temp2 As String + temp2 = cmdOpen(0).Caption + cmdOpen(0).Caption = cmdOpen(1).Caption + cmdOpen(1).Caption = temp2 + + ' update the channel devices + Call BASS_ChannelSetDevice(chan(0), outdev(0)) + Call BASS_ChannelSetDevice(chan(1), outdev(1)) +End Sub + +' clone on device #1 / #2 +Private Sub cmdClone_Click(index As Integer) + Dim devn As Integer + devn = index + + Dim i As BASS_CHANNELINFO + If (BASS_ChannelGetInfo(chan(devn Xor 1), i) = 0) Then + Call Error_("Nothing to clone") + Exit Sub + End If + + Call BASS_StreamFree(chan(devn)) ' free old stream + Call BASS_SetDevice(outdev(devn)) ' set the device to create stream on + + chan(devn) = BASS_StreamCreate(i.freq, i.chans, i.flags, STREAMPROC_PUSH, 0) + + If (chan(devn) = 0) Then ' create a "push" stream + cmdOpen(devn).Caption = "click here to open a file..." + Call Error_("Can't create clone") + Exit Sub + End If + + Call BASS_ChannelLock(chan(devn Xor 1), BASSTRUE) ' lock source stream to synchonise buffer contents + Call BASS_ChannelSetDSP(chan(devn Xor 1), AddressOf CloneDSP, chan(devn), 0) ' set DSP to feed data to clone + ' copy buffered data to clone + Dim c As Long + c = BASS_ChannelGetData(chan(devn Xor 1), ByVal 0, BASS_DATA_AVAILABLE) + Dim buf() As Long + ReDim buf(c) As Long + c = BASS_ChannelGetData(chan(devn Xor 1), buf(0), c) + Call BASS_StreamPutData(chan(devn), buf(0), c) + Erase buf + + Call BASS_ChannelLock(chan(devn Xor 1), BASSFALSE) ' unlock source stream + Call BASS_ChannelPlay(chan(devn), BASSFALSE) ' play clone + cmdOpen(devn).Caption = "clone" +End Sub diff --git a/bass-sys/bass24/vb/Multi/modMulti.bas b/bass-sys/bass24/vb/Multi/modMulti.bas new file mode 100644 index 0000000..f72a1fb --- /dev/null +++ b/bass-sys/bass24/vb/Multi/modMulti.bas @@ -0,0 +1,17 @@ +Attribute VB_Name = "modMulti" +'////////////////////////////////////////////////////////////////////////////// +' modMulti.bas - Copyright (c) 2003-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' Other sources: frmDevice.frm and frmMulti.frm +' +' BASS Multiple output example +' Originally translated from - multi.c - Example of Ian Luck +'////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +' Cloning DSP function +Sub CloneDSP(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) + Call BASS_StreamPutData(user, ByVal buffer, length) ' user = clone +End Sub diff --git a/bass-sys/bass24/vb/Multi/prjMulti.vbp b/bass-sys/bass24/vb/Multi/prjMulti.vbp new file mode 100644 index 0000000..4defe2c --- /dev/null +++ b/bass-sys/bass24/vb/Multi/prjMulti.vbp @@ -0,0 +1,41 @@ +Type=Exe +Form=frmMulti.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Module=modBass; ..\Bass.bas +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Form=frmDevice.frm +Module=modMulti; modMulti.bas +IconForm="frmMulti" +Startup="frmMulti" +HelpFile="" +Title="prjMulti" +ExeName32="prjMulti.exe" +Command32="" +Name="prjMulti" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/NetRadio/clsFileIo.cls b/bass-sys/bass24/vb/NetRadio/clsFileIo.cls new file mode 100644 index 0000000..e33a0ed --- /dev/null +++ b/bass-sys/bass24/vb/NetRadio/clsFileIo.cls @@ -0,0 +1,97 @@ +VERSION 1.0 CLASS +BEGIN + MultiUse = -1 'True + Persistable = 0 'NotPersistable + DataBindingBehavior = 0 'vbNone + DataSourceBehavior = 0 'vbNone + MTSTransactionMode = 0 'NotAnMTSObject +END +Attribute VB_Name = "clsFileIo" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = True +Attribute VB_PredeclaredId = False +Attribute VB_Exposed = False +' This ClassModule is written by Peter Hebels +Option Explicit + +Private Const GENERIC_WRITE = &H40000000 +Private Const FILE_ATTRIBUTE_NORMAL = &H80 +Private Const CREATE_ALWAYS = 2 +Private Const OPEN_ALWAYS = 4 +Private Const INVALID_HANDLE_VALUE = -1 + +Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long +Private Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long, ByVal lpOverlapped As Long) As Long +Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long +Private Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, lpNumberOfBytesWritten As Long, ByVal lpOverlapped As Long) As Long +Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, ByVal lpSecurityAttributes As Long, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long +Private Declare Function FlushFileBuffers Lib "kernel32" (ByVal hFile As Long) As Long +Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal length As Long) + +Private fHandle As Long +Private fSuccess As Long +Private lFilePos As Long +Private File_Name As String + +Public Function OpenFile(FileN As String) As Boolean + fHandle = CreateFile(FileN, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) + If fHandle <> INVALID_HANDLE_VALUE Then + File_Name = FileN + OpenFile = True + Else + OpenFile = False + End If +End Function + +Public Function CloseFile() As Boolean + If fHandle <> INVALID_HANDLE_VALUE And File_Name <> "" Then + fSuccess = CloseHandle(fHandle) + CloseFile = True + Else + CloseFile = False + End If +End Function + +Public Function WriteBytes(Pointer As Long, Size As Long) As Boolean +Dim hHdr As String +Dim NewHeader As String +Dim i As Long + +Dim d() As Byte +ReDim d(Size) As Byte + +If fHandle <> INVALID_HANDLE_VALUE And File_Name <> "" Then + hHdr = Chr(255) & Chr(251) + If GotHeader = False Then + Call CopyMemory(d(0), ByVal Pointer, Size) + For i = 1 To Size + If d(i) = 255 Then + If d(i + 1) = 251 Then + NewHeader = hHdr & Chr(d(i + 2)) + fSuccess = WriteFile(fHandle, ByVal NewHeader, LenB(NewHeader), lFilePos, 0) + If fSuccess <> 0 Then + fSuccess = FlushFileBuffers(fHandle) + GotHeader = True + Exit For + End If + End If + End If + Next i + End If + + If GotHeader = True Then + fSuccess = WriteFile(fHandle, ByVal Pointer, Size, lFilePos, 0) + If fSuccess <> 0 Then + fSuccess = FlushFileBuffers(fHandle) + WriteBytes = True + Else + WriteBytes = False + Exit Function + End If + End If +Else + WriteBytes = False + Exit Function +End If + +End Function diff --git a/bass-sys/bass24/vb/NetRadio/frmNetRadio.frm b/bass-sys/bass24/vb/NetRadio/frmNetRadio.frm new file mode 100644 index 0000000..07dc682 --- /dev/null +++ b/bass-sys/bass24/vb/NetRadio/frmNetRadio.frm @@ -0,0 +1,357 @@ +VERSION 5.00 +Begin VB.Form frmNetRadio + BorderStyle = 3 'Fixed Dialog + Caption = "BASS internet radio tuner" + ClientHeight = 4215 + ClientLeft = 45 + ClientTop = 330 + ClientWidth = 4215 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 4215 + ScaleWidth = 4215 + StartUpPosition = 2 'CenterScreen + Begin VB.Timer tmrNetRadio + Enabled = 0 'False + Interval = 50 + Left = 3120 + Top = 1320 + End + Begin VB.Frame frameProxy + Caption = " Proxy server " + Height = 975 + Left = 120 + TabIndex = 18 + Top = 3120 + Width = 3975 + Begin VB.CheckBox chkDirectConnect + Caption = "Direct connection" + Height = 255 + Left = 240 + TabIndex = 20 + Top = 600 + Width = 1575 + End + Begin VB.TextBox txtProxy + Height = 285 + Left = 120 + MaxLength = 100 + TabIndex = 19 + Top = 240 + Width = 3735 + End + Begin VB.Label lblUserPass + AutoSize = -1 'True + Caption = "[user:pass@]server:port" + Height = 195 + Left = 2160 + TabIndex = 21 + Top = 600 + Width = 1680 + End + End + Begin VB.Frame framePresents + Caption = " Presents " + Height = 1455 + Left = 120 + TabIndex = 11 + Top = 0 + Width = 3975 + Begin VB.CheckBox chkSave + Caption = "Save local copy" + Height = 255 + Left = 120 + TabIndex = 10 + Top = 1080 + Width = 3735 + End + Begin VB.CommandButton btnPresents + Caption = "5" + Height = 350 + Index = 9 + Left = 3360 + TabIndex = 9 + Top = 630 + Width = 450 + End + Begin VB.CommandButton btnPresents + Caption = "4" + Height = 350 + Index = 8 + Left = 2790 + TabIndex = 7 + Top = 630 + Width = 450 + End + Begin VB.CommandButton btnPresents + Caption = "3" + Height = 350 + Index = 7 + Left = 2220 + TabIndex = 5 + Top = 630 + Width = 450 + End + Begin VB.CommandButton btnPresents + Caption = "2" + Height = 350 + Index = 6 + Left = 1650 + TabIndex = 3 + Top = 630 + Width = 450 + End + Begin VB.CommandButton btnPresents + Caption = "1" + Height = 350 + Index = 5 + Left = 1080 + TabIndex = 1 + Top = 630 + Width = 450 + End + Begin VB.CommandButton btnPresents + Caption = "5" + Height = 350 + Index = 4 + Left = 3360 + TabIndex = 8 + Top = 240 + Width = 450 + End + Begin VB.CommandButton btnPresents + Caption = "4" + Height = 350 + Index = 3 + Left = 2790 + TabIndex = 6 + Top = 240 + Width = 450 + End + Begin VB.CommandButton btnPresents + Caption = "3" + Height = 350 + Index = 2 + Left = 2220 + TabIndex = 4 + Top = 240 + Width = 450 + End + Begin VB.CommandButton btnPresents + Caption = "2" + Height = 350 + Index = 1 + Left = 1650 + TabIndex = 2 + Top = 240 + Width = 450 + End + Begin VB.CommandButton btnPresents + Caption = "1" + Height = 350 + Index = 0 + Left = 1080 + TabIndex = 0 + Top = 240 + Width = 450 + End + Begin VB.Label lblModem + AutoSize = -1 'True + Caption = "Modem" + Height = 195 + Left = 120 + TabIndex = 14 + Top = 720 + Width = 525 + End + Begin VB.Label lblBroadband + AutoSize = -1 'True + Caption = "Broadband" + Height = 195 + Left = 120 + TabIndex = 13 + Top = 240 + Width = 780 + End + End + Begin VB.Frame framePlaying + Caption = " Currently playing " + Height = 1455 + Left = 120 + TabIndex = 12 + Top = 1560 + Width = 3975 + Begin VB.Label lblBPS + Alignment = 2 'Center + Height = 195 + Left = 90 + TabIndex = 17 + Top = 1200 + Width = 3795 + WordWrap = -1 'True + End + Begin VB.Label lblName + Alignment = 2 'Center + Caption = "not playing" + Height = 375 + Left = 105 + TabIndex = 16 + Top = 720 + Width = 3765 + WordWrap = -1 'True + End + Begin VB.Label lblSong + Alignment = 2 'Center + Height = 435 + Left = 105 + TabIndex = 15 + Top = 240 + Width = 3765 + WordWrap = -1 'True + End + End +End +Attribute VB_Name = "frmNetRadio" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'///////////////////////////////////////////////////////////////////////////////// +' frmNetRadio.frm - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' * Save local copy is added by: Peter Hebels @ http://www.phsoft.nl +' e-mail: info@phsoft.nl +' +' Other sources: modNetRadio.bas & clsFileIo.cls +' +' BASS Internet radio example +' Originally translated from - netradio.c - Example of Ian Luck +'///////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long +Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal length As Long) + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' setup output device + If (BASS_Init(-1, 44100, 0, Me.hwnd, 0) = 0) Then + Call Error_("Can't initialize device") + End + End If + + Call BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1) ' enable playlist processing + Call BASS_SetConfig(BASS_CONFIG_NET_PREBUF, 0) ' minimize automatic pre-buffering, so we can do it (and display it) instead + + ' preset stream URLs + url = Array("http://www.radioparadise.com/m3u/mp3-128.m3u", "http://www.radioparadise.com/m3u/mp3-32.m3u", _ + "http://icecast.timlradio.co.uk/vr160.ogg", "http://icecast.timlradio.co.uk/vr32.ogg", _ + "http://icecast.timlradio.co.uk/a8160.ogg", "http://icecast.timlradio.co.uk/a832.ogg", _ + "http://somafm.com/secretagent.pls", "http://somafm.com/secretagent24.pls", _ + "http://somafm.com/suburbsofgoa.pls", "http://somafm.com/suburbsofgoa24.pls") + + Set WriteFile = New clsFileIo + cthread = 0 +End Sub + +' this function will check if you're running in IDE or EXE modes +' VB will crash if you're closing the app while (cthread<>0) in IDE, +' but won't crash if in EXE mode +Public Function isIDEmode() As Boolean + Dim sFileName As String, lCount As Long + + sFileName = String(255, 0) + lCount = GetModuleFileName(App.hInstance, sFileName, 255) + sFileName = UCase(GetFileName(Mid(sFileName, 1, lCount))) + + isIDEmode = (sFileName = "VB6.EXE") +End Function + +Private Sub Form_Unload(Cancel As Integer) + If (isIDEmode And cthread) Then + ' IDE Version + Cancel = True ' disable closing app to avoid crash + Else + ' Compiled Version or (cthread = 0) close app is available + Call BASS_Free + End If +End Sub + +Private Sub btnPresents_Click(index As Integer) + If (cthread) Then ' already connecting + Call Beep + Else + If (chkDirectConnect.value) Then + Call BASS_SetConfigPtr(BASS_CONFIG_NET_PROXY, vbNullString) ' disable proxy + Else + Call BASS_SetConfigPtr(BASS_CONFIG_NET_PROXY, txtProxy.Text) ' set proxy server + End If + + ' open URL in a new thread (so that main thread is free) + Dim threadid As Long + cthread = CreateThread(ByVal 0&, 0, AddressOf OpenURL, index, 0, threadid) ' threadid param required on win9x + End If +End Sub + +Private Sub chkSave_Click() + If chkSave.value = vbChecked Then + DoDownload = True + Else + DoDownload = False + End If +End Sub + +Private Sub tmrNetRadio_Timer() + Dim progress As Long + progress = BASS_StreamGetFilePosition(chan, BASS_FILEPOS_BUFFER) * 100 / BASS_StreamGetFilePosition(chan, BASS_FILEPOS_END) ' percentage of buffer filled + If (progress > 75 Or BASS_StreamGetFilePosition(chan, BASS_FILEPOS_CONNECTED) = 0) Then ' over 75% full (or end of download) + tmrNetRadio.Enabled = False ' finished prebuffering, stop monitoring + ' get the broadcast name and bitrate + Dim icyPtr As Long + icyPtr = BASS_ChannelGetTags(chan, BASS_TAG_ICY) + If (icyPtr = 0) Then icyPtr = BASS_ChannelGetTags(chan, BASS_TAG_HTTP) ' no ICY tags, try HTTP + If (icyPtr) Then + Dim icyStr As String + Do + icyStr = VBStrFromAnsiPtr(icyPtr) + icyPtr = icyPtr + Len(icyStr) + 1 + lblName.Caption = IIf(Mid(icyStr, 1, 9) = "icy-name:", Mid(icyStr, 10), lblName.Caption) + lblBPS.Caption = IIf(Mid(icyStr, 1, 7) = "icy-br:", "bitrate: " & Mid(icyStr, 8), lblBPS.Caption) + + ' NOTE: you can get more ICY info like: icy-genre:, icy-url:... :) + Loop While (icyStr <> "") + End If + + ' get the stream title and set sync for subsequent titles + Call DoMeta + Call BASS_ChannelSetSync(chan, BASS_SYNC_META, 0, AddressOf MetaSync, 0) + ' set sync for end of stream + Call BASS_ChannelSetSync(chan, BASS_SYNC_END, 0, AddressOf EndSync, 0) + ' play it! + Call BASS_ChannelPlay(chan, BASSFALSE) + Else + lblName.Caption = "buffering... " & progress & "%" + End If +End Sub + +'-------------------- +' useful function :) +'-------------------- + +' get file name from file path +Public Function GetFileName(ByVal fp As String) As String + GetFileName = Mid(fp, InStrRev(fp, "\") + 1) +End Function diff --git a/bass-sys/bass24/vb/NetRadio/modNetRadio.bas b/bass-sys/bass24/vb/NetRadio/modNetRadio.bas new file mode 100644 index 0000000..4c9618d --- /dev/null +++ b/bass-sys/bass24/vb/NetRadio/modNetRadio.bas @@ -0,0 +1,165 @@ +Attribute VB_Name = "modNetRadio" +'///////////////////////////////////////////////////////////////////////////////// +' modNetRadio.bas - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' * Save local copy is added by: Peter Hebels @ http://www.phsoft.nl +' e-mail: info@phsoft.nl +' +' Other sources: frmNetRadio.frm & clsFileIo.cls +' +' BASS Internet radio example +' Originally translated from - netradio.c - Example of Ian Luck +'///////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Public chan As Long +Public url As Variant +Public TmpNameHold As String +Public TmpNameHold2 As String + +Public proxy(100) As Byte ' proxy server + +' SAVE LOCAL COPY +Public WriteFile As clsFileIo +Public FileIsOpen As Boolean, GotHeader As Boolean +Public DownloadStarted As Boolean, DoDownload As Boolean +Public DlOutput As String, SongNameUpdate As Boolean + +' THREADING +Public cthread As Long +Public Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As Any, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, ByVal lpParameter As Long, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long +Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long + +' MESSAGE BOX +Public Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long + +Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) + +' display error message +Public Sub Error_(ByVal es As String) + Call MessageBox(frmNetRadio.hwnd, es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, "Error", vbExclamation) +End Sub + +' update stream title from metadata +Sub DoMeta() + Dim meta As Long + Dim p As String, tmpMeta As String + meta = BASS_ChannelGetTags(chan, BASS_TAG_META) + If meta = 0 Then Exit Sub + tmpMeta = VBStrFromAnsiPtr(meta) + If ((Mid(tmpMeta, 1, 13) = "StreamTitle='")) Then + p = Mid(tmpMeta, 14) + TmpNameHold = Mid(p, 1, InStr(p, ";") - 2) + frmNetRadio.lblSong.Caption = TmpNameHold + + If TmpNameHold = TmpNameHold2 Then + ' do noting + Else + TmpNameHold2 = TmpNameHold + GotHeader = False + DownloadStarted = False + End If + + DlOutput = App.Path & "\" & RemoveSpecialChar(Mid(p, 1, InStr(p, ";") - 2)) & ".mp3" + End If +End Sub + +Sub MetaSync(ByVal handle As Long, ByVal channel As Long, ByVal data As Long, ByVal user As Long) + Call DoMeta +End Sub + +Sub EndSync(ByVal handle As Long, ByVal channel As Long, ByVal data As Long, ByVal user As Long) + With frmNetRadio + .lblName.Caption = "not playing" + .lblBPS.Caption = "" + .lblSong.Caption = "" + End With +End Sub + +Public Sub OpenURL(ByVal clkURL As Long) + With frmNetRadio + .tmrNetRadio.Enabled = False + Call BASS_StreamFree(chan) ' close old stream + .lblName.Caption = "connecting..." + .lblBPS.Caption = "" + .lblSong.Caption = "" + + chan = BASS_StreamCreateURL(CStr(url((IIf(clkURL < 5, clkURL * 2, (clkURL * 2) - 9)))), 0, BASS_STREAM_BLOCK Or BASS_STREAM_STATUS Or BASS_STREAM_AUTOFREE, AddressOf SUBDOWNLOADPROC, 0) + + If chan = 0 Then + .lblName.Caption = "not playing" + Call Error_("Can't play the stream") + Else + .tmrNetRadio.Enabled = True + End If + End With +done: + Call CloseHandle(cthread) ' close the thread + cthread = 0 +End Sub + +' The following functions where added by Peter Hebels +Public Sub SUBDOWNLOADPROC(ByVal buffer As Long, ByVal length As Long, ByVal user As Long) + If (buffer And length = 0) Then + frmNetRadio.lblBPS.Caption = VBStrFromAnsiPtr(buffer) ' display connection status + Exit Sub + End If + + If (Not DoDownload) Then + DownloadStarted = False + Call WriteFile.CloseFile + Exit Sub + End If + + If (Trim(DlOutput) = "") Then Exit Sub + + If (Not DownloadStarted) Then + DownloadStarted = True + Call WriteFile.CloseFile + If (WriteFile.OpenFile(DlOutput)) Then + SongNameUpdate = False + Else + + SongNameUpdate = True + + GotHeader = False + End If + End If + + If (Not SongNameUpdate) Then + If (length) Then + Call WriteFile.WriteBytes(buffer, length) + Else + Call WriteFile.CloseFile + GotHeader = False + End If + Else + DownloadStarted = False + Call WriteFile.CloseFile + GotHeader = False + End If +End Sub + +Public Function RemoveSpecialChar(strFileName As String) + Dim i As Byte + Dim SpecialChar As Boolean + Dim SelChar As String, OutFileName As String + + For i = 1 To Len(strFileName) + SelChar = Mid(strFileName, i, 1) + SpecialChar = InStr(":/\?*|<>" & Chr$(34), SelChar) > 0 + + If (Not SpecialChar) Then + OutFileName = OutFileName & SelChar + SpecialChar = False + Else + OutFileName = OutFileName + SpecialChar = False + End If + Next i + + RemoveSpecialChar = OutFileName +End Function diff --git a/bass-sys/bass24/vb/NetRadio/prjNetRadio.vbp b/bass-sys/bass24/vb/NetRadio/prjNetRadio.vbp new file mode 100644 index 0000000..105b844 --- /dev/null +++ b/bass-sys/bass24/vb/NetRadio/prjNetRadio.vbp @@ -0,0 +1,40 @@ +Type=Exe +Form=frmNetRadio.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Module=modBass; ..\Bass.bas +Class=clsFileIo; clsFileIo.cls +Module=modNetRadio; modNetRadio.bas +IconForm="frmNetRadio" +Startup="frmNetRadio" +HelpFile="" +Title="prjNetRadio" +ExeName32="prjNetRadio.exe" +Command32="" +Name="prjNetRadio" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/Plugins/frmPlugins.frm b/bass-sys/bass24/vb/Plugins/frmPlugins.frm new file mode 100644 index 0000000..709cfd4 --- /dev/null +++ b/bass-sys/bass24/vb/Plugins/frmPlugins.frm @@ -0,0 +1,241 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx" +Begin VB.Form frmPlugins + BorderStyle = 3 'Fixed Dialog + Caption = "BASS plugin test" + ClientHeight = 3105 + ClientLeft = 45 + ClientTop = 435 + ClientWidth = 4560 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 3105 + ScaleWidth = 4560 + StartUpPosition = 2 'CenterScreen + Begin VB.Timer tmrPlugins + Interval = 500 + Left = 0 + Top = 2400 + End + Begin MSComctlLib.Slider sldPosition + Height = 435 + Left = 360 + TabIndex = 1 + Top = 2640 + Width = 3855 + _ExtentX = 6800 + _ExtentY = 767 + _Version = 393216 + TickStyle = 3 + TickFrequency = 0 + End + Begin VB.Frame framePlugins + Caption = " Loaded plugins " + Height = 1455 + Left = 120 + TabIndex = 2 + Top = 120 + Width = 4335 + Begin VB.ListBox lstPlugins + Height = 1035 + Left = 120 + TabIndex = 3 + TabStop = 0 'False + Top = 240 + Width = 4095 + End + End + Begin VB.CommandButton btnOpen + Caption = "click here to open a file..." + Height = 375 + Left = 120 + TabIndex = 0 + Top = 1680 + Width = 4335 + End + Begin MSComDlg.CommonDialog cmdOpenFile + Left = 4080 + Top = 2400 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.Label lblInfo + Alignment = 2 'Center + Height = 435 + Left = 120 + TabIndex = 4 + Top = 2160 + Width = 4320 + End +End +Attribute VB_Name = "frmPlugins" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'//////////////////////////////////////////////////////////////////////////////// +' frmPlugins.frm - Copyright (c) 2006-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' BASS plugin test +' Originally translated from - plugins.c - Example of Ian Luck +'//////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Dim chan As Long ' the channel +Dim filter As String + +' display error messages +Sub Error_(ByVal mes As String) + Call MsgBox(mes & vbCrLf & vbCrLf & "(error code: " & BASS_ErrorGetCode & ")", vbExclamation, "Error!") +End Sub + +' translate a CTYPE value to text +Public Function GetCTypeString(ByVal ctype As Long, ByVal plugin As Long) As String + If (plugin) Then ' using a plugin + Dim pinfo As BASS_PLUGININFO, a As Long + + pinfo = BASS_PluginGetInfo(plugin) ' get plugin info + + For a = 0 To pinfo.formatc - 1 + If (BASS_PluginGetInfoFormat(plugin, a).ctype = ctype) Then ' found a "ctype" match... + GetCTypeString = VBStrFromAnsiPtr(BASS_PluginGetInfoFormat(plugin, a).name) ' return it's name + Exit Function + End If + Next a + End If + + ' check built-in stream formats... + Select Case (ctype) + Case (BASS_CTYPE_STREAM_OGG): GetCTypeString = "Ogg Vorbis" + Case (BASS_CTYPE_STREAM_MP1): GetCTypeString = "MPEG layer 1" + Case (BASS_CTYPE_STREAM_MP2): GetCTypeString = "MPEG layer 2" + Case (BASS_CTYPE_STREAM_MP3): GetCTypeString = "MPEG layer 3" + Case (BASS_CTYPE_STREAM_AIFF): GetCTypeString = "Audio IFF" + Case (BASS_CTYPE_STREAM_WAV_PCM): GetCTypeString = "PCM WAVE" + Case (BASS_CTYPE_STREAM_WAV_FLOAT): GetCTypeString = "Floating-point WAVE" + Case Else: GetCTypeString = "?" + End Select + + ' other WAVE codec, could use acmFormatTagDetails to get its name, but... + If (ctype And BASS_CTYPE_STREAM_WAV) Then GetCTypeString = "WAVE" +End Function + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' initialize default output device + If (BASS_Init(-1, 44100, 0, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize device") + End + End If + + ' initialize file selector + cmdOpenFile.CancelError = True + cmdOpenFile.flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + cmdOpenFile.DialogTitle = "Open" + cmdOpenFile.filter = filter + filter = "BASS built-in (*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif)|*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif" + + ' look for plugins (in the executable's directory) + Dim fh As String + fh = Dir("bass*.dll") ' find 1st file + + Do While (fh <> "") + Dim plug As Long + plug = BASS_PluginLoad(fh, 0) ' plugin loaded... + If (plug) Then + Dim pinfo As BASS_PLUGININFO + pinfo = BASS_PluginGetInfo(plug) ' get plugin info to add to the file selector filter... + Dim a As Long + For a = 0 To pinfo.formatc - 1 + filter = filter & "|" & VBStrFromAnsiPtr(BASS_PluginGetInfoFormat(plug, a).name) & " (" & VBStrFromAnsiPtr(BASS_PluginGetInfoFormat(plug, a).exts) & ")" & " - " & fh ' format description + filter = filter & "|" & VBStrFromAnsiPtr(BASS_PluginGetInfoFormat(plug, a).exts) ' extension filter + Next a + + ' add plugin to the list + lstPlugins.AddItem fh + End If + fh = Dir() ' get next file + Loop + + ' no plugins... + If (lstPlugins.ListCount = 0) Then _ + lstPlugins.AddItem "no plugins - visit the BASS webpage to get some" + + filter = filter & "|" & "All files|*.*" + cmdOpenFile.filter = filter +End Sub + +Private Sub Form_Unload(Cancel As Integer) + ' "free" the output device and all plugins + Call BASS_Free + Call BASS_PluginFree(0) + End +End Sub + +Private Sub btnOpen_Click() + On Local Error Resume Next ' if Cancel pressed... + + cmdOpenFile.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + Call BASS_StreamFree(chan) ' free the old stream + + chan = BASS_StreamCreateFile(BASSFALSE, StrPtr(cmdOpenFile.filename), 0, 0, BASS_SAMPLE_LOOP) + + ' it ain't playable + If (chan = 0) Then + btnOpen.Caption = "click here to open a file..." + lblInfo.Caption = "" + Call Error_("Can't play the file") + Exit Sub + End If + + btnOpen.Caption = cmdOpenFile.filename + + ' display the file type and length + Dim bytes As Long + bytes = BASS_ChannelGetLength(chan, BASS_POS_BYTE) + + Dim time As Long + time = BASS_ChannelBytes2Seconds(chan, bytes) + + Dim info As BASS_CHANNELINFO + Call BASS_ChannelGetInfo(chan, info) + + lblInfo.Caption = "channel type = " & Hex(info.ctype) & " (" & GetCTypeString(info.ctype, info.plugin) _ + & ")" & vbCrLf & "length = " & bytes & " (" & time \ 60 & ":" & Format(time Mod 60, "00") & ")" + + sldPosition.max = time ' update scroller range + + Call BASS_ChannelPlay(chan, BASSFALSE) +End Sub + +Private Sub sldPosition_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) + tmrPlugins.Enabled = False +End Sub + +Private Sub sldPosition_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) + Call BASS_ChannelSetPosition(chan, BASS_ChannelSeconds2Bytes(chan, sldPosition.value), BASS_POS_BYTE) ' set the position + tmrPlugins.Enabled = True +End Sub + +Private Sub tmrPlugins_Timer() + sldPosition.value = BASS_ChannelBytes2Seconds(chan, BASS_ChannelGetPosition(chan, BASS_POS_BYTE)) ' update position +End Sub diff --git a/bass-sys/bass24/vb/Plugins/prjPlugins.vbp b/bass-sys/bass24/vb/Plugins/prjPlugins.vbp new file mode 100644 index 0000000..b96c088 --- /dev/null +++ b/bass-sys/bass24/vb/Plugins/prjPlugins.vbp @@ -0,0 +1,40 @@ +Type=Exe +Form=frmPlugins.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Module=modBass; ..\Bass.bas +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX +IconForm="frmPlugins" +Startup="frmPlugins" +HelpFile="" +Title="prjPlugins" +ExeName32="prjPlugins.exe" +Command32="" +Name="prjPlugins" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/RecTest/frmRecTest.frm b/bass-sys/bass24/vb/RecTest/frmRecTest.frm new file mode 100644 index 0000000..ae64ec0 --- /dev/null +++ b/bass-sys/bass24/vb/RecTest/frmRecTest.frm @@ -0,0 +1,203 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx" +Begin VB.Form frmRecTest + BorderStyle = 3 'Fixed Dialog + Caption = "BASS recording test" + ClientHeight = 990 + ClientLeft = 600 + ClientTop = 990 + ClientWidth = 4965 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 990 + ScaleWidth = 4965 + StartUpPosition = 2 'CenterScreen + Begin MSComctlLib.Slider sldInputLevel + Height = 255 + Left = 120 + TabIndex = 5 + Top = 720 + Width = 1455 + _ExtentX = 2566 + _ExtentY = 450 + _Version = 393216 + Max = 100 + SelectRange = -1 'True + TickStyle = 3 + End + Begin VB.ComboBox cmbInput + Height = 315 + Left = 120 + Style = 2 'Dropdown List + TabIndex = 3 + Top = 160 + Width = 1455 + End + Begin MSComDlg.CommonDialog cmd + Left = 4440 + Top = 480 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.Timer tmrRecTest + Enabled = 0 'False + Interval = 200 + Left = 3960 + Top = 480 + End + Begin VB.CommandButton btnSave + Caption = "Save" + Enabled = 0 'False + Height = 300 + Left = 4080 + TabIndex = 2 + Top = 170 + Width = 735 + End + Begin VB.CommandButton btnPlay + Caption = "Play" + Enabled = 0 'False + Height = 300 + Left = 3120 + TabIndex = 1 + Top = 170 + Width = 855 + End + Begin VB.CommandButton btnRecord + Caption = "Record" + Height = 300 + Left = 1680 + TabIndex = 0 + Top = 170 + Width = 1335 + End + Begin VB.Label lblPos + Alignment = 2 'Center + BorderStyle = 1 'Fixed Single + Height = 285 + Left = 1680 + TabIndex = 6 + Top = 600 + Width = 3135 + End + Begin VB.Label lblInputType + Alignment = 2 'Center + Height = 195 + Left = 120 + TabIndex = 4 + Top = 480 + Width = 1440 + End +End +Attribute VB_Name = "frmRecTest" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'//////////////////////////////////////////////////////////////////////////////// +' frmRecTest.frm - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other source: modRecTest.bas +' +' BASS Recording example +' Originally translated from - rectest.c - Example of Ian Luck +'//////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' setup recording and output devices (using default devices) + If (BASS_RecordInit(-1) = 0) Or (BASS_Init(-1, 44100, 0, Me.hwnd, 0) = 0) Then + Call Error_("Can't initialize device") + End + Else + ' get list of inputs + Dim c As Integer + input_ = -1 + While BASS_RecordGetInputName(c) + cmbInput.AddItem VBStrFromAnsiPtr(BASS_RecordGetInputName(c)) + If (BASS_RecordGetInput(c, ByVal 0) And BASS_INPUT_OFF) = 0 Then + cmbInput.ListIndex = c ' this 1 is currently "on" + input_ = c + Call UpdateInputInfo ' display info + End If + c = c + 1 + Wend + End If + + tmrRecTest.Enabled = True ' timer to update the position display (200ms) + + recPtr = 0 + reclen = 0 + BUFSTEP = 200000 ' memory allocation unit +End Sub + +Private Sub Form_Unload(Cancel As Integer) + ' release all BASS stuff + Call GlobalFree(ByVal recPtr) + Call BASS_RecordFree + Call BASS_Free +End Sub + +' input selection changed +Private Sub cmbInput_Click() + input_ = cmbInput.ListIndex ' get the selection + ' enable the selected input + Dim i As Integer + For i = 0 To cmbInput.ListCount - 1 + Call BASS_RecordSetInput(i, BASS_INPUT_OFF, -1) ' 1st disable all inputs, then... + Next i + Call BASS_RecordSetInput(input_, BASS_INPUT_ON, -1) ' enable the selected input + Call UpdateInputInfo +End Sub + +Private Sub btnPlay_Click() + Call BASS_ChannelPlay(chan, BASSFALSE) ' play the recorded data +End Sub + +Private Sub btnRecord_Click() + If (rchan = 0) Then + Call StartRecording + Else + Call StopRecording + End If +End Sub + +Private Sub btnSave_Click() + Call WriteToDisk +End Sub + +' set input source level +Private Sub sldInputLevel_Scroll() + If BASS_RecordSetInput(input_, 0, sldInputLevel.value / 100) = 0 Then ' failed to set input level + Call BASS_RecordSetInput(-1, 0, sldInputLevel.value / 100) ' try master level instead + End If +End Sub + +Private Sub tmrRecTest_Timer() + ' update the recording/playback counter + If (rchan) Then ' recording/encoding + lblPos.Caption = BASS_ChannelGetPosition(rchan, BASS_POS_BYTE) + ElseIf (chan) Then + If (BASS_ChannelIsActive(chan)) Then ' playing + lblPos.Caption = BASS_ChannelGetPosition(chan, BASS_POS_BYTE) & " / " & BASS_ChannelGetLength(chan, BASS_POS_BYTE) + Else + lblPos.Caption = BASS_ChannelGetLength(chan, BASS_POS_BYTE) + End If + End If +End Sub diff --git a/bass-sys/bass24/vb/RecTest/modRecTest.bas b/bass-sys/bass24/vb/RecTest/modRecTest.bas new file mode 100644 index 0000000..eecbaff --- /dev/null +++ b/bass-sys/bass24/vb/RecTest/modRecTest.bas @@ -0,0 +1,245 @@ +Attribute VB_Name = "modRecTest" +'//////////////////////////////////////////////////////////////////////////////// +' modRecTest.bas - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other source: frmRecTest.frm +' +' BASS Recording example +' Originally translated from - rectest.c - Example of Ian Luck +'//////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +' MEMORY +Public Const GMEM_FIXED = &H0 +Public Const GMEM_MOVEABLE = &H2 +Public Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long +Public Declare Function GlobalReAlloc Lib "kernel32" (ByVal hMem As Long, ByVal dwBytes As Long, ByVal wFlags As Long) As Long +Public Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long +Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long) + +' FILE +Const OFS_MAXPATHNAME = 128 +Const OF_CREATE = &H1000 +Const OF_READ = &H0 +Const OF_WRITE = &H1 + +Private Type OFSTRUCT + cBytes As Byte + fFixedDisk As Byte + nErrCode As Integer + Reserved1 As Integer + Reserved2 As Integer + szPathName(OFS_MAXPATHNAME) As Byte +End Type + +Private Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long +Private Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, lpNumberOfBytesWritten As Long, ByVal lpOverlapped As Any) As Long +Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long + +' WAV Header +Private Type WAVEHEADER_RIFF ' == 12 bytes == + RIFF As Long ' "RIFF" = &H46464952 + riffBlockSize As Long ' reclen - 8 + riffBlockType As Long ' "WAVE" = &H45564157 +End Type + +Private Type WAVEFORMAT ' == 24 bytes == + wfBlockType As Long ' "fmt " = &H20746D66 + wfBlockSize As Long + ' == block size begins from here = 16 bytes + wFormatTag As Integer + nChannels As Integer + nSamplesPerSec As Long + nAvgBytesPerSec As Long + nBlockAlign As Integer + wBitsPerSample As Integer +End Type + +Private Type WAVEHEADER_data ' == 8 bytes == + dataBlockType As Long ' "data" = &H61746164 + dataBlockSize As Long ' reclen - 44 +End Type + +Dim wr As WAVEHEADER_RIFF +Dim wf As WAVEFORMAT +Dim wd As WAVEHEADER_data + +Public Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long + +Public BUFSTEP As Long ' memory allocation unit +Public input_ As Long ' current input source +Public recPtr As Long ' a recording pointer to a memory location +Public reclen As Long ' buffer length + +Public rchan As Long ' recording channel +Public chan As Long ' playback channel + +' display error messages +Public Sub Error_(ByVal es As String) + Call MessageBox(frmRecTest.hwnd, es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, "Error", vbExclamation) +End Sub + +' buffer the recorded data +Public Function RecordingCallback(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long + ' increase buffer size if needed + If ((reclen Mod BUFSTEP) + length >= BUFSTEP) Then + recPtr = GlobalReAlloc(ByVal recPtr, ((reclen + length) / BUFSTEP + 1) * BUFSTEP, GMEM_MOVEABLE) + If recPtr = 0 Then + rchan = 0 + Call Error_("Out of memory!") + frmRecTest.btnRecord.Caption = "Record" + RecordingCallback = BASSFALSE ' stop recording + Exit Function + End If + End If + ' buffer the data + Call CopyMemory(ByVal recPtr + reclen, ByVal buffer, length) + reclen = reclen + length + RecordingCallback = BASSTRUE ' continue recording +End Function + +Public Sub StartRecording() + ' free old recording + If (recPtr) Then + Call BASS_StreamFree(chan) + Call GlobalFree(ByVal recPtr) + recPtr = 0 + chan = 0 + frmRecTest.btnPlay.Enabled = False + frmRecTest.btnSave.Enabled = False + End If + + ' allocate initial buffer and make space for WAVE header + recPtr = GlobalAlloc(GMEM_FIXED, BUFSTEP) + reclen = 44 + + ' fill the WAVE header + wf.wFormatTag = 1 + wf.nChannels = 2 + wf.wBitsPerSample = 16 + wf.nSamplesPerSec = 44100 + wf.nBlockAlign = wf.nChannels * wf.wBitsPerSample / 8 + wf.nAvgBytesPerSec = wf.nSamplesPerSec * wf.nBlockAlign + + ' Set WAV "fmt " header + wf.wfBlockType = &H20746D66 ' "fmt " + wf.wfBlockSize = 16 + + ' Set WAV "RIFF" header + wr.RIFF = &H46464952 ' "RIFF" + wr.riffBlockSize = 0 ' after recording + wr.riffBlockType = &H45564157 ' "WAVE" + + ' set WAV "data" header + wd.dataBlockType = &H61746164 ' "data" + wd.dataBlockSize = 0 ' after recording + + ' copy WAV Header to Memory + Call CopyMemory(ByVal recPtr, wr, LenB(wr)) ' "RIFF" + Call CopyMemory(ByVal recPtr + 12, wf, LenB(wf)) ' "fmt " + Call CopyMemory(ByVal recPtr + 36, wd, LenB(wd)) ' "data" + + ' start recording @ 44100hz 16-bit stereo + rchan = BASS_RecordStart(44100, 2, 0, AddressOf RecordingCallback, 0) + + If (rchan = 0) Then + Call Error_("Couldn't start recording") + Call GlobalFree(ByVal recPtr) + recPtr = 0 + Exit Sub + End If + frmRecTest.btnRecord.Caption = "Stop" +End Sub + +Public Sub StopRecording() + Call BASS_ChannelStop(rchan) + rchan = 0 + frmRecTest.btnRecord.Caption = "Record" + + ' complete the WAVE header + wr.riffBlockSize = reclen - 8 + wd.dataBlockSize = reclen - 44 + + Call CopyMemory(ByVal recPtr + 4, wr.riffBlockSize, LenB(wr.riffBlockSize)) + Call CopyMemory(ByVal recPtr + 40, wd.dataBlockSize, LenB(wd.dataBlockSize)) + + ' create a stream from the recording + chan = BASS_StreamCreateFile(BASSTRUE, recPtr, 0, reclen, 0) + If (chan) Then + ' enable "play" & "save" buttons + frmRecTest.btnPlay.Enabled = True + frmRecTest.btnSave.Enabled = True + End If +End Sub + +' write the recorded data to disk +Public Sub WriteToDisk() + On Local Error Resume Next ' if Cancel pressed... + + With frmRecTest.cmd + .CancelError = True + .flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + .DialogTitle = "Save As..." + .Filter = "WAV files|*.wav|All files|*.*" + .DefaultExt = "wav" + .ShowSave + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + ' create a file .WAV, directly from Memory location + Dim FileHandle As Long, ret As Long, OF As OFSTRUCT + + FileHandle = OpenFile(.filename, OF, OF_CREATE) + + If (FileHandle = 0) Then + Call Error_("Can't create the file") + Exit Sub + End If + + Call WriteFile(FileHandle, ByVal recPtr, reclen, ret, ByVal 0&) + Call CloseHandle(FileHandle) + End With +End Sub + +Public Sub UpdateInputInfo() + Dim it As Long + Dim level As Single + + it = BASS_RecordGetInput(input_, level) ' get info on the input + If (it = -1 Or level < 0) Then ' failed + Call BASS_RecordGetInput(-1, level) ' try master input instead + If (level < 0) Then level = 1 ' that failed too, just display 100% + End If + frmRecTest.sldInputLevel.value = level * 100 ' set the level slider + + Dim type_ As String + Select Case (it And BASS_INPUT_TYPE_MASK) + Case BASS_INPUT_TYPE_DIGITAL: + type_ = "digital" + Case BASS_INPUT_TYPE_LINE: + type_ = "line-in" + Case BASS_INPUT_TYPE_MIC: + type_ = "microphone" + Case BASS_INPUT_TYPE_SYNTH: + type_ = "midi synth" + Case BASS_INPUT_TYPE_CD: + type_ = "analog cd" + Case BASS_INPUT_TYPE_PHONE: + type_ = "telephone" + Case BASS_INPUT_TYPE_SPEAKER: + type_ = "pc speaker" + Case BASS_INPUT_TYPE_WAVE: + type_ = "wave/pcm" + Case BASS_INPUT_TYPE_AUX: + type_ = "aux" + Case BASS_INPUT_TYPE_ANALOG: + type_ = "analog" + Case Else: + type_ = "undefined" + End Select + frmRecTest.lblInputType.Caption = type_ ' display the type +End Sub diff --git a/bass-sys/bass24/vb/RecTest/prjRecTest.vbp b/bass-sys/bass24/vb/RecTest/prjRecTest.vbp new file mode 100644 index 0000000..4d5ae88 --- /dev/null +++ b/bass-sys/bass24/vb/RecTest/prjRecTest.vbp @@ -0,0 +1,40 @@ +Type=Exe +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Form=frmRecTest.frm +Module=modRecTest; modRecTest.bas +Module=modBass; ..\Bass.bas +Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX +IconForm="frmRecTest" +Startup="frmRecTest" +HelpFile="" +Title="prjRecTest" +ExeName32="prjRecTest.exe" +Command32="" +Name="prjRecTest" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/Speakers/frmSpeakers.frm b/bass-sys/bass24/vb/Speakers/frmSpeakers.frm new file mode 100644 index 0000000..6f45a77 --- /dev/null +++ b/bass-sys/bass24/vb/Speakers/frmSpeakers.frm @@ -0,0 +1,252 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Begin VB.Form frmSpeakers + BorderStyle = 3 'Fixed Dialog + Caption = "BASS multi-speaker example" + ClientHeight = 3030 + ClientLeft = 45 + ClientTop = 435 + ClientWidth = 5175 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 3030 + ScaleWidth = 5175 + StartUpPosition = 2 'CenterScreen + Begin VB.CommandButton btnSwap + Caption = "swap" + Height = 375 + Index = 2 + Left = 4320 + TabIndex = 10 + Top = 2040 + Width = 615 + End + Begin VB.CommandButton btnSwap + Caption = "swap" + Height = 375 + Index = 1 + Left = 4320 + TabIndex = 9 + Top = 1320 + Width = 615 + End + Begin VB.CommandButton btnSwap + Caption = "swap" + Height = 375 + Index = 0 + Left = 4320 + TabIndex = 8 + Top = 600 + Width = 615 + End + Begin MSComDlg.CommonDialog cmdOpenFile + Left = 4440 + Top = 2520 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.CommandButton btnOpen + Caption = "click here to open a file..." + Height = 375 + Index = 0 + Left = 240 + TabIndex = 4 + Top = 240 + Width = 3975 + End + Begin VB.Frame Frame + Caption = "1 - front " + Height = 735 + Index = 0 + Left = 120 + TabIndex = 0 + Top = 0 + Width = 4935 + End + Begin VB.Frame Frame + Caption = "2 - rear " + Height = 735 + Index = 1 + Left = 120 + TabIndex = 1 + Top = 720 + Width = 4935 + Begin VB.CommandButton btnOpen + Caption = "click here to open a file..." + Height = 375 + Index = 1 + Left = 120 + TabIndex = 5 + Top = 240 + Width = 3975 + End + End + Begin VB.Frame Frame + Caption = "3 - center/LFE " + Height = 735 + Index = 2 + Left = 120 + TabIndex = 2 + Top = 1440 + Width = 4935 + Begin VB.CommandButton btnOpen + Caption = "click here to open a file..." + Height = 375 + Index = 2 + Left = 120 + TabIndex = 6 + Top = 240 + Width = 3975 + End + End + Begin VB.Frame Frame + Caption = "4 - rear center " + Height = 735 + Index = 3 + Left = 120 + TabIndex = 3 + Top = 2160 + Width = 4935 + Begin VB.CommandButton btnOpen + Caption = "click here to open a file..." + Height = 375 + Index = 3 + Left = 120 + TabIndex = 7 + Top = 240 + Width = 3975 + End + End +End +Attribute VB_Name = "frmSpeakers" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'///////////////////////////////////////////////////////////////////////////////// +' frmSpeakers.frm - Copyright (c) 2003-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' BASS multi-speaker example +' Originally translated from - speakers.c - Example of Ian Luck +'///////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Dim flags(4) As Long +Dim chan(4) As Long + +' display error messages +Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' initialize BASS - default device + If (BASS_Init(-1, 44100, 0, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize device") + End + End If + + flags(0) = BASS_SPEAKER_FRONT + flags(1) = BASS_SPEAKER_REAR + flags(2) = BASS_SPEAKER_CENLFE + flags(3) = BASS_SPEAKER_REAR2 + + ' check how many speakers the device supports + Dim i As BASS_INFO + Call BASS_GetInfo(i) + If (i.speakers < 4) Then ' no extra speakers detected, enable them anyway? + If (MsgBox("Do you wish to enable ""speaker assignment"" anyway?", vbYesNo + vbQuestion, "No extra speakers detected") = vbYes) Then + ' reinitialize BASS - forcing speaker assignment + Call BASS_Free + If (BASS_Init(-1, 44100, BASS_DEVICE_SPEAKERS, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize device") + End + End If + Call BASS_GetInfo(i) ' get info again + End If + End If + If (i.speakers < 8) Then + btnOpen(3).Enabled = False + btnSwap(2).Enabled = False + End If + If (i.speakers < 6) Then + btnOpen(2).Enabled = False + btnSwap(1).Enabled = False + End If + If (i.speakers < 4) Then + btnOpen(1).Enabled = False + btnSwap(0).Enabled = False + End If +End Sub + +Private Sub Form_Unload(Cancel As Integer) + Call BASS_Free + End +End Sub + +Private Sub btnOpen_Click(index As Integer) + On Local Error Resume Next ' if Cancel pressed... + + Dim speaker As Long + speaker = index + + cmdOpenFile.CancelError = True + cmdOpenFile.flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + cmdOpenFile.DialogTitle = "Open" + cmdOpenFile.Filter = "streamable files|*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif|All files|*.*" + cmdOpenFile.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + Call BASS_StreamFree(chan(speaker)) ' free old stream before opening new + + chan(speaker) = BASS_StreamCreateFile(BASSFALSE, StrPtr(cmdOpenFile.filename), 0, 0, flags(speaker) Or BASS_SAMPLE_LOOP) + + If (chan(speaker) = 0) Then + btnOpen(index).Caption = "click here to open a file..." + Call Error_("Can't play the file") + Exit Sub + End If + + btnOpen(speaker).Caption = cmdOpenFile.filename + Call BASS_ChannelPlay(chan(speaker), BASSFALSE) +End Sub + +Private Sub btnSwap_Click(index As Integer) + Dim speaker As Long + speaker = index + + ' swap handles + Dim temp As Long + + temp = chan(speaker) + chan(speaker) = chan(speaker + 1) + chan(speaker + 1) = temp + + ' swap text + Dim temp1 As String + + temp1 = btnOpen(index).Caption + btnOpen(index).Caption = btnOpen(index + 1).Caption + btnOpen(index + 1).Caption = temp1 + + ' update speaker flags + Call BASS_ChannelFlags(chan(speaker), flags(speaker), BASS_SPEAKER_FRONT) + Call BASS_ChannelFlags(chan(speaker + 1), flags(speaker + 1), BASS_SPEAKER_FRONT) +End Sub diff --git a/bass-sys/bass24/vb/Speakers/prjSpeakers.vbp b/bass-sys/bass24/vb/Speakers/prjSpeakers.vbp new file mode 100644 index 0000000..b17b047 --- /dev/null +++ b/bass-sys/bass24/vb/Speakers/prjSpeakers.vbp @@ -0,0 +1,39 @@ +Type=Exe +Form=frmSpeakers.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Module=modBass; ..\Bass.bas +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +IconForm="frmSpeakers" +Startup="frmSpeakers" +HelpFile="" +Title="prjSpeakers" +ExeName32="prjSpeakers.exe" +Command32="" +Name="prjSpeakers" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/Spectrum/frmSpectrum.frm b/bass-sys/bass24/vb/Spectrum/frmSpectrum.frm new file mode 100644 index 0000000..ef7965b --- /dev/null +++ b/bass-sys/bass24/vb/Spectrum/frmSpectrum.frm @@ -0,0 +1,160 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Begin VB.Form frmSpectrum + BorderStyle = 3 'Fixed Dialog + Caption = "Bass spectrum example (click to toggle mode)" + ClientHeight = 1905 + ClientLeft = 45 + ClientTop = 330 + ClientWidth = 5520 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 127 + ScaleMode = 3 'Pixel + ScaleWidth = 368 + StartUpPosition = 2 'CenterScreen + Begin VB.Timer tmrSpectrum + Enabled = 0 'False + Interval = 25 + Left = 4440 + Top = 1440 + End + Begin MSComDlg.CommonDialog cmd + Left = 4920 + Top = 1440 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End +End +Attribute VB_Name = "frmSpectrum" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'///////////////////////////////////////////////////////////////////////////////// +' frmSpectrum.frm - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other source: modSpectrum.bas +' +' Bass spectrum example +' Originally translated from - spectrum.c - Example of Ian Luck +'///////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +' display error messages +Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' initialize BASS + If (BASS_Init(-1, 44100, 0, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize device") + End + End If + + If (Not PlayFile) Then ' start a file playing + BASS_Free + End + End If + + specpos = 0 + specmode = 0 + + ' create bitmap to draw spectrum in - 8 bit for easy updating :) + With bh.bmiHeader + .biBitCount = 8 + .biPlanes = 1 + .biSize = Len(bh.bmiHeader) + .biWidth = SPECWIDTH + .biHeight = SPECHEIGHT ' upside down (line 0=bottom) + .biClrUsed = 256 + .biClrImportant = 256 + End With + + Dim a As Byte + + ' setup palette + For a = 1 To 127 + bh.bmiColors(a).rgbGreen = 256 - 2 * a + bh.bmiColors(a).rgbRed = 2 * a + Next a + For a = 0 To 31 + bh.bmiColors(128 + a).rgbBlue = 8 * a + bh.bmiColors(128 + 32 + a).rgbBlue = 255 + bh.bmiColors(128 + 32 + a).rgbRed = 8 * a + bh.bmiColors(128 + 64 + a).rgbRed = 255 + bh.bmiColors(128 + 64 + a).rgbBlue = 8 * (31 - a) + bh.bmiColors(128 + 64 + a).rgbGreen = 8 * a + bh.bmiColors(128 + 96 + a).rgbRed = 255 + bh.bmiColors(128 + 96 + a).rgbGreen = 255 + bh.bmiColors(128 + 96 + a).rgbBlue = 8 * a + Next a + + ' setup update timer (40hz) +#If 1 Then + tmrSpectrum.Enabled = True +#Else + timing = timeSetEvent(25, 25, AddressOf UpdateSpectrum, 0, TIME_PERIODIC) ' API MM timer +#End If +End Sub + +Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) + specmode = (specmode + 1) Mod 4 ' swap spectrum mode + ReDim specbuf(SPECWIDTH * (SPECHEIGHT + 1)) As Byte ' clear display +End Sub + +Private Sub Form_Unload(Cancel As Integer) + If (timing) Then Call timeKillEvent(timing) + tmrSpectrum.Enabled = False + Call BASS_Free + End +End Sub + +Function PlayFile() As Boolean + On Local Error Resume Next ' if Cancel pressed... + + cmd.CancelError = True + cmd.flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + cmd.DialogTitle = "Select a file to play" + cmd.Filter = "playable files|*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif|All files|*.*" + cmd.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Function + + Call BASS_StreamFree(chan) + Call BASS_MusicFree(chan) + + chan = BASS_StreamCreateFile(BASSFALSE, StrPtr(cmd.filename), 0, 0, BASS_SAMPLE_LOOP) + If chan = 0 Then chan = BASS_MusicLoad(BASSFALSE, cmd.filename, 0, 0, BASS_MUSIC_RAMP Or BASS_MUSIC_LOOP, 1) + + If chan = 0 Then + Call Error_("Selected file couldn't be played!") + PlayFile = False ' Can't load the file + Exit Function + End If + + Call BASS_ChannelPlay(chan, BASSFALSE) + + PlayFile = True +End Function + +Private Sub tmrSpectrum_Timer() + Call UpdateSpectrum(0, 0, 0, 0, 0) ' the params are if using the API MM timer +End Sub diff --git a/bass-sys/bass24/vb/Spectrum/modSpectrum.bas b/bass-sys/bass24/vb/Spectrum/modSpectrum.bas new file mode 100644 index 0000000..a829ab3 --- /dev/null +++ b/bass-sys/bass24/vb/Spectrum/modSpectrum.bas @@ -0,0 +1,174 @@ +Attribute VB_Name = "modSpectrum" +'///////////////////////////////////////////////////////////////////////////////// +' modSpectrum.bas - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other source: frmSpectrum.frm +' +' Bass spectrum example +' Originally translated from - spectrum.c - Example of Ian Luck +'///////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Public Const BI_RGB = 0& +Public Const DIB_RGB_COLORS = 0& ' color table in RGBs + +Public Type BITMAPINFOHEADER + biSize As Long + biWidth As Long + biHeight As Long + biPlanes As Integer + biBitCount As Integer + biCompression As Long + biSizeImage As Long + biXPelsPerMeter As Long + biYPelsPerMeter As Long + biClrUsed As Long + biClrImportant As Long +End Type + +Public Type RGBQUAD + rgbBlue As Byte + rgbGreen As Byte + rgbRed As Byte + rgbReserved As Byte +End Type + +Public Type BITMAPINFO + bmiHeader As BITMAPINFOHEADER + bmiColors(255) As RGBQUAD +End Type + +Declare Sub FillMemory Lib "kernel32.dll" Alias "RtlFillMemory" (Destination As Any, ByVal length As Long, ByVal Fill As Byte) +Public Declare Function SetDIBitsToDevice Lib "gdi32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, Bits As Any, BitsInfo As BITMAPINFO, ByVal wUsage As Long) As Long + +' NOTE: Using an API MM timer (may sometimes Crash your app in an IDE mode) +Public Const TIME_PERIODIC = 1 ' program for continuous periodic event +Public Declare Function timeSetEvent Lib "winmm.dll" (ByVal uDelay As Long, ByVal uResolution As Long, ByVal lpFunction As Long, ByVal dwUser As Long, ByVal uFlags As Long) As Long +Public Declare Function timeKillEvent Lib "winmm.dll" (ByVal uID As Long) As Long +Public timing As Long ' an API timer Handle + +Public Const SPECWIDTH As Long = 368 ' display width +Public Const SPECHEIGHT As Long = 127 ' height (changing requires palette adjustments too) + +Public chan As Long ' stream/music handle + +Public specmode As Long, specpos As Long ' spectrum mode (and marker pos for 2nd mode) +Public specbuf() As Byte ' a pointer + +Public bh As BITMAPINFO ' bitmap header + +' MATH Functions +Public Function Sqrt(ByVal num As Double) As Double + Sqrt = num ^ 0.5 +End Function + +Function Log10(ByVal X As Double) As Double + Log10 = Log(X) / Log(10#) +End Function + +' update the spectrum display - the interesting bit :) +Public Sub UpdateSpectrum(ByVal uTimerID As Long, ByVal uMsg As Long, ByVal dwUser As Long, ByVal dw1 As Long, ByVal dw2 As Long) + Dim X As Long, Y As Long, y1 As Long + + If (specmode = 3) Then ' waveform + Dim c As Long, buf() As Single, ci As BASS_CHANNELINFO + ReDim specbuf(SPECWIDTH * (SPECHEIGHT + 1)) As Byte ' clear display + + Call BASS_ChannelGetInfo(chan, ci) ' get number of channels + ReDim buf(ci.chans * SPECWIDTH * LenB(buf(0))) As Single ' allocate buffer for data + + Call BASS_ChannelGetData(chan, buf(0), (ci.chans * SPECWIDTH * LenB(buf(0))) Or BASS_DATA_FLOAT) ' get the sample data (floating-point to avoid 8 & 16 bit processing) + For c = 0 To ci.chans - 1 + For X = 0 To SPECWIDTH - 1 + Dim v As Long + v = (1 - buf(X * ci.chans + c)) * SPECHEIGHT / 2 ' invert and scale to fit display + If (v < 0) Then + v = 0 + ElseIf (v >= SPECHEIGHT) Then + v = SPECHEIGHT - 1 + End If + If (X = 0) Then Y = v + Do ' draw line from previous sample... + If (Y < v) Then + Y = Y + 1 + ElseIf (Y > v) Then + Y = Y - 1 + End If + specbuf(Y * SPECWIDTH + X) = IIf(c And 1, 127, 1) ' left=green, right=red (could add more colours to palette for more chans) + Loop While (Y <> v) + Next X + Next c + Else + Dim fft(1024) As Single ' get the FFT data + Call BASS_ChannelGetData(chan, fft(0), BASS_DATA_FFT2048) + + If (specmode = 0) Then ' "normal" FFT + ReDim specbuf(SPECWIDTH * (SPECHEIGHT + 1)) As Byte ' clear display + For X = 0 To (SPECWIDTH / 2) - 1 +#If 1 Then + Y = Sqrt(fft(X + 1)) * 3 * SPECHEIGHT - 4 ' scale it (sqrt to make low values more visible) +#Else + Y = fft(X + 1) * 10 * SPECHEIGHT ' scale it (linearly) +#End If + If (Y > SPECHEIGHT) Then Y = SPECHEIGHT ' cap it + If (X) Then ' interpolate from previous to make the display smoother + y1 = (Y + y1) / 2 + y1 = y1 - 1 + While (y1 >= 0) + specbuf(y1 * SPECWIDTH + X * 2 - 1) = y1 + 1 + y1 = y1 - 1 + Wend + End If + y1 = Y + Y = Y - 1 + While (Y >= 0) + specbuf(Y * SPECWIDTH + X * 2) = Y + 1 ' draw level + Y = Y - 1 + Wend + Next X + ElseIf (specmode = 1) Then ' logarithmic, acumulate & average bins + ReDim specbuf(SPECWIDTH * (SPECHEIGHT + 1)) As Byte ' clear display + Dim b0 As Long, BANDS As Integer + b0 = 0 + BANDS = 28 + Dim sc As Long, b1 As Long + Dim sum As Single + For X = 0 To BANDS - 1 + sum = 0 + b1 = 2 ^ (X * 10# / (BANDS - 1)) + If (b1 > 1023) Then b1 = 1023 + If (b1 <= b0) Then b1 = b0 + 1 ' make sure it uses at least 1 FFT bin + sc = 10 + b1 - b0 + Do + sum = sum + fft(1 + b0) + b0 = b0 + 1 + Loop While b0 < b1 + Y = (Sqrt(sum / Log10(sc)) * 1.7 * SPECHEIGHT) - 4 ' scale it + If (Y > SPECHEIGHT) Then Y = SPECHEIGHT ' cap it + Y = Y - 1 + While (Y >= 0) + Call FillMemory(specbuf(Y * SPECWIDTH + X * Int(SPECWIDTH / BANDS)), SPECWIDTH / BANDS - 2, Y + 1) + Y = Y - 1 + Wend + Next X + Else ' "3D" + For X = 0 To SPECHEIGHT - 1 + Y = Sqrt(fft(X + 1)) * 3 * 127 ' scale it (sqrt to make low values more visible) + If (Y > 127) Then Y = 127 ' cap it + specbuf(X * SPECWIDTH + specpos) = 128 + Y ' plot it + Next X + ' move marker onto next position + specpos = (specpos + 1) Mod SPECWIDTH + For X = 0 To SPECHEIGHT - 1 + specbuf(X * SPECWIDTH + specpos) = 255 + Next X + End If + End If + + ' update the display + ' to display in a PictureBox, simply change the .hDC to Picture1.hDC :) + Call SetDIBitsToDevice(frmSpectrum.hDC, 0, 0, SPECWIDTH, SPECHEIGHT, 0, 0, 0, SPECHEIGHT, specbuf(0), bh, 0) +End Sub diff --git a/bass-sys/bass24/vb/Spectrum/prjSpectrum.vbp b/bass-sys/bass24/vb/Spectrum/prjSpectrum.vbp new file mode 100644 index 0000000..e88890b --- /dev/null +++ b/bass-sys/bass24/vb/Spectrum/prjSpectrum.vbp @@ -0,0 +1,40 @@ +Type=Exe +Form=frmSpectrum.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Module=modSpectrum; modSpectrum.bas +Module=modBass; ..\Bass.bas +IconForm="frmSpectrum" +Startup="frmSpectrum" +HelpFile="" +Title="prjSpectrum" +ExeName32="prjSpectrum.exe" +Command32="" +Name="prjSpectrum" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/Synth/frmSynth.frm b/bass-sys/bass24/vb/Synth/frmSynth.frm new file mode 100644 index 0000000..e6141c4 --- /dev/null +++ b/bass-sys/bass24/vb/Synth/frmSynth.frm @@ -0,0 +1,175 @@ +VERSION 5.00 +Begin VB.Form frmSynth + BorderStyle = 3 'Fixed Dialog + Caption = "BASS Simple Sinewave Synth" + ClientHeight = 3375 + ClientLeft = 45 + ClientTop = 435 + ClientWidth = 4350 + BeginProperty Font + Name = "Arial" + Size = 9.75 + Charset = 177 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 225 + ScaleMode = 3 'Pixel + ScaleWidth = 290 + StartUpPosition = 2 'CenterScreen + Begin VB.Label lblWinTxt + Height = 855 + Left = 0 + TabIndex = 0 + Top = 2520 + Width = 4335 + End +End +Attribute VB_Name = "frmSynth" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'////////////////////////////////////////////////////////////////////////////// +' frmSynth.frm - Copyright (c) 2006-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other source: modSynth.bas +' +' BASS Simple Synth +' Originally translated from - synth.c - Example of Ian Luck +'////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Dim str As Long +Dim fx(9) As Long ' effect handles +Dim r As Long, buflen As Long +Dim fxname As Variant + +' display error messages +Sub Error_(ByVal es As String) + Call MsgBox(es & vbCrLf & vbCrLf & "error code: " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + fxname = Array("CHORUS", "COMPRESSOR", "DISTORTION", "ECHO", "FLANGER", "GARGLE", "I3DL2REVERB", "PARAMEQ", "REVERB") + keys = Array("Q", "2", "W", "3", "E", "R", "5", "T", "6", "Y", "7", "U", "I", "9", "O", "0", "P", 219, 187, 221) + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion()) <> BASSVERSION) Then + Call Error_("An incorrect version of BASS.DLL was loaded") + End + End If + + ' 10ms update period + Call BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 10) + + ' setup output - get latency + If (BASS_Init(-1, 44100, BASS_DEVICE_LATENCY, 0, 0) = 0) Then + Call Error_("Can't initialize device") + End + End If + + ' build sine table + For r = 0 To TABLESIZE - 1 + sinetable(r) = CLng(Sin(2# * PI * CDbl(r) / TABLESIZE) * 7000#) + Next r + + Call BASS_GetInfo(info) + ' default buffer size = update period + 'minbuf' + Call BASS_SetConfig(BASS_CONFIG_BUFFER, 10 + info.minbuf) + buflen = BASS_GetConfig(BASS_CONFIG_BUFFER) + ' if the device's output rate is unknown default to 44100 Hz + If (info.freq = 0) Then info.freq = 44100 + ' create a stream, stereo so that effects sound nice + str = BASS_StreamCreate(info.freq, 2, 0, AddressOf WriteStream, 0) + + Me.AutoRedraw = True + Me.KeyPreview = True + + Print "device latency: " & info.latency & "ms" + Print "device minbuf : " & info.minbuf & "ms" + Print "ds version: " & info.dsver & " (effects " & IIf(info.dsver < 8, "disabled", "enabled") & ")" + Print "press these keys to play:" & vbCrLf + Print " 2 3 5 6 7 9 0 =" + Print " Q W ER T Y UI O P[ ]" & vbCrLf + Print "press -/+ to de/increase the buffer" + Print "press spacebar to quit" & vbCrLf + If (info.dsver >= 8) Then ' DX8 effects available + Print "press F1-F9 to toggle effects" & vbCrLf + End If + lblWinTxt.Caption = "using a " & buflen & "ms buffer" + + Call BASS_ChannelPlay(str, BASSFALSE) +End Sub + +Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) + If (KeyCode = vbKeySpace) Then Call Unload(Me) + + If (KeyCode = vbKeySubtract Or KeyCode = vbKeyAdd) Then + ' recreate stream with smaller/larger buffer + Call BASS_StreamFree(str) + If (KeyCode = vbKeySubtract) Then + Call BASS_SetConfig(BASS_CONFIG_BUFFER, buflen - 1) ' smaller buffer + Else + Call BASS_SetConfig(BASS_CONFIG_BUFFER, buflen + 1) ' larger buffer + End If + buflen = BASS_GetConfig(BASS_CONFIG_BUFFER) + lblWinTxt.Caption = "using a " & buflen & "ms buffer" + str = BASS_StreamCreate(info.freq, 2, 0, AddressOf WriteStream, 0) + ' set effects on the new stream + For r = 0 To 9 + If (fx(r)) Then fx(r) = BASS_ChannelSetFX(str, BASS_FX_DX8_CHORUS + r, 0) + Next r + Call BASS_ChannelPlay(str, BASSFALSE) + End If + + If (KeyCode >= vbKeyF1 And KeyCode <= vbKeyF9) Then + r = KeyCode - vbKeyF1 + If (fx(r)) Then + Call BASS_ChannelRemoveFX(str, fx(r)) + fx(r) = 0 + lblWinTxt.Caption = "effect " & fxname(r) & " = OFF" + Else + ' set the effect, not bothering with parameters (use defaults) + fx(r) = BASS_ChannelSetFX(str, BASS_FX_DX8_CHORUS + r, 0) + If (fx(r)) Then lblWinTxt.Caption = "effect " & fxname(r) & " = ON" + End If + End If + + Dim key As Long + For key = 0 To KEYS_ - 1 + If (KeyCode = keys(key) Or KeyCode = Asc(keys(key))) Then Exit For + Next key + If (key <> KEYS_) Then + If (KeyCode And (vol(key) <> MAXVOL)) Then + pos(key) = 0 + vol(key) = MAXVOL ' start key + ElseIf ((KeyCode = 0) And vol(key)) Then + vol(key) = vol(key) - 1 ' trigger key fadeout + End If + End If +End Sub + +Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) + Dim key As Long + For key = 0 To KEYS_ - 1 + If (KeyCode = keys(key) Or KeyCode = Asc(keys(key))) Then Exit For + Next key + If (key <> KEYS_) Then vol(key) = vol(key) - 1 ' trigger key fadeout +End Sub + +Private Sub Form_Unload(Cancel As Integer) + BASS_Free +End Sub diff --git a/bass-sys/bass24/vb/Synth/modSynth.bas b/bass-sys/bass24/vb/Synth/modSynth.bas new file mode 100644 index 0000000..1ac604b --- /dev/null +++ b/bass-sys/bass24/vb/Synth/modSynth.bas @@ -0,0 +1,58 @@ +Attribute VB_Name = "modSynth" +'////////////////////////////////////////////////////////////////////////////// +' modSynth.bas - Copyright (c) 2006-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' Other source: frmSynth.frm +' +' BASS Simple Synth +' Originally translated from - synth.c - Example of Ian Luck +'////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Public info As BASS_INFO + +Public Const PI = 3.14159265358979 +Public Const TABLESIZE = 2048 +Public sinetable(TABLESIZE) As Long ' sine table +Public Const KEYS_ = 20 +Public keys As Variant +Public Const MAXVOL = 4000 ' higher value = longer fadeout + +Public vol(KEYS_) As Long, pos(KEYS_) As Long ' keys' volume & pos + +Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal length As Long) + +' stream writer +Public Function WriteStream(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long + Dim n As Long, s As Long, c As Long + Dim f As Single + Dim buf() As Integer + ReDim buf(length) As Integer + + For n = 0 To KEYS_ - 1 + If (vol(n)) Then + f = (2 ^ ((n + 3) / 12#)) * TABLESIZE * 440# / info.freq + c = 0 + Do While (c < length / 4 And vol(n)) + s = sinetable((pos(n) * f) And (TABLESIZE - 1)) * vol(n) / MAXVOL + pos(n) = pos(n) + 1 + s = s + buf(c * 2) + ' clip + If (s > 32767) Then s = 32767 + If (s < -32768) Then s = -32768 + ' left and right channels are the same + buf(c * 2) = s + buf(c * 2 + 1) = s + If (vol(n) < MAXVOL) Then vol(n) = vol(n) - 1 + c = c + 1 + Loop + End If + Next n + + Call CopyMemory(ByVal buffer, buf(0), length) + + WriteStream = length +End Function diff --git a/bass-sys/bass24/vb/Synth/prjSynth.vbp b/bass-sys/bass24/vb/Synth/prjSynth.vbp new file mode 100644 index 0000000..0c17bd7 --- /dev/null +++ b/bass-sys/bass24/vb/Synth/prjSynth.vbp @@ -0,0 +1,39 @@ +Type=Exe +Form=frmSynth.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Module=modBass; ..\Bass.bas +Module=modSynth; modSynth.bas +IconForm="frmSynth" +Startup="frmSynth" +HelpFile="" +Title="prjSynth" +ExeName32="prjSynth.exe" +Command32="" +Name="prjSynth" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/WriteWav/frmWriteWave.frm b/bass-sys/bass24/vb/WriteWav/frmWriteWave.frm new file mode 100644 index 0000000..5fa9d0a --- /dev/null +++ b/bass-sys/bass24/vb/WriteWav/frmWriteWave.frm @@ -0,0 +1,296 @@ +VERSION 5.00 +Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" +Begin VB.Form frmWriteWave + BorderStyle = 3 'Fixed Dialog + Caption = "BASS WAVE writer example" + ClientHeight = 2295 + ClientLeft = 45 + ClientTop = 330 + ClientWidth = 4470 + LinkTopic = "Form1" + MaxButton = 0 'False + MinButton = 0 'False + ScaleHeight = 2295 + ScaleWidth = 4470 + StartUpPosition = 2 'CenterScreen + Begin VB.CommandButton btnConvert + Caption = "Convert to ""BASS.WAV""" + Enabled = 0 'False + Height = 495 + Left = 120 + TabIndex = 3 + Top = 1680 + Width = 4215 + End + Begin VB.CommandButton btnLoadFile + Caption = "Select File to Convert" + Height = 495 + Left = 120 + TabIndex = 2 + Top = 1080 + Width = 4215 + End + Begin MSComDlg.CommonDialog cmd + Left = 3840 + Top = 480 + _ExtentX = 847 + _ExtentY = 847 + _Version = 393216 + End + Begin VB.Label lblTime + AutoSize = -1 'True + Caption = "Time:" + Height = 195 + Left = 120 + TabIndex = 4 + Top = 360 + Width = 390 + End + Begin VB.Label lblStrFile + AutoSize = -1 'True + Caption = "Streaming File:" + Height = 195 + Left = 120 + TabIndex = 1 + Top = 120 + Width = 1035 + End + Begin VB.Label lblPos + AutoSize = -1 'True + Caption = "Pos:" + Height = 195 + Left = 120 + TabIndex = 0 + Top = 600 + Width = 315 + End +End +Attribute VB_Name = "frmWriteWave" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'////////////////////////////////////////////////////////////////////////////////// +' frmWriteWave.frm - Copyright (c) 2002-2007 (: JOBnik! :) [Arthur Aminov, ISRAEL] +' [http://www.jobnik.org] +' [ jobnik@jobnik.org ] +' +' BASS WAVE writer example: MOD/MPx/OGG -> "BASS.WAV" +' Originally translated from - writewav.c - Example of Ian Luck +'////////////////////////////////////////////////////////////////////////////////// + +Option Explicit + +Dim info As BASS_CHANNELINFO +Dim chan As Long, p As Long +Dim pos As Long +Dim buf() As Byte + +Private Type WAVEHEADER_RIFF ' == 12 bytes == + RIFF As Long ' "RIFF" = &H46464952 + riffBlockSize As Long ' pos + 44 - 8 + riffBlockType As Long ' "WAVE" = &H45564157 +End Type + +Private Type WAVEHEADER_data ' == 8 bytes == + dataBlockType As Long ' "data" = &H61746164 + dataBlockSize As Long ' pos +End Type + +Private Type WAVEFORMAT ' == 24 bytes == + wfBlockType As Long ' "fmt " = &H20746D66 + wfBlockSize As Long + ' == block size begins from here = 16 bytes + wFormatTag As Integer + nChannels As Integer + nSamplesPerSec As Long + nAvgBytesPerSec As Long + nBlockAlign As Integer + wBitsPerSample As Integer +End Type + +Dim wr As WAVEHEADER_RIFF +Dim wf As WAVEFORMAT +Dim wd As WAVEHEADER_data + +' display error message +Sub Error_(ByVal Message As String) + Call MsgBox(Message & vbCrLf & vbCrLf & "Error Code : " & BASS_ErrorGetCode, vbExclamation, "Error") +End Sub + +Private Sub Form_Load() + ' change and set the current path, to prevent from VB not finding BASS.DLL + ChDrive App.Path + ChDir App.Path + + ' check the correct BASS was loaded + If (HiWord(BASS_GetVersion) <> BASSVERSION) Then + Call MsgBox("An incorrect version of BASS.DLL was loaded", vbCritical) + End + End If + + ' not playing anything, so don't need an update thread + Call BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 0) + + ' setup output - "no sound" device, 44100hz, stereo, 16 bits + If (BASS_Init(0, 44100, 0, Me.hWnd, 0) = 0) Then + Call Error_("Can't initialize device") + End + End If +End Sub + +Private Sub Form_Unload(Cancel As Integer) + On Local Error Resume Next + + BASS_Free + End +End Sub + +Private Sub btnLoadFile_Click() + On Local Error Resume Next ' if Cancel pressed... + + cmd.CancelError = True + cmd.flags = cdlOFNExplorer Or cdlOFNFileMustExist Or cdlOFNHideReadOnly + cmd.DialogTitle = "Select a file to Convert" + cmd.Filter = "Convertable files (*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;*.mp3;*.mp2;*.mp1;*.ogg)|*.mo3;*.xm;*.mod;*.s3m;*.it;*.mtm;*.umx;*.mp3;*.mp2;*.mp1;*.ogg" + cmd.ShowOpen + + ' if cancel was pressed, exit the procedure + If Err.Number = 32755 Then Exit Sub + + ' try streaming the file + chan = BASS_StreamCreateFile(BASSFALSE, StrPtr(cmd.filename), 0, 0, BASS_STREAM_DECODE) + If chan Then + pos = BASS_ChannelGetLength(chan, BASS_POS_BYTE) + lblStrFile.Caption = "Streaming file: " & GetFileName(cmd.filename) & " [" & pos & " bytes]" + End If + + ' try loading the MOD (with sensitive ramping, and calculate the duration) + If chan = 0 Then + chan = BASS_MusicLoad(BASSFALSE, StrPtr(cmd.filename), 0, 0, BASS_MUSIC_DECODE Or BASS_MUSIC_RAMP Or BASS_MUSIC_PRESCAN, 0) + If chan = 0 Then + ' not a MOD either + Call Error_("Can't play the file") + Exit Sub + Else + Dim dummy As Single + p = 0 + While (BASS_ChannelGetAttribute(chan, BASS_ATTRIB_MUSIC_VOL_CHAN + p, dummy)) ' count channels + p = p + 1 + Wend + lblStrFile.Caption = "MOD music """ & VBStrFromAnsiPtr(BASS_ChannelGetTags(chan, BASS_TAG_MUSIC_NAME)) & _ + """ [" & p & " chans, " & BASS_ChannelGetLength(chan, BASS_POS_MUSIC_ORDER) & " orders]" + pos = BASS_ChannelGetLength(chan, BASS_POS_BYTE) + End If + End If + + ' display the time length + If (pos) Then + p = CLng(BASS_ChannelBytes2Seconds(chan, pos)) + lblTime.Caption = "Time: " & CInt(p \ 60) & ":" & Format(CInt(p Mod 60), "00") + Else ' no time length available + lblPos.Caption = "" + End If + + lblPos.Caption = "Pos:" + btnConvert.Enabled = True +End Sub + +Private Sub btnConvert_Click() + Static convert As Boolean + + convert = Not convert + + If (convert) Then + btnLoadFile.Enabled = False + btnConvert.Caption = "Stop conversion..." + + Call BASS_ChannelGetInfo(chan, info) + + ' Set WAV Format + wf.wFormatTag = 1 + wf.nChannels = info.chans + wf.wBitsPerSample = IIf(info.flags And BASS_SAMPLE_8BITS, 8, 16) + wf.nBlockAlign = wf.nChannels * wf.wBitsPerSample / 8 + wf.nSamplesPerSec = info.freq + wf.nAvgBytesPerSec = wf.nSamplesPerSec * wf.nBlockAlign + + ' Set WAV "fmt " header + wf.wfBlockType = &H20746D66 ' "fmt " + wf.wfBlockSize = 16 + + ' Set WAV "RIFF" header + wr.RIFF = &H46464952 ' "RIFF" + wr.riffBlockSize = 0 ' after conversion + wr.riffBlockType = &H45564157 ' "WAVE" + + ' set WAV "data" header + wd.dataBlockType = &H61746164 ' "data" + wd.dataBlockSize = 0 ' after conversion + + ' create a file BASS.WAV + If (FileExists(RPP(App.Path) & "BASS.WAV")) Then _ + Call Kill(RPP(App.Path) & "BASS.WAV") ' delete if already created and create a new one + Open RPP(App.Path) & "BASS.WAV" For Binary Lock Read Write As #1 + + ' Write WAV Header to file + Put #1, , wr ' RIFF + Put #1, , wf ' Format + Put #1, , wd ' data + + ReDim buf(19999) As Byte + + Do While BASS_ChannelIsActive(chan) + If Not convert Then Exit Do + Dim c As Long + c = BASS_ChannelGetData(chan, buf(0), 20000) + ' write data to WAV file + Put #1, , buf + pos = BASS_ChannelGetPosition(chan, BASS_POS_BYTE) + lblPos.Caption = "Pos: " & pos + DoEvents ' in case you want to stop/exit... + Loop + End If + + convert = False + + btnLoadFile.Enabled = True + btnConvert.Caption = "Convert to ""BASS.WAV""" + Call CompleteWAVHeader + + ' start next conversion from the beginning + pos = 0 + Call BASS_ChannelSetPosition(chan, 0, BASS_POS_BYTE) +End Sub + +Private Sub CompleteWAVHeader() + ' complete WAV header + wr.riffBlockSize = pos + 44 - 8 + wd.dataBlockSize = pos + + On Local Error Resume Next + + Put #1, 5, wr.riffBlockSize + Put #1, 41, wd.dataBlockSize + + Close #1 +End Sub + +'-------------------------- +' some useful functions :) +'-------------------------- + +' check if any file exists +Public Function FileExists(ByVal fp As String) As Boolean + FileExists = (Dir(fp) <> "") +End Function + +' RPP = Return Proper Path +Function RPP(ByVal fp As String) As String + RPP = IIf(Mid(fp, Len(fp), 1) <> "\", fp & "\", fp) +End Function + +' get file name from file path +Public Function GetFileName(ByVal fp As String) As String + GetFileName = Mid(fp, InStrRev(fp, "\") + 1) +End Function diff --git a/bass-sys/bass24/vb/WriteWav/prjWriteWave.vbp b/bass-sys/bass24/vb/WriteWav/prjWriteWave.vbp new file mode 100644 index 0000000..f94c271 --- /dev/null +++ b/bass-sys/bass24/vb/WriteWav/prjWriteWave.vbp @@ -0,0 +1,39 @@ +Type=Exe +Form=frmWriteWave.frm +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\Windows\system32\stdole2.tlb#OLE Automation +Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx +Module=modBass; ..\Bass.bas +IconForm="frmWriteWave" +Startup="frmWriteWave" +HelpFile="" +Title="prjWriteWave" +ExeName32="prjWriteWave.exe" +Command32="" +Name="prjWriteWave" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=0 +AutoIncrementVer=0 +ServerSupportFiles=0 +VersionCompanyName="(: JOBnik! :) [Arthur Aminov, ISRAEL]" +CompilationType=0 +OptimizationType=1 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 + +[MS Transaction Server] +AutoRefresh=1 diff --git a/bass-sys/bass24/vb/bass.bas b/bass-sys/bass24/vb/bass.bas new file mode 100644 index 0000000..fa058f4 --- /dev/null +++ b/bass-sys/bass24/vb/bass.bas @@ -0,0 +1,1062 @@ +Attribute VB_Name = "modBass" +' BASS 2.4 Visual Basic module +' Copyright (c) 1999-2019 Un4seen Developments Ltd. +' +' See the BASS.CHM file for more detailed documentation + +' NOTE: VB does not support 64-bit integers, so VB users only have access +' to the low 32-bits of 64-bit return values. 64-bit parameters can +' be specified though, using the "64" version of the function. + +' NOTE: Use "StrPtr(filename)" to pass a filename to the BASS_MusicLoad, +' BASS_SampleLoad and BASS_StreamCreateFile functions. + +' NOTE: Use the VBStrFromAnsiPtr function to convert "char *" to VB "String". + +Global Const BASSVERSION = &H204 'API version +Global Const BASSVERSIONTEXT = "2.4" + +Global Const BASSTRUE As Long = 1 'Use this instead of VB Booleans +Global Const BASSFALSE As Long = 0 'Use this instead of VB Booleans + +' Error codes returned by BASS_ErrorGetCode +Global Const BASS_OK = 0 'all is OK +Global Const BASS_ERROR_MEM = 1 'memory error +Global Const BASS_ERROR_FILEOPEN = 2 'can't open the file +Global Const BASS_ERROR_DRIVER = 3 'can't find a free sound driver +Global Const BASS_ERROR_BUFLOST = 4 'the sample buffer was lost +Global Const BASS_ERROR_HANDLE = 5 'invalid handle +Global Const BASS_ERROR_FORMAT = 6 'unsupported sample format +Global Const BASS_ERROR_POSITION = 7 'invalid position +Global Const BASS_ERROR_INIT = 8 'BASS_Init has not been successfully called +Global Const BASS_ERROR_START = 9 'BASS_Start has not been successfully called +Global Const BASS_ERROR_ALREADY = 14 'already initialized/paused/whatever +Global Const BASS_ERROR_NOTAUDIO = 17 'file does not contain audio +Global Const BASS_ERROR_NOCHAN = 18 'can't get a free channel +Global Const BASS_ERROR_ILLTYPE = 19 'an illegal type was specified +Global Const BASS_ERROR_ILLPARAM = 20 'an illegal parameter was specified +Global Const BASS_ERROR_NO3D = 21 'no 3D support +Global Const BASS_ERROR_NOEAX = 22 'no EAX support +Global Const BASS_ERROR_DEVICE = 23 'illegal device number +Global Const BASS_ERROR_NOPLAY = 24 'not playing +Global Const BASS_ERROR_FREQ = 25 'illegal sample rate +Global Const BASS_ERROR_NOTFILE = 27 'the stream is not a file stream +Global Const BASS_ERROR_NOHW = 29 'no hardware voices available +Global Const BASS_ERROR_EMPTY = 31 'the MOD music has no sequence data +Global Const BASS_ERROR_NONET = 32 'no internet connection could be opened +Global Const BASS_ERROR_CREATE = 33 'couldn't create the file +Global Const BASS_ERROR_NOFX = 34 'effects are not available +Global Const BASS_ERROR_NOTAVAIL = 37 'requested data/action is not available +Global Const BASS_ERROR_DECODE = 38 'the channel is/isn't a "decoding channel" +Global Const BASS_ERROR_DX = 39 'a sufficient DirectX version is not installed +Global Const BASS_ERROR_TIMEOUT = 40 'connection timedout +Global Const BASS_ERROR_FILEFORM = 41 'unsupported file format +Global Const BASS_ERROR_SPEAKER = 42 'unavailable speaker +Global Const BASS_ERROR_VERSION = 43 'invalid BASS version (used by add-ons) +Global Const BASS_ERROR_CODEC = 44 'codec is not available/supported +Global Const BASS_ERROR_ENDED = 45 'the channel/file has ended +Global Const BASS_ERROR_BUSY = 46 'the device is busy +Global Const BASS_ERROR_UNSTREAMABLE = 47 'unstreamable file +Global Const BASS_ERROR_UNKNOWN = -1 'some other mystery problem + +' BASS_SetConfig options +Global Const BASS_CONFIG_BUFFER = 0 +Global Const BASS_CONFIG_UPDATEPERIOD = 1 +Global Const BASS_CONFIG_GVOL_SAMPLE = 4 +Global Const BASS_CONFIG_GVOL_STREAM = 5 +Global Const BASS_CONFIG_GVOL_MUSIC = 6 +Global Const BASS_CONFIG_CURVE_VOL = 7 +Global Const BASS_CONFIG_CURVE_PAN = 8 +Global Const BASS_CONFIG_FLOATDSP = 9 +Global Const BASS_CONFIG_3DALGORITHM = 10 +Global Const BASS_CONFIG_NET_TIMEOUT = 11 +Global Const BASS_CONFIG_NET_BUFFER = 12 +Global Const BASS_CONFIG_PAUSE_NOPLAY = 13 +Global Const BASS_CONFIG_NET_PREBUF = 15 +Global Const BASS_CONFIG_NET_PASSIVE = 18 +Global Const BASS_CONFIG_REC_BUFFER = 19 +Global Const BASS_CONFIG_NET_PLAYLIST = 21 +Global Const BASS_CONFIG_MUSIC_VIRTUAL = 22 +Global Const BASS_CONFIG_VERIFY = 23 +Global Const BASS_CONFIG_UPDATETHREADS = 24 +Global Const BASS_CONFIG_DEV_BUFFER = 27 +Global Const BASS_CONFIG_REC_LOOPBACK = 28 +Global Const BASS_CONFIG_VISTA_TRUEPOS = 30 +Global Const BASS_CONFIG_DEV_DEFAULT = 36 +Global Const BASS_CONFIG_NET_READTIMEOUT = 37 +Global Const BASS_CONFIG_VISTA_SPEAKERS = 38 +Global Const BASS_CONFIG_MF_DISABLE = 40 +Global Const BASS_CONFIG_HANDLES = 41 +Global Const BASS_CONFIG_UNICODE = 42 +Global Const BASS_CONFIG_SRC = 43 +Global Const BASS_CONFIG_SRC_SAMPLE = 44 +Global Const BASS_CONFIG_ASYNCFILE_BUFFER = 45 +Global Const BASS_CONFIG_OGG_PRESCAN = 47 +Global Const BASS_CONFIG_MF_VIDEO = 48 +Global Const BASS_CONFIG_VERIFY_NET = 52 +Global Const BASS_CONFIG_DEV_PERIOD = 53 +Global Const BASS_CONFIG_FLOAT = 54 +Global Const BASS_CONFIG_NET_SEEK = 56 +Global Const BASS_CONFIG_NET_PLAYLIST_DEPTH = 59 +Global Const BASS_CONFIG_NET_PREBUF_WAIT = 60 +Global Const BASS_CONFIG_WASAPI_PERSIST = 65 +Global Const BASS_CONFIG_REC_WASAPI = 66 + +' BASS_SetConfigPtr options +Global Const BASS_CONFIG_NET_AGENT = 16 +Global Const BASS_CONFIG_NET_PROXY = 17 +Global Const BASS_CONFIG_LIBSSL = 64 + +' BASS_ASIO_Init flags +Global Const BASS_DEVICE_8BITS = 1 '8 bit +Global Const BASS_DEVICE_MONO = 2 'mono +Global Const BASS_DEVICE_3D = 4 'enable 3D functionality +Global Const BASS_DEVICE_LATENCY = &H100 'calculate device latency (BASS_INFO struct) +Global Const BASS_DEVICE_CPSPEAKERS = &H400 'detect speakers via Windows control panel +Global Const BASS_DEVICE_SPEAKERS = &H800 'force enabling of speaker assignment +Global Const BASS_DEVICE_NOSPEAKER = &H1000 'ignore speaker arrangement +Global Const BASS_DEVICE_DSOUND = &H40000 ' use DirectSound output + +' DirectSound interfaces (for use with BASS_GetDSoundObject) +Global Const BASS_OBJECT_DS = 1 ' DirectSound +Global Const BASS_OBJECT_DS3DL = 2 'IDirectSound3DListener + +' Device info structure +Type BASS_DEVICEINFO + name As Long ' description + driver As Long ' driver + flags As Long +End Type + +' BASS_DEVICEINFO flags +Global Const BASS_DEVICE_ENABLED = 1 +Global Const BASS_DEVICE_DEFAULT = 2 +Global Const BASS_DEVICE_INIT = 4 +Global Const BASS_DEVICE_LOOPBACK = 8 + +Global Const BASS_DEVICE_TYPE_MASK = &Hff000000 +Global Const BASS_DEVICE_TYPE_NETWORK = &H01000000 +Global Const BASS_DEVICE_TYPE_SPEAKERS = &H02000000 +Global Const BASS_DEVICE_TYPE_LINE = &H03000000 +Global Const BASS_DEVICE_TYPE_HEADPHONES = &H04000000 +Global Const BASS_DEVICE_TYPE_MICROPHONE = &H05000000 +Global Const BASS_DEVICE_TYPE_HEADSET = &H06000000 +Global Const BASS_DEVICE_TYPE_HANDSET = &H07000000 +Global Const BASS_DEVICE_TYPE_DIGITAL = &H08000000 +Global Const BASS_DEVICE_TYPE_SPDIF = &H09000000 +Global Const BASS_DEVICE_TYPE_HDMI = &H0a000000 +Global Const BASS_DEVICE_TYPE_DISPLAYPORT = &H40000000 + +Type BASS_INFO + flags As Long ' device capabilities (DSCAPS_xxx flags) + hwsize As Long ' size of total device hardware memory + hwfree As Long ' size of free device hardware memory + freesam As Long ' number of free sample slots in the hardware + free3d As Long ' number of free 3D sample slots in the hardware + minrate As Long ' min sample rate supported by the hardware + maxrate As Long ' max sample rate supported by the hardware + eax As Long ' device supports EAX? (always BASSFALSE if BASS_DEVICE_3D was not used) + minbuf As Long ' recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY) + dsver As Long ' DirectSound version + latency As Long ' delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY) + initflags As Long ' BASS_Init "flags" parameter + speakers As Long ' number of speakers available + freq As Long ' current output rate +End Type + +' BASS_INFO flags (from DSOUND.H) +Global Const DSCAPS_CONTINUOUSRATE = 16 ' supports all sample rates between min/maxrate +Global Const DSCAPS_EMULDRIVER = 32 ' device does NOT have hardware DirectSound support +Global Const DSCAPS_CERTIFIED = 64 ' device driver has been certified by Microsoft +Global Const DSCAPS_SECONDARYMONO = 256 ' mono +Global Const DSCAPS_SECONDARYSTEREO = 512 ' stereo +Global Const DSCAPS_SECONDARY8BIT = 1024 ' 8 bit +Global Const DSCAPS_SECONDARY16BIT = 2048 ' 16 bit + +' Recording device info structure +Type BASS_RECORDINFO + flags As Long ' device capabilities (DSCCAPS_xxx flags) + formats As Long ' supported standard formats (WAVE_FORMAT_xxx flags) + inputs As Long ' number of inputs + singlein As Long ' BASSTRUE = only 1 input can be set at a time + freq As Long ' current input rate +End Type + +' BASS_RECORDINFO flags (from DSOUND.H) +Global Const DSCCAPS_EMULDRIVER = DSCAPS_EMULDRIVER ' device does NOT have hardware DirectSound recording support +Global Const DSCCAPS_CERTIFIED = DSCAPS_CERTIFIED ' device driver has been certified by Microsoft + +' defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H) +Global Const WAVE_FORMAT_1M08 = &H1 ' 11.025 kHz, Mono, 8-bit +Global Const WAVE_FORMAT_1S08 = &H2 ' 11.025 kHz, Stereo, 8-bit +Global Const WAVE_FORMAT_1M16 = &H4 ' 11.025 kHz, Mono, 16-bit +Global Const WAVE_FORMAT_1S16 = &H8 ' 11.025 kHz, Stereo, 16-bit +Global Const WAVE_FORMAT_2M08 = &H10 ' 22.05 kHz, Mono, 8-bit +Global Const WAVE_FORMAT_2S08 = &H20 ' 22.05 kHz, Stereo, 8-bit +Global Const WAVE_FORMAT_2M16 = &H40 ' 22.05 kHz, Mono, 16-bit +Global Const WAVE_FORMAT_2S16 = &H80 ' 22.05 kHz, Stereo, 16-bit +Global Const WAVE_FORMAT_4M08 = &H100 ' 44.1 kHz, Mono, 8-bit +Global Const WAVE_FORMAT_4S08 = &H200 ' 44.1 kHz, Stereo, 8-bit +Global Const WAVE_FORMAT_4M16 = &H400 ' 44.1 kHz, Mono, 16-bit +Global Const WAVE_FORMAT_4S16 = &H800 ' 44.1 kHz, Stereo, 16-bit + +' Sample info structure +Type BASS_SAMPLE + freq As Long ' default playback rate + volume As Single ' default volume (0-100) + pan As Single ' default pan (-100=left, 0=middle, 100=right) + flags As Long ' BASS_SAMPLE_xxx flags + length As Long ' length (in samples, not bytes) + max As Long ' maximum simultaneous playbacks + origres As Long ' original resolution + chans As Long ' number of channels + mingap As Long ' minimum gap (ms) between creating channels + mode3d As Long ' BASS_3DMODE_xxx mode + mindist As Single ' minimum distance + MAXDIST As Single ' maximum distance + iangle As Long ' angle of inside projection cone + oangle As Long ' angle of outside projection cone + outvol As Single ' delta-volume outside the projection cone + vam As Long ' voice allocation/management flags (BASS_VAM_xxx) + priority As Long ' priority (0=lowest, &Hffffffff=highest) +End Type + +Global Const BASS_SAMPLE_8BITS = 1 ' 8 bit +Global Const BASS_SAMPLE_FLOAT = 256 ' 32 bit floating-point +Global Const BASS_SAMPLE_MONO = 2 ' mono +Global Const BASS_SAMPLE_LOOP = 4 ' looped +Global Const BASS_SAMPLE_3D = 8 ' 3D functionality +Global Const BASS_SAMPLE_SOFTWARE = 16 ' not using hardware mixing +Global Const BASS_SAMPLE_MUTEMAX = 32 ' mute at max distance (3D only) +Global Const BASS_SAMPLE_VAM = 64 ' DX7 voice allocation & management +Global Const BASS_SAMPLE_FX = 128 ' old implementation of DX8 effects +Global Const BASS_SAMPLE_OVER_VOL = &H10000 ' override lowest volume +Global Const BASS_SAMPLE_OVER_POS = &H20000 ' override longest playing +Global Const BASS_SAMPLE_OVER_DIST = &H30000 ' override furthest from listener (3D only) + +Global Const BASS_STREAM_PRESCAN = &H20000 ' enable pin-point seeking/length (MP3/MP2/MP1) +Global Const BASS_STREAM_AUTOFREE = &H40000 ' automatically free the stream when it stop/ends +Global Const BASS_STREAM_RESTRATE = &H80000 ' restrict the download rate of internet file streams +Global Const BASS_STREAM_BLOCK = &H100000 ' download/play internet file stream in small blocks +Global Const BASS_STREAM_DECODE = &H200000 ' don't play the stream, only decode (BASS_ChannelGetData) +Global Const BASS_STREAM_STATUS = &H800000 ' give server status info (HTTP/ICY tags) in DOWNLOADPROC + +Global Const BASS_MP3_IGNOREDELAY = &H200 ' ignore LAME/Xing/VBRI/iTunes delay & padding info +Global Const BASS_MP3_SETPOS = BASS_STREAM_PRESCAN + +Global Const BASS_MUSIC_FLOAT = BASS_SAMPLE_FLOAT +Global Const BASS_MUSIC_MONO = BASS_SAMPLE_MONO +Global Const BASS_MUSIC_LOOP = BASS_SAMPLE_LOOP +Global Const BASS_MUSIC_3D = BASS_SAMPLE_3D +Global Const BASS_MUSIC_FX = BASS_SAMPLE_FX +Global Const BASS_MUSIC_AUTOFREE = BASS_STREAM_AUTOFREE +Global Const BASS_MUSIC_DECODE = BASS_STREAM_DECODE +Global Const BASS_MUSIC_PRESCAN = BASS_STREAM_PRESCAN ' calculate playback length +Global Const BASS_MUSIC_CALCLEN = BASS_MUSIC_PRESCAN +Global Const BASS_MUSIC_RAMP = &H200 ' normal ramping +Global Const BASS_MUSIC_RAMPS = &H400 ' sensitive ramping +Global Const BASS_MUSIC_SURROUND = &H800 ' surround sound +Global Const BASS_MUSIC_SURROUND2 = &H1000 ' surround sound (mode 2) +Global Const BASS_MUSIC_FT2PAN = &H2000 ' apply FastTracker 2 panning to XM files +Global Const BASS_MUSIC_FT2MOD = &H2000 ' play .MOD as FastTracker 2 does +Global Const BASS_MUSIC_PT1MOD = &H4000 ' play .MOD as ProTracker 1 does +Global Const BASS_MUSIC_NONINTER = &H10000 ' non-interpolated sample mixing +Global Const BASS_MUSIC_SINCINTER = &H800000 ' sinc interpolated sample mixing +Global Const BASS_MUSIC_POSRESET = 32768 ' stop all notes when moving position +Global Const BASS_MUSIC_POSRESETEX = &H400000 ' stop all notes and reset bmp/etc when moving position +Global Const BASS_MUSIC_STOPBACK = &H80000 ' stop the music on a backwards jump effect +Global Const BASS_MUSIC_NOSAMPLE = &H100000 ' don't load the samples + +' Speaker assignment flags +Global Const BASS_SPEAKER_FRONT = &H1000000 ' front speakers +Global Const BASS_SPEAKER_REAR = &H2000000 ' rear/side speakers +Global Const BASS_SPEAKER_CENLFE = &H3000000 ' center & LFE speakers (5.1) +Global Const BASS_SPEAKER_REAR2 = &H4000000 ' rear center speakers (7.1) +Global Const BASS_SPEAKER_LEFT = &H10000000 ' modifier: left +Global Const BASS_SPEAKER_RIGHT = &H20000000 ' modifier: right +Global Const BASS_SPEAKER_FRONTLEFT = BASS_SPEAKER_FRONT Or BASS_SPEAKER_LEFT +Global Const BASS_SPEAKER_FRONTRIGHT = BASS_SPEAKER_FRONT Or BASS_SPEAKER_RIGHT +Global Const BASS_SPEAKER_REARLEFT = BASS_SPEAKER_REAR Or BASS_SPEAKER_LEFT +Global Const BASS_SPEAKER_REARRIGHT = BASS_SPEAKER_REAR Or BASS_SPEAKER_RIGHT +Global Const BASS_SPEAKER_CENTER = BASS_SPEAKER_CENLFE Or BASS_SPEAKER_LEFT +Global Const BASS_SPEAKER_LFE = BASS_SPEAKER_CENLFE Or BASS_SPEAKER_RIGHT +Global Const BASS_SPEAKER_REAR2LEFT = BASS_SPEAKER_REAR2 Or BASS_SPEAKER_LEFT +Global Const BASS_SPEAKER_REAR2RIGHT = BASS_SPEAKER_REAR2 Or BASS_SPEAKER_RIGHT + +Global Const BASS_ASYNCFILE = &H40000000 +Global Const BASS_UNICODE = &H80000000 + +Global Const BASS_RECORD_PAUSE = 32768 ' start recording paused + +' DX7 voice allocation flags +Global Const BASS_VAM_HARDWARE = 1 +Global Const BASS_VAM_SOFTWARE = 2 +Global Const BASS_VAM_TERM_TIME = 4 +Global Const BASS_VAM_TERM_DIST = 8 +Global Const BASS_VAM_TERM_PRIO = 16 + +' Channel info structure +Type BASS_CHANNELINFO + freq As Long ' default playback rate + chans As Long ' channels + flags As Long ' BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags + ctype As Long ' type of channel + origres As Long ' original resolution + plugin As Long ' plugin + sample As Long ' sample + filename As Long ' filename +End Type + +Global Const BASS_ORIGRES_FLOAT = &H10000 + +' BASS_CHANNELINFO types +Global Const BASS_CTYPE_SAMPLE = 1 +Global Const BASS_CTYPE_RECORD = 2 +Global Const BASS_CTYPE_STREAM = &H10000 +Global Const BASS_CTYPE_STREAM_VORBIS = &H10002 +Global Const BASS_CTYPE_STREAM_OGG = &H10002 +Global Const BASS_CTYPE_STREAM_MP1 = &H10003 +Global Const BASS_CTYPE_STREAM_MP2 = &H10004 +Global Const BASS_CTYPE_STREAM_MP3 = &H10005 +Global Const BASS_CTYPE_STREAM_AIFF = &H10006 +Global Const BASS_CTYPE_STREAM_MF = &H10008 +Global Const BASS_CTYPE_STREAM_DUMMY = &H18000 +Global Const BASS_CTYPE_STREAM_DEVICE = &H18001 +Global Const BASS_CTYPE_STREAM_WAV = &H40000 ' WAVE flag, LOWORD=codec +Global Const BASS_CTYPE_STREAM_WAV_PCM = &H50001 +Global Const BASS_CTYPE_STREAM_WAV_FLOAT = &H50003 +Global Const BASS_CTYPE_MUSIC_MOD = &H20000 +Global Const BASS_CTYPE_MUSIC_MTM = &H20001 +Global Const BASS_CTYPE_MUSIC_S3M = &H20002 +Global Const BASS_CTYPE_MUSIC_XM = &H20003 +Global Const BASS_CTYPE_MUSIC_IT = &H20004 +Global Const BASS_CTYPE_MUSIC_MO3 = &H100 ' MO3 flag + +Type BASS_PLUGINFORM + ctype As Long ' channel type + name As Long ' format description + exts As Long ' file extension filter (*.ext1;*.ext2;etc...) +End Type + +Type BASS_PLUGININFO + Version As Long ' version (same form as BASS_GetVersion) + formatc As Long ' number of formats + formats As Long ' the array of formats +End Type + +' 3D vector (for 3D positions/velocities/orientations) +Type BASS_3DVECTOR + X As Single ' +=right, -=left + Y As Single ' +=up, -=down + z As Single ' +=front, -=behind +End Type + +' 3D channel modes +Global Const BASS_3DMODE_NORMAL = 0 ' normal 3D processing +Global Const BASS_3DMODE_RELATIVE = 1 ' position is relative to the listener +Global Const BASS_3DMODE_OFF = 2 ' no 3D processing + +' software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM) +Global Const BASS_3DALG_DEFAULT = 0 +Global Const BASS_3DALG_OFF = 1 +Global Const BASS_3DALG_FULL = 2 +Global Const BASS_3DALG_LIGHT = 3 + +' EAX environments, use with BASS_SetEAXParameters +Global Const EAX_ENVIRONMENT_GENERIC = 0 +Global Const EAX_ENVIRONMENT_PADDEDCELL = 1 +Global Const EAX_ENVIRONMENT_ROOM = 2 +Global Const EAX_ENVIRONMENT_BATHROOM = 3 +Global Const EAX_ENVIRONMENT_LIVINGROOM = 4 +Global Const EAX_ENVIRONMENT_STONEROOM = 5 +Global Const EAX_ENVIRONMENT_AUDITORIUM = 6 +Global Const EAX_ENVIRONMENT_CONCERTHALL = 7 +Global Const EAX_ENVIRONMENT_CAVE = 8 +Global Const EAX_ENVIRONMENT_ARENA = 9 +Global Const EAX_ENVIRONMENT_HANGAR = 10 +Global Const EAX_ENVIRONMENT_CARPETEDHALLWAY = 11 +Global Const EAX_ENVIRONMENT_HALLWAY = 12 +Global Const EAX_ENVIRONMENT_STONECORRIDOR = 13 +Global Const EAX_ENVIRONMENT_ALLEY = 14 +Global Const EAX_ENVIRONMENT_FOREST = 15 +Global Const EAX_ENVIRONMENT_CITY = 16 +Global Const EAX_ENVIRONMENT_MOUNTAINS = 17 +Global Const EAX_ENVIRONMENT_QUARRY = 18 +Global Const EAX_ENVIRONMENT_PLAIN = 19 +Global Const EAX_ENVIRONMENT_PARKINGLOT = 20 +Global Const EAX_ENVIRONMENT_SEWERPIPE = 21 +Global Const EAX_ENVIRONMENT_UNDERWATER = 22 +Global Const EAX_ENVIRONMENT_DRUGGED = 23 +Global Const EAX_ENVIRONMENT_DIZZY = 24 +Global Const EAX_ENVIRONMENT_PSYCHOTIC = 25 +Global Const EAX_ENVIRONMENT_COUNT = 26 ' total number of environments + +Global Const BASS_STREAMPROC_END = &H80000000 ' end of user stream flag + +' special STREAMPROCs +Global Const STREAMPROC_DUMMY = 0 ' "dummy" stream +Global Const STREAMPROC_PUSH = -1 ' push stream +Global Const STREAMPROC_DEVICE = -2 ' device mix stream +Global Const STREAMPROC_DEVICE_3D = -3 ' device 3D mix stream + +' BASS_StreamCreateFileUser file systems +Global Const STREAMFILE_NOBUFFER = 0 +Global Const STREAMFILE_BUFFER = 1 +Global Const STREAMFILE_BUFFERPUSH = 2 + +Type BASS_FILEPROCS + close As Long + length As Long + read As Long + seek As Long +End Type + +' BASS_StreamPutFileData options +Global Const BASS_FILEDATA_END = 0 ' end & close the file + +' BASS_StreamGetFilePosition modes +Global Const BASS_FILEPOS_CURRENT = 0 +Global Const BASS_FILEPOS_DECODE = BASS_FILEPOS_CURRENT +Global Const BASS_FILEPOS_DOWNLOAD = 1 +Global Const BASS_FILEPOS_END = 2 +Global Const BASS_FILEPOS_START = 3 +Global Const BASS_FILEPOS_CONNECTED = 4 +Global Const BASS_FILEPOS_BUFFER = 5 +Global Const BASS_FILEPOS_SOCKET = 6 +Global Const BASS_FILEPOS_ASYNCBUF = 7 +Global Const BASS_FILEPOS_SIZE = 8 +Global Const BASS_FILEPOS_BUFFERING = 9 + +' BASS_ChannelSetSync types +Global Const BASS_SYNC_POS = 0 +Global Const BASS_SYNC_END = 2 +Global Const BASS_SYNC_META = 4 +Global Const BASS_SYNC_SLIDE = 5 +Global Const BASS_SYNC_STALL = 6 +Global Const BASS_SYNC_DOWNLOAD = 7 +Global Const BASS_SYNC_FREE = 8 +Global Const BASS_SYNC_SETPOS = 11 +Global Const BASS_SYNC_MUSICPOS = 10 +Global Const BASS_SYNC_MUSICINST = 1 +Global Const BASS_SYNC_MUSICFX = 3 +Global Const BASS_SYNC_OGG_CHANGE = 12 +Global Const BASS_SYNC_DEV_FAIL = 14 +Global Const BASS_SYNC_DEV_FORMAT = 15 +Global Const BASS_SYNC_THREAD = &H20000000 ' flag: call sync in other thread +Global Const BASS_SYNC_MIXTIME = &H40000000 ' flag: sync at mixtime, else at playtime +Global Const BASS_SYNC_ONETIME = &H80000000 ' flag: sync only once, else continuously + +' BASS_ChannelIsActive return values +Global Const BASS_ACTIVE_STOPPED = 0 +Global Const BASS_ACTIVE_PLAYING = 1 +Global Const BASS_ACTIVE_STALLED = 2 +Global Const BASS_ACTIVE_PAUSED = 3 +Global Const BASS_ACTIVE_PAUSED_DEVICE = 4 + +' Channel attributes +Global Const BASS_ATTRIB_FREQ = 1 +Global Const BASS_ATTRIB_VOL = 2 +Global Const BASS_ATTRIB_PAN = 3 +Global Const BASS_ATTRIB_EAXMIX = 4 +Global Const BASS_ATTRIB_NOBUFFER = 5 +Global Const BASS_ATTRIB_VBR = 6 +Global Const BASS_ATTRIB_CPU = 7 +Global Const BASS_ATTRIB_SRC = 8 +Global Const BASS_ATTRIB_NET_RESUME = 9 +Global Const BASS_ATTRIB_SCANINFO = 10 +Global Const BASS_ATTRIB_NORAMP = 11 +Global Const BASS_ATTRIB_BITRATE = 12 +Global Const BASS_ATTRIB_BUFFER = 13 +Global Const BASS_ATTRIB_GRANULE = 14 +Global Const BASS_ATTRIB_MUSIC_AMPLIFY = &H100 +Global Const BASS_ATTRIB_MUSIC_PANSEP = &H101 +Global Const BASS_ATTRIB_MUSIC_PSCALER = &H102 +Global Const BASS_ATTRIB_MUSIC_BPM = &H103 +Global Const BASS_ATTRIB_MUSIC_SPEED = &H104 +Global Const BASS_ATTRIB_MUSIC_VOL_GLOBAL = &H105 +Global Const BASS_ATTRIB_MUSIC_ACTIVE = &H106 +Global Const BASS_ATTRIB_MUSIC_VOL_CHAN = &H200 ' + channel # +Global Const BASS_ATTRIB_MUSIC_VOL_INST = &H300 ' + instrument # + +' BASS_ChannelSlideAttribute flags +Global Const BASS_SLIDE_LOG = &H1000000 + +' BASS_ChannelGetData flags +Global Const BASS_DATA_AVAILABLE = 0 ' query how much data is buffered +Global Const BASS_DATA_FIXED = &H20000000 ' flag: return 8.24 fixed-point data +Global Const BASS_DATA_FLOAT = &H40000000 ' flag: return floating-point sample data +Global Const BASS_DATA_FFT256 = &H80000000 ' 256 sample FFT +Global Const BASS_DATA_FFT512 = &H80000001 ' 512 FFT +Global Const BASS_DATA_FFT1024 = &H80000002 ' 1024 FFT +Global Const BASS_DATA_FFT2048 = &H80000003 ' 2048 FFT +Global Const BASS_DATA_FFT4096 = &H80000004 ' 4096 FFT +Global Const BASS_DATA_FFT8192 = &H80000005 ' 8192 FFT +Global Const BASS_DATA_FFT16384 = &H80000006 ' 16384 FFT +Global Const BASS_DATA_FFT32768 = &H80000007 ' 32768 FFT +Global Const BASS_DATA_FFT_INDIVIDUAL = &H10 ' FFT flag: FFT for each channel, else all combined +Global Const BASS_DATA_FFT_NOWINDOW = &H20 ' FFT flag: no Hanning window +Global Const BASS_DATA_FFT_REMOVEDC = &H40 ' FFT flag: pre-remove DC bias +Global Const BASS_DATA_FFT_COMPLEX = &H80 ' FFT flag: return complex data +Global Const BASS_DATA_FFT_NYQUIST = &H100 ' FFT flag: return extra Nyquist value + +' BASS_ChannelGetLevelEx flags +Global Const BASS_LEVEL_MONO = 1 +Global Const BASS_LEVEL_STEREO = 2 +Global Const BASS_LEVEL_RMS = 4 +Global Const BASS_LEVEL_VOLPAN = 8 + +' BASS_ChannelGetTags types : what's returned +Global Const BASS_TAG_ID3 = 0 ' ID3v1 tags : TAG_ID3 structure +Global Const BASS_TAG_ID3V2 = 1 ' ID3v2 tags : variable length block +Global Const BASS_TAG_OGG = 2 ' OGG comments : series of null-terminated UTF-8 strings +Global Const BASS_TAG_HTTP = 3 ' HTTP headers : series of null-terminated ANSI strings +Global Const BASS_TAG_ICY = 4 ' ICY headers : series of null-terminated ANSI strings +Global Const BASS_TAG_META = 5 ' ICY metadata : ANSI string +Global Const BASS_TAG_APE = 6 ' APEv2 tags : series of null-terminated UTF-8 strings +Global Const BASS_TAG_MP4 = 7 ' MP4/iTunes metadata : series of null-terminated UTF-8 strings +Global Const BASS_TAG_WMA = 8 ' WMA tags : series of null-terminated UTF-8 strings +Global Const BASS_TAG_VENDOR = 9 ' OGG encoder : UTF-8 string +Global Const BASS_TAG_LYRICS3 = 10 ' Lyric3v2 tag : ASCII string +Global Const BASS_TAG_CA_CODEC = 11 ' CoreAudio codec info : TAG_CA_CODEC structure +Global Const BASS_TAG_MF = 13 ' Media Foundation tags : series of null-terminated UTF-8 strings +Global Const BASS_TAG_WAVEFORMAT = 14 ' WAVE format : WAVEFORMATEEX structure +Global Const BASS_TAG_RIFF_INFO = &H100 ' RIFF "INFO" tags : series of null-terminated ANSI strings +Global Const BASS_TAG_RIFF_BEXT = &H101 ' RIFF/BWF "bext" tags : TAG_BEXT structure +Global Const BASS_TAG_RIFF_CART = &H102 ' RIFF/BWF "cart" tags : TAG_CART structure +Global Const BASS_TAG_RIFF_DISP = &H103 ' RIFF "DISP" text tag : ANSI string +Global Const BASS_TAG_RIFF_CUE = &H104 ' RIFF "cue " chunk : TAG_CUE structure +Global Const BASS_TAG_RIFF_SMPL = &H105 ' RIFF "smpl" chunk : TAG_SMPL structure +Global Const BASS_TAG_APE_BINARY = &H1000 ' + index #, binary APEv2 tag : TAG_APE_BINARY structure +Global Const BASS_TAG_MUSIC_NAME = &H10000 ' MOD music name : ANSI string +Global Const BASS_TAG_MUSIC_ORDERS = &H10002 ' MOD order list : BYTE array of pattern numbers +Global Const BASS_TAG_MUSIC_MESSAGE = &H10001 ' MOD message : ANSI string +Global Const BASS_TAG_MUSIC_AUTH = &H10003 ' MOD author : UTF-8 string +Global Const BASS_TAG_MUSIC_INST = &H10100 ' + instrument #, MOD instrument name : ANSI string +Global Const BASS_TAG_MUSIC_SAMPLE = &H10300 ' + sample #, MOD sample name : ANSI string + +' ID3v1 tag structure +Type TAG_ID3 + id As String * 3 + title As String * 30 + artist As String * 30 + album As String * 30 + year As String * 4 + comment As String * 30 + genre As Byte +End Type + +' Binary APEv2 tag structure +Type TAG_APE_BINARY + key As Long + data As Long + length As Long +End Type + +' BWF "bext" tag structure +Type TAG_BEXT + Description As String * 256 ' description + Originator As String * 32 ' name of the originator + OriginatorReference As String * 32 ' reference of the originator + OriginationDate As String * 10 ' date of creation (yyyy-mm-dd) + OriginationTime As String * 8 ' time of creation (hh-mm-ss) + TimeReferenceLo As Long ' low 32 bits of first sample count since midnight (little-endian) + TimeReferenceHi As Long ' high 32 bits of first sample count since midnight (little-endian) + Version As Integer ' BWF version (little-endian) + UMID(0 To 63) As Byte ' SMPTE UMID + Reserved(0 To 189) As Byte + CodingHistory() As String ' history +End Type + +' BASS_ChannelGetLength/GetPosition/SetPosition modes +Global Const BASS_POS_BYTE = 0 ' byte position +Global Const BASS_POS_MUSIC_ORDER = 1 ' order.row position, MAKELONG(order,row) +Global Const BASS_POS_OGG = 3 ' OGG bitstream number +Global Const BASS_POS_RESET = &H2000000 ' flag: reset user file buffers +Global Const BASS_POS_RELATIVE = &H4000000 ' flag: seek relative to the current position +Global Const BASS_POS_INEXACT = &H8000000 ' flag: allow seeking to inexact position +Global Const BASS_POS_DECODE = &H10000000 ' flag: get the decoding (not playing) position +Global Const BASS_POS_DECODETO = &H20000000 ' flag: decode to the position instead of seeking +Global Const BASS_POS_SCAN = &H40000000 ' flag: scan to the position + +' BASS_ChannelSetDevice/GetDevice option +Global Const BASS_NODEVICE = &H20000 + +' BASS_RecordSetInput flags +Global Const BASS_INPUT_OFF = &H10000 +Global Const BASS_INPUT_ON = &H20000 + +Global Const BASS_INPUT_TYPE_MASK = &HFF000000 +Global Const BASS_INPUT_TYPE_UNDEF = &H0 +Global Const BASS_INPUT_TYPE_DIGITAL = &H1000000 +Global Const BASS_INPUT_TYPE_LINE = &H2000000 +Global Const BASS_INPUT_TYPE_MIC = &H3000000 +Global Const BASS_INPUT_TYPE_SYNTH = &H4000000 +Global Const BASS_INPUT_TYPE_CD = &H5000000 +Global Const BASS_INPUT_TYPE_PHONE = &H6000000 +Global Const BASS_INPUT_TYPE_SPEAKER = &H7000000 +Global Const BASS_INPUT_TYPE_WAVE = &H8000000 +Global Const BASS_INPUT_TYPE_AUX = &H9000000 +Global Const BASS_INPUT_TYPE_ANALOG = &HA000000 + +' BASS_ChannelSetFX effect types +Global Const BASS_FX_DX8_CHORUS = 0 +Global Const BASS_FX_DX8_COMPRESSOR = 1 +Global Const BASS_FX_DX8_DISTORTION = 2 +Global Const BASS_FX_DX8_ECHO = 3 +Global Const BASS_FX_DX8_FLANGER = 4 +Global Const BASS_FX_DX8_GARGLE = 5 +Global Const BASS_FX_DX8_I3DL2REVERB = 6 +Global Const BASS_FX_DX8_PARAMEQ = 7 +Global Const BASS_FX_DX8_REVERB = 8 +Global Const BASS_FX_VOLUME = 9 + +Type BASS_DX8_CHORUS + fWetDryMix As Single + fDepth As Single + fFeedback As Single + fFrequency As Single + lWaveform As Long ' 0=triangle, 1=sine + fDelay As Single + lPhase As Long ' BASS_DX8_PHASE_xxx +End Type + +Type BASS_DX8_COMPRESSOR + fGain As Single + fAttack As Single + fRelease As Single + fThreshold As Single + fRatio As Single + fPredelay As Single +End Type + +Type BASS_DX8_DISTORTION + fGain As Single + fEdge As Single + fPostEQCenterFrequency As Single + fPostEQBandwidth As Single + fPreLowpassCutoff As Single +End Type + +Type BASS_DX8_ECHO + fWetDryMix As Single + fFeedback As Single + fLeftDelay As Single + fRightDelay As Single + lPanDelay As Long +End Type + +Type BASS_DX8_FLANGER + fWetDryMix As Single + fDepth As Single + fFeedback As Single + fFrequency As Single + lWaveform As Long ' 0=triangle, 1=sine + fDelay As Single + lPhase As Long ' BASS_DX8_PHASE_xxx +End Type + +Type BASS_DX8_GARGLE + dwRateHz As Long ' Rate of modulation in hz + dwWaveShape As Long ' 0=triangle, 1=square +End Type + +Type BASS_DX8_I3DL2REVERB + lRoom As Long ' [-10000, 0] default: -1000 mB + lRoomHF As Long ' [-10000, 0] default: 0 mB + flRoomRolloffFactor As Single ' [0.0, 10.0] default: 0.0 + flDecayTime As Single ' [0.1, 20.0] default: 1.49s + flDecayHFRatio As Single ' [0.1, 2.0] default: 0.83 + lReflections As Long ' [-10000, 1000] default: -2602 mB + flReflectionsDelay As Single ' [0.0, 0.3] default: 0.007 s + lReverb As Long ' [-10000, 2000] default: 200 mB + flReverbDelay As Single ' [0.0, 0.1] default: 0.011 s + flDiffusion As Single ' [0.0, 100.0] default: 100.0 % + flDensity As Single ' [0.0, 100.0] default: 100.0 % + flHFReference As Single ' [20.0, 20000.0] default: 5000.0 Hz +End Type + +Type BASS_DX8_PARAMEQ + fCenter As Single + fBandwidth As Single + fGain As Single +End Type + +Type BASS_DX8_REVERB + fInGain As Single ' [-96.0,0.0] default: 0.0 dB + fReverbMix As Single ' [-96.0,0.0] default: 0.0 db + fReverbTime As Single ' [0.001,3000.0] default: 1000.0 ms + fHighFreqRTRatio As Single ' [0.001,0.999] default: 0.001 +End Type + +Global Const BASS_DX8_PHASE_NEG_180 = 0 +Global Const BASS_DX8_PHASE_NEG_90 = 1 +Global Const BASS_DX8_PHASE_ZERO = 2 +Global Const BASS_DX8_PHASE_90 = 3 +Global Const BASS_DX8_PHASE_180 = 4 + +Type BASS_FX_VOLUME_PARAM + fTarget As Single + fCurrent As Single + fTime As Single + lCurve As Long +End Type + +Type GUID ' used with BASS_Init - use VarPtr(guid) in clsid parameter + Data1 As Long + Data2 As Integer + Data3 As Integer + Data4(0 To 7) As Byte +End Type + + +Declare Function BASS_SetConfig Lib "bass.dll" (ByVal opt As Long, ByVal value As Long) As Long +Declare Function BASS_GetConfig Lib "bass.dll" (ByVal opt As Long) As Long +Declare Function BASS_SetConfigPtr Lib "bass.dll" (ByVal opt As Long, ByVal value As Any) As Long +Declare Function BASS_GetConfigPtr Lib "bass.dll" (ByVal opt As Long) As Long +Declare Function BASS_GetVersion Lib "bass.dll" () As Long +Declare Function BASS_ErrorGetCode Lib "bass.dll" () As Long +Declare Function BASS_GetDeviceInfo Lib "bass.dll" (ByVal device As Long, ByRef info As BASS_DEVICEINFO) As Long +Declare Function BASS_Init Lib "bass.dll" (ByVal device As Long, ByVal freq As Long, ByVal flags As Long, ByVal win As Long, ByVal clsid As Long) As Long +Declare Function BASS_SetDevice Lib "bass.dll" (ByVal device As Long) As Long +Declare Function BASS_GetDevice Lib "bass.dll" () As Long +Declare Function BASS_Free Lib "bass.dll" () As Long +Declare Function BASS_GetDSoundObject Lib "bass.dll" (ByVal object As Long) As Long +Declare Function BASS_GetInfo Lib "bass.dll" (ByRef info As BASS_INFO) As Long +Declare Function BASS_Update Lib "bass.dll" (ByVal legnth As Long) As Long +Declare Function BASS_GetCPU Lib "bass.dll" () As Single +Declare Function BASS_Start Lib "bass.dll" () As Long +Declare Function BASS_Stop Lib "bass.dll" () As Long +Declare Function BASS_Pause Lib "bass.dll" () As Long +Declare Function BASS_IsStarted Lib "bass.dll" () As Long +Declare Function BASS_SetVolume Lib "bass.dll" (ByVal volume As Single) As Long +Declare Function BASS_GetVolume Lib "bass.dll" () As Single + +Declare Function BASS_PluginLoad Lib "bass.dll" (ByVal filename As String, ByVal flags As Long) As Long +Declare Function BASS_PluginFree Lib "bass.dll" (ByVal handle As Long) As Long +Declare Function BASS_PluginGetInfo_ Lib "bass.dll" Alias "BASS_PluginGetInfo" (ByVal handle As Long) As Long + +Declare Function BASS_Set3DFactors Lib "bass.dll" (ByVal distf As Single, ByVal rollf As Single, ByVal doppf As Single) As Long +Declare Function BASS_Get3DFactors Lib "bass.dll" (ByRef distf As Single, ByRef rollf As Single, ByRef doppf As Single) As Long +Declare Function BASS_Set3DPosition Lib "bass.dll" (ByRef pos As Any, ByRef vel As Any, ByRef front As Any, ByRef top As Any) As Long +Declare Function BASS_Get3DPosition Lib "bass.dll" (ByRef pos As Any, ByRef vel As Any, ByRef front As Any, ByRef top As Any) As Long +Declare Function BASS_Apply3D Lib "bass.dll" () As Long +Declare Function BASS_SetEAXParameters Lib "bass.dll" (ByVal env As Long, ByVal vol As Single, ByVal decay As Single, ByVal damp As Single) As Long +Declare Function BASS_GetEAXParameters Lib "bass.dll" (ByRef env As Long, ByRef vol As Single, ByRef decay As Single, ByRef damp As Single) As Long + +Declare Function BASS_MusicLoad64 Lib "bass.dll" Alias "BASS_MusicLoad" (ByVal mem As Long, ByVal file As Any, ByVal offset As Long, ByVal offsethigh As Long, ByVal length As Long, ByVal flags As Long, ByVal freq As Long) As Long +Declare Function BASS_MusicFree Lib "bass.dll" (ByVal handle As Long) As Long + +Declare Function BASS_SampleLoad64 Lib "bass.dll" Alias "BASS_SampleLoad" (ByVal mem As Long, ByVal file As Any, ByVal offset As Long, ByVal offsethigh As Long, ByVal length As Long, ByVal max As Long, ByVal flags As Long) As Long +Declare Function BASS_SampleCreate Lib "bass.dll" (ByVal length As Long, ByVal freq As Long, ByVal chans As Long, ByVal max As Long, ByVal flags As Long) As Long +Declare Function BASS_SampleFree Lib "bass.dll" (ByVal handle As Long) As Long +Declare Function BASS_SampleSetData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any) As Long +Declare Function BASS_SampleGetData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any) As Long +Declare Function BASS_SampleGetInfo Lib "bass.dll" (ByVal handle As Long, ByRef info As BASS_SAMPLE) As Long +Declare Function BASS_SampleSetInfo Lib "bass.dll" (ByVal handle As Long, ByRef info As BASS_SAMPLE) As Long +Declare Function BASS_SampleGetChannel Lib "bass.dll" (ByVal handle As Long, ByVal onlynew As Long) As Long +Declare Function BASS_SampleGetChannels Lib "bass.dll" (ByVal handle As Long, ByRef channels As Long) As Long +Declare Function BASS_SampleStop Lib "bass.dll" (ByVal handle As Long) As Long + +Declare Function BASS_StreamCreate Lib "bass.dll" (ByVal freq As Long, ByVal chans As Long, ByVal flags As Long, ByVal proc As Long, ByVal user As Long) As Long +Declare Function BASS_StreamCreateFile64 Lib "bass.dll" Alias "BASS_StreamCreateFile" (ByVal mem As Long, ByVal file As Any, ByVal offset As Long, ByVal offsethigh As Long, ByVal length As Long, ByVal lengthhigh As Long, ByVal flags As Long) As Long +Declare Function BASS_StreamCreateURL Lib "bass.dll" (ByVal url As String, ByVal offset As Long, ByVal flags As Long, ByVal proc As Long, ByVal user As Long) As Long +Declare Function BASS_StreamCreateFileUser Lib "bass.dll" (ByVal system As Long, ByVal flags As Long, ByVal procs As Long, ByVal user As Long) As Long +Declare Function BASS_StreamFree Lib "bass.dll" (ByVal handle As Long) As Long +Declare Function BASS_StreamGetFilePosition Lib "bass.dll" (ByVal handle As Long, ByVal mode As Long) As Long +Declare Function BASS_StreamPutData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any, ByVal length As Long) As Long +Declare Function BASS_StreamPutFileData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any, ByVal length As Long) As Long + +Declare Function BASS_RecordGetDeviceInfo Lib "bass.dll" (ByVal device As Long, ByRef info As BASS_DEVICEINFO) As Long +Declare Function BASS_RecordInit Lib "bass.dll" (ByVal device As Long) As Long +Declare Function BASS_RecordSetDevice Lib "bass.dll" (ByVal device As Long) As Long +Declare Function BASS_RecordGetDevice Lib "bass.dll" () As Long +Declare Function BASS_RecordFree Lib "bass.dll" () As Long +Declare Function BASS_RecordGetInfo Lib "bass.dll" (ByRef info As BASS_RECORDINFO) As Long +Declare Function BASS_RecordGetInputName Lib "bass.dll" (ByVal inputn As Long) As Long +Declare Function BASS_RecordSetInput Lib "bass.dll" (ByVal inputn As Long, ByVal flags As Long, ByVal volume As Single) As Long +Declare Function BASS_RecordGetInput Lib "bass.dll" (ByVal inputn As Long, ByRef volume As Single) As Long +Declare Function BASS_RecordStart Lib "bass.dll" (ByVal freq As Long, ByVal chans As Long, ByVal flags As Long, ByVal proc As Long, ByVal user As Long) As Long + +Declare Function BASS_ChannelBytes2Seconds64 Lib "bass.dll" Alias "BASS_ChannelBytes2Seconds" (ByVal handle As Long, ByVal pos As Long, ByVal poshigh As Long) As Double +Declare Function BASS_ChannelSeconds2Bytes Lib "bass.dll" (ByVal handle As Long, ByVal pos As Double) As Long +Declare Function BASS_ChannelGetDevice Lib "bass.dll" (ByVal handle As Long) As Long +Declare Function BASS_ChannelSetDevice Lib "bass.dll" (ByVal handle As Long, ByVal device As Long) As Long +Declare Function BASS_ChannelIsActive Lib "bass.dll" (ByVal handle As Long) As Long +Declare Function BASS_ChannelGetInfo Lib "bass.dll" (ByVal handle As Long, ByRef info As BASS_CHANNELINFO) As Long +Declare Function BASS_ChannelGetTags Lib "bass.dll" (ByVal handle As Long, ByVal tags As Long) As Long +Declare Function BASS_ChannelFlags Lib "bass.dll" (ByVal handle As Long, ByVal flags As Long, ByVal mask As Long) As Long +Declare Function BASS_ChannelUpdate Lib "bass.dll" (ByVal handle As Long, ByVal length As Long) As Long +Declare Function BASS_ChannelLock Lib "bass.dll" (ByVal handle As Long, ByVal lock_ As Long) As Long +Declare Function BASS_ChannelPlay Lib "bass.dll" (ByVal handle As Long, ByVal restart As Long) As Long +Declare Function BASS_ChannelStop Lib "bass.dll" (ByVal handle As Long) As Long +Declare Function BASS_ChannelPause Lib "bass.dll" (ByVal handle As Long) As Long +Declare Function BASS_ChannelSetAttribute Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long, ByVal value As Single) As Long +Declare Function BASS_ChannelGetAttribute Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long, ByRef value As Single) As Long +Declare Function BASS_ChannelSlideAttribute Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long, ByVal value As Single, ByVal time As Long) As Long +Declare Function BASS_ChannelIsSliding Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long) As Long +Declare Function BASS_ChannelSetAttributeEx Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long, ByRef value As Any, ByVal size As Long) As Long +Declare Function BASS_ChannelGetAttributeEx Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long, ByRef value As Any, ByVal size As Long) As Long +Declare Function BASS_ChannelSet3DAttributes Lib "bass.dll" (ByVal handle As Long, ByVal mode As Long, ByVal min As Single, ByVal max As Single, ByVal iangle As Long, ByVal oangle As Long, ByVal outvol As Single) As Long +Declare Function BASS_ChannelGet3DAttributes Lib "bass.dll" (ByVal handle As Long, ByRef mode As Long, ByRef min As Single, ByRef max As Single, ByRef iangle As Long, ByRef oangle As Long, ByRef outvol As Single) As Long +Declare Function BASS_ChannelSet3DPosition Lib "bass.dll" (ByVal handle As Long, ByRef pos As Any, ByRef orient As Any, ByRef vel As Any) As Long +Declare Function BASS_ChannelGet3DPosition Lib "bass.dll" (ByVal handle As Long, ByRef pos As Any, ByRef orient As Any, ByRef vel As Any) As Long +Declare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As Long, ByVal mode As Long) As Long +Declare Function BASS_ChannelSetPosition64 Lib "bass.dll" Alias "BASS_ChannelSetPosition" (ByVal handle As Long, ByVal pos As Long, ByVal poshigh As Long, ByVal mode As Long) As Long +Declare Function BASS_ChannelGetPosition Lib "bass.dll" (ByVal handle As Long, ByVal mode As Long) As Long +Declare Function BASS_ChannelGetLevel Lib "bass.dll" (ByVal handle As Long) As Long +Declare Function BASS_ChannelGetLevelEx Lib "bass.dll" (ByVal handle As Long, ByRef levels As Single, ByVal length As Single, ByVal flags As Long) As Long +Declare Function BASS_ChannelGetData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any, ByVal length As Long) As Long +Declare Function BASS_ChannelSetSync64 Lib "bass.dll" Alias "BASS_ChannelSetSync" (ByVal handle As Long, ByVal type_ As Long, ByVal param As Long, ByVal paramhigh As Long, ByVal proc As Long, ByVal user As Long) As Long +Declare Function BASS_ChannelRemoveSync Lib "bass.dll" (ByVal handle As Long, ByVal sync As Long) As Long +Declare Function BASS_ChannelSetDSP Lib "bass.dll" (ByVal handle As Long, ByVal proc As Long, ByVal user As Long, ByVal priority As Long) As Long +Declare Function BASS_ChannelRemoveDSP Lib "bass.dll" (ByVal handle As Long, ByVal dsp As Long) As Long +Declare Function BASS_ChannelSetLink Lib "bass.dll" (ByVal handle As Long, ByVal chan As Long) As Long +Declare Function BASS_ChannelRemoveLink Lib "bass.dll" (ByVal handle As Long, ByVal chan As Long) As Long +Declare Function BASS_ChannelSetFX Lib "bass.dll" (ByVal handle As Long, ByVal type_ As Long, ByVal priority As Long) As Long +Declare Function BASS_ChannelRemoveFX Lib "bass.dll" (ByVal handle As Long, ByVal fx As Long) As Long +Declare Function BASS_FXSetParameters Lib "bass.dll" (ByVal handle As Long, ByRef par As Any) As Long +Declare Function BASS_FXGetParameters Lib "bass.dll" (ByVal handle As Long, ByRef par As Any) As Long +Declare Function BASS_FXReset Lib "bass.dll" (ByVal handle As Long) As Long +Declare Function BASS_FXSetPriority Lib "bass.dll" (ByVal handle As Long, ByVal priority As Long) As Long + +Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal length As Long) +Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As Long) As Long + +Public Function BASS_SPEAKER_N(ByVal n As Long) As Long +BASS_SPEAKER_N = n * (2 ^ 24) +End Function + +' 32-bit wrappers for 64-bit BASS functions +Function BASS_MusicLoad(ByVal mem As Long, ByVal file As Long, ByVal offset As Long, ByVal length As Long, ByVal flags As Long, ByVal freq As Long) As Long +BASS_MusicLoad = BASS_MusicLoad64(mem, file, offset, 0, length, flags Or BASS_UNICODE, freq) +End Function + +Function BASS_SampleLoad(ByVal mem As Long, ByVal file As Long, ByVal offset As Long, ByVal length As Long, ByVal max As Long, ByVal flags As Long) As Long +BASS_SampleLoad = BASS_SampleLoad64(mem, file, offset, 0, length, max, flags Or BASS_UNICODE) +End Function + +Function BASS_StreamCreateFile(ByVal mem As Long, ByVal file As Long, ByVal offset As Long, ByVal length As Long, ByVal flags As Long) As Long +BASS_StreamCreateFile = BASS_StreamCreateFile64(mem, file, offset, 0, length, 0, flags Or BASS_UNICODE) +End Function + +Function BASS_ChannelBytes2Seconds(ByVal handle As Long, ByVal pos As Long) As Double +BASS_ChannelBytes2Seconds = BASS_ChannelBytes2Seconds64(handle, pos, 0) +End Function + +Function BASS_ChannelSetPosition(ByVal handle As Long, ByVal pos As Long, ByVal mode As Long) As Long +BASS_ChannelSetPosition = BASS_ChannelSetPosition64(handle, pos, 0, mode) +End Function + +Function BASS_ChannelSetSync(ByVal handle As Long, ByVal type_ As Long, ByVal param As Long, ByVal proc As Long, ByVal user As Long) As Long +BASS_ChannelSetSync = BASS_ChannelSetSync64(handle, type_, param, 0, proc, user) +End Function + +' BASS_PluginGetInfo wrappers +Function BASS_PluginGetInfo(ByVal handle As Long) As BASS_PLUGININFO +Dim pinfo As BASS_PLUGININFO, plug As Long +plug = BASS_PluginGetInfo_(handle) +If plug Then + Call CopyMemory(pinfo, ByVal plug, LenB(pinfo)) +End If +BASS_PluginGetInfo = pinfo +End Function + +Function BASS_PluginGetInfoFormat(ByVal handle As Long, ByVal index As Long) As BASS_PLUGINFORM +Dim pform As BASS_PLUGINFORM, plug As Long +plug = BASS_PluginGetInfo(handle).formats +If plug Then + plug = plug + (index * LenB(pform)) + Call CopyMemory(pform, ByVal plug, LenB(pform)) +End If +BASS_PluginGetInfoFormat = pform +End Function + +' callback functions +Function STREAMPROC(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long + + 'CALLBACK FUNCTION !!! + + ' User stream callback function + ' handle : The stream that needs writing + ' buffer : Buffer to write the samples in + ' length : Number of bytes to write + ' user : The 'user' parameter value given when calling BASS_StreamCreate + ' RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end + ' the stream. + +End Function + +Sub DOWNLOADPROC(ByVal buffer As Long, ByVal length As Long, ByVal user As Long) + + 'CALLBACK FUNCTION !!! + + ' Internet stream download callback function. + ' buffer : Buffer containing the downloaded data... NULL=end of download + ' length : Number of bytes in the buffer + ' user : The 'user' parameter given when calling BASS_StreamCreateURL + +End Sub + +Sub SYNCPROC(ByVal handle As Long, ByVal channel As Long, ByVal data As Long, ByVal user As Long) + + 'CALLBACK FUNCTION !!! + + ' Sync callback function. + ' handle : The sync that has occured + ' channel: Channel that the sync occured in + ' data : Additional data associated with the sync's occurance + ' user : The 'user' parameter given when calling BASS_ChannelSetSync */ + +End Sub + +Sub DSPPROC(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) + + 'CALLBACK FUNCTION !!! + + ' DSP callback function. + ' handle : The DSP handle + ' channel: Channel that the DSP is being applied to + ' buffer : Buffer to apply the DSP to + ' length : Number of bytes in the buffer + ' user : The 'user' parameter given when calling BASS_ChannelSetDSP + + ' VB doesn't support pointers, so you should copy the buffer into an array, + ' process it, and then copy it back into the buffer. + +End Sub + +Function RECORDPROC(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long + + 'CALLBACK FUNCTION !!! + + ' Recording callback function. + ' handle : The recording handle + ' buffer : Buffer containing the recorded samples + ' length : Number of bytes + ' user : The 'user' parameter value given when calling BASS_RecordStart + ' RETURN : BASSTRUE = continue recording, BASSFALSE = stop + +End Function + +' User file stream callback functions (BASS_FILEPROCS) +Sub FILECLOSEPROC(ByVal user As Long) + +End Sub + +Function FILELENPROC(ByVal user As Long) As Currency ' ??? + +End Function + +Function FILEREADPROC(ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long + +End Function + +Function FILESEEKPROC(ByVal offset As Long, ByVal offsethigh As Long, ByVal user As Long) As Long + +End Function + + +Function BASS_SetEAXPreset(preset) As Long +' This function is a workaround, because VB doesn't support multiple comma seperated +' paramaters for each Global Const, simply pass the EAX_ENVIRONMENT_xxx value to this function +' instead of BASS_SetEAXParameters as you would do in C/C++ +Select Case preset + Case EAX_ENVIRONMENT_GENERIC + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_GENERIC, 0.5, 1.493, 0.5) + Case EAX_ENVIRONMENT_PADDEDCELL + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PADDEDCELL, 0.25, 0.1, 0) + Case EAX_ENVIRONMENT_ROOM + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_ROOM, 0.417, 0.4, 0.666) + Case EAX_ENVIRONMENT_BATHROOM + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_BATHROOM, 0.653, 1.499, 0.166) + Case EAX_ENVIRONMENT_LIVINGROOM + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_LIVINGROOM, 0.208, 0.478, 0) + Case EAX_ENVIRONMENT_STONEROOM + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_STONEROOM, 0.5, 2.309, 0.888) + Case EAX_ENVIRONMENT_AUDITORIUM + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_AUDITORIUM, 0.403, 4.279, 0.5) + Case EAX_ENVIRONMENT_CONCERTHALL + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CONCERTHALL, 0.5, 3.961, 0.5) + Case EAX_ENVIRONMENT_CAVE + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CAVE, 0.5, 2.886, 1.304) + Case EAX_ENVIRONMENT_ARENA + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_ARENA, 0.361, 7.284, 0.332) + Case EAX_ENVIRONMENT_HANGAR + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_HANGAR, 0.5, 10, 0.3) + Case EAX_ENVIRONMENT_CARPETEDHALLWAY + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CARPETEDHALLWAY, 0.153, 0.259, 2) + Case EAX_ENVIRONMENT_HALLWAY + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_HALLWAY, 0.361, 1.493, 0) + Case EAX_ENVIRONMENT_STONECORRIDOR + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_STONECORRIDOR, 0.444, 2.697, 0.638) + Case EAX_ENVIRONMENT_ALLEY + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_ALLEY, 0.25, 1.752, 0.776) + Case EAX_ENVIRONMENT_FOREST + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_FOREST, 0.111, 3.145, 0.472) + Case EAX_ENVIRONMENT_CITY + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CITY, 0.111, 2.767, 0.224) + Case EAX_ENVIRONMENT_MOUNTAINS + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_MOUNTAINS, 0.194, 7.841, 0.472) + Case EAX_ENVIRONMENT_QUARRY + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_QUARRY, 1, 1.499, 0.5) + Case EAX_ENVIRONMENT_PLAIN + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PLAIN, 0.097, 2.767, 0.224) + Case EAX_ENVIRONMENT_PARKINGLOT + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PARKINGLOT, 0.208, 1.652, 1.5) + Case EAX_ENVIRONMENT_SEWERPIPE + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_SEWERPIPE, 0.652, 2.886, 0.25) + Case EAX_ENVIRONMENT_UNDERWATER + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_UNDERWATER, 1, 1.499, 0) + Case EAX_ENVIRONMENT_DRUGGED + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_DRUGGED, 0.875, 8.392, 1.388) + Case EAX_ENVIRONMENT_DIZZY + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_DIZZY, 0.139, 17.234, 0.666) + Case EAX_ENVIRONMENT_PSYCHOTIC + BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PSYCHOTIC, 0.486, 7.563, 0.806) +End Select +End Function + +Public Function LoByte(ByVal lparam As Long) As Long +LoByte = lparam And &HFF& +End Function +Public Function HiByte(ByVal lparam As Long) As Long +HiByte = (lparam And &HFF00&) / &H100& +End Function +Public Function LoWord(ByVal lparam As Long) As Long +LoWord = lparam And &HFFFF& +End Function +Public Function HiWord(ByVal lparam As Long) As Long +If lparam < 0 Then + HiWord = (lparam \ &H10000 - 1) And &HFFFF& +Else + HiWord = lparam \ &H10000 +End If +End Function +Function MakeWord(ByVal LoByte As Long, ByVal HiByte As Long) As Long +MakeWord = (LoByte And &HFF&) Or ((HiByte And &HFF&) * &H100&) +End Function +Function MakeLong(ByVal LoWord As Long, ByVal HiWord As Long) As Long +MakeLong = LoWord And &HFFFF& +HiWord = HiWord And &HFFFF& +If HiWord And &H8000& Then + MakeLong = MakeLong Or (((HiWord And &H7FFF&) * &H10000) Or &H80000000) +Else + MakeLong = MakeLong Or (HiWord * &H10000) +End If +End Function + +Public Function VBStrFromAnsiPtr(ByVal lpStr As Long) As String +Dim bStr() As Byte +Dim cChars As Long +On Error Resume Next +' Get the number of characters in the buffer +cChars = lstrlen(lpStr) +If cChars Then + ' Resize the byte array + ReDim bStr(0 To cChars - 1) As Byte + ' Grab the ANSI buffer + Call CopyMemory(bStr(0), ByVal lpStr, cChars) +End If +' Now convert to a VB Unicode string +VBStrFromAnsiPtr = StrConv(bStr, vbUnicode) +End Function diff --git a/bass-sys/bass24/x64/bass.dll b/bass-sys/bass24/x64/bass.dll new file mode 100644 index 0000000..825b68e Binary files /dev/null and b/bass-sys/bass24/x64/bass.dll differ diff --git a/bass-sys/bass24/x64/mp3-free/bass.dll b/bass-sys/bass24/x64/mp3-free/bass.dll new file mode 100644 index 0000000..e29f943 Binary files /dev/null and b/bass-sys/bass24/x64/mp3-free/bass.dll differ diff --git a/bass-sys/build.rs b/bass-sys/build.rs new file mode 100644 index 0000000..c876337 --- /dev/null +++ b/bass-sys/build.rs @@ -0,0 +1,12 @@ +use std::env; +use std::path::PathBuf; + +fn main() { + let mut project_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); + project_dir.push("bass24"); + project_dir.push("c"); + project_dir.push("x64"); + + println!("cargo:rustc-link-search={}", project_dir.to_str().unwrap()); + println!("cargo:rustc-link-lib=bass"); +} diff --git a/bass-sys/src/constants.rs b/bass-sys/src/constants.rs new file mode 100644 index 0000000..e2a680f --- /dev/null +++ b/bass-sys/src/constants.rs @@ -0,0 +1,54 @@ +use crate::types::*; + +pub const BASS_DEVICE_8BITS: DWORD = 1; +pub const BASS_DEVICE_MONO: DWORD = 2; +pub const BASS_DEVICE_3D: DWORD = 4; +pub const BASS_DEVICE_16BITS: DWORD = 8; +pub const BASS_DEVICE_LATENCY: DWORD = 0x100; +pub const BASS_DEVICE_CPSPEAKERS: DWORD = 0x400; +pub const BASS_DEVICE_SPEAKERS: DWORD = 0x800; +pub const BASS_DEVICE_NOSPEAKER: DWORD = 0x1000; +pub const BASS_DEVICE_DMIX: DWORD = 0x2000; +pub const BASS_DEVICE_FREQ: DWORD = 0x4000; +pub const BASS_DEVICE_STEREO: DWORD = 0x8000; + +pub const BASS_DEVICE_ENABLED: DWORD = 1; +pub const BASS_DEVICE_DEFAULT: DWORD = 2; +pub const BASS_DEVICE_INIT: DWORD = 4; +pub const BASS_DEVICE_LOOPBACK: DWORD = 8; + +pub const BASS_DEVICE_TYPE_MASK: DWORD = 0xff000000; +pub const BASS_DEVICE_TYPE_NETWORK: DWORD = 0x01000000; +pub const BASS_DEVICE_TYPE_SPEAKERS: DWORD = 0x02000000; +pub const BASS_DEVICE_TYPE_LINE: DWORD = 0x03000000; +pub const BASS_DEVICE_TYPE_HEADPHONES: DWORD = 0x04000000; +pub const BASS_DEVICE_TYPE_MICROPHONE: DWORD = 0x05000000; +pub const BASS_DEVICE_TYPE_HEADSET: DWORD = 0x06000000; +pub const BASS_DEVICE_TYPE_HANDSET: DWORD = 0x07000000; +pub const BASS_DEVICE_TYPE_DIGITAL: DWORD = 0x08000000; +pub const BASS_DEVICE_TYPE_SPDIF: DWORD = 0x09000000; +pub const BASS_DEVICE_TYPE_HDMI: DWORD = 0x0a000000; +pub const BASS_DEVICE_TYPE_DISPLAYPORT: DWORD = 0x40000000; + +pub const BASS_SAMPLE_8BITS: DWORD = 1; +pub const BASS_SAMPLE_FLOAT: DWORD = 256; +pub const BASS_SAMPLE_MONO: DWORD = 2; +pub const BASS_SAMPLE_LOOP: DWORD = 4; +pub const BASS_SAMPLE_3D: DWORD = 8; +pub const BASS_SAMPLE_SOFTWARE: DWORD = 16; +pub const BASS_SAMPLE_MUTEMAX: DWORD = 32; +pub const BASS_SAMPLE_VAM: DWORD = 64; +pub const BASS_SAMPLE_FX: DWORD = 128; +pub const BASS_SAMPLE_OVER_VOL: DWORD = 0x10000; +pub const BASS_SAMPLE_OVER_POS: DWORD = 0x20000; +pub const BASS_SAMPLE_OVER_DIST: DWORD = 0x30000; + +pub const BASS_POS_BYTE: DWORD = 0; +pub const BASS_POS_MUSIC_ORDER: DWORD = 1; +pub const BASS_POS_OGG: DWORD = 3; +pub const BASS_POS_RESET: DWORD = 0x2000000; +pub const BASS_POS_RELATIVE: DWORD = 0x4000000; +pub const BASS_POS_INEXACT: DWORD = 0x8000000; +pub const BASS_POS_DECODE: DWORD = 0x10000000; +pub const BASS_POS_DECODETO: DWORD = 0x20000000; +pub const BASS_POS_SCAN: DWORD = 0x40000000; diff --git a/bass-sys/src/lib.rs b/bass-sys/src/lib.rs new file mode 100644 index 0000000..7f41f6f --- /dev/null +++ b/bass-sys/src/lib.rs @@ -0,0 +1,47 @@ +#[macro_use] +mod macros; + +pub mod constants; +pub mod types; + +pub use crate::types::*; + +extern_log! { + pub fn BASS_ErrorGetCode() -> c_int; + + pub fn BASS_GetConfig(option: DWORD) -> DWORD; + + pub fn BASS_ChannelGetDevice(handle: DWORD) -> DWORD; + pub fn BASS_ChannelSetDevice(handle: DWORD, device: DWORD) -> BOOL; + pub fn BASS_ChannelPlay(handle: DWORD, restart: BOOL) -> BOOL; + pub fn BASS_ChannelPause(handle: DWORD) -> BOOL; + pub fn BASS_ChannelGetLength(handle: DWORD, mode: DWORD) -> QWORD; + pub fn BASS_ChannelGetPosition(handle: DWORD, mode: DWORD) -> QWORD; + pub fn BASS_ChannelBytes2Seconds(handle: DWORD, pos: QWORD) -> f64; + + pub fn BASS_GetDevice() -> DWORD; + pub fn BASS_GetDeviceInfo(device: DWORD, info: *mut BASS_DEVICEINFO) -> BOOL; + pub fn BASS_Init(device: c_int, freq: DWORD, flags: DWORD, win: *const c_void, clsid: *const c_void) -> BOOL; + pub fn BASS_Free() -> BOOL; + pub fn BASS_Pause() -> BOOL; + pub fn BASS_Start() -> BOOL; + pub fn BASS_GetVolume() -> c_float; + + pub fn BASS_StreamCreate( + freq: DWORD, + chans: DWORD, + flags: DWORD, + proc: STREAMPROC, + user: *mut c_void, + ) -> HSTREAM; + pub fn BASS_StreamCreateFile( + mem: BOOL, + file: *mut c_void, + offset: QWORD, + length: QWORD, + flags: DWORD, + ) -> HSTREAM; + pub fn BASS_StreamFree(handle: HSTREAM) -> BOOL; + + pub fn BASS_SampleGetInfo(handle: HSAMPLE, info: *mut BASS_SAMPLE) -> BOOL; +} diff --git a/bass-sys/src/macros.rs b/bass-sys/src/macros.rs new file mode 100644 index 0000000..27316e7 --- /dev/null +++ b/bass-sys/src/macros.rs @@ -0,0 +1,26 @@ +/// Wraps all calls with debug-level logging of the arguments and return value. +macro_rules! extern_log { + ($($vis:vis fn $name:ident ( $($arg:ident: $argty:ty),* $(,)? ) $(-> $ty:ty)? ;)*) => { + $( + paste::item! { + #[allow(non_snake_case)] + mod [< __inner_ffi_ $name >] { + #[allow(unused_imports)] + use std::os::raw::*; + #[allow(unused_imports)] + use crate::types::*; + extern "C" { + pub fn $name($($arg: $argty,)*) $(-> $ty)?; + } + } + } + #[allow(non_snake_case)] + $vis unsafe fn $name ($($arg: $argty,)*) $(-> $ty)? { + log::debug!("entering {} ({:?})", stringify!($name), ($($arg,)*)); + let result = paste::expr! { self::[< __inner_ffi_ $name >]::$name($($arg,)*) }; + log::debug!("exiting {} => {:?}", stringify!($name), result); + result + } + )* + }; +} diff --git a/bass-sys/src/types.rs b/bass-sys/src/types.rs new file mode 100644 index 0000000..3e9ec62 --- /dev/null +++ b/bass-sys/src/types.rs @@ -0,0 +1,39 @@ +pub use std::os::raw::{c_char, c_float, c_int, c_uint, c_ulong, c_void}; + +pub type DWORD = c_uint; +pub type QWORD = c_ulong; +pub type BOOL = c_int; + +pub type HSAMPLE = DWORD; +pub type HSTREAM = DWORD; + +pub type STREAMPROC = extern "C" fn(HSTREAM, *mut c_void, DWORD, *mut c_void) -> DWORD; + +#[repr(C)] +pub struct BASS_DEVICEINFO { + pub name: *mut c_char, + pub driver: *mut c_char, + pub flags: DWORD, +} + +#[repr(C)] +pub struct BASS_SAMPLE { + /// Default sample rate. + pub freq: DWORD, + pub volume: c_float, + pub pan: c_float, + pub flags: DWORD, + pub length: DWORD, + pub max: DWORD, + pub origres: DWORD, + pub chans: DWORD, + pub mingap: DWORD, + pub mode3d: DWORD, + pub mindist: c_float, + pub maxdist: c_float, + pub iangle: DWORD, + pub oangle: DWORD, + pub outvol: c_float, + pub vam: DWORD, + pub priority: DWORD, +} diff --git a/bass.dll b/bass.dll new file mode 100644 index 0000000..825b68e Binary files /dev/null and b/bass.dll differ diff --git a/happy-time/Akari Yui Kyouko Chinatsu 486.jpg b/happy-time/Akari Yui Kyouko Chinatsu 486.jpg new file mode 100644 index 0000000..3c73d21 Binary files /dev/null and b/happy-time/Akari Yui Kyouko Chinatsu 486.jpg differ diff --git a/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Expert].osu b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Expert].osu new file mode 100644 index 0000000..c89ba35 --- /dev/null +++ b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Expert].osu @@ -0,0 +1,677 @@ +osu file format v14 + +[General] +AudioFilename: audio.mp3 +AudioLeadIn: 0 +PreviewTime:75687 +Countdown: 0 +SampleSet: Soft +StackLeniency: 0.2 +Mode: 0 +LetterboxInBreaks: 0 +WidescreenStoryboard: 1 + +[Editor] +DistanceSpacing: 1.6 +BeatDivisor: 4 +GridSize: 8 +TimelineZoom: 3.099999 + +[Metadata] +Title:Happy Time wa Owaranai (Cut Ver.) +TitleUnicode:ハッピータイムは終わらない (Cut Ver.) +Artist:Nanamori-chu * Goraku-bu +ArtistUnicode:七森中☆ごらく部 +Creator:-Keitaro +Version:Expert +Source:ゆるゆり +Tags:japanese anime pop YuruYuri 三上枝織 大坪由佳 津田美波 大久保瑠美 Mikami Shiori Otsubo Yuka Tsuda Minami Okubo Rumi 赤座あかり Akaza Akari 歳納京子 Toshino Kyoko 船見結衣 Funami Yui 吉川ちなつ Yoshikawa Chinatsu ioexception deadcode ceo of osu ceo_of_osu +BeatmapID:2743617 +BeatmapSetID:1057015 + +[Difficulty] +HPDrainRate:6 +CircleSize:3.8 +OverallDifficulty:9 +ApproachRate:8 +SliderMultiplier:1.6 +SliderTickRate:1 + +[Events] +//Background and Video events +0,0,"Akari Yui Kyouko Chinatsu 486.jpg",0,0 +//Break Periods +//Storyboard Layer 0 (Background) +//Storyboard Layer 1 (Fail) +//Storyboard Layer 2 (Pass) +//Storyboard Layer 3 (Foreground) +//Storyboard Layer 4 (Overlay) +//Storyboard Sound Samples + +[TimingPoints] +1635,315.789473684211,4,2,22,62,1,0 +10003,-100,4,2,22,52,0,0 +10477,-200,4,2,22,62,0,0 +20582,-80,4,2,22,72,0,0 +30687,-100,4,2,22,72,0,0 +32582,-50,4,2,22,72,0,0 +33213,-100,4,2,22,72,0,0 +37635,-50,4,2,22,72,0,0 +38266,-100,4,2,22,72,0,0 +40792,-133.333333333333,4,2,22,62,0,0 +50898,-80,4,2,22,72,0,0 +61003,-133.333333333333,4,2,22,72,0,0 +68582,-100,4,2,22,72,0,0 +71108,-50,4,2,22,72,0,0 +73635,-66.6666666666667,4,2,22,72,0,0 +76161,-76.9230769230769,4,2,22,82,0,0 +85792,-76.9230769230769,4,2,22,82,0,0 +85832,-76.9230769230769,4,2,22,82,0,0 +85950,-76.9230769230769,4,2,22,82,0,0 +85990,-76.9230769230769,4,2,22,82,0,0 +86108,-76.9230769230769,4,2,22,82,0,0 +86148,-76.9230769230769,4,2,22,82,0,0 +86266,-76.9230769230769,4,2,22,82,0,0 +116582,-100,4,2,22,72,0,0 +118477,-40,4,2,22,72,0,0 +119108,-100,4,2,22,72,0,0 +123529,-33.3333333333333,4,2,22,72,0,0 +124161,-100,4,2,22,82,0,0 +127792,-66.6666666666667,4,2,22,72,0,0 + + +[Colours] +Combo1 : 95,20,250 +Combo2 : 0,64,128 +Combo3 : 18,124,255 +Combo4 : 255,145,91 + +[HitObjects] +48,32,10003,5,2,0:0:0:0: +120,56,10161,1,2,0:0:0:0: +192,80,10319,1,2,0:0:0:0: +48,32,10477,6,0,B|11:86|11:86|36:349,1,320,4|2,1:0|0:0,0:0:0:0: +107,292,12056,1,0,0:0:0:0: +107,292,12213,2,0,L|97:201,1,80,2|2,0:0|0:0,0:0:0:0: +85,126,12687,5,2,0:0:0:0: +169,147,12845,1,0,0:0:0:0: +361,184,13003,6,0,B|372:104|372:104|295:88|295:88|281:181,1,240,4|0,1:0|0:0,0:0:0:0: +468,372,14266,6,0,B|478:292|478:292|320:270,1,240,4|0,1:2|0:0,0:0:0:0: +30,252,15529,6,0,B|20:332|20:332|97:342|97:342|110:246,1,240,4|0,1:2|0:0,0:0:0:0: +44,30,16792,6,0,B|36:108|36:108|205:120,1,240,4|2,1:2|0:0,0:0:0:0: +348,14,18056,6,0,L|339:110,1,80,4|0,1:2|0:0,0:0:0:0: +425,43,18687,6,0,L|416:139,1,80,4|0,1:2|0:0,0:0:0:0: +499,77,19319,6,0,L|494:134,1,40,4|0,1:2|0:0,0:0:0:0: +486,199,19635,6,0,L|481:256,1,40,4|0,1:2|0:0,0:0:0:0: +408,360,20108,5,2,0:0:0:0: +328,344,20266,1,2,0:0:0:0: +248,328,20424,1,2,0:0:0:0: +408,360,20582,6,0,P|428:309|459:261,1,100,4|2,1:0|0:0,0:0:0:0: +343,173,20898,2,0,P|325:219|299:262,1,100,8|2,0:0|0:0,0:0:0:0: +435,171,21213,5,0,1:0:0:0: +386,91,21371,1,2,0:0:0:0: +343,173,21529,1,8,0:0:0:0: +386,91,21687,1,2,0:0:0:0: +112,0,21845,6,0,L|131:106,1,100,0|2,1:0|0:0,0:0:0:0: +204,98,22161,2,0,L|186:0,1,100,8|2,0:0|0:0,0:0:0:0: +112,332,22477,6,0,L|54:340,1,50,0|0,1:0|0:0,0:0:0:0: +83,238,22635,1,2,0:0:0:0: +400,332,22792,6,0,L|458:340,1,50,8|0,0:0|0:0,0:0:0:0: +429,238,22950,1,2,0:0:0:0: +112,332,23108,6,0,P|176:321|199:269,1,100,4|2,1:2|0:0,0:0:0:0: +453,148,23424,5,8,0:0:0:0: +429,238,23582,1,2,0:0:0:0: +400,332,23740,2,0,L|280:308,1,100,0|2,1:0|0:2,0:0:0:0: +194,295,24056,5,8,0:0:0:0: +512,216,24213,1,2,0:0:0:0: +293,10,24371,6,0,P|301:61|309:139,1,100,0|2,1:2|0:0,0:0:0:0: +306,109,24687,1,8,0:0:0:0: +472,31,24845,1,2,0:0:0:0: +306,109,25003,1,0,1:2:0:0: +140,70,25161,1,2,0:0:0:0: +115,63,25239,1,2,0:0:0:0: +91,56,25318,1,10,0:0:0:0: +306,109,25477,1,2,0:0:0:0: +316,189,25635,6,0,L|326:300,1,100,4|2,1:2|0:0,0:0:0:0: +324,288,25950,1,8,0:0:0:0: +306,109,26108,1,2,0:0:0:0: +316,189,26266,2,0,L|326:300,1,100,0|2,1:2|0:0,0:0:0:0: +331,371,26582,5,8,0:0:0:0: +298,32,26740,1,2,0:0:0:0: +0,354,26898,6,0,L|129:340,1,100,0|2,1:2|0:0,0:0:0:0: +231,381,27213,2,0,L|360:367,1,100,8|2,0:0|0:0,0:0:0:0: +330,370,27529,1,0,1:2:0:0: +74,189,27687,6,0,P|134:190|170:253,1,100,2|8,0:0|0:0,0:0:0:0: +160,215,28003,1,2,0:0:0:0: +369,12,28161,5,4,1:2:0:0: +399,92,28319,1,2,0:0:0:0: +419,100,28398,1,2,0:0:0:0: +440,103,28477,1,8,0:0:0:0: +512,57,28635,1,2,0:0:0:0: +57,79,28792,5,0,1:2:0:0: +134,21,28950,1,2,0:0:0:0: +233,36,29108,1,8,0:0:0:0: +292,109,29266,1,2,0:0:0:0: +71,271,29424,5,0,1:2:0:0: +95,265,29582,1,2,0:0:0:0: +138,121,29740,5,8,0:0:0:0: +0,150,29898,1,2,0:0:0:0: +107,378,30056,5,0,1:2:0:0: +209,357,30213,1,2,3:2:0:0: +213,333,30291,1,0,3:0:0:0: +218,308,30370,1,8,0:0:0:0: +233,212,30529,1,2,0:0:0:0: +329,236,30687,6,0,L|441:260,1,80,4|2,1:0|0:0,0:0:0:0: +233,212,31003,5,8,0:0:0:0: +297,140,31161,1,2,0:0:0:0: +407,252,31319,1,0,1:0:0:0: +344,384,31477,2,0,L|248:360,1,80,2|8,0:0|0:0,0:0:0:0: +160,336,31792,2,0,L|64:312,1,80,2|0,0:0|1:0,0:0:0:0: +32,232,32108,1,2,0:0:0:0: +120,224,32266,1,8,0:0:0:0: +72,144,32424,1,2,0:0:0:0: +248,16,32582,6,0,B|264:32|264:32|240:224,3,160,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +224,264,33213,6,0,L|320:256,1,80,4|2,1:2|0:0,0:0:0:0: +392,248,33529,1,8,0:0:0:0: +336,176,33687,1,2,0:0:0:0: +264,352,33845,1,0,1:0:0:0: +480,376,34003,2,0,L|488:272,1,80,2|8,0:0|0:0,0:0:0:0: +496,192,34319,2,0,L|504:88,1,80,2|0,0:0|1:0,0:0:0:0: +424,48,34635,1,2,0:0:0:0: +416,136,34792,1,8,0:0:0:0: +344,80,34950,1,2,0:0:0:0: +160,96,35108,5,2,1:2:0:0: +96,152,35266,1,0,3:0:0:0: +99,191,35344,1,0,3:0:0:0: +103,231,35423,1,8,0:0:0:0: +176,272,35582,1,2,0:0:0:0: +80,64,35740,6,0,L|-16:80,1,80,4|2,1:2|0:0,0:0:0:0: +96,152,36056,1,8,0:0:0:0: +160,96,36213,1,2,0:0:0:0: +497,9,36371,5,0,1:0:0:0: +464,96,36529,2,0,L|448:192,1,80,2|8,0:0|0:0,0:0:0:0: +424,272,36845,2,0,L|408:368,1,80,2|0,0:0|1:0,0:0:0:0: +320,360,37161,1,2,0:0:0:0: +264,288,37319,1,8,0:0:0:0: +360,192,37477,1,2,0:0:0:0: +148,11,37635,6,0,B|68:3|68:3|28:155,3,160,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +119,184,38266,5,0,1:0:0:0: +127,90,38424,1,2,0:0:0:0: +231,99,38582,1,8,0:0:0:0: +222,202,38740,1,2,0:0:0:0: +119,184,38898,5,0,1:0:0:0: +231,99,39056,1,2,0:0:0:0: +222,202,39213,1,8,0:0:0:0: +127,90,39371,1,2,0:0:0:0: +162,284,39529,5,0,1:0:0:0: +35,129,39687,1,2,0:0:0:0: +187,4,39845,1,8,0:0:0:0: +314,158,40003,1,2,0:0:0:0: +162,284,40161,5,0,1:0:0:0: +187,4,40319,1,2,0:0:0:0: +314,158,40477,1,8,0:0:0:0: +35,129,40635,1,2,0:0:0:0: +19,334,40792,5,2,0:0:0:0: +57,264,41266,1,2,0:0:0:0: +13,196,41898,1,2,0:0:0:0: +58,134,42213,1,2,0:0:0:0: +19,334,42687,5,2,0:0:0:0: +57,264,42845,1,2,0:0:0:0: +13,196,43003,1,2,0:0:0:0: +58,134,43161,1,2,0:0:0:0: +492,49,43319,5,2,0:0:0:0: +454,119,43793,1,2,0:0:0:0: +498,187,44425,1,2,0:0:0:0: +453,249,44740,1,2,0:0:0:0: +492,49,45214,5,2,0:0:0:0: +454,119,45372,1,2,0:0:0:0: +498,187,45530,1,2,0:0:0:0: +453,249,45688,1,2,0:0:0:0: +256,0,45845,5,2,0:0:0:0: +256,80,46319,1,2,0:0:0:0: +256,160,46950,1,2,0:0:0:0: +256,240,47266,1,2,0:0:0:0: +256,0,47740,5,2,0:0:0:0: +256,80,47898,1,2,0:0:0:0: +256,160,48056,1,2,0:0:0:0: +256,240,48213,1,2,0:0:0:0: +440,376,48371,6,0,P|409:319|334:323,1,120.000004577637,2|0,0:0|0:0,0:0:0:0: +298,353,48845,1,2,0:0:0:0: +358,311,49003,2,0,P|386:311|416:327,2,60.0000022888184,2|0|2,0:0|0:0|0:0,0:0:0:0: +0,357,49635,6,0,L|141:370,1,120.000004577637,2|2,0:0|0:0,0:0:0:0: +119,368,50108,1,0,0:0:0:0: +0,357,50266,1,2,0:0:0:0: +512,384,50582,5,8,0:0:0:0: +55,110,50898,6,0,P|57:48|117:32,1,100,4|2,1:2|0:0,0:0:0:0: +121,139,51213,2,0,P|156:106|150:58,1,100,8|2,0:0|0:0,0:0:0:0: +150,58,51529,1,0,1:0:0:0: +263,0,51687,2,0,L|243:110,1,100,2|8,0:0|0:0,0:0:0:0: +245,98,52003,1,2,0:0:0:0: +111,275,52161,6,0,P|75:211|36:204,1,100,0|2,1:0|0:0,0:0:0:0: +53,204,52477,1,8,0:0:0:0: +245,98,52635,1,2,0:0:0:0: +116,365,52792,6,0,L|50:355,1,50,0|0,1:0|0:0,0:0:0:0: +186,317,52950,1,2,0:0:0:0: +396,365,53108,6,0,L|462:355,1,50,8|0,0:0|0:0,0:0:0:0: +326,317,53266,1,2,0:0:0:0: +423,26,53424,5,4,1:2:0:0: +512,142,53582,2,0,P|437:136|415:100,1,100,2|8,0:0|0:0,0:0:0:0: +423,26,53898,1,2,0:0:0:0: +245,93,54056,2,0,L|358:79,1,100,0|2,1:2|0:0,0:0:0:0: +344,80,54371,1,8,0:0:0:0: +423,26,54529,1,2,0:0:0:0: +172,151,54687,6,0,P|216:170|236:236,1,100,0|2,1:2|0:0,0:0:0:0: +237,215,55003,1,8,0:0:0:0: +5,311,55161,1,2,0:0:0:0: +72,378,55319,2,0,L|88:269,1,100,0|2,1:2|0:0,0:0:0:0: +82,265,55556,1,2,0:0:0:0: +76,252,55635,1,8,0:0:0:0: +307,164,55792,1,2,0:0:0:0: +0,0,55950,6,0,P|53:7|83:79,1,100,4|2,1:2|0:0,0:0:0:0: +51,122,56266,1,8,0:0:0:0: +80,41,56424,1,2,0:0:0:0: +138,110,56582,1,0,1:2:0:0: +80,41,56740,2,0,L|186:18,1,100,2|8,0:0|0:0,0:0:0:0: +51,122,57056,1,2,0:0:0:0: +138,110,57213,5,0,1:2:0:0: +80,41,57371,1,2,0:0:0:0: +76,252,57529,5,8,0:0:0:0: +138,110,57687,1,2,0:0:0:0: +170,384,57845,6,0,L|149:274,1,100,0|2,1:2|0:0,0:0:0:0: +76,252,58161,1,8,0:0:0:0: +229,277,58319,1,2,0:0:0:0: +512,222,58477,6,0,P|464:262|472:324,2,100,0|2|8,1:2|0:0|0:0,0:0:0:0: +460,296,58950,1,2,0:0:0:0: +415,97,59108,2,0,L|405:209,1,100,0|2,1:0|0:0,0:0:0:0: +293,215,59424,2,0,P|341:255|333:317,1,100,8|2,0:0|0:0,0:0:0:0: +125,361,59740,6,0,P|157:329|159:297,1,50,0|0,1:2|0:0,0:0:0:0: +229,277,59898,2,0,P|208:236|178:224,1,50,2|0,0:0|0:0,0:0:0:0: +181,152,60056,2,0,P|136:159|115:183,1,50,8|0,0:0|0:0,0:0:0:0: +47,159,60213,2,0,P|39:203|57:230,1,50,2|0,0:0|0:0,0:0:0:0: +229,277,60371,6,0,P|208:236|178:224,1,50,0|0,1:0|0:0,0:0:0:0: +47,159,60529,6,0,P|39:203|57:230,1,50,2|0,0:2|0:0,0:0:0:0: +12,288,60687,6,0,P|52:308|83:300,1,50,8|0,0:0|0:0,0:0:0:0: +181,152,60845,6,0,P|136:159|115:183,1,50,2|0,0:0|0:0,0:0:0:0: +125,361,61003,5,4,1:2:0:0: +512,193,61319,1,8,0:0:0:0: +13,44,61635,5,0,1:2:0:0: +512,193,61950,1,8,0:0:0:0: +456,252,62108,5,0,0:0:0:0: +456,252,62266,2,0,L|432:180,2,60.0000022888184,2|0|8,1:2|0:0|0:0,0:0:0:0: +489,323,62740,1,2,0:0:0:0: +489,323,62898,5,0,1:0:0:0: +509,150,63056,1,0,0:0:0:0: +351,77,63213,1,10,0:0:0:0: +232,204,63370,1,0,0:0:0:0: +318,357,63528,5,2,1:2:0:0: +256,0,63845,1,8,0:0:0:0: +157,294,64161,5,0,1:0:0:0: +256,0,64477,1,8,0:0:0:0: +246,81,64635,6,0,L|319:65,1,60.0000022888184,0|2,0:0|1:2,0:0:0:0: +263,156,64950,2,0,L|336:140,1,60.0000022888184,0|8,0:0|0:0,0:0:0:0: +185,139,65266,5,2,0:0:0:0: +399,173,65424,1,2,0:0:0:0: +13,382,65661,5,0,1:0:0:0: +19,360,65740,1,8,0:0:0:0: +46,226,65898,1,0,1:0:0:0: +8,0,66056,5,4,1:2:0:0: +429,384,66371,1,8,0:0:0:0: +504,0,66687,5,0,1:0:0:0: +83,384,67002,1,8,0:0:0:0: +116,312,67161,6,0,L|161:360,1,60.0000022888184,0|2,0:0|1:2,0:0:0:0: +209,302,67477,2,0,L|167:258,1,60.0000022888184,0|8,0:0|0:0,0:0:0:0: +95,238,67792,1,2,0:0:0:0: +272,377,67950,5,0,1:0:0:0: +315,316,68108,1,0,1:0:0:0: +391,291,68266,1,10,0:0:0:0: +468,313,68424,1,0,1:0:0:0: +491,6,68582,6,0,P|452:37|395:36,1,80,2|0,1:2|0:0,0:0:0:0: +396,189,68898,1,8,0:0:0:0: +375,114,69056,1,0,0:0:0:0: +317,208,69213,1,2,1:2:0:0: +296,133,69371,1,0,0:0:0:0: +24,60,69687,5,0,0:0:0:0: +112,26,69845,2,0,L|94:124,1,80,2|0,1:2|0:0,0:0:0:0: +80,191,70161,5,8,0:0:0:0: +296,133,70319,1,0,1:2:0:0: +512,76,70477,1,2,1:2:0:0: +444,113,70635,5,0,1:0:0:0: +430,90,70713,1,0,1:0:0:0: +458,14,70792,5,8,0:0:0:0: +500,184,70950,1,0,1:2:0:0: +441,302,71108,6,0,L|417:401,1,80,4|0,1:2|0:0,0:0:0:0: +441,302,71424,1,0,3:0:0:0: +71,302,71740,6,0,L|95:401,1,80,4|0,1:2|0:0,0:0:0:0: +71,302,72056,1,0,3:0:0:0: +459,224,72371,6,0,L|435:323,1,80,4|0,1:2|0:0,0:0:0:0: +459,224,72687,1,0,3:0:0:0: +53,224,73003,6,0,L|77:323,1,80,12|0,1:2|0:0,0:0:0:0: +53,224,73161,1,0,3:0:0:0: +256,384,73477,5,0,3:0:0:0: +308,24,73635,5,4,1:0:0:0: +318,105,73792,1,0,0:0:0:0: +185,129,73950,5,0,1:0:0:0: +175,210,74107,1,0,0:0:0:0: +331,212,74266,5,4,1:0:0:0: +341,293,74423,1,0,0:0:0:0: +162,303,74582,5,0,1:0:0:0: +152,384,74739,1,0,0:0:0:0: +152,384,74898,5,4,1:0:0:0: +175,210,75056,5,2,0:0:0:0: +341,293,75213,5,4,1:0:0:0: +318,105,75371,5,2,0:0:0:0: +311,24,75529,5,4,1:0:0:0: +318,105,75687,5,0,0:0:0:0: +318,105,75845,1,0,0:0:0:0: +318,105,76003,1,0,0:0:0:0: +311,24,76161,6,0,L|198:19,1,103.999995239258,4|0,1:0|0:0,0:0:0:0: +207,19,76477,1,8,0:0:0:0: +213,108,76635,1,2,0:0:0:0: +0,101,76792,5,0,1:0:0:0: +68,65,76950,2,0,P|74:122|43:166,1,103.999995239258,2|8,0:0|0:0,0:0:0:0: +0,101,77266,1,2,0:0:0:0: +86,384,77424,6,0,P|103:333|123:272,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +146,211,77740,1,8,0:0:0:0: +0,383,77898,1,2,0:0:0:0: +394,285,78056,6,0,L|460:271,1,51.999997619629,0|0,1:0|0:0,0:0:0:0: +366,211,78213,1,2,0:0:0:0: +118,285,78371,6,0,L|52:271,1,51.999997619629,8|0,0:0|0:0,0:0:0:0: +146,211,78528,1,2,0:0:0:0: +312,379,78687,5,4,1:2:0:0: +302,300,78845,1,2,0:0:0:0: +199,131,79003,5,8,0:0:0:0: +209,52,79161,1,2,0:0:0:0: +274,101,79319,2,0,P|340:88|398:77,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +376,81,79635,5,8,0:0:0:0: +22,20,79792,1,2,0:0:0:0: +498,127,79950,6,0,L|513:14,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +512,24,80266,5,8,0:0:0:0: +199,131,80424,1,2,0:0:0:0: +274,101,80582,5,0,1:0:0:0: +509,218,80740,1,2,3:2:0:0: +509,218,80819,1,0,3:0:0:0: +509,218,80898,1,8,0:0:0:0: +433,175,81056,5,2,0:0:0:0: +401,384,81213,6,0,L|377:248,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +382,281,81529,1,8,0:0:0:0: +109,325,81687,1,2,0:0:0:0: +209,341,81845,1,0,1:0:0:0: +310,356,82003,1,2,0:0:0:0: +13,284,82161,5,8,0:0:0:0: +24,373,82319,1,2,0:0:0:0: +124,26,82477,5,0,1:0:0:0: +113,111,82635,1,2,0:0:0:0: +113,111,82792,1,8,0:0:0:0: +393,125,82950,5,2,0:0:0:0: +404,40,83108,1,0,1:0:0:0: +404,40,83265,1,2,0:0:0:0: +171,250,83424,5,8,0:0:0:0: +182,165,83582,1,2,0:0:0:0: +101,197,83740,6,0,P|34:177|-17:171,5,103.999995239258,4|2|8|2|0|2,1:2|0:0|0:0|0:0|1:0|0:0,0:0:0:0: +101,197,84687,5,8,0:0:0:0: +139,384,84845,5,2,0:0:0:0: +133,363,84924,1,2,0:0:0:0: +127,341,85003,2,0,L|198:366,1,51.999997619629,0|0,1:2|0:0,0:0:0:0: +325,314,85161,2,0,L|396:339,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +387,257,85319,6,0,L|316:232,1,51.999997619629,8|0,0:0|0:0,0:0:0:0: +189,284,85477,2,0,L|118:259,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +314,0,85635,5,0,1:0:0:0: +371,55,85792,6,0,L|388:28,1,25.9999988098145,2|0,0:0|0:0,0:0:0:0: +371,55,85950,2,0,L|388:28,1,25.9999988098145,2|0,0:0|0:0,0:0:0:0: +371,55,86108,2,0,L|388:28,1,25.9999988098145,2|0,0:0|0:0,0:0:0:0: +86,64,86266,5,4,1:0:0:0: +164,49,86424,1,2,0:0:0:0: +102,144,86582,1,8,0:0:0:0: +180,129,86740,1,2,0:0:0:0: +86,64,86898,5,0,1:0:0:0: +180,129,87056,1,2,0:0:0:0: +102,144,87213,1,8,0:0:0:0: +164,49,87371,1,2,0:0:0:0: +180,129,87529,6,0,L|163:247,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +166,232,87845,1,8,0:0:0:0: +354,236,88003,1,2,0:0:0:0: +69,310,88161,6,0,L|-7:318,1,51.999997619629,0|0,1:0|0:0,0:0:0:0: +168,365,88319,1,2,0:0:0:0: +453,291,88477,6,0,L|504:286,1,51.999997619629,8|0,0:0|0:0,0:0:0:0: +354,236,88635,1,2,0:0:0:0: +164,49,88792,5,4,1:2:0:0: +180,129,88950,1,2,0:0:0:0: +180,129,89108,1,8,0:0:0:0: +241,74,89266,1,2,0:0:0:0: +164,49,89424,1,0,1:0:0:0: +352,102,89582,5,2,0:0:0:0: +180,129,89740,1,8,0:0:0:0: +8,156,89898,1,2,0:0:0:0: +164,384,90056,6,0,L|182:266,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +179,281,90371,1,8,0:0:0:0: +348,305,90529,1,2,0:0:0:0: +179,281,90687,1,0,1:0:0:0: +256,244,90845,1,2,3:2:0:0: +262,269,90923,1,0,3:0:0:0: +261,294,91002,1,8,0:0:0:0: +179,281,91161,1,2,0:0:0:0: +335,201,91319,6,0,L|352:329,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +348,304,91635,1,8,0:0:0:0: +408,132,91792,1,2,0:0:0:0: +348,304,91950,1,0,1:0:0:0: +474,76,92108,5,2,0:0:0:0: +237,166,92266,1,8,0:0:0:0: +0,255,92424,1,2,0:0:0:0: +53,196,92582,6,0,L|64:73,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +479,269,92898,2,0,L|490:146,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +154,384,93213,6,0,L|148:307,1,51.999997619629,0|0,1:0|0:0,0:0:0:0: +74,364,93371,1,2,0:0:0:0: +358,384,93529,6,0,L|364:307,1,51.999997619629,8|0,0:0|0:0,0:0:0:0: +438,364,93687,1,2,0:0:0:0: +232,12,93845,5,2,1:2:0:0: +236,63,93923,1,2,0:2:0:0: +240,115,94002,1,2,0:2:0:0: +244,167,94081,1,2,0:2:0:0: +270,196,94161,5,10,0:2:0:0: +272,221,94239,1,2,0:2:0:0: +274,247,94318,1,2,0:2:0:0: +276,273,94397,1,2,0:2:0:0: +285,271,94477,5,2,1:2:0:0: +283,245,94556,1,2,0:2:0:0: +281,219,94635,1,2,0:2:0:0: +279,194,94713,1,2,0:2:0:0: +253,165,94793,5,10,0:2:0:0: +249,113,94872,1,2,0:2:0:0: +245,61,94951,1,2,0:2:0:0: +241,10,95029,1,2,0:2:0:0: +325,33,95108,5,0,1:0:0:0: +103,90,95266,1,2,0:0:0:0: +325,33,95424,1,8,0:0:0:0: +424,239,95582,1,2,0:0:0:0: +325,33,95740,1,0,1:0:0:0: +401,50,95898,1,2,3:2:0:0: +451,39,95976,1,0,3:0:0:0: +502,28,96055,1,8,0:0:0:0: +325,33,96213,1,2,0:0:0:0: +258,290,96371,5,4,1:2:0:0: +142,219,96529,1,2,0:0:0:0: +174,352,96687,1,8,0:2:0:0: +142,219,96845,1,2,0:2:0:0: +70,339,97002,1,0,1:2:0:0: +142,219,97161,1,2,0:2:0:0: +8,256,97318,1,8,0:2:0:0: +142,219,97477,1,2,0:2:0:0: +70,339,97634,1,0,1:2:0:0: +142,219,97792,1,2,0:2:0:0: +174,352,97950,1,8,0:2:0:0: +142,219,98108,1,2,0:2:0:0: +8,256,98266,5,0,1:0:0:0: +70,339,98424,1,0,1:0:0:0: +174,352,98582,1,8,0:0:0:0: +258,290,98740,1,0,1:0:0:0: +26,148,98898,5,4,1:2:0:0: +142,219,99056,1,2,0:0:0:0: +110,86,99214,1,8,0:2:0:0: +142,219,99372,1,2,0:2:0:0: +214,99,99529,1,0,1:2:0:0: +142,219,99688,1,2,0:2:0:0: +276,182,99845,1,8,0:2:0:0: +142,219,100004,1,2,0:2:0:0: +214,99,100161,1,0,1:2:0:0: +142,219,100319,1,2,0:2:0:0: +110,86,100477,1,8,0:2:0:0: +142,219,100635,1,2,0:2:0:0: +276,182,100793,5,0,1:0:0:0: +214,99,100951,1,0,1:0:0:0: +160,91,101029,1,0,1:0:0:0: +110,86,101109,1,8,0:0:0:0: +26,148,101267,1,0,1:0:0:0: +26,148,101424,6,0,P|6:87|22:47,1,103.999995239258,4|2,0:0|0:0,0:0:0:0: +18,51,101740,2,0,P|5:101|26:148,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +332,7,102056,5,0,1:2:0:0: +359,87,102213,1,2,0:0:0:0: +417,20,102371,1,8,0:0:0:0: +278,71,102529,1,2,0:0:0:0: +213,384,102687,6,0,L|243:135,1,207.999990478516,0|8,1:2|0:0,0:0:0:0: +237,177,103161,1,2,0:0:0:0: +410,345,103319,2,0,P|349:343|318:300,1,103.999995239258,0|2,1:2|0:0,0:0:0:0: +307,232,103635,1,8,0:0:0:0: +476,295,103792,1,2,0:0:0:0: +113,382,103950,5,0,1:0:0:0: +100,304,104108,1,2,0:0:0:0: +22,317,104266,1,8,0:0:0:0: +100,304,104424,1,2,0:0:0:0: +113,382,104582,1,0,1:2:0:0: +100,304,104740,1,2,0:0:0:0: +22,317,104898,1,8,0:0:0:0: +100,304,105056,1,2,0:0:0:0: +113,382,105213,5,0,1:2:0:0: +113,382,105371,1,2,0:0:0:0: +113,382,105529,1,8,0:0:0:0: +100,304,105687,1,2,0:0:0:0: +22,317,105845,5,0,1:2:0:0: +22,317,106003,1,2,3:2:0:0: +62,310,106082,1,0,3:0:0:0: +100,304,106161,1,8,0:0:0:0: +100,304,106319,1,2,0:0:0:0: +252,38,106477,5,4,1:2:0:0: +106,25,106635,1,2,0:0:0:0: +93,173,106793,1,8,0:2:0:0: +106,25,106951,1,2,0:2:0:0: +252,38,107108,1,0,1:2:0:0: +239,186,107266,1,2,0:2:0:0: +93,173,107424,1,8,0:2:0:0: +239,186,107582,1,2,0:2:0:0: +252,38,107740,1,0,1:2:0:0: +93,173,107898,1,2,0:2:0:0: +106,25,108056,1,8,0:2:0:0: +239,186,108214,1,2,0:2:0:0: +252,38,108371,1,0,1:0:0:0: +239,186,108529,1,0,1:0:0:0: +93,173,108687,1,8,0:0:0:0: +106,25,108845,1,0,1:0:0:0: +383,164,109003,5,4,1:2:0:0: +372,59,109161,1,2,0:0:0:0: +481,48,109319,1,8,0:2:0:0: +372,59,109477,1,2,0:2:0:0: +383,164,109634,1,0,1:2:0:0: +491,156,109792,1,2,0:2:0:0: +481,48,109950,1,8,0:2:0:0: +491,156,110108,1,2,0:2:0:0: +383,164,110266,1,0,1:2:0:0: +481,48,110424,1,2,0:2:0:0: +372,59,110582,1,8,0:2:0:0: +491,156,110740,1,2,0:2:0:0: +383,164,110897,1,0,1:0:0:0: +372,59,111055,1,0,1:0:0:0: +423,54,111135,1,0,1:0:0:0: +481,48,111213,1,8,0:0:0:0: +491,156,111371,1,2,1:2:0:0: +182,221,111529,6,0,L|300:204,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +198,303,111845,2,0,L|316:286,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +490,384,112161,6,0,P|475:320|419:314,1,103.999995239258,0|2,1:2|0:0,0:0:0:0: +369,349,112477,1,8,0:0:0:0: +512,229,112635,1,2,0:0:0:0: +379,0,112792,6,0,L|371:120,1,103.999995239258,0|2,1:2|0:0,0:0:0:0: +457,14,113108,2,0,L|449:134,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +450,117,113424,5,0,1:2:0:0: +206,227,113582,1,2,0:0:0:0: +151,166,113740,5,8,0:0:0:0: +512,229,113898,1,2,0:0:0:0: +452,285,114056,5,6,1:2:0:0: +372,264,114213,5,2,0:0:0:0: +379,243,114292,1,2,0:2:0:0: +392,225,114371,1,10,0:0:0:0: +265,330,114529,5,2,0:0:0:0: +281,315,114608,1,2,0:2:0:0: +301,306,114687,1,2,1:2:0:0: +138,350,114845,5,2,0:0:0:0: +159,345,114924,1,2,0:0:0:0: +181,347,115003,1,10,0:2:0:0: +27,282,115161,5,2,0:0:0:0: +47,288,115240,1,2,0:2:0:0: +65,300,115319,1,2,1:2:0:0: +14,360,115477,1,2,0:0:0:0: +14,24,115635,5,10,0:0:0:0: +65,84,115793,1,2,0:0:0:0: +498,24,115950,5,2,1:2:0:0: +447,84,116108,2,0,L|473:149,1,51.999997619629,2|0,3:2|3:2,0:0:0:0: +447,300,116266,5,10,0:0:0:0: +498,360,116424,1,2,0:0:0:0: +158,92,116582,6,0,L|168:-2,1,80,4|2,1:0|0:0,0:0:0:0: +166,12,116898,1,8,0:0:0:0: +149,171,117056,1,2,0:0:0:0: +166,12,117213,1,0,1:0:0:0: +66,238,117371,6,0,L|53:344,1,80,2|8,0:0|0:0,0:0:0:0: +56,317,117687,1,2,0:0:0:0: +196,339,117845,2,0,L|205:259,1,80,0|2,1:0|0:0,0:0:0:0: +149,171,118161,2,0,L|158:91,1,80,8|2,0:0|0:0,0:0:0:0: +52,144,118477,6,0,P|152:137|252:133,3,200,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +395,383,119108,5,4,1:2:0:0: +431,310,119266,1,2,0:0:0:0: +358,274,119424,1,8,0:0:0:0: +322,347,119582,1,2,0:0:0:0: +512,107,119740,5,0,1:0:0:0: +432,113,119898,2,0,L|536:105,1,80,2|8,0:0|0:0,0:0:0:0: +358,274,120213,5,2,0:0:0:0: +340,115,120371,2,0,L|351:212,1,80,0|2,1:0|0:0,0:0:0:0: +432,113,120687,2,0,L|443:210,1,80,8|2,0:0|0:0,0:0:0:0: +256,0,121003,5,2,1:2:0:0: +202,62,121161,1,0,3:0:0:0: +177,56,121240,1,0,3:0:0:0: +151,50,121319,1,8,0:0:0:0: +256,0,121477,1,2,0:0:0:0: +47,336,121635,6,0,L|27:239,1,80,4|2,1:2|0:0,0:0:0:0: +47,336,121950,1,8,0:0:0:0: +85,175,122108,1,2,0:0:0:0: +0,117,122266,5,0,1:0:0:0: +85,175,122424,2,0,L|169:156,1,80,2|8,0:0|0:0,0:0:0:0: +256,384,122740,5,2,0:0:0:0: +341,326,122898,2,0,L|425:345,1,80,0|2,1:0|0:0,0:0:0:0: +171,326,123213,2,0,L|87:345,1,80,8|2,0:0|0:0,0:0:0:0: +455,89,123529,6,0,P|340:82|170:59,3,240.000009155274,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +98,4,124161,5,0,1:0:0:0: +0,154,124320,1,2,0:0:0:0: +2,162,124398,1,2,0:0:0:0: +4,170,124477,1,8,0:0:0:0: +154,220,124635,1,2,0:0:0:0: +156,228,124713,1,2,0:0:0:0: +158,236,124792,1,0,1:0:0:0: +258,90,124950,1,2,0:0:0:0: +260,98,125028,1,2,0:0:0:0: +262,106,125107,1,8,0:0:0:0: +98,4,125266,5,2,0:0:0:0: +100,12,125344,1,2,0:0:0:0: +102,20,125423,1,0,1:0:0:0: +188,362,125582,1,2,0:0:0:0: +189,366,125660,1,2,0:0:0:0: +190,370,125739,1,8,0:0:0:0: +414,4,125898,1,2,0:0:0:0: +412,12,125976,1,2,0:0:0:0: +410,20,126055,1,0,1:0:0:0: +324,362,126214,1,0,3:0:0:0: +323,366,126292,1,0,3:0:0:0: +322,370,126371,1,8,3:2:0:0: +256,0,126529,5,2,0:0:0:0: +0,374,127792,6,0,L|294:341,1,240.000009155274,14|2,0:0|0:0,0:0:0:0: +381,327,128266,2,0,L|537:309,1,120.000004577637,14|0,0:0|0:0,0:0:0:0: +87,275,128582,5,12,0:0:0:0: +300,255,128740,1,2,1:2:0:0: +463,239,128898,1,0,1:2:0:0: +463,239,129056,5,12,0:0:0:0: +256,192,129213,12,0,130477,0:0:0:0: diff --git a/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Insane].osu b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Insane].osu new file mode 100644 index 0000000..ea29480 --- /dev/null +++ b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Insane].osu @@ -0,0 +1,561 @@ +osu file format v14 + +[General] +AudioFilename: audio.mp3 +AudioLeadIn: 0 +PreviewTime:75687 +Countdown: 0 +SampleSet: Soft +StackLeniency: 0.2 +Mode: 0 +LetterboxInBreaks: 0 +WidescreenStoryboard: 1 + +[Editor] +DistanceSpacing: 1 +BeatDivisor: 4 +GridSize: 8 +TimelineZoom: 2.3 + +[Metadata] +Title:Happy Time wa Owaranai (Cut Ver.) +TitleUnicode:ハッピータイムは終わらない (Cut Ver.) +Artist:Nanamori-chu * Goraku-bu +ArtistUnicode:七森中☆ごらく部 +Creator:-Keitaro +Version:Insane +Source:ゆるゆり +Tags:japanese anime pop YuruYuri 三上枝織 大坪由佳 津田美波 大久保瑠美 Mikami Shiori Otsubo Yuka Tsuda Minami Okubo Rumi 赤座あかり Akaza Akari 歳納京子 Toshino Kyoko 船見結衣 Funami Yui 吉川ちなつ Yoshikawa Chinatsu ioexception deadcode ceo of osu ceo_of_osu +BeatmapID:2210722 +BeatmapSetID:1057015 + +[Difficulty] +HPDrainRate:5 +CircleSize:4 +OverallDifficulty:8 +ApproachRate:7.8 +SliderMultiplier:1.4 +SliderTickRate:1 + +[Events] +//Background and Video events +0,0,"Akari Yui Kyouko Chinatsu 486.jpg",0,0 +//Break Periods +//Storyboard Layer 0 (Background) +//Storyboard Layer 1 (Fail) +//Storyboard Layer 2 (Pass) +//Storyboard Layer 3 (Foreground) +//Storyboard Layer 4 (Overlay) +//Storyboard Sound Samples + +[TimingPoints] +1635,315.789473684211,4,2,22,62,1,0 +10003,-100,4,2,22,52,0,0 +10477,-200,4,2,22,62,0,0 +20582,-100,4,2,22,72,0,0 +32582,-66.6666666666667,4,2,22,72,0,0 +33213,-100,4,2,22,72,0,0 +37635,-66.6666666666667,4,2,22,72,0,0 +38266,-100,4,2,22,72,0,0 +40792,-133.333333333333,4,2,22,62,0,0 +50898,-100,4,2,22,72,0,0 +61003,-133.333333333333,4,2,22,72,0,0 +68582,-100,4,2,22,72,0,0 +71108,-100,4,2,22,72,0,0 +73635,-100,4,2,22,72,0,0 +76161,-100,4,2,22,82,0,0 +116582,-100,4,2,22,72,0,0 +118477,-66.6666666666667,4,2,22,72,0,0 +119108,-100,4,2,22,72,0,0 +123529,-66.6666666666667,4,2,22,72,0,0 +124161,-100,4,2,22,82,0,0 +127792,-100,4,2,22,72,0,0 + + +[Colours] +Combo1 : 95,20,250 +Combo2 : 0,64,128 +Combo3 : 18,124,255 +Combo4 : 255,145,91 + +[HitObjects] +89,51,10003,5,2,0:0:0:0: +176,71,10161,1,2,0:0:0:0: +266,92,10319,1,2,0:0:0:0: +89,51,10477,6,0,B|61:97|61:97|83:328,1,280,4|2,1:0|0:0,0:0:0:0: +467,198,13003,6,0,P|417:146|363:182,1,140,4|0,1:0|0:0,0:0:0:0: +354,263,14266,6,0,P|403:314|457:278,1,140,4|0,1:2|0:0,0:0:0:0: +230,207,15529,6,0,B|175:212|175:212|146:239|146:239|87:242,1,140,4|0,1:2|0:0,0:0:0:0: +88,102,16792,6,0,L|101:247,1,140,4|0,1:2|0:0,0:0:0:0: +177,383,18056,6,0,L|184:306,1,70,4|0,1:2|0:0,0:0:0:0: +269,384,18687,6,0,L|275:306,1,70,4|0,1:2|0:0,0:0:0:0: +183,314,19319,5,4,1:2:0:0: +274,314,19635,1,4,1:2:0:0: +418,310,20108,6,0,L|422:361,2,35,2|2|2,0:0|0:0|0:0,0:0:0:0: +408,229,20582,6,0,L|400:132,1,70,4|2,1:0|0:0,0:0:0:0: +333,272,20898,2,0,L|325:175,1,70,8|2,0:0|0:0,0:0:0:0: +318,115,21213,5,0,1:0:0:0: +245,165,21371,1,2,0:0:0:0: +99,267,21529,5,8,0:0:0:0: +172,217,21687,1,2,0:0:0:0: +168,124,21845,6,0,L|109:83,2,70,0|2|8,1:0|0:0|0:0,0:0:0:0: +42,225,22319,2,0,L|105:271,1,70,2|0,0:0|1:0,0:0:0:0: +172,310,22635,1,2,0:0:0:0: +172,217,22792,1,8,0:0:0:0: +256,262,22950,1,2,0:0:0:0: +376,328,23108,6,0,L|392:248,1,70,4|2,1:2|0:0,0:0:0:0: +408,168,23424,1,8,0:0:0:0: +496,208,23582,1,2,0:0:0:0: +328,128,23740,5,0,1:0:0:0: +240,88,23898,1,2,0:2:0:0: +312,32,24056,1,8,0:0:0:0: +248,184,24213,1,2,0:0:0:0: +192,328,24371,6,0,L|265:341,1,70,0|2,1:2|0:0,0:0:0:0: +260,340,24687,1,8,0:0:0:0: +248,184,24845,2,0,L|168:168,1,70,2|0,0:0|1:2,0:0:0:0: +72,136,25161,1,2,0:0:0:0: +72,136,25240,1,2,0:0:0:0: +72,136,25319,1,10,0:0:0:0: +104,224,25477,1,2,0:0:0:0: +27,3,25635,6,0,L|75:147,1,140,4|8,1:2|0:0,0:0:0:0: +71,135,26108,1,2,0:0:0:0: +104,224,26266,2,0,L|88:304,1,70,0|2,1:2|0:0,0:0:0:0: +72,384,26582,1,8,0:0:0:0: +104,224,26740,1,2,0:0:0:0: +224,368,26898,6,0,L|144:352,1,70,0|2,1:2|0:0,0:0:0:0: +224,368,27213,2,0,L|292:381,1,70,8|2,0:0|0:0,0:0:0:0: +240,272,27529,1,0,1:2:0:0: +399,303,27687,2,0,L|311:287,1,70,2|8,0:0|0:0,0:0:0:0: +240,272,28003,1,2,0:0:0:0: +144,248,28161,6,0,L|168:152,1,70,4|2,1:2|0:0,0:0:0:0: +208,24,28477,2,0,L|191:91,1,70,8|2,0:0|0:0,0:0:0:0: +160,180,28792,5,0,1:2:0:0: +72,152,28950,1,2,0:0:0:0: +191,91,29108,5,8,0:0:0:0: +279,119,29266,1,2,0:0:0:0: +416,160,29424,6,0,L|400:240,1,70,0|2,1:2|0:0,0:0:0:0: +432,72,29740,2,0,L|445:3,1,70,8|2,0:0|0:0,0:0:0:0: +402,228,30056,1,0,1:2:0:0: +384,320,30213,1,2,3:2:0:0: +400,324,30291,1,0,3:0:0:0: +417,328,30370,1,8,0:0:0:0: +264,288,30529,1,2,0:0:0:0: +120,256,30687,6,0,L|104:352,1,70,4|2,1:0|0:0,0:0:0:0: +208,200,31003,1,8,0:0:0:0: +48,176,31161,1,2,0:0:0:0: +208,200,31319,1,0,1:0:0:0: +288,144,31477,2,0,L|280:64,1,70,2|8,0:0|0:0,0:0:0:0: +80,16,31792,1,2,0:0:0:0: +61,107,31950,6,0,L|45:187,1,70,0|2,1:0|0:0,0:0:0:0: +24,264,32266,2,0,L|8:344,1,70,8|2,0:0|0:0,0:0:0:0: +136,360,32582,6,0,L|112:232,3,105.000004005432,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +61,107,33213,6,0,L|157:123,1,70,4|2,1:2|0:0,0:0:0:0: +224,136,33529,1,8,0:0:0:0: +192,8,33687,1,2,0:0:0:0: +224,136,33845,1,0,1:0:0:0: +304,96,34003,2,0,L|376:104,1,70,2|8,0:0|0:0,0:0:0:0: +472,112,34319,1,2,0:0:0:0: +416,192,34477,6,0,L|424:272,1,70,0|2,1:0|0:0,0:0:0:0: +429,331,34792,2,0,L|422:261,1,70,8|2,0:0|0:0,0:0:0:0: +472,112,35108,1,2,1:2:0:0: +416,192,35266,1,0,3:0:0:0: +398,194,35344,1,0,3:0:0:0: +381,196,35423,1,8,0:0:0:0: +296,208,35582,1,2,0:0:0:0: +128,232,35740,6,0,L|136:384,1,140,4|8,1:2|0:0,0:0:0:0: +135,371,36213,1,2,0:0:0:0: +128,232,36371,1,0,1:0:0:0: +120,136,36529,2,0,L|40:144,1,70,2|8,0:0|0:0,0:0:0:0: +208,128,36845,1,2,0:0:0:0: +216,224,37003,2,0,L|224:312,1,70,0|2,1:0|0:0,0:0:0:0: +208,128,37319,2,0,L|201:58,1,70,8|2,0:0|0:0,0:0:0:0: +320,218,37635,6,0,L|168:226,3,105.000004005432,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +32,240,38266,5,0,1:0:0:0: +32,240,38424,1,2,0:0:0:0: +72,168,38582,1,8,0:0:0:0: +72,168,38740,1,2,0:0:0:0: +120,232,38898,1,0,1:0:0:0: +120,232,39056,1,2,0:0:0:0: +176,144,39213,1,8,0:0:0:0: +176,144,39371,1,2,0:0:0:0: +248,224,39529,1,0,1:0:0:0: +248,224,39687,1,2,0:0:0:0: +304,120,39845,1,8,0:0:0:0: +304,120,40003,1,2,0:0:0:0: +400,216,40161,1,0,1:0:0:0: +400,216,40319,1,2,0:0:0:0: +488,88,40477,1,8,0:0:0:0: +488,88,40635,1,2,0:0:0:0: +400,216,40792,6,0,L|288:224,1,105.000004005432,2|0,0:0|0:0,0:0:0:0: +200,232,41266,2,0,P|168:168|184:120,1,105.000004005432,2|0,0:0|0:0,0:0:0:0: +336,24,41898,2,0,L|264:32,1,52.5000020027161,2|0,0:0|0:0,0:0:0:0: +208,40,42213,2,0,L|136:48,1,52.5000020027161,2|0,0:0|0:0,0:0:0:0: +24,56,42687,2,0,L|32:128,3,52.5000020027161,2|2|2|2,0:0|0:0|0:0|0:0,0:0:0:0: +40,192,43319,6,0,P|104:208|144:176,1,105.000004005432,2|0,0:0|0:0,0:0:0:0: +208,152,43792,2,0,B|184:192|184:192|192:264,1,105.000004005432,2|0,0:0|0:0,0:0:0:0: +320,384,44424,2,0,L|312:312,1,52.5000020027161,2|0,0:0|0:0,0:0:0:0: +304,240,44740,2,0,L|296:168,1,52.5000020027161,2|0,0:0|0:0,0:0:0:0: +280,32,45213,2,0,L|336:40,3,52.5000020027161,2|2|2|2,0:0|0:0|0:0|0:0,0:0:0:0: +200,24,45845,6,0,P|168:64|184:128,1,105.000004005432,2|0,0:0|0:0,0:0:0:0: +216,176,46319,2,0,B|176:160|176:160|96:168,1,105.000004005432,2|0,0:0|0:0,0:0:0:0: +48,288,46950,2,0,L|112:280,1,52.5000020027161,2|0,0:0|0:0,0:0:0:0: +176,320,47266,2,0,L|240:312,1,52.5000020027161,2|0,0:0|0:0,0:0:0:0: +416,360,47740,2,0,L|408:288,3,52.5000020027161,2|2|2|2,0:0|0:0|0:0|0:0,0:0:0:0: +432,232,48371,6,0,P|384:264|320:248,1,105.000004005432,2|0,0:0|0:0,0:0:0:0: +280,208,48845,1,2,0:0:0:0: +280,208,49003,2,0,L|288:136,2,52.5000020027161,2|0|2,0:0|0:0|0:0,0:0:0:0: +152,96,49635,2,0,L|160:208,1,105.000004005432,2|2,0:0|0:0,0:0:0:0: +160,224,50108,1,0,0:0:0:0: +168,376,50266,1,2,0:0:0:0: +152,96,50582,1,8,0:0:0:0: +152,96,50898,6,0,L|80:104,1,70,4|2,1:2|0:0,0:0:0:0: +264,80,51213,2,0,L|333:72,1,70,8|2,0:0|0:0,0:0:0:0: +152,96,51529,1,0,1:0:0:0: +160,192,51687,2,0,L|170:287,1,70,2|8,0:0|0:0,0:0:0:0: +176,346,52003,1,2,0:0:0:0: +160,192,52161,6,0,L|152:104,1,70,0|2,1:0|0:0,0:0:0:0: +144,24,52477,1,8,0:0:0:0: +248,40,52635,2,0,L|344:56,1,70,2|0,0:0|1:0,0:0:0:0: +144,24,52950,2,0,L|74:12,1,70,2|8,0:0|0:0,0:0:0:0: +16,88,53266,1,2,0:0:0:0: +144,24,53424,5,4,1:2:0:0: +248,40,53582,2,0,L|342:57,1,70,2|8,0:0|0:0,0:0:0:0: +397,71,53898,1,2,0:0:0:0: +478,89,54056,2,0,L|459:178,1,70,0|2,1:2|0:0,0:0:0:0: +443,242,54371,1,8,0:0:0:0: +478,89,54529,1,2,0:0:0:0: +397,71,54687,6,0,L|378:160,1,70,0|2,1:2|0:0,0:0:0:0: +443,242,55003,1,8,0:0:0:0: +283,106,55161,2,0,L|293:209,1,70,2|0,0:0|1:2,0:0:0:0: +309,284,55477,1,2,0:0:0:0: +309,284,55556,1,2,0:0:0:0: +309,284,55635,1,8,0:0:0:0: +211,260,55792,1,2,0:0:0:0: +89,228,55950,6,0,L|79:377,1,140,4|8,1:2|0:0,0:0:0:0: +79,367,56424,1,2,0:0:0:0: +89,228,56582,1,0,1:2:0:0: +95,131,56740,2,0,L|256:148,1,140,2|2,0:0|0:0,0:0:0:0: +319,155,57213,5,0,1:2:0:0: +283,72,57371,1,2,0:0:0:0: +283,72,57529,5,8,0:0:0:0: +319,155,57687,1,2,0:0:0:0: +355,238,57845,6,0,L|192:260,1,140,0|8,1:2|0:0,0:0:0:0: +121,272,58319,1,2,0:0:0:0: +209,326,58477,6,0,L|217:237,1,70,0|2,1:2|0:0,0:0:0:0: +121,272,58792,2,0,L|114:341,1,70,8|2,0:0|0:0,0:0:0:0: +216,256,59108,1,0,1:0:0:0: +221,160,59266,2,0,L|64:150,1,140,2|2,0:0|0:0,0:0:0:0: +89,70,59740,6,0,L|173:76,1,70,0|2,1:2|0:0,0:0:0:0: +264,81,60056,2,0,L|348:87,1,70,8|2,0:0|0:0,0:0:0:0: +158,74,60371,2,0,L|89:70,1,70,0|2,1:0|0:2,0:0:0:0: +264,81,60687,1,8,0:0:0:0: +358,0,60845,1,2,0:0:0:0: +446,91,61003,6,0,L|431:219,1,105.000004005432,4|8,1:2|0:0,0:0:0:0: +421,299,61635,2,0,L|433:194,1,105.000004005432,0|8,1:2|0:0,0:0:0:0: +433,194,62266,5,2,1:2:0:0: +353,165,62424,1,0,0:0:0:0: +292,219,62582,1,8,0:0:0:0: +229,280,62740,2,0,L|113:266,1,105.000004005432,2|0,0:0|0:0,0:0:0:0: +45,256,63213,1,10,0:0:0:0: +45,256,63529,6,0,L|36:130,1,105.000004005432,2|8,1:2|0:0,0:0:0:0: +30,46,64161,6,0,L|37:150,1,105.000004005432,0|8,1:0|0:0,0:0:0:0: +37,150,64792,5,2,1:2:0:0: +64,147,64950,1,0,0:0:0:0: +154,138,65108,1,8,0:0:0:0: +270,123,65266,1,2,0:0:0:0: +420,104,65424,1,2,0:0:0:0: +154,138,65661,5,0,1:0:0:0: +176,136,65740,1,8,0:0:0:0: +270,123,65898,1,0,1:0:0:0: +420,104,66056,6,0,L|411:222,1,105.000004005432,4|8,1:2|0:0,0:0:0:0: +420,313,66687,2,0,L|412:208,1,105.000004005432,0|8,1:0|0:0,0:0:0:0: +412,208,67319,5,2,1:2:0:0: +340,167,67477,1,0,0:0:0:0: +260,156,67635,1,8,0:0:0:0: +220,164,67792,1,2,0:0:0:0: +150,199,67950,1,0,1:0:0:0: +68,189,68108,1,0,1:0:0:0: +18,112,68266,1,10,0:0:0:0: +45,18,68424,1,0,1:0:0:0: +137,0,68582,6,0,L|150:152,1,140,2|8,1:2|0:0,0:0:0:0: +158,270,69056,1,0,0:0:0:0: +148,139,69213,2,0,L|141:42,1,70,2|0,1:2|0:0,0:0:0:0: +158,270,69529,2,0,L|163:339,1,70,8|0,0:0|0:0,0:0:0:0: +297,255,69845,6,0,L|142:271,1,140,2|8,1:2|0:0,0:0:0:0: +297,255,70319,1,0,1:2:0:0: +289,168,70477,1,2,1:2:0:0: +283,80,70635,1,0,1:0:0:0: +300,78,70713,1,0,1:0:0:0: +317,77,70792,1,8,0:0:0:0: +405,70,70950,1,0,1:2:0:0: +188,89,71108,5,4,1:2:0:0: +0,384,71740,5,4,1:2:0:0: +512,192,72371,5,4,1:2:0:0: +0,0,73003,5,12,1:2:0:0: +357,309,73635,6,0,B|262:260|272:385|161:331,1,210,4|0,1:0|0:0,0:0:0:0: +154,176,74266,2,0,B|176:157|187:116|187:116|222:189|204:273,1,210,4|0,1:0|0:0,0:0:0:0: +38,105,74898,2,0,P|85:102|123:126,1,70,4|2,1:0|0:0,0:0:0:0: +372,18,75213,2,0,P|325:15|287:39,1,70,4|2,1:0|0:0,0:0:0:0: +154,176,75529,5,4,1:0:0:0: +105,110,75687,5,2,0:0:0:0: +105,110,75845,1,2,0:0:0:0: +105,110,76003,1,2,0:0:0:0: +154,176,76161,6,0,L|168:340,1,140,4|8,1:0|0:0,0:0:0:0: +154,176,76635,1,2,0:0:0:0: +335,164,76792,1,0,1:0:0:0: +401,110,76950,2,0,P|362:82|317:83,1,70,2|8,0:0|0:0,0:0:0:0: +266,208,77266,1,2,0:0:0:0: +341,249,77424,6,0,L|415:242,1,70,0|2,1:0|0:0,0:0:0:0: +410,242,77740,1,8,0:0:0:0: +266,208,77898,2,0,L|181:197,1,70,2|0,0:0|1:0,0:0:0:0: +36,174,78213,5,2,0:0:0:0: +143,116,78371,1,8,0:0:0:0: +258,59,78529,1,2,0:0:0:0: +258,59,78687,6,0,L|265:128,1,70,4|2,1:2|0:0,0:0:0:0: +266,208,79003,2,0,L|273:277,1,70,8|2,0:0|0:0,0:0:0:0: +281,371,79319,5,0,1:0:0:0: +350,322,79477,1,2,0:0:0:0: +273,277,79635,1,8,0:0:0:0: +143,325,79792,1,2,0:0:0:0: +17,373,79950,6,0,L|29:200,1,140,0|8,1:0|0:0,0:0:0:0: +17,163,80424,2,0,L|27:241,1,70,2|0,0:0|1:0,0:0:0:0: +81,103,80740,1,2,3:2:0:0: +58,87,80819,1,0,3:0:0:0: +28,77,80898,1,8,0:0:0:0: +17,163,81056,1,2,0:0:0:0: +162,34,81213,6,0,L|170:134,1,70,4|2,1:2|0:0,0:0:0:0: +167,103,81529,1,8,0:0:0:0: +262,210,81687,2,0,L|254:123,1,70,2|0,0:0|1:0,0:0:0:0: +255,140,82003,1,2,0:0:0:0: +345,34,82161,1,8,0:0:0:0: +245,56,82319,1,2,0:0:0:0: +441,87,82477,6,0,L|517:79,1,70,0|2,1:0|0:0,0:0:0:0: +512,162,82792,2,0,L|442:169,1,70,8|2,0:0|0:0,0:0:0:0: +368,126,83108,1,0,1:0:0:0: +442,169,83266,1,2,0:0:0:0: +399,243,83424,1,8,0:0:0:0: +326,199,83582,1,2,0:0:0:0: +184,274,83740,6,0,L|39:288,1,140,4|8,1:2|0:0,0:0:0:0: +184,274,84213,1,2,0:0:0:0: +24,196,84371,2,0,L|124:204,1,70,0|2,1:0|0:0,0:0:0:0: +316,221,84687,2,0,L|246:215,1,70,8|2,0:0|0:0,0:0:0:0: +100,131,85003,6,0,L|92:212,1,70,0|2,1:2|0:0,0:0:0:0: +246,215,85319,2,0,L|252:145,1,70,8|2,0:0|0:0,0:0:0:0: +185,21,85635,5,0,1:0:0:0: +258,64,85792,5,2,0:0:0:0: +258,64,85950,1,2,0:0:0:0: +258,64,86108,1,2,0:0:0:0: +337,24,86266,5,4,1:0:0:0: +417,65,86424,1,2,0:0:0:0: +497,106,86582,1,8,0:0:0:0: +417,65,86740,1,2,0:0:0:0: +337,24,86898,2,0,L|341:101,1,70,0|2,1:0|0:0,0:0:0:0: +346,174,87213,2,0,L|350:251,1,70,8|2,0:0|0:0,0:0:0:0: +358,336,87529,5,0,1:0:0:0: +243,314,87687,1,2,0:0:0:0: +138,292,87845,1,8,0:0:0:0: +115,287,88003,2,0,L|134:209,1,70,2|0,0:0|1:0,0:0:0:0: +127,64,88319,1,2,0:0:0:0: +72,143,88477,1,8,0:0:0:0: +131,218,88635,1,2,0:0:0:0: +217,190,88792,5,4,1:2:0:0: +221,92,88950,1,2,0:0:0:0: +346,39,89108,1,8,0:0:0:0: +369,128,89266,1,2,0:0:0:0: +453,145,89424,2,0,P|448:91|423:65,1,70,0|2,1:0|0:0,0:0:0:0: +346,39,89740,1,8,0:0:0:0: +306,189,89898,1,2,0:0:0:0: +263,340,90056,6,0,L|415:332,1,140,0|8,1:0|0:0,0:0:0:0: +263,340,90529,1,2,0:0:0:0: +161,346,90687,1,0,1:0:0:0: +60,348,90845,1,2,3:2:0:0: +66,315,90924,1,0,3:0:0:0: +72,283,91003,1,8,0:0:0:0: +78,186,91161,1,2,0:0:0:0: +61,47,91319,6,0,L|81:212,1,140,4|8,1:2|0:0,0:0:0:0: +176,174,91792,1,2,0:0:0:0: +164,75,91950,2,0,L|155:-2,1,70,0|2,1:0|0:0,0:0:0:0: +176,174,92266,1,8,0:0:0:0: +366,156,92424,1,2,0:0:0:0: +437,220,92582,6,0,L|427:292,1,70,0|2,1:0|0:0,0:0:0:0: +465,52,92898,2,0,L|455:124,1,70,8|2,0:0|0:0,0:0:0:0: +437,220,93213,1,0,1:0:0:0: +494,376,93371,2,0,L|338:358,1,140,2|2,0:0|0:0,0:0:0:0: +427,289,93845,5,2,1:2:0:0: +444,290,93923,1,2,0:2:0:0: +461,292,94002,1,2,0:2:0:0: +479,294,94081,1,2,0:2:0:0: +496,296,94160,1,10,0:2:0:0: +424,160,94319,1,2,0:2:0:0: +427,289,94477,5,2,1:2:0:0: +409,287,94556,1,2,0:2:0:0: +392,285,94635,1,2,0:2:0:0: +374,283,94714,1,2,0:2:0:0: +357,281,94792,1,10,0:2:0:0: +424,160,94950,1,2,0:2:0:0: +505,29,95108,6,0,L|511:109,1,70,0|2,1:0|0:0,0:0:0:0: +336,123,95424,2,0,L|341:53,1,70,8|2,0:0|0:0,0:0:0:0: +424,160,95740,6,0,L|430:240,1,70,0|2,1:0|3:2,0:0:0:0: +338,278,95977,1,0,3:0:0:0: +330,284,96056,2,0,L|335:214,1,70,8|2,0:0|0:0,0:0:0:0: +81,185,96371,5,4,1:2:0:0: +35,281,96529,1,2,0:0:0:0: +90,366,96687,1,8,0:2:0:0: +35,281,96845,1,2,0:2:0:0: +81,185,97003,1,0,1:2:0:0: +135,273,97161,1,2,0:2:0:0: +90,366,97319,1,8,0:2:0:0: +135,273,97477,1,2,0:2:0:0: +81,185,97635,6,0,L|-10:188,1,70,0|2,1:2|0:2,0:0:0:0: +90,366,97951,2,0,L|159:363,1,70,8|2,0:2|0:2,0:0:0:0: +214,291,98266,5,0,1:0:0:0: +269,359,98424,1,0,1:0:0:0: +214,291,98582,5,8,0:0:0:0: +269,359,98740,1,0,1:0:0:0: +260,178,98898,5,4,1:2:0:0: +164,128,99056,1,2,0:0:0:0: +79,187,99213,1,8,0:2:0:0: +164,128,99371,1,2,0:2:0:0: +260,178,99529,1,0,1:2:0:0: +171,229,99687,1,2,0:2:0:0: +79,187,99845,1,8,0:2:0:0: +171,229,100003,1,2,0:2:0:0: +260,178,100162,6,0,L|257:87,1,70,0|2,1:2|0:2,0:0:0:0: +79,187,100478,2,0,L|81:256,1,70,8|2,0:2|0:2,0:0:0:0: +258,108,100793,5,0,1:0:0:0: +167,46,100950,1,0,1:0:0:0: +167,46,101029,1,0,1:0:0:0: +167,46,101108,1,8,0:0:0:0: +75,97,101267,1,0,1:0:0:0: +204,241,101424,6,0,P|273:258|336:216,1,140,4|8,0:0|0:0,0:0:0:0: +394,142,101898,1,2,0:0:0:0: +340,68,102056,1,0,1:2:0:0: +425,52,102213,1,2,0:0:0:0: +498,174,102371,1,8,0:0:0:0: +394,142,102529,1,2,0:0:0:0: +250,104,102687,6,0,L|263:257,1,140,0|8,1:2|0:0,0:0:0:0: +276,348,103161,1,2,0:0:0:0: +331,252,103319,2,0,L|235:240,1,70,0|2,1:2|0:0,0:0:0:0: +150,228,103635,1,8,0:0:0:0: +331,252,103792,6,0,L|501:271,1,140,2|2,0:0|0:0,0:0:0:0: +308,170,104266,2,0,L|230:177,1,70,8|2,0:0|0:0,0:0:0:0: +390,160,104582,2,0,L|459:153,1,70,0|2,1:2|0:0,0:0:0:0: +308,170,104898,2,0,L|230:177,1,70,8|2,0:0|0:0,0:0:0:0: +379,20,105213,6,0,L|391:175,1,140,0|8,1:2|0:0,0:0:0:0: +331,252,105687,1,2,0:0:0:0: +379,20,105845,2,0,L|391:175,1,140,0|8,1:2|0:0,0:0:0:0: +331,252,106319,1,2,0:0:0:0: +401,362,106477,5,4,1:2:0:0: +418,273,106635,1,2,0:0:0:0: +331,252,106792,1,8,0:2:0:0: +418,273,106950,1,2,0:2:0:0: +401,362,107108,1,0,1:2:0:0: +418,273,107266,1,2,0:2:0:0: +331,252,107424,1,8,0:2:0:0: +418,273,107582,1,2,0:2:0:0: +401,362,107740,1,0,1:2:0:0: +418,273,107898,1,2,0:2:0:0: +331,252,108056,1,8,0:2:0:0: +418,273,108214,1,2,0:2:0:0: +512,295,108371,5,0,1:0:0:0: +418,273,108529,1,0,1:0:0:0: +433,178,108687,1,8,0:0:0:0: +343,157,108845,1,0,1:0:0:0: +77,260,109003,5,4,1:2:0:0: +140,189,109161,1,2,0:0:0:0: +224,240,109319,1,8,0:2:0:0: +140,189,109477,1,2,0:2:0:0: +77,260,109635,1,0,1:2:0:0: +140,189,109793,1,2,0:2:0:0: +224,240,109951,1,8,0:2:0:0: +140,189,110109,1,2,0:2:0:0: +77,260,110266,1,0,1:2:0:0: +140,189,110424,1,2,0:2:0:0: +224,240,110582,1,8,0:2:0:0: +140,189,110740,1,2,0:2:0:0: +63,132,110898,5,2,1:2:0:0: +149,199,111056,1,0,1:0:0:0: +149,199,111135,1,0,1:0:0:0: +149,199,111213,1,8,0:0:0:0: +202,108,111371,1,0,1:0:0:0: +496,271,111529,6,0,L|324:250,1,140,4|8,1:2|0:0,0:0:0:0: +224,240,112003,1,2,0:0:0:0: +419,346,112161,2,0,L|517:356,1,70,0|2,1:2|0:0,0:0:0:0: +331,335,112477,2,0,L|261:327,1,70,8|2,0:0|0:0,0:0:0:0: +404,206,112792,6,0,L|421:369,1,140,0|8,1:2|0:0,0:0:0:0: +418,345,113266,1,2,0:0:0:0: +509,273,113424,1,0,1:2:0:0: +498,184,113582,2,0,L|486:94,1,70,2|8,0:0|0:0,0:0:0:0: +383,24,113898,1,2,0:0:0:0: +329,92,114056,5,6,1:2:0:0: +311,90,114134,1,2,0:0:0:0: +294,88,114213,1,2,0:0:0:0: +276,86,114292,1,2,0:2:0:0: +259,84,114371,1,10,0:0:0:0: +156,76,114529,1,2,0:0:0:0: +259,84,114687,5,2,1:2:0:0: +276,86,114766,1,2,0:0:0:0: +294,88,114845,1,2,0:0:0:0: +311,90,114924,1,2,0:0:0:0: +329,92,115002,1,10,0:2:0:0: +416,103,115161,1,2,0:0:0:0: +351,180,115319,5,2,1:2:0:0: +362,266,115477,1,2,0:0:0:0: +288,326,115635,5,10,0:0:0:0: +277,240,115793,1,2,0:0:0:0: +194,198,115950,5,2,1:2:0:0: +277,240,116108,1,2,3:2:0:0: +283,284,116187,1,0,3:2:0:0: +288,326,116266,5,10,0:0:0:0: +204,384,116424,1,2,0:0:0:0: +393,235,116582,6,0,L|383:380,1,140,4|8,1:0|0:0,0:0:0:0: +383,374,117056,1,2,0:0:0:0: +304,200,117214,1,0,1:0:0:0: +316,119,117372,2,0,L|324:39,1,70,2|8,0:0|0:0,0:0:0:0: +322,49,117687,1,2,0:0:0:0: +451,107,117845,6,0,L|467:187,1,70,0|2,1:0|0:0,0:0:0:0: +501,332,118161,2,0,L|488:264,1,70,8|2,0:0|0:0,0:0:0:0: +395,256,118477,6,0,L|376:360,3,105.000004005432,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +450,106,119108,6,0,L|297:129,1,140,4|8,1:2|0:0,0:0:0:0: +312,127,119582,1,2,0:0:0:0: +406,33,119740,1,0,1:0:0:0: +268,51,119898,2,0,L|196:59,1,70,2|8,0:0|0:0,0:0:0:0: +115,67,120214,1,2,0:0:0:0: +91,193,120372,6,0,L|83:273,1,70,0|2,1:0|0:0,0:0:0:0: +155,380,120687,2,0,L|162:310,1,70,8|2,0:0|0:0,0:0:0:0: +173,206,121003,1,2,1:2:0:0: +56,189,121161,1,0,3:0:0:0: +74,191,121239,1,0,3:0:0:0: +91,193,121318,1,8,0:0:0:0: +173,206,121477,1,2,0:0:0:0: +384,232,121635,6,0,L|376:384,1,140,4|8,1:2|0:0,0:0:0:0: +377,371,122108,1,2,0:0:0:0: +384,232,122266,1,0,1:0:0:0: +392,136,122424,2,0,L|472:144,1,70,2|8,0:0|0:0,0:0:0:0: +461,142,122740,1,2,0:0:0:0: +304,128,122898,2,0,L|296:216,1,70,0|2,1:0|0:0,0:0:0:0: +184,244,123214,2,0,L|191:174,1,70,8|2,0:0|0:0,0:0:0:0: +208,44,123530,6,0,L|360:52,3,105.000004005432,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +439,73,124161,5,0,1:0:0:0: +462,167,124319,1,2,0:0:0:0: +351,236,124477,5,8,0:0:0:0: +374,142,124635,1,2,0:0:0:0: +446,82,124792,5,0,1:0:0:0: +469,176,124950,1,2,0:0:0:0: +358,245,125108,5,8,0:0:0:0: +381,151,125266,1,2,0:0:0:0: +475,186,125424,5,0,1:0:0:0: +454,292,125582,1,2,0:0:0:0: +366,342,125740,1,8,0:0:0:0: +269,325,125898,1,2,0:0:0:0: +210,258,126056,1,0,1:0:0:0: +125,195,126213,1,0,3:0:0:0: +32,233,126371,1,8,3:2:0:0: +1,327,126529,1,2,0:0:0:0: +25,356,127792,6,0,L|189:342,1,140,14|2,0:0|0:0,0:0:0:0: +290,330,128266,2,0,P|294:279|273:238,1,70,14|0,0:0|0:0,0:0:0:0: +139,147,128582,1,12,0:0:0:0: +224,100,128740,1,2,1:2:0:0: +224,100,128898,1,0,1:2:0:0: +64,42,129056,1,12,0:0:0:0: +256,192,129213,12,0,130477,0:0:0:0: diff --git a/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Keitarosu's Advanced].osu b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Keitarosu's Advanced].osu new file mode 100644 index 0000000..54c36f1 --- /dev/null +++ b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Keitarosu's Advanced].osu @@ -0,0 +1,411 @@ +osu file format v14 + +[General] +AudioFilename: audio.mp3 +AudioLeadIn: 0 +PreviewTime: 75687 +Countdown: 0 +SampleSet: None +StackLeniency: 0.2 +Mode: 0 +LetterboxInBreaks: 0 +WidescreenStoryboard: 1 + +[Editor] +Bookmarks: 76161 +DistanceSpacing: 1.3 +BeatDivisor: 4 +GridSize: 8 +TimelineZoom: 2.3 + +[Metadata] +Title:Happy Time wa Owaranai (Cut Ver.) +TitleUnicode:ハッピータイムは終わらない (Cut Ver.) +Artist:Nanamori-chu * Goraku-bu +ArtistUnicode:七森中☆ごらく部 +Creator:-Keitaro +Version:Keitarosu's Advanced +Source:ゆるゆり +Tags:japanese anime pop YuruYuri 三上枝織 大坪由佳 津田美波 大久保瑠美 Mikami Shiori Otsubo Yuka Tsuda Minami Okubo Rumi 赤座あかり Akaza Akari 歳納京子 Toshino Kyoko 船見結衣 Funami Yui 吉川ちなつ Yoshikawa Chinatsu ioexception deadcode ceo of osu ceo_of_osu +BeatmapID:2776487 +BeatmapSetID:1057015 + +[Difficulty] +HPDrainRate:4.5 +CircleSize:3.8 +OverallDifficulty:6 +ApproachRate:7.2 +SliderMultiplier:1.3 +SliderTickRate:1 + +[Events] +//Background and Video events +0,0,"Akari Yui Kyouko Chinatsu 486.jpg",0,0 +//Break Periods +//Storyboard Layer 0 (Background) +//Storyboard Layer 1 (Fail) +//Storyboard Layer 2 (Pass) +//Storyboard Layer 3 (Foreground) +//Storyboard Layer 4 (Overlay) +//Storyboard Sound Samples + +[TimingPoints] +1635,315.789473684211,4,2,22,32,1,0 +1635,-125,4,2,22,32,0,0 +2898,-111.111111111111,4,2,22,32,0,0 +5424,-111.111111111111,4,2,22,42,0,0 +7950,-111.111111111111,4,2,22,52,0,0 +10477,-111.111111111111,4,2,22,62,0,0 +20582,-100,4,2,22,72,0,0 +32582,-90.9090909090909,4,2,22,72,0,0 +33213,-100,4,2,22,72,0,0 +37635,-90.9090909090909,4,2,22,72,0,0 +38266,-100,4,2,22,72,0,0 +40792,-111.111111111111,4,2,22,62,0,0 +50898,-100,4,2,22,72,0,0 +61003,-125,4,2,22,72,0,0 +68582,-100,4,2,22,72,0,0 +76161,-83.3333333333333,4,2,22,82,0,0 +116582,-100,4,2,22,72,0,0 +118477,-71.4285714285714,4,2,22,72,0,0 +119108,-100,4,2,22,72,0,0 +123529,-71.4285714285714,4,2,22,72,0,0 +124160,-100,4,2,22,82,0,0 +127792,-90.9090909090909,4,2,22,72,0,0 + + +[Colours] +Combo1 : 95,20,250 +Combo2 : 0,64,128 +Combo3 : 18,124,255 +Combo4 : 255,145,91 + +[HitObjects] +63,91,10003,6,0,L|56:21,2,58.4999982147217,2|2|2,0:0|0:0|0:0,0:0:0:0: +8,142,10477,2,0,L|501:106,1,467.999985717774,4|2,1:0|0:0,0:0:0:0: +493,263,12056,1,0,0:0:0:0: +493,263,12213,2,0,L|369:275,1,116.999996429443,2|2,0:0|0:0,0:0:0:0: +320,222,12687,1,2,0:0:0:0: +216,333,13003,6,0,P|236:229|38:189,1,350.99998928833,4|0,1:0|0:0,0:0:0:0: +30,335,14266,2,0,L|392:360,1,350.99998928833,4|0,1:2|0:0,0:0:0:0: +463,231,15529,2,0,B|507:146|435:73|435:73|348:110|376:222,1,350.99998928833,4|0,1:2|0:0,0:0:0:0: +376,222,16635,1,0,0:0:0:0: +319,272,16792,6,0,P|251:242|261:192,1,116.999996429443,4|0,1:2|0:0,0:0:0:0: +275,136,17266,2,0,P|215:179|176:146,1,116.999996429443 +179,86,17740,2,0,L|192:12,1,58.4999982147217,2|0,0:0|0:0,0:0:0:0: +113,17,18056,6,0,L|297:34,1,175.499994644165,4|0,1:2|0:0,0:0:0:0: +275,108,18687,2,0,L|100:91,1,175.499994644165,4|0,1:2|0:0,0:0:0:0: +39,139,19319,2,0,L|57:222,1,58.4999982147217,4|0,1:2|0:0,0:0:0:0: +20,266,19635,2,0,L|38:349,1,58.4999982147217,4|0,1:2|0:0,0:0:0:0: +178,379,20108,5,2,0:0:0:0: +178,379,20266,2,0,L|188:301,1,58.4999982147217,2|2,0:0|0:0,0:0:0:0: +234,262,20582,6,0,P|298:255|330:314,1,130,4|8,1:0|0:0,0:0:0:0: +358,380,21056,1,2,0:0:0:0: +358,380,21213,2,0,P|397:346|398:319,1,65,0|2,1:0|0:0,0:0:0:0: +477,344,21529,2,0,P|467:293|444:278,1,65,8|2,0:0|0:0,0:0:0:0: +390,256,21845,6,0,L|369:123,1,130,0|8,1:0|0:0,0:0:0:0: +443,91,22319,2,0,P|487:77|517:86,1,65,2|0,0:0|1:0,0:0:0:0: +349,0,22635,2,0,L|371:131,1,130,2|2,0:0|0:0,0:0:0:0: +309,174,23108,6,0,P|252:172|241:98,1,130,4|8,1:2|0:0,0:0:0:0: +234,109,23582,1,2,0:0:0:0: +180,33,23740,2,0,L|262:17,1,65,0|2,1:0|0:2,0:0:0:0: +234,109,24056,2,0,L|161:126,1,65,8|2,0:0|0:0,0:0:0:0: +75,140,24371,6,0,P|131:162|134:230,1,130,0|8,1:2|0:0,0:0:0:0: +89,304,24845,2,0,P|136:266|196:297,1,130,2|2,0:0|0:0,0:0:0:0: +193,303,25240,1,2,0:0:0:0: +192,317,25319,2,0,L|279:330,1,65,10|2,0:0|0:0,0:0:0:0: +332,368,25635,6,0,B|340:312|340:312|330:288|330:288|338:223,1,130,4|8,1:2|0:0,0:0:0:0: +335,240,26108,1,2,0:0:0:0: +277,191,26266,2,0,P|258:151|266:113,1,65,0|2,1:2|0:0,0:0:0:0: +336,104,26582,2,0,P|355:144|347:182,1,65,8|2,0:0|0:0,0:0:0:0: +277,191,26898,2,0,L|121:179,1,130,0|8,1:2|0:0,0:0:0:0: +15,57,27529,5,0,1:2:0:0: +15,57,27687,2,0,P|54:50|90:126,1,130,2|2,0:0|0:0,0:0:0:0: +147,181,28161,2,0,P|172:150|170:108,1,65,4|2,1:2|0:0,0:0:0:0: +162,40,28477,2,0,L|250:49,1,65,8|2,0:0|0:0,0:0:0:0: +316,38,28792,2,0,P|274:46|272:138,1,130,0|8,1:2|0:0,0:0:0:0: +327,155,29266,1,2,0:0:0:0: +377,94,29424,5,0,1:2:0:0: +174,125,29740,1,8,0:0:0:0: +300,290,30056,1,0,1:2:0:0: +358,229,30213,5,2,3:2:0:0: +366,229,30292,1,0,3:0:0:0: +373,228,30371,2,0,P|401:275|398:312,1,65,8|2,0:0|0:0,0:0:0:0: +354,361,30687,2,0,L|212:336,1,130,4|8,1:0|0:0,0:0:0:0: +154,374,31161,1,2,0:0:0:0: +154,374,31319,2,0,L|144:299,1,65,0|2,1:0|0:0,0:0:0:0: +13,193,31792,5,2,0:0:0:0: +13,193,31950,2,0,P|52:183|86:257,1,130,0|8,1:0|0:0,0:0:0:0: +145,309,32424,1,2,0:0:0:0: +212,265,32582,2,0,L|221:182,3,71.5000021820069,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +295,237,33213,6,0,P|350:205|331:124,1,130,4|8,1:2|0:0,0:0:0:0: +294,74,33687,1,2,0:0:0:0: +294,74,33845,2,0,L|373:56,1,65,0|2,1:0|0:0,0:0:0:0: +478,164,34319,5,2,0:0:0:0: +478,164,34477,2,0,L|322:140,1,130,0|8,1:0|0:0,0:0:0:0: +198,22,35108,1,2,1:2:0:0: +135,84,35266,1,0,3:0:0:0: +136,91,35345,1,0,3:0:0:0: +138,98,35424,2,0,L|146:170,1,65,8|2,0:0|0:0,0:0:0:0: +75,213,35740,2,0,P|140:203|174:268,1,130,4|8,1:2|0:0,0:0:0:0: +218,321,36213,1,2,0:0:0:0: +218,321,36371,2,0,L|136:329,1,65,0|2,1:0|0:0,0:0:0:0: +346,366,36845,5,2,0:0:0:0: +346,366,37003,2,0,P|311:327|342:238,1,130,0|8,1:0|0:0,0:0:0:0: +403,239,37477,1,2,0:0:0:0: +464,299,37635,2,0,L|419:366,3,71.5000021820069,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +346,366,38266,5,0,1:0:0:0: +482,220,38582,6,0,L|492:134,1,65,8|2,0:0|0:0,0:0:0:0: +403,239,38898,2,0,L|413:153,1,65,0|2,1:0|0:0,0:0:0:0: +334,101,39213,6,0,L|324:187,1,65,8|2,0:0|0:0,0:0:0:0: +255,120,39529,2,0,L|245:206,1,65,0|2,1:0|0:0,0:0:0:0: +161,233,39845,6,0,L|171:147,1,65,8|2,0:0|0:0,0:0:0:0: +172,80,40161,2,0,L|92:114,1,65,0|2,1:0|0:0,0:0:0:0: +35,147,40477,2,0,L|104:198,1,65,8|2,0:0|0:0,0:0:0:0: +161,233,40792,6,0,P|110:277|117:345,1,116.999996429443,2|0,0:0|0:0,0:0:0:0: +168,368,41266,2,0,L|296:357,1,116.999996429443,2|0,0:0|0:0,0:0:0:0: +378,237,41898,2,0,L|388:168,1,58.4999982147217,2|0,0:0|0:0,0:0:0:0: +461,191,42213,2,0,L|452:248,1,58.4999982147217,2|0,0:0|0:0,0:0:0:0: +303,225,42687,2,0,L|313:156,3,58.4999982147217,2|2|2|2,0:0|0:0|0:0|0:0,0:0:0:0: +347,99,43319,6,0,P|289:89|245:126,1,116.999996429443,2|0,0:0|0:0,0:0:0:0: +187,75,43792,2,0,L|54:83,1,116.999996429443,2|0,0:0|0:0,0:0:0:0: +76,234,44424,2,0,L|152:230,1,58.4999982147217,2|0,0:0|0:0,0:0:0:0: +130,154,44740,2,0,L|71:156,1,58.4999982147217,2|0,0:0|0:0,0:0:0:0: +80,311,45213,2,0,L|156:307,3,58.4999982147217,2|2|2|2,0:0|0:0|0:0|0:0,0:0:0:0: +208,339,45845,6,0,P|248:280|302:293,1,116.999996429443,2|0,0:0|0:0,0:0:0:0: +342,335,46319,2,0,L|327:200,1,116.999996429443,2|0,0:0|0:0,0:0:0:0: +418,95,46950,2,0,L|498:90,1,58.4999982147217,2|0,0:0|0:0,0:0:0:0: +466,15,47266,2,0,L|407:18,1,58.4999982147217,2|0,0:0|0:0,0:0:0:0: +428,171,47740,2,0,L|508:166,3,58.4999982147217,2|2|2|2,0:0|0:0|0:0|0:0,0:0:0:0: +499,242,48371,6,0,P|448:270|442:338,1,116.999996429443,2|0,0:0|0:0,0:0:0:0: +364,334,48845,1,2,0:0:0:0: +364,334,49003,2,0,L|284:324,2,58.4999982147217,2|0|2,0:0|0:0|0:0,0:0:0:0: +214,363,49635,6,0,P|170:303|111:311,1,116.999996429443,2|2,0:0|0:0,0:0:0:0: +64,335,50108,1,0,0:0:0:0: +135,310,50266,1,2,0:0:0:0: +52,182,50582,1,8,0:0:0:0: +115,43,50898,6,0,L|188:56,1,65,4|2,1:2|0:0,0:0:0:0: +134,126,51213,2,0,L|207:139,1,65,8|2,0:0|0:0,0:0:0:0: +263,82,51529,1,0,1:0:0:0: +263,82,51687,2,0,P|230:138|253:202,1,130,2|2,0:0|0:0,0:0:0:0: +300,263,52161,1,0,1:0:0:0: +468,249,52477,1,8,0:0:0:0: +368,119,52792,1,0,1:0:0:0: +368,119,52950,2,0,L|360:47,1,65,2|8,0:0|0:0,0:0:0:0: +428,14,53266,1,2,0:0:0:0: +428,14,53424,6,0,P|498:45|496:94,1,130,4|8,1:2|0:0,0:0:0:0: +446,158,53898,1,2,0:0:0:0: +446,158,54056,2,0,L|429:296,1,130,0|8,1:2|0:0,0:0:0:0: +418,373,54529,1,2,0:0:0:0: +418,373,54687,6,0,L|497:363,1,65,0|2,1:2|0:0,0:0:0:0: +430,287,55003,2,0,L|509:277,1,65,8|2,0:0|0:0,0:0:0:0: +351,310,55319,1,0,1:2:0:0: +306,242,55477,1,2,0:0:0:0: +303,233,55556,1,2,0:0:0:0: +300,226,55635,2,0,P|259:205|224:218,1,65,8|2,0:0|0:0,0:0:0:0: +179,255,55950,6,0,B|110:277|118:213|45:237,1,130,4|8,1:2|0:0,0:0:0:0: +56,233,56424,1,2,0:0:0:0: +12,168,56582,1,0,1:2:0:0: +12,168,56740,2,0,P|28:118|104:106,1,130,2|2,0:0|0:0,0:0:0:0: +172,63,57213,2,0,L|181:151,2,65,0|2|8,1:2|0:0|0:0,0:0:0:0: +257,88,57687,1,2,0:0:0:0: +257,88,57845,2,0,P|309:143|375:117,1,130,0|8,1:2|0:0,0:0:0:0: +410,69,58319,5,2,0:0:0:0: +410,69,58477,2,0,L|401:206,1,130,0|8,1:2|0:0,0:0:0:0: +429,278,58950,2,0,P|477:278|500:192,2,130,2|2|2,0:0|0:0|0:0,0:0:0:0: +401,198,59740,6,0,L|310:207,1,65,0|2,1:2|0:0,0:0:0:0: +294,278,60056,2,0,L|203:287,1,65,8|2,0:0|0:0,0:0:0:0: +173,347,60371,2,0,L|183:188,1,130,0|8,1:0|0:0,0:0:0:0: +90,116,61003,6,0,P|56:72|84:22,1,104,4|8,1:2|0:0,0:0:0:0: +204,5,61635,2,0,P|238:49|210:99,1,104,0|8,1:2|0:0,0:0:0:0: +94,134,62266,2,0,L|24:125,2,52,2|0|8,1:2|0:0|0:0,0:0:0:0: +139,202,62740,2,0,P|95:231|94:296,1,104,2|0,0:0|0:0,0:0:0:0: +135,339,63213,1,10,0:0:0:0: +256,280,63529,6,0,L|384:290,1,104,2|8,1:2|0:0,0:0:0:0: +375,153,64161,2,0,L|271:144,1,104,0|8,1:0|0:0,0:0:0:0: +145,94,64792,2,0,P|173:29|218:26,1,104,2|8,1:2|0:0,0:0:0:0: +266,54,65266,2,0,L|336:47,1,52,2|2,0:0|0:0,0:0:0:0: +452,34,65740,1,8,0:0:0:0: +384,149,66056,6,0,B|368:206|368:206|396:248,1,104,4|8,1:2|0:0,0:0:0:0: +485,341,66687,2,0,B|501:284|501:284|473:242,1,104,0|8,1:0|0:0,0:0:0:0: +364,323,67319,2,0,L|245:306,1,104,2|8,1:2|0:0,0:0:0:0: +185,289,67792,1,2,0:0:0:0: +185,289,67950,2,0,L|191:350,2,52,0|0|10,1:0|1:0|0:0,0:0:0:0: +110,327,68424,1,0,1:0:0:0: +110,327,68582,6,0,P|69:280|92:220,1,130,2|8,1:2|0:0,0:0:0:0: +158,178,69056,1,0,0:0:0:0: +158,178,69213,2,0,L|146:105,1,65,2|0,1:2|0:0,0:0:0:0: +313,154,69687,1,0,0:0:0:0: +313,154,69844,2,0,L|301:81,1,65,2|0,1:2|0:0,0:0:0:0: +382,72,70161,2,0,L|392:136,1,65,8|0,0:0|1:2,0:0:0:0: +474,162,70477,2,0,P|420:174|403:250,1,130,2|8,1:2|0:0,0:0:0:0: +453,305,70950,1,0,1:2:0:0: +512,249,71108,5,4,1:2:0:0: +162,310,71740,1,4,1:2:0:0: +512,368,72371,1,4,1:2:0:0: +256,192,73003,5,12,1:2:0:0: +264,280,73161,1,0,3:0:0:0: +264,280,73477,5,0,3:0:0:0: +256,192,73635,2,0,P|224:136|143:133,1,130,4|0,1:0|1:0,0:0:0:0: +132,291,74266,2,0,P|164:347|245:350,1,130,4|0,1:0|1:0,0:0:0:0: +264,280,74740,1,0,0:0:0:0: +333,232,74898,2,0,L|418:226,1,65,4|2,1:0|0:0,0:0:0:0: +372,308,75213,2,0,L|457:302,1,65,4|2,1:0|0:0,0:0:0:0: +489,213,75529,1,4,1:0:0:0: +489,213,75687,2,0,L|499:130,2,65 +512,306,76161,6,0,P|474:238|392:241,1,155.999995239258,4|8,1:0|0:0,0:0:0:0: +334,284,76635,1,2,0:0:0:0: +266,336,76792,1,0,1:0:0:0: +266,336,76950,2,0,P|246:298|281:181,1,155.999995239258,2|2,0:0|0:0,0:0:0:0: +219,111,77424,2,0,L|318:102,1,77.999997619629,0|2,1:0|0:0,0:0:0:0: +362,164,77740,1,8,0:0:0:0: +362,164,77898,2,0,P|335:86|370:-5,1,155.999995239258,2|2,0:0|0:0,0:0:0:0: +436,38,78371,2,0,L|524:55,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +488,138,78687,6,0,B|482:177|482:177|501:230,1,77.999997619629,4|2,1:2|0:0,0:0:0:0: +512,299,79003,2,0,L|417:287,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +382,216,79319,1,0,1:0:0:0: +382,216,79477,1,2,0:0:0:0: +298,231,79635,2,0,L|207:244,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +218,337,79950,6,0,P|197:269|110:238,1,155.999995239258,0|8,1:0|0:0,0:0:0:0: +36,269,80424,2,0,L|50:158,1,77.999997619629,2|0,0:0|1:0,0:0:0:0: +8,114,80740,1,2,3:2:0:0: +8,114,80819,1,0,3:0:0:0: +8,114,80898,1,8,0:0:0:0: +74,53,81056,6,0,B|153:61|123:120|225:129,1,155.999995239258,2|2,0:0|0:0,0:0:0:0: +342,140,81529,2,0,B|263:148|293:207|191:216,1,155.999995239258,8|0,0:0|1:0,0:0:0:0: +124,207,82003,1,2,0:0:0:0: +124,207,82161,2,0,P|118:251|148:291,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +204,340,82477,6,0,P|154:308|47:338,1,155.999995239258,0|8,1:0|0:0,0:0:0:0: +204,340,82950,2,0,P|236:290|206:183,1,155.999995239258,2|2,0:0|0:0,0:0:0:0: +204,340,83424,2,0,P|235:372|277:384,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +340,337,83740,6,0,L|512:321,1,155.999995239258,4|8,1:2|0:0,0:0:0:0: +434,232,84213,2,0,L|527:242,1,77.999997619629,2|0,0:0|1:0,0:0:0:0: +486,154,84529,1,2,0:0:0:0: +486,154,84687,1,8,0:0:0:0: +453,78,84845,2,0,B|458:114|458:114|430:249,1,155.999995239258,2|2,0:0|0:0,0:0:0:0: +374,122,85319,2,0,L|362:34,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +435,0,85635,1,0,1:0:0:0: +435,0,86266,6,0,L|341:17,1,77.999997619629,4|2,1:0|0:0,0:0:0:0: +286,76,86582,2,0,L|269:-18,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +201,53,86898,1,0,1:0:0:0: +201,53,87056,1,2,0:0:0:0: +121,71,87213,2,0,L|27:88,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +88,163,87529,6,0,L|79:252,2,77.999997619629,0|2|8,1:0|0:0|0:0,0:0:0:0: +174,162,88003,2,0,L|250:148,1,77.999997619629,2|0,0:0|1:0,0:0:0:0: +208,297,88319,2,0,P|174:253|62:248,1,155.999995239258,2|2,0:0|0:0,0:0:0:0: +0,267,88792,6,0,L|11:174,1,77.999997619629,4|2,1:2|0:0,0:0:0:0: +18,106,89108,2,0,L|111:117,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +175,123,89424,1,0,1:0:0:0: +175,123,89582,1,2,0:0:0:0: +255,137,89740,2,0,L|266:44,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +334,0,90056,6,0,P|392:5|432:107,1,155.999995239258,0|8,1:0|0:0,0:0:0:0: +479,160,90529,2,0,L|402:178,1,77.999997619629,2|0,0:0|1:0,0:0:0:0: +391,259,90845,2,0,B|308:235|360:180|233:169,1,155.999995239258,2|2,3:2|0:0,0:0:0:0: +200,252,91319,6,0,L|32:279,2,155.999995239258,4|8|0,1:2|0:0|1:0,0:0:0:0: +200,252,92108,1,2,0:0:0:0: +245,179,92266,2,0,L|260:75,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +256,101,92582,6,0,L|99:58,2,155.999995239258,0|8|0,1:0|0:0|1:0,0:0:0:0: +315,24,93371,2,0,P|348:11|408:4,1,77.999997619629,2|8,0:0|0:0,0:0:0:0: +467,86,93687,1,2,0:0:0:0: +467,86,93845,6,0,B|193:41|313:390|21:355,1,545.999983337403,2|2,1:2|0:2,0:0:0:0: +45,357,95108,6,0,B|53:318|53:318|38:262,1,77.999997619629,0|2,1:0|0:0,0:0:0:0: +0,200,95424,2,0,L|103:209,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +159,213,95740,1,0,1:0:0:0: +245,223,95898,1,2,3:2:0:0: +245,223,95977,1,0,3:0:0:0: +245,223,96056,2,0,L|348:232,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +363,300,96371,6,0,P|359:232|389:132,1,155.999995239258,4|8,1:2|0:2,0:0:0:0: +381,147,97003,2,0,P|315:129|229:70,1,155.999995239258,0|8,1:2|0:2,0:0:0:0: +241,82,97635,2,0,P|204:139|121:202,1,155.999995239258,0|8,1:2|0:2,0:0:0:0: +136,194,98266,1,0,1:0:0:0: +205,247,98424,2,0,P|221:285|220:327,1,77.999997619629,0|8,1:0|0:0,0:0:0:0: +173,384,98740,1,0,1:0:0:0: +173,384,98898,6,0,L|17:355,1,155.999995239258,4|8,1:2|0:2,0:0:0:0: +19,355,99529,2,0,L|48:199,1,155.999995239258,0|8,1:2|0:2,0:0:0:0: +47,201,100161,2,0,L|203:230,1,155.999995239258,0|8,1:2|0:2,0:0:0:0: +200,229,100792,1,0,1:0:0:0: +259,138,100950,2,0,L|268:198,2,38.9999988098145,0|0|8,1:0|1:0|0:0,0:0:0:0: +336,225,101266,6,0,L|182:196,1,155.999995239258,0|2,1:0|0:0,0:0:0:0: +97,204,101740,2,0,P|91:155|102:116,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +162,73,102056,1,0,1:2:0:0: +162,73,102213,1,2,0:0:0:0: +107,8,102371,2,0,L|29:22,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +20,100,102687,6,0,P|7:156|37:268,1,155.999995239258,0|8,1:2|0:0,0:0:0:0: +26,250,103319,1,0,1:2:0:0: +104,276,103477,1,2,0:0:0:0: +171,230,103635,1,8,0:0:0:0: +202,153,103792,6,0,L|217:317,1,155.999995239258,2|2,0:0|0:0,0:0:0:0: +224,384,104266,1,8,0:0:0:0: +256,192,104424,12,0,105845,1:2:0:0: +438,51,106477,6,0,P|371:51|290:98,1,155.999995239258,4|8,1:2|0:2,0:0:0:0: +294,93,107108,2,0,P|260:151|260:244,1,155.999995239258,0|8,1:2|0:2,0:0:0:0: +258,238,107740,2,0,P|291:296|372:342,1,155.999995239258,0|8,1:2|0:2,0:0:0:0: +366,341,108371,1,0,1:0:0:0: +445,355,108529,2,0,P|491:337|525:292,1,77.999997619629,0|8,1:0|0:0,0:0:0:0: +470,242,108845,1,0,1:0:0:0: +470,242,109003,6,0,L|301:225,1,155.999995239258,4|8,1:2|0:2,0:0:0:0: +314,226,109635,2,0,L|297:395,1,155.999995239258,0|8,1:2|0:2,0:0:0:0: +298,381,110266,2,0,L|129:364,1,155.999995239258,0|8,1:2|0:2,0:0:0:0: +142,365,110898,1,0,1:0:0:0: +64,326,111056,1,0,1:0:0:0: +60,345,111134,1,0,1:0:0:0: +57,364,111213,1,8,0:0:0:0: +144,285,111371,6,0,B|153:251|153:251|126:103,1,155.999995239258,2|2,1:2|0:0,0:0:0:0: +91,47,111845,2,0,L|194:60,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +242,109,112161,2,0,P|257:71|251:24,1,77.999997619629,0|2,1:2|0:0,0:0:0:0: +254,34,112477,2,0,L|357:47,1,77.999997619629,8|2,0:0|0:0,0:0:0:0: +373,110,112792,6,0,P|412:77|526:58,1,155.999995239258,0|8,1:2|0:0,0:0:0:0: +512,55,113424,1,0,1:2:0:0: +509,133,113582,1,2,0:0:0:0: +502,209,113740,1,8,0:0:0:0: +496,286,113898,1,2,0:0:0:0: +496,364,114056,6,0,L|410:383,1,77.999997619629,6|2,1:2|0:0,0:0:0:0: +397,309,114371,2,0,L|378:223,1,77.999997619629,10|2,0:0|0:0,0:0:0:0: +305,248,114687,6,0,L|219:267,1,77.999997619629,2|2,1:2|0:0,0:0:0:0: +206,193,115002,2,0,L|187:107,1,77.999997619629,10|2,0:2|0:0,0:0:0:0: +115,135,115319,6,0,L|29:154,1,77.999997619629,2|2,1:2|0:0,0:0:0:0: +16,80,115634,2,0,L|-3:-6,1,77.999997619629,10|2,0:0|0:0,0:0:0:0: +94,30,115950,5,2,1:2:0:0: +158,102,116108,1,2,3:2:0:0: +158,102,116187,1,0,3:2:0:0: +158,102,116266,2,0,B|163:141|163:141|148:184,1,77.999997619629,10|2,0:0|0:0,0:0:0:0: +67,238,116582,6,0,L|214:266,1,130,4|8,1:0|0:0,0:0:0:0: +263,308,117056,1,2,0:0:0:0: +334,345,117213,1,0,1:0:0:0: +334,345,117371,2,0,L|415:328,1,65,2|8,0:0|0:0,0:0:0:0: +508,272,117687,2,0,P|479:226|392:219,1,130,2|2,0:0|0:0,0:0:0:0: +332,191,118161,2,0,L|321:113,1,65,8|2,0:0|0:0,0:0:0:0: +302,267,118477,6,0,L|275:363,3,90.9999972229005,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +210,273,119108,6,0,P|148:231|69:251,1,130,4|8,1:2|0:0,0:0:0:0: +30,285,119582,1,2,0:0:0:0: +0,378,119740,1,0,1:0:0:0: +0,378,119898,2,0,L|86:366,1,65,2|8,0:0|0:0,0:0:0:0: +144,383,120213,6,0,P|131:310|141:246,1,130,2|2,0:0|0:0,0:0:0:0: +219,273,120687,2,0,L|227:187,1,65,8|2,0:0|0:0,0:0:0:0: +240,123,121003,2,0,P|211:121|165:143,1,65,2|0,1:2|3:0,0:0:0:0: +158,157,121240,1,0,3:0:0:0: +158,157,121319,2,0,L|78:166,1,65,8|2,0:0|0:0,0:0:0:0: +17,132,121635,6,0,P|10:75|74:23,1,130,4|8,1:2|0:0,0:0:0:0: +134,48,122108,1,2,0:0:0:0: +211,77,122266,1,0,1:0:0:0: +211,77,122424,2,0,P|226:35|226:5,1,65,2|8,0:0|0:0,0:0:0:0: +305,40,122740,2,0,L|449:28,1,130,2|2,0:0|0:0,0:0:0:0: +434,29,123213,2,0,P|451:76|451:108,1,65,8|2,0:0|0:0,0:0:0:0: +406,163,123529,6,0,L|510:192,3,90.9999972229005,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +512,276,124161,6,0,P|499:324|411:340,1,130,0|8,1:0|0:0,0:0:0:0: +348,363,124635,1,2,0:0:0:0: +348,363,124792,2,0,L|341:281,1,65,0|2,1:0|0:0,0:0:0:0: +260,220,125108,1,8,0:0:0:0: +260,220,125266,1,2,0:0:0:0: +260,220,125424,2,0,L|253:302,1,65,0|2,1:0|0:0,0:0:0:0: +175,377,125740,2,0,L|168:295,1,65,8|2,0:0|0:0,0:0:0:0: +101,185,126056,2,0,L|94:267,1,65,0|0,1:0|3:0,0:0:0:0: +95,249,126292,1,0,3:0:0:0: +95,249,126371,1,0,3:0:0:0: +36,314,126529,1,2,0:0:0:0: +36,314,127792,6,0,L|278:293,1,214.500006546021,14|14,0:0|0:0,0:0:0:0: +338,379,128582,1,12,0:0:0:0: +398,325,128740,1,2,1:2:0:0: +398,325,128898,1,0,1:2:0:0: +470,365,129056,1,12,0:0:0:0: +256,192,129213,12,0,130477,0:0:0:0: diff --git a/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Normal].osu b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Normal].osu new file mode 100644 index 0000000..cd3eeaa --- /dev/null +++ b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Normal].osu @@ -0,0 +1,359 @@ +osu file format v14 + +[General] +AudioFilename: audio.mp3 +AudioLeadIn: 0 +PreviewTime:75687 +Countdown: 0 +SampleSet: Soft +StackLeniency: 0.5 +Mode: 0 +LetterboxInBreaks: 0 +WidescreenStoryboard: 1 + +[Editor] +DistanceSpacing: 1 +BeatDivisor: 4 +GridSize: 8 +TimelineZoom: 2.3 + +[Metadata] +Title:Happy Time wa Owaranai (Cut Ver.) +TitleUnicode:ハッピータイムは終わらない (Cut Ver.) +Artist:Nanamori-chu * Goraku-bu +ArtistUnicode:七森中☆ごらく部 +Creator:-Keitaro +Version:Normal +Source:ゆるゆり +Tags:japanese anime pop YuruYuri 三上枝織 大坪由佳 津田美波 大久保瑠美 Mikami Shiori Otsubo Yuka Tsuda Minami Okubo Rumi 赤座あかり Akaza Akari 歳納京子 Toshino Kyoko 船見結衣 Funami Yui 吉川ちなつ Yoshikawa Chinatsu ioexception deadcode ceo of osu ceo_of_osu +BeatmapID:2209626 +BeatmapSetID:1057015 + +[Difficulty] +HPDrainRate:4 +CircleSize:3.5 +OverallDifficulty:5 +ApproachRate:5 +SliderMultiplier:1.1 +SliderTickRate:1 + +[Events] +//Background and Video events +0,0,"Akari Yui Kyouko Chinatsu 486.jpg",0,0 +//Break Periods +//Storyboard Layer 0 (Background) +//Storyboard Layer 1 (Fail) +//Storyboard Layer 2 (Pass) +//Storyboard Layer 3 (Foreground) +//Storyboard Layer 4 (Overlay) +//Storyboard Sound Samples + +[TimingPoints] +1635,315.789473684211,4,2,22,62,1,0 +10003,-100,4,2,22,52,0,0 +10477,-100,4,2,22,62,0,0 +20582,-100,4,2,22,72,0,0 +32582,-100,4,2,22,72,0,0 +33213,-100,4,2,22,72,0,0 +37635,-100,4,2,22,72,0,0 +38266,-100,4,2,22,72,0,0 +40792,-100,4,2,22,62,0,0 +50898,-100,4,2,22,72,0,0 +71108,-100,4,2,22,72,0,0 +73635,-100,4,2,22,72,0,0 +76161,-100,4,2,22,82,0,0 +116582,-100,4,2,22,72,0,0 +118477,-100,4,2,22,72,0,0 +119108,-100,4,2,22,72,0,0 +123529,-100,4,2,22,72,0,0 +124161,-100,4,2,22,82,0,0 +127792,-100,4,2,22,72,0,0 + + +[Colours] +Combo1 : 95,20,250 +Combo2 : 0,64,128 +Combo3 : 18,124,255 +Combo4 : 255,145,91 + +[HitObjects] +100,64,10003,6,0,L|32:60,2,55,2|2|2,0:0|0:0|0:0,0:0:0:0: +154,71,10477,5,4,1:0:0:0: +249,200,13003,5,4,1:0:0:0: +409,75,14266,5,4,1:2:0:0: +511,248,15529,5,4,1:2:0:0: +256,354,16792,5,4,1:2:0:0: +61,221,18056,6,0,L|53:88,1,110,4|0,1:2|0:0,0:0:0:0: +143,46,18687,2,0,L|149:155,1,110,4|0,1:2|0:0,0:0:0:0: +157,265,19319,1,4,1:2:0:0: +265,248,19635,1,4,1:2:0:0: +427,221,20108,2,0,L|439:292,2,55,2|2|2,0:0|0:0|0:0,0:0:0:0: +456,168,20582,6,0,L|440:56,1,110,4|8,1:0|0:0,0:0:0:0: +336,24,21213,2,0,L|264:32,1,55,0|2,1:0|0:0,0:0:0:0: +224,40,21529,1,8,0:0:0:0: +112,24,21845,2,0,B|96:64|96:64|112:144,1,110,0|8,1:0|0:0,0:0:0:0: +160,152,22319,2,0,B|176:192|176:192|160:272,1,110,2|2,0:0|0:0,0:0:0:0: +144,312,22792,1,8,0:0:0:0: +250,338,23108,6,0,L|370:362,1,110,4|8,1:2|0:0,0:0:0:0: +468,326,23740,1,0,1:0:0:0: +468,326,23898,1,2,0:2:0:0: +468,326,24056,1,8,0:0:0:0: +430,222,24371,2,0,L|454:94,1,110,0|8,1:2|0:0,0:0:0:0: +416,69,24845,2,0,B|371:33|371:33|296:45,1,110,2|2,0:0|0:0,0:0:0:0: +268,63,25319,1,10,0:0:0:0: +175,3,25635,5,4,1:2:0:0: +95,78,25950,2,0,L|121:184,1,110,8|0,0:0|1:2,0:0:0:0: +94,297,26582,1,8,0:0:0:0: +94,297,26740,1,2,0:0:0:0: +94,297,26898,2,0,P|147:300|199:253,1,110,0|8,1:2|0:0,0:0:0:0: +284,207,27529,1,0,1:2:0:0: +284,207,27687,2,0,L|292:327,1,110,2|2,0:0|0:0,0:0:0:0: +340,341,28161,6,0,B|388:366|388:366|460:349,1,110,4|8,1:2|0:0,0:0:0:0: +458,244,28792,2,0,B|413:219|413:219|355:231,1,110,0|8,1:2|0:0,0:0:0:0: +257,274,29424,1,0,1:2:0:0: +274,165,29740,1,8,0:0:0:0: +297,63,30056,1,0,1:2:0:0: +297,63,30213,1,2,3:2:0:0: +297,63,30371,1,8,0:0:0:0: +189,41,30687,6,0,L|77:25,1,110,4|8,1:0|0:0,0:0:0:0: +29,12,31161,1,2,0:0:0:0: +29,12,31319,2,0,L|13:132,1,110,0|8,1:0|0:0,0:0:0:0: +85,204,31950,1,0,1:0:0:0: +193,220,32266,1,8,0:0:0:0: +301,235,32582,2,0,L|293:299,1,55,8|8,0:0|0:0,0:0:0:0: +301,352,32898,1,8,0:0:0:0: +301,352,33056,1,8,0:0:0:0: +301,352,33213,6,0,L|431:372,1,110,4|8,1:2|0:0,0:0:0:0: +497,301,33845,1,0,1:0:0:0: +414,227,34161,1,8,0:0:0:0: +480,139,34477,2,0,L|464:11,1,110,0|8,1:0|0:0,0:0:0:0: +356,39,35108,2,0,L|276:47,1,55,2|0,1:2|3:0,0:0:0:0: +244,47,35424,2,0,L|164:55,1,55,8|2,0:0|0:0,0:0:0:0: +132,63,35740,6,0,B|116:95|116:95|132:183,1,110,4|8,1:2|0:0,0:0:0:0: +239,159,36371,1,0,1:0:0:0: +348,144,36687,1,8,0:0:0:0: +356,253,37003,2,0,L|372:373,1,110,0|8,1:0|0:0,0:0:0:0: +268,319,37635,2,0,L|196:335,1,55,8|8,0:0|0:0,0:0:0:0: +156,343,37950,1,8,0:0:0:0: +156,343,38108,1,8,0:0:0:0: +156,343,38266,5,0,1:0:0:0: +133,235,38582,1,8,0:0:0:0: +239,208,38898,1,0,1:0:0:0: +268,319,39213,1,8,0:0:0:0: +373,286,39529,5,0,1:0:0:0: +352,177,39845,1,8,0:0:0:0: +325,70,40161,1,0,1:0:0:0: +217,93,40477,1,8,0:0:0:0: +109,114,40792,6,0,L|-19:138,1,110,2|0,0:0|0:0,0:0:0:0: +14,243,41424,2,0,L|142:219,1,110,2|0,0:0|0:0,0:0:0:0: +212,285,42056,2,0,P|244:245|228:173,1,110,2|0,0:0|0:0,0:0:0:0: +217,138,42529,2,0,P|209:90|265:34,1,110,2|2,0:0|0:0,0:0:0:0: +298,37,43003,1,2,0:0:0:0: +407,42,43319,6,0,L|399:162,1,110,2|0,0:0|0:0,0:0:0:0: +429,266,43950,1,2,0:0:0:0: +429,266,44108,2,0,P|373:226|317:242,1,110,2|2,0:0|0:0,0:0:0:0: +289,261,44582,2,0,P|249:269|177:221,1,110,2|0,0:0|0:0,0:0:0:0: +146,137,45213,1,2,0:0:0:0: +36,149,45529,1,2,0:0:0:0: +21,39,45845,6,0,L|141:31,1,110,2|0,0:0|0:0,0:0:0:0: +188,49,46319,1,2,0:0:0:0: +188,49,46477,2,0,P|196:121|172:145,1,110,2|0,0:0|0:0,0:0:0:0: +117,238,47108,2,0,P|149:230|213:278,1,110,2|0,0:0|0:0,0:0:0:0: +233,319,47582,1,2,0:0:0:0: +340,340,47898,1,2,0:0:0:0: +450,370,48213,1,2,0:0:0:0: +450,370,48371,6,0,L|434:250,1,110,2|0,0:0|0:0,0:0:0:0: +450,210,48845,1,2,0:0:0:0: +450,210,49003,2,0,P|418:234|330:234,1,110,2|2,0:0|0:0,0:0:0:0: +249,195,49635,2,0,P|185:155|137:163,1,110,2|2,0:0|0:0,0:0:0:0: +104,177,50108,1,0,0:0:0:0: +104,177,50266,1,2,0:0:0:0: +30,95,50582,1,8,0:0:0:0: +115,25,50898,6,0,L|235:33,1,110,4|8,1:2|0:0,0:0:0:0: +332,72,51529,1,0,1:0:0:0: +332,72,51687,2,0,L|324:184,1,110,2|2,0:0|0:0,0:0:0:0: +321,237,52161,1,0,1:0:0:0: +433,245,52477,1,8,0:0:0:0: +427,354,52792,1,0,1:0:0:0: +317,347,53108,2,0,L|237:339,1,55,8|2,0:0|0:0,0:0:0:0: +222,350,53424,6,0,L|232:221,1,110,4|8,1:2|0:0,0:0:0:0: +237,188,53898,1,2,0:0:0:0: +237,188,54056,2,0,L|114:176,1,110,0|8,1:2|0:0,0:0:0:0: +77,172,54529,1,2,0:0:0:0: +77,172,54687,1,0,1:2:0:0: +88,62,55003,1,8,0:0:0:0: +196,77,55319,1,0,1:2:0:0: +305,90,55635,1,8,0:0:0:0: +357,186,55950,6,0,L|341:319,1,110,4|8,1:2|0:0,0:0:0:0: +256,361,56582,1,0,1:2:0:0: +256,361,56740,2,0,P|168:369|136:345,1,110,2|2,0:0|0:0,0:0:0:0: +121,314,57213,1,0,1:2:0:0: +205,243,57529,2,0,L|197:171,1,55,8|2,0:0|0:0,0:0:0:0: +193,133,57845,1,0,1:2:0:0: +84,153,58161,1,8,0:0:0:0: +67,44,58477,6,0,L|179:28,1,110,0|8,1:2|0:0,0:0:0:0: +193,133,59108,1,0,1:0:0:0: +193,133,59266,2,0,L|322:116,1,110,2|2,0:0|0:0,0:0:0:0: +343,82,59740,1,0,1:2:0:0: +451,70,60056,1,8,0:0:0:0: +463,178,60371,1,0,1:0:0:0: +476,287,60687,1,8,0:0:0:0: +366,295,61003,6,0,L|238:303,1,110,4|8,1:2|0:0,0:0:0:0: +155,311,61635,2,0,L|27:319,1,110,0|8,1:2|0:0,0:0:0:0: +37,210,62266,1,2,1:2:0:0: +149,202,62582,1,8,0:0:0:0: +261,194,62898,2,0,L|341:186,1,55,0|0,1:0|0:0,0:0:0:0: +370,182,63213,1,10,0:0:0:0: +355,72,63529,6,0,L|227:80,1,110,2|8,1:2|0:0,0:0:0:0: +139,88,64161,1,0,1:0:0:0: +27,96,64477,2,0,L|35:168,1,55,8|0,0:0|0:0,0:0:0:0: +43,208,64792,1,2,1:2:0:0: +59,320,65108,1,8,0:0:0:0: +167,301,65424,1,2,0:0:0:0: +151,189,65740,1,8,0:0:0:0: +254,225,66056,6,0,L|382:209,1,110,4|8,1:2|0:0,0:0:0:0: +451,146,66687,2,0,L|443:82,1,55,0|0,1:0|0:0,0:0:0:0: +435,34,67003,1,8,0:0:0:0: +329,18,67319,2,0,L|217:34,1,110,2|8,1:2|0:0,0:0:0:0: +117,74,67950,2,0,L|125:154,1,55,0|0,1:0|1:0,0:0:0:0: +133,186,68266,2,0,L|141:266,1,55,10|0,0:0|1:0,0:0:0:0: +162,290,68582,6,0,B|186:258|186:258|266:250,1,110,2|8,1:2|0:0,0:0:0:0: +339,322,69213,1,2,1:2:0:0: +464,304,69529,2,0,L|472:248,1,55,8|0,0:0|0:0,0:0:0:0: +480,192,69845,2,0,P|448:144|376:136,1,110,2|8,1:2|0:0,0:0:0:0: +309,67,70477,2,0,L|229:59,1,55,2|0,1:2|1:0,0:0:0:0: +212,97,70792,2,0,L|148:89,1,55,8|0,0:0|1:2,0:0:0:0: +114,124,71108,5,4,1:2:0:0: +147,341,71740,1,4,1:2:0:0: +114,124,72371,1,4,1:2:0:0: +315,206,73003,1,12,1:2:0:0: +147,341,73635,6,0,B|123:301|147:245|147:245|181:179|131:117,2,220,4|4|4,1:0|1:0|1:0,0:0:0:0: +236,277,75213,1,4,1:0:0:0: +317,350,75529,1,4,1:0:0:0: +464,184,76161,6,0,L|336:176,1,110,4|8,1:0|0:0,0:0:0:0: +248,176,76792,1,0,1:0:0:0: +248,176,76950,2,0,P|224:224|240:288,1,110,2|2,0:0|0:0,0:0:0:0: +256,328,77424,1,0,1:0:0:0: +146,312,77740,1,8,0:0:0:0: +36,301,78056,1,0,1:0:0:0: +56,193,78371,2,0,L|64:137,1,55,8|2,0:0|0:0,0:0:0:0: +76,84,78687,6,0,B|124:119|124:119|197:95,1,110,4|8,1:2|0:0,0:0:0:0: +252,27,79319,2,0,B|311:8|311:8|364:43,1,110,0|8,1:0|0:0,0:0:0:0: +390,80,79792,1,2,0:0:0:0: +390,80,79950,2,0,L|382:208,1,110,0|8,1:0|0:0,0:0:0:0: +375,244,80424,1,2,0:0:0:0: +265,258,80740,1,2,3:2:0:0: +159,273,81056,1,2,0:0:0:0: +159,273,81213,6,0,L|47:281,1,110,4|8,1:2|0:0,0:0:0:0: +31,169,81845,2,0,L|140:161,1,110,0|8,1:0|0:0,0:0:0:0: +199,153,82319,1,2,0:0:0:0: +199,153,82477,2,0,L|311:145,1,110,0|8,1:0|0:0,0:0:0:0: +363,139,82950,1,2,0:0:0:0: +450,214,83266,1,2,0:0:0:0: +450,214,83424,2,0,L|442:278,1,55,8|2,0:0|0:0,0:0:0:0: +443,323,83740,6,0,P|379:283|336:305,1,110,4|8,1:2|0:0,0:0:0:0: +305,322,84213,2,0,P|249:330|209:277,1,110,2|2,0:0|0:0,0:0:0:0: +168,264,84687,1,8,0:0:0:0: +64,296,85003,1,0,1:2:0:0: +141,373,85319,1,8,0:0:0:0: +168,264,85635,1,0,1:0:0:0: +12,109,86266,6,0,L|20:-27,1,110,4|8,1:0|0:0,0:0:0:0: +113,55,86898,1,0,1:0:0:0: +213,11,87213,2,0,L|277:19,1,55,8|2,0:0|0:0,0:0:0:0: +319,36,87529,2,0,B|343:60|343:60|328:153,1,110,0|8,1:0|0:0,0:0:0:0: +371,172,88003,2,0,L|351:301,1,110,2|2,0:0|0:0,0:0:0:0: +375,331,88477,1,8,0:0:0:0: +267,351,88792,6,0,B|203:367|219:319|139:335,1,110,4|8,1:2|0:0,0:0:0:0: +110,339,89266,1,2,0:0:0:0: +110,339,89424,2,0,P|110:283|94:219,1,110,0|8,1:0|0:0,0:0:0:0: +22,149,90056,2,0,P|54:117|132:123,1,110,0|8,1:0|0:0,0:0:0:0: +163,142,90529,2,0,L|292:164,1,110,2|2,0:0|3:2,0:0:0:0: +311,121,91003,1,8,0:0:0:0: +411,76,91319,6,0,L|403:204,1,110,4|8,1:2|0:0,0:0:0:0: +495,247,91950,1,0,1:0:0:0: +424,320,92266,2,0,L|360:312,1,55,8|2,0:0|0:0,0:0:0:0: +325,279,92582,2,0,P|303:320|231:328,1,110,0|8,1:0|0:0,0:0:0:0: +143,369,93213,1,0,1:0:0:0: +143,369,93371,2,0,P|143:313|135:257,1,110,2|2,0:0|0:0,0:0:0:0: +88,224,93845,5,2,1:2:0:0: +24,136,94161,1,10,0:2:0:0: +120,80,94477,1,2,1:2:0:0: +184,168,94792,1,10,0:2:0:0: +250,255,95108,5,0,1:0:0:0: +157,314,95424,1,8,0:0:0:0: +88,224,95740,1,0,1:0:0:0: +184,168,96056,1,8,0:0:0:0: +274,107,96371,6,0,L|384:118,1,110,4|8,1:2|0:2,0:0:0:0: +453,32,97003,2,0,L|343:21,1,110,0|8,1:2|0:2,0:0:0:0: +233,10,97635,2,0,L|123:-1,1,110,0|8,1:2|0:2,0:0:0:0: +55,85,98266,1,0,1:0:0:0: +55,85,98424,2,0,P|28:129|33:186,1,110,0|0,1:0|1:0,0:0:0:0: +77,218,98898,6,0,L|209:236,1,110,4|8,1:2|0:2,0:0:0:0: +294,250,99529,2,0,L|426:268,1,110,0|8,1:2|0:2,0:0:0:0: +393,374,100161,2,0,L|284:359,1,110,0|8,1:2|0:2,0:0:0:0: +294,250,100792,1,0,1:0:0:0: +294,250,100950,2,0,B|299:163|299:163|318:141,1,110,0|0,1:0|1:0,0:0:0:0: +361,117,101424,6,0,L|476:130,1,110,4|8,0:0|0:0,0:0:0:0: +489,20,102056,2,0,L|379:7,1,110,0|8,1:2|0:0,0:0:0:0: +275,43,102687,2,0,B|192:48|210:107|112:104,1,165,0|2,1:2|0:0,0:0:0:0: +71,94,103319,1,0,1:2:0:0: +16,189,103635,1,8,0:0:0:0: +103,254,103950,6,0,L|212:238,1,110,0|8,1:0|0:0,0:0:0:0: +233,346,104582,2,0,L|124:362,1,110,0|8,1:2|0:0,0:0:0:0: +99,245,105213,2,0,L|209:235,1,110,0|8,1:2|0:0,0:0:0:0: +224,344,105845,2,0,L|115:354,1,110,0|8,1:2|0:0,0:0:0:0: +99,245,106477,6,0,L|91:115,1,110,4|8,1:2|0:2,0:0:0:0: +4,68,107108,2,0,L|10:177,1,110,0|8,1:2|0:2,0:0:0:0: +99,245,107740,1,0,1:2:0:0: +207,229,108056,1,8,0:2:0:0: +202,119,108371,1,0,1:0:0:0: +202,119,108529,2,0,L|315:107,1,110,0|0,1:0|1:0,0:0:0:0: +366,103,109003,6,0,L|377:222,1,110,4|8,1:2|0:2,0:0:0:0: +304,296,109635,2,0,L|293:186,1,110,0|8,1:2|0:2,0:0:0:0: +365,103,110266,1,0,1:2:0:0: +474,87,110582,1,8,0:2:0:0: +489,200,110898,1,0,1:0:0:0: +489,200,111056,2,0,L|503:318,1,110,0|2,1:0|1:2,0:0:0:0: +462,348,111529,6,0,P|415:366|353:325,1,110,4|8,1:2|0:0,0:0:0:0: +286,263,112161,1,0,1:2:0:0: +176,277,112477,1,8,0:0:0:0: +99,356,112792,2,0,L|91:185,1,165,0|2,1:2|0:0,0:0:0:0: +79,137,113424,2,0,P|140:154|203:130,1,110,0|8,1:2|0:0,0:0:0:0: +264,66,114056,6,0,L|380:82,1,110,6|10,1:2|0:0,0:0:0:0: +461,14,114687,2,0,L|352:-2,1,110,2|10,1:2|0:2,0:0:0:0: +264,66,115319,1,2,1:2:0:0: +296,171,115635,1,10,0:0:0:0: +405,161,115950,1,2,1:2:0:0: +426,268,116266,1,10,0:0:0:0: +317,284,116582,6,0,L|186:300,1,110,4|8,1:0|0:0,0:0:0:0: +103,284,117213,1,0,1:0:0:0: +103,284,117371,2,0,B|80:256|80:256|93:162,1,110,2|2,0:0|0:0,0:0:0:0: +139,157,117845,2,0,L|128:25,1,110,0|8,1:0|0:0,0:0:0:0: +235,16,118477,2,0,L|313:19,1,55,8|8,0:0|0:0,0:0:0:0: +344,22,118792,2,0,L|422:25,1,55,8|8,0:0|0:0,0:0:0:0: +453,30,119108,6,0,P|468:68|456:148,1,110,4|8,1:2|0:0,0:0:0:0: +378,207,119740,1,0,1:0:0:0: +378,207,119898,2,0,P|353:273|369:324,1,110,2|2,0:0|0:0,0:0:0:0: +376,362,120371,1,0,1:0:0:0: +266,372,120687,1,8,0:0:0:0: +155,375,121003,2,0,L|160:319,1,55,2|0,1:2|3:0,0:0:0:0: +172,266,121319,2,0,L|177:210,1,55,8|2,0:0|0:0,0:0:0:0: +188,157,121635,6,0,B|156:147|156:147|60:160,1,110,4|8,1:2|0:0,0:0:0:0: +41,54,122266,1,0,1:0:0:0: +41,54,122424,2,0,B|75:76|75:76|168:62,1,110,2|2,0:0|0:0,0:0:0:0: +197,52,122898,1,0,1:0:0:0: +305,36,123213,1,8,0:0:0:0: +414,24,123529,2,0,L|423:96,1,55,8|8,0:0|0:0,0:0:0:0: +454,122,123845,2,0,L|463:194,1,55,8|8,0:0|0:0,0:0:0:0: +478,229,124161,5,0,1:0:0:0: +368,239,124477,1,8,0:0:0:0: +247,249,124792,1,0,1:0:0:0: +126,260,125108,1,8,0:0:0:0: +97,129,125424,1,0,1:0:0:0: +228,117,125740,1,8,0:0:0:0: +370,104,126056,1,0,1:0:0:0: +512,93,126371,1,8,3:2:0:0: +322,361,127792,6,0,L|153:345,1,165,14|14,0:0|0:0,0:0:0:0: +47,336,128582,2,0,P|40:256|66:212,1,110,12|0,0:0|1:2,0:0:0:0: +101,206,129056,1,12,0:0:0:0: +256,192,129213,12,0,130477,0:0:0:0: diff --git a/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Osu's Expert].osu b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Osu's Expert].osu new file mode 100644 index 0000000..638b49d --- /dev/null +++ b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Osu's Expert].osu @@ -0,0 +1,700 @@ +osu file format v14 + +[General] +AudioFilename: audio.mp3 +AudioLeadIn: 0 +PreviewTime: 75687 +Countdown: 0 +SampleSet: Soft +StackLeniency: 0.2 +Mode: 0 +LetterboxInBreaks: 0 +WidescreenStoryboard: 1 + +[Editor] +DistanceSpacing: 1.6 +BeatDivisor: 4 +GridSize: 8 +TimelineZoom: 3.099999 + +[Metadata] +Title:Happy Time wa Owaranai (Cut Ver.) +TitleUnicode:ハッピータイムは終わらない (Cut Ver.) +Artist:Nanamori-chu * Goraku-bu +ArtistUnicode:七森中☆ごらく部 +Creator:-Keitaro +Version:Osu's Expert +Source:ゆるゆり +Tags:japanese anime pop YuruYuri 三上枝織 大坪由佳 津田美波 大久保瑠美 Mikami Shiori Otsubo Yuka Tsuda Minami Okubo Rumi 赤座あかり Akaza Akari 歳納京子 Toshino Kyoko 船見結衣 Funami Yui 吉川ちなつ Yoshikawa Chinatsu ioexception deadcode ceo of osu ceo_of_osu +BeatmapID:2745510 +BeatmapSetID:1057015 + +[Difficulty] +HPDrainRate:6 +CircleSize:3.8 +OverallDifficulty:9 +ApproachRate:8 +SliderMultiplier:1.6 +SliderTickRate:1 + +[Events] +//Background and Video events +0,0,"Akari Yui Kyouko Chinatsu 486.jpg",0,0 +//Break Periods +//Storyboard Layer 0 (Background) +//Storyboard Layer 1 (Fail) +//Storyboard Layer 2 (Pass) +//Storyboard Layer 3 (Foreground) +//Storyboard Layer 4 (Overlay) +//Storyboard Sound Samples + +[TimingPoints] +1635,315.789473684211,4,2,22,32,1,0 +1637,-100,4,2,22,32,0,0 +2266,-100,4,2,22,32,0,0 +2898,-100,4,2,22,32,0,0 +3529,-100,4,2,22,32,0,0 +4161,-100,4,2,22,32,0,0 +4793,-100,4,2,22,32,0,0 +5424,-100,4,2,22,42,0,0 +6056,-100,4,2,22,42,0,0 +6687,-100,4,2,22,42,0,0 +7319,-100,4,2,22,42,0,0 +7950,-100,4,2,22,52,0,0 +10003,-100,4,2,22,52,0,0 +10477,-200,4,2,22,62,0,0 +13003,-133.333333333333,4,2,22,62,0,0 +15529,-111.111111111111,4,2,22,62,0,0 +20582,-100,4,2,22,72,0,0 +32582,-33.3333333333333,4,2,22,72,0,0 +33214,-100,4,2,22,72,0,0 +37635,-33.3333333333333,4,2,22,72,0,0 +38266,-100,4,2,22,72,0,0 +38898,-100,4,2,22,72,0,0 +39529,-100,4,2,22,72,0,0 +40161,-100,4,2,22,72,0,0 +40793,-100,4,2,22,62,0,0 +50582,-100,4,2,22,62,0,0 +50740,-100,4,2,22,62,0,0 +50898,-100,4,2,22,72,0,0 +61003,-100,4,2,22,72,0,0 +61358,-100,4,2,22,72,0,0 +61477,-100,4,2,22,72,0,0 +61990,-100,4,2,22,72,0,0 +62108,-100,4,2,22,72,0,0 +68582,-100,4,2,22,72,0,0 +69845,-100,4,2,22,72,0,0 +71108,-100,4,2,22,72,0,0 +71128,-100,4,2,22,72,0,0 +71427,-100,4,2,22,72,0,0 +71760,-100,4,2,22,72,0,0 +72056,-100,4,2,22,72,0,0 +72391,-100,4,2,22,72,0,0 +72687,-100,4,2,22,72,0,0 +73023,-100,4,2,22,72,0,0 +73161,-100,4,2,22,72,0,0 +76161,-76.9230769230769,4,2,22,82,0,0 +116584,-76.9230769230769,4,2,22,72,0,0 +116661,-76.9230769230769,4,2,22,72,0,0 +118477,-25.6410256410256,4,2,22,72,0,0 +119108,-76.9230769230769,4,2,22,72,0,0 +123529,-25.6410256410256,4,2,22,72,0,0 +124161,-76.9230769230769,4,2,22,82,0,0 +124793,-76.9230769230769,4,2,22,82,0,0 +125424,-76.9230769230769,4,2,22,82,0,0 +127793,-33.3333333333333,4,2,22,72,0,0 +128266,-133.333333333333,4,2,22,72,0,0 +130477,-133.333333333333,4,2,22,72,0,0 + + +[Colours] +Combo1 : 95,20,250 +Combo2 : 0,64,128 +Combo3 : 18,124,255 +Combo4 : 255,145,91 + +[HitObjects] +37,348,1635,5,2,0:0:0:0: +37,348,1950,1,2,0:0:0:0: +37,348,2266,1,2,0:0:0:0: +37,348,2424,1,2,0:0:0:0: +37,348,2582,1,2,0:0:0:0: +37,348,2740,1,2,0:0:0:0: +37,348,2898,1,2,0:0:0:0: +37,348,3214,1,2,0:0:0:0: +37,348,3529,1,2,0:0:0:0: +37,348,3845,1,2,0:0:0:0: +37,348,4161,1,2,0:0:0:0: +37,348,4477,1,2,0:0:0:0: +37,348,4793,1,2,0:0:0:0: +37,348,4950,1,2,0:0:0:0: +37,348,5108,1,2,0:0:0:0: +37,348,5266,1,2,0:0:0:0: +103,297,5424,5,6,0:0:0:0: +103,297,5740,1,2,0:0:0:0: +103,297,6056,1,2,0:0:0:0: +103,297,6372,1,2,0:0:0:0: +103,297,6687,1,2,0:0:0:0: +103,297,7003,1,2,0:0:0:0: +103,297,7319,1,2,0:0:0:0: +103,297,7477,1,2,0:0:0:0: +103,297,7635,1,2,0:0:0:0: +103,297,7793,1,2,0:0:0:0: +191,282,7950,5,2,0:0:0:0: +187,265,8266,1,2,0:0:0:0: +208,287,8582,1,2,0:0:0:0: +178,294,8898,1,2,0:0:0:0: +191,282,9214,1,2,0:0:0:0: +191,282,9529,1,2,0:0:0:0: +191,282,9687,1,2,0:0:0:0: +473,0,10003,5,2,0:0:0:0: +467,85,10161,1,2,0:0:0:0: +461,170,10319,1,2,0:0:0:0: +455,255,10477,2,0,B|289:226|332:382|156:339,1,320,4|2,1:0|0:0,0:0:0:0: +163,340,12214,1,2,0:0:0:0: +163,340,12529,1,2,0:0:0:0: +163,340,12687,1,2,0:0:0:0: +20,57,13003,6,0,P|14:150|157:17,1,480,4|4,1:0|1:2,0:0:0:0: +170,24,14740,1,2,0:0:0:0: +170,24,15056,1,2,0:0:0:0: +380,313,15372,5,0,0:0:0:0: +380,313,15529,2,0,B|353:161|353:161|428:98|428:98|498:164|498:164|468:317,1,503.999984619141,4|0,1:2|0:0,0:0:0:0: +292,373,16793,6,0,B|79:356|250:101|-6:100,1,431.999986816407,4|2,1:2|0:0,0:0:0:0: +11,100,17898,1,0,0:0:0:0: +255,36,18056,5,4,1:2:0:0: +170,41,18214,2,0,P|202:104|281:115,1,143.999995605469 +336,71,18687,1,4,1:2:0:0: +270,251,18845,2,0,P|333:219|344:140,1,143.999995605469 +79,202,19319,5,4,1:2:0:0: +68,291,19477,1,0,0:0:0:0: +444,291,19635,5,4,1:2:0:0: +433,202,19793,1,0,0:0:0:0: +444,291,20108,5,2,0:0:0:0: +433,202,20266,1,2,0:0:0:0: +421,103,20424,1,2,0:0:0:0: +410,14,20582,6,0,P|360:10|302:0,1,80,4|2,1:0|0:0,0:0:0:0: +180,170,20898,2,0,L|285:161,1,80,8|2,0:0|0:0,0:0:0:0: +325,92,21214,5,0,1:0:0:0: +239,75,21372,1,2,0:0:0:0: +189,0,21529,5,8,0:0:0:0: +20,175,21687,1,2,0:0:0:0: +20,175,21766,1,2,0:0:0:0: +20,175,21845,5,0,1:0:0:0: +3,89,22003,1,2,0:0:0:0: +89,72,22161,1,8,0:0:0:0: +106,157,22319,2,0,P|104:212|96:266,1,80,2|0,0:0|1:0,0:0:0:0: +492,175,22635,5,2,0:0:0:0: +509,89,22793,1,8,0:0:0:0: +423,72,22951,1,2,0:0:0:0: +406,157,23109,6,0,P|408:212|416:266,1,80,4|2,1:2|0:0,0:0:0:0: +447,364,23424,2,0,L|346:354,1,80,8|2,0:0|0:0,0:0:0:0: +367,356,23661,1,2,0:0:0:0: +367,356,23740,1,0,1:0:0:0: +283,350,23898,1,2,0:2:0:0: +126,324,24056,1,8,0:0:0:0: +28,311,24214,1,2,0:0:0:0: +28,311,24293,1,2,0:0:0:0: +28,311,24372,6,0,B|40:250|-10:227|12:155,1,160,0|8,1:2|0:0,0:0:0:0: +178,192,24845,2,0,L|277:200,1,80,2|0,0:0|1:2,0:0:0:0: +51,82,25161,2,0,L|39:31,1,40,2|2,0:0|0:0,0:0:0:0: +96,181,25319,2,0,P|129:125|192:110,1,120,10|0,0:0|0:0,0:0:0:0: +178,108,25635,6,0,P|155:63|158:8,1,80,4|2,1:2|0:0,0:0:0:0: +350,211,25950,2,0,P|339:293|335:386,1,160,8|0,0:0|1:2,0:0:0:0: +456,28,26424,1,2,0:0:0:0: +481,109,26582,2,0,P|432:108|389:77,1,80,8|2,0:0|0:0,0:0:0:0: +288,21,26898,6,0,P|311:63|306:116,1,80,0|2,1:2|0:0,0:0:0:0: +61,76,27214,2,0,L|234:85,1,160,8|0,0:0|1:2,0:0:0:0: +8,8,27687,5,2,0:0:0:0: +42,162,27845,1,8,0:0:0:0: +25,248,28003,1,2,0:0:0:0: +0,337,28161,6,0,P|44:340|90:353,1,80,4|2,1:2|0:0,0:0:0:0: +281,223,28477,1,8,0:0:0:0: +193,237,28635,1,2,0:0:0:0: +255,366,28793,5,0,1:2:0:0: +259,370,28950,2,0,L|264:321,1,40,2|0,0:0|0:0,0:0:0:0: +289,132,29108,1,8,0:0:0:0: +344,279,29266,1,2,0:0:0:0: +404,349,29424,5,0,1:2:0:0: +436,63,29582,1,2,0:0:0:0: +504,11,29740,5,8,0:0:0:0: +447,147,29898,1,2,0:0:0:0: +357,29,30056,1,0,1:2:0:0: +57,30,30214,5,2,3:2:0:0: +57,30,30293,1,0,3:0:0:0: +57,30,30372,2,0,L|114:36,1,40,8|0,0:0|0:0,0:0:0:0: +51,103,30529,2,0,L|108:109,1,40,2|0,0:0|0:0,0:0:0:0: +31,346,30687,6,0,P|86:358|147:259,1,160,4|8,1:0|0:0,0:0:0:0: +122,207,31161,1,2,0:0:0:0: +167,141,31319,1,0,1:0:0:0: +415,114,31477,1,2,0:0:0:0: +372,44,31635,1,8,0:0:0:0: +332,119,31793,2,0,P|327:174|331:227,1,80,2|0,0:0|1:0,0:0:0:0: +404,348,32108,5,2,0:0:0:0: +379,271,32266,1,8,0:0:0:0: +301,291,32424,1,2,0:0:0:0: +493,87,32582,6,0,B|505:132|505:132|484:328,3,240.000009155274,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +484,324,33214,5,4,1:2:0:0: +484,324,33529,1,8,0:0:0:0: +404,344,33687,1,2,0:0:0:0: +393,263,33845,1,0,1:0:0:0: +192,113,34003,2,0,P|193:65|214:14,1,80,2|8,0:0|0:0,0:0:0:0: +347,31,34319,2,0,P|357:69|357:109,1,80,2|0,0:0|1:0,0:0:0:0: +274,87,34635,5,2,0:0:0:0: +30,129,34793,2,0,L|127:111,1,80,8|2,0:0|0:0,0:0:0:0: +512,41,35108,2,0,L|433:55,1,80,2|0,1:2|3:0,0:0:0:0: +500,148,35345,1,0,3:0:0:0: +500,148,35424,2,0,P|446:149|412:104,1,80,8|2,0:0|0:0,0:0:0:0: +274,87,35740,6,0,P|302:155|256:245,1,160,4|8,1:2|0:0,0:0:0:0: +179,290,36214,1,2,0:0:0:0: +184,207,36372,1,0,1:0:0:0: +332,371,36529,1,2,0:0:0:0: +337,288,36687,1,8,0:0:0:0: +87,351,36845,2,0,P|90:305|91:261,1,80,2|0,0:0|1:0,0:0:0:0: +423,252,37161,1,2,0:0:0:0: +427,256,37319,2,0,P|424:295|423:335,1,80,8|2,0:0|0:0,0:0:0:0: +512,130,37635,6,0,B|522:184|522:184|514:369,3,240.000009155274,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +512,130,38266,5,0,1:0:0:0: +207,257,38582,5,8,0:0:0:0: +189,143,38740,1,2,0:0:0:0: +303,125,38898,1,0,1:0:0:0: +321,239,39056,1,2,0:0:0:0: +368,174,39214,5,8,0:0:0:0: +238,78,39372,1,2,0:0:0:0: +142,209,39530,1,0,1:0:0:0: +273,304,39688,1,2,0:0:0:0: +160,322,39845,5,8,0:0:0:0: +124,96,40003,1,2,0:0:0:0: +350,60,40161,1,0,1:0:0:0: +386,286,40319,1,2,0:0:0:0: +386,286,40398,1,2,0:0:0:0: +386,286,40477,1,8,0:0:0:0: +256,192,40635,1,2,0:0:0:0: +488,148,40793,5,2,0:0:0:0: +492,152,40950,2,0,P|503:101|428:17,1,160,2|2,0:0|0:0,0:0:0:0: +422,201,41424,2,0,P|375:188|348:143,1,80,2|0,0:0|0:0,0:0:0:0: +191,231,41740,2,0,P|225:196|278:195,1,80,2|0,0:0|0:0,0:0:0:0: +276,12,42056,1,2,0:0:0:0: +280,16,42214,2,0,P|292:63|266:109,1,80 +38,51,42529,6,0,P|116:52|218:60,1,160,2|2,0:0|0:0,0:0:0:0: +70,139,43003,2,0,P|120:140|171:145,1,80,0|2,0:0|0:0,0:0:0:0: +149,142,43240,1,2,0:0:0:0: +149,142,43319,1,2,0:0:0:0: +344,355,43477,5,2,0:0:0:0: +332,273,43635,1,0,0:0:0:0: +430,338,43793,1,2,0:0:0:0: +418,256,43951,1,2,0:0:0:0: +201,93,44108,5,2,0:0:0:0: +201,93,44424,1,2,0:0:0:0: +189,175,44582,1,2,0:0:0:0: +287,110,44740,1,0,0:0:0:0: +275,192,44898,1,2,0:0:0:0: +44,359,45056,5,2,0:0:0:0: +32,277,45372,1,2,0:0:0:0: +130,342,45530,1,0,0:0:0:0: +118,260,45688,1,2,0:0:0:0: +374,287,45845,5,0,0:0:0:0: +450,250,46003,2,0,P|416:212|369:204,1,80,0|2,0:0|0:0,0:0:0:0: +358,370,46319,2,0,P|321:355|298:324,1,80,0|2,0:0|0:0,0:0:0:0: +27,140,46793,6,0,P|61:102|108:94,1,80,2|0,0:0|0:0,0:0:0:0: +118,260,47109,2,0,P|154:245|178:213,1,80,2|0,0:0|0:0,0:0:0:0: +403,102,47424,5,2,0:0:0:0: +387,185,47582,2,0,P|350:170|326:138,1,80,2|0,0:0|0:0,0:0:0:0: +479,65,47898,2,0,P|445:27|398:19,1,80,2|0,0:0|0:0,0:0:0:0: +103,12,48214,5,2,0:0:0:0: +103,12,48293,1,2,0:0:0:0: +103,12,48372,1,2,0:0:0:0: +171,54,48687,2,0,P|133:87|81:91,1,80,0|2,0:0|0:0,0:0:0:0: +103,12,49003,1,2,0:0:0:0: +266,81,49161,2,0,P|256:31|278:-15,1,80,0|2,0:0|0:0,0:0:0:0: +344,51,49477,1,2,0:0:0:0: +344,51,49556,1,2,0:0:0:0: +344,51,49635,1,2,0:0:0:0: +195,149,49793,2,0,P|242:165|272:208,1,80,0|2,0:0|0:0,0:0:0:0: +170,222,50108,2,0,P|189:227|205:240,1,40 +479,128,50266,5,2,0:0:0:0: +204,239,50582,6,0,P|189:227|170:222,1,40,8|0,0:0|0:0,0:0:0:0: +85,349,50898,5,4,1:2:0:0: +215,336,51056,1,2,0:0:0:0: +345,323,51214,1,8,0:0:0:0: +475,310,51372,1,2,0:0:0:0: +345,323,51529,1,0,1:0:0:0: +215,336,51687,1,2,0:0:0:0: +85,349,52003,5,2,0:0:0:0: +215,336,52161,1,0,1:0:0:0: +345,323,52319,1,2,0:0:0:0: +475,310,52477,1,8,0:0:0:0: +345,323,52634,1,2,0:0:0:0: +215,336,52950,1,2,0:0:0:0: +85,349,53266,1,2,0:0:0:0: +125,114,53424,5,4,1:2:0:0: +228,241,53582,1,2,0:0:0:0: +365,202,53898,1,2,0:0:0:0: +373,41,54056,1,0,1:2:0:0: +365,202,54372,1,8,0:0:0:0: +228,241,54529,1,2,0:0:0:0: +125,114,54687,5,0,1:2:0:0: +228,241,55003,1,8,0:0:0:0: +365,202,55160,1,2,0:0:0:0: +373,41,55477,5,0,3:2:0:0: +373,41,55556,1,0,3:2:0:0: +373,41,55635,1,8,0:0:0:0: +322,118,55792,1,2,0:0:0:0: +409,130,55950,1,4,1:2:0:0: +487,361,56108,6,0,P|459:309|346:298,1,160,2|2,0:0|0:0,0:0:0:0: +302,347,56582,1,0,1:2:0:0: +393,371,56740,1,2,0:0:0:0: +393,371,57056,1,2,0:0:0:0: +373,149,57214,5,0,1:2:0:0: +284,172,57372,1,2,0:0:0:0: +195,195,57529,1,8,0:0:0:0: +106,218,57687,1,2,0:0:0:0: +17,241,57845,5,0,1:2:0:0: +41,12,58003,1,2,0:0:0:0: +255,44,58161,1,8,0:0:0:0: +231,273,58319,1,2,0:0:0:0: +155,309,58477,6,0,B|128:227|190:232|153:135,1,160,0|8,1:2|0:0,0:0:0:0: +174,70,58950,2,0,P|128:74|69:78,1,80,2|0,0:0|1:0,0:0:0:0: +225,376,59266,2,0,P|249:316|341:303,1,160,2|2,0:0|0:0,0:0:0:0: +512,294,59740,6,0,P|504:352|478:381,1,80,0|2,1:2|0:0,0:0:0:0: +256,96,60056,2,0,P|255:139|256:192,1,80,8|2,0:0|0:0,0:0:0:0: +81,309,60372,5,0,1:0:0:0: +0,294,60529,2,0,P|8:352|34:381,1,80,2|8,0:2|0:0,0:0:0:0: +199,299,60845,2,0,L|137:305,1,40,2|0,0:0|0:0,0:0:0:0: +81,309,61003,5,4,1:2:0:0: +261,241,61161,2,0,P|279:275|280:315,1,80,0|8,0:0|0:0,0:0:0:0: +167,214,61477,1,0,0:0:0:0: +176,133,61635,1,2,1:2:0:0: +41,40,61793,1,0,0:0:0:0: +122,49,61951,1,8,0:0:0:0: +122,49,62108,1,2,0:0:0:0: +47,318,62266,6,0,P|88:310|131:309,1,80,2|0,1:2|0:0,0:0:0:0: +364,119,62582,1,8,0:0:0:0: +393,211,62740,2,0,P|353:209|313:201,1,80,2|0,0:0|1:0,0:0:0:0: +142,12,63056,5,0,0:0:0:0: +168,221,63214,1,10,0:0:0:0: +142,12,63372,1,0,0:0:0:0: +106,98,63529,5,2,1:2:0:0: +208,61,63687,1,0,0:0:0:0: +394,118,63845,5,8,0:0:0:0: +217,155,64003,1,0,0:0:0:0: +106,98,64161,5,2,1:2:0:0: +208,61,64319,1,0,0:0:0:0: +394,118,64477,5,8,0:0:0:0: +217,155,64635,1,0,0:0:0:0: +38,163,64793,6,0,P|17:112|-17:86,1,80,2|0,1:2|0:0,0:0:0:0: +256,80,65108,2,0,P|257:44|256:0,1,80,8|2,0:0|0:0,0:0:0:0: +474,163,65424,2,0,P|495:112|529:86,1,80,2|0,0:0|0:0,0:0:0:0: +416,232,65661,1,0,1:0:0:0: +416,232,65740,2,0,P|389:180|387:124,1,80,8|0,0:0|1:0,0:0:0:0: +423,70,66056,5,4,1:2:0:0: +470,344,66214,1,0,0:0:0:0: +385,363,66372,1,8,0:0:0:0: +300,382,66529,1,0,0:0:0:0: +233,110,66687,5,2,1:2:0:0: +300,382,66845,1,0,0:0:0:0: +385,363,67002,1,8,0:0:0:0: +470,344,67160,1,0,0:0:0:0: +219,291,67319,6,0,P|279:293|319:310,1,80,2|0,1:2|0:0,0:0:0:0: +123,243,67635,2,0,P|175:214|219:209,1,80,8|2,0:0|0:0,0:0:0:0: +11,245,67950,1,0,1:0:0:0: +15,249,68108,2,0,P|46:198|81:171,1,80,0|10,1:0|0:0,0:0:0:0: +178,123,68424,1,0,1:0:0:0: +1,100,68582,6,0,P|31:157|0:267,1,160,2|8,1:2|0:0,0:0:0:0: +106,22,69056,1,0,0:0:0:0: +120,338,69214,1,2,1:2:0:0: +124,342,69372,2,0,P|124:293|109:253,2,80,0|8|0,0:0|0:0|0:0,0:0:0:0: +199,135,69845,5,2,1:2:0:0: +199,135,70161,1,8,0:0:0:0: +117,174,70319,1,0,1:2:0:0: +438,213,70477,5,2,1:2:0:0: +271,219,70635,1,0,1:0:0:0: +239,222,70713,1,0,1:0:0:0: +214,242,70792,1,8,0:0:0:0: +502,145,70950,6,0,L|489:75,1,40,0|0,1:2|0:0,0:0:0:0: +477,29,71108,5,4,1:2:0:0: +428,341,71424,1,0,3:0:0:0: +477,29,71740,5,4,1:2:0:0: +329,302,72056,1,0,3:0:0:0: +477,29,72372,5,4,1:2:0:0: +230,263,72687,1,0,3:0:0:0: +477,29,73003,5,12,1:2:0:0: +131,224,73161,1,0,3:0:0:0: +477,29,73477,5,0,3:0:0:0: +32,185,73635,2,0,P|79:166|113:100,1,120,4|0,1:0|0:0,0:0:0:0: +145,304,73950,2,0,L|152:344,1,40,0|0,1:0|0:0,0:0:0:0: +480,185,74266,6,0,P|433:166|399:100,1,120,4|0,1:0|0:0,0:0:0:0: +366,304,74582,2,0,L|360:344,1,40,0|0,1:0|0:0,0:0:0:0: +256,40,74898,5,4,1:0:0:0: +256,128,75214,5,4,1:0:0:0: +256,368,75372,2,0,L|256:304,1,40,2|0,0:0|0:0,0:0:0:0: +256,40,75529,5,4,1:0:0:0: +168,310,75687,5,2,0:0:0:0: +89,325,75845,1,2,0:0:0:0: +10,340,76003,1,2,0:0:0:0: +439,337,76161,6,0,P|362:315|377:188,1,207.999990478516,4|8,1:0|0:0,0:0:0:0: +359,202,76635,1,2,0:0:0:0: +124,14,76793,2,0,P|120:77|112:154,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +489,258,77108,2,0,P|492:206|496:154,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +496,154,77345,1,2,0:0:0:0: +496,154,77424,1,2,1:2:0:0: +253,378,77582,5,2,0:0:0:0: +241,286,77740,1,8,0:0:0:0: +229,194,77898,1,2,0:0:0:0: +263,17,78056,5,0,1:0:0:0: +64,129,78214,2,0,P|99:135|129:152,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +274,105,78372,5,8,0:0:0:0: +472,217,78530,2,0,P|446:220|422:229,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +288,198,78687,5,4,1:2:0:0: +175,344,78845,1,2,0:0:0:0: +0,285,79003,1,8,0:0:0:0: +175,344,79161,1,2,0:0:0:0: +288,198,79319,5,0,1:0:0:0: +175,344,79477,1,2,0:0:0:0: +175,344,79635,1,8,0:0:0:0: +0,285,79793,1,2,0:0:0:0: +340,46,79950,6,0,P|308:109|175:46,1,207.999990478516,0|8,1:0|0:0,0:0:0:0: +189,0,80424,2,0,L|53:27,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +342,228,80740,1,2,3:2:0:0: +306,225,80818,1,0,3:0:0:0: +270,223,80897,1,8,0:0:0:0: +479,91,81056,2,0,L|412:86,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +365,0,81214,6,0,P|309:33|293:92,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +213,333,81529,2,0,P|201:232|182:101,1,207.999990478516,8|0,0:0|1:0,0:0:0:0: +186,126,82003,1,2,0:0:0:0: +384,88,82161,1,8,0:0:0:0: +7,5,82319,5,2,3:2:0:0: +7,5,82398,1,0,3:0:0:0: +7,5,82477,2,0,P|18:65|25:123,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +33,192,82793,1,8,0:0:0:0: +220,166,82950,2,0,P|160:177|102:184,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +33,192,83266,1,2,0:0:0:0: +59,379,83424,2,0,P|48:319|41:261,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +453,379,83740,6,0,P|464:319|471:261,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +479,192,84056,1,8,0:0:0:0: +292,166,84214,2,0,P|352:177|410:184,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +479,192,84529,1,2,0:0:0:0: +501,1,84687,1,8,0:0:0:0: +505,5,84845,2,0,P|494:65|487:123,1,103.999995239258,2|0,0:0|1:2,0:0:0:0: +512,369,85161,5,2,0:0:0:0: +357,287,85319,1,8,0:0:0:0: +155,97,85477,5,2,0:0:0:0: +0,15,85635,1,0,1:0:0:0: +69,263,85793,5,2,0:0:0:0: +92,340,85950,1,2,0:0:0:0: +69,263,86108,1,2,0:0:0:0: +6,327,86266,5,4,1:0:0:0: +155,97,86424,2,0,P|156:154|139:222,2,103.999995239258,2|8|2,0:0|0:0|0:0,0:0:0:0: +155,97,86819,1,2,0:0:0:0: +155,97,86898,1,0,1:0:0:0: +322,367,87056,1,2,0:0:0:0: +232,240,87214,2,0,P|230:291|240:342,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +477,272,87529,5,0,1:0:0:0: +481,276,87687,2,0,P|427:272|369:267,1,103.999995239258,2|8,0:0|0:0,0:0:0:0: +55,237,88003,1,2,0:0:0:0: +283,154,88161,5,0,1:0:0:0: +197,371,88319,2,0,P|223:356|248:330,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +368,120,88477,5,8,0:0:0:0: +87,42,88635,2,0,P|128:46|155:54,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +456,84,88793,6,0,P|462:147|466:207,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +139,49,89108,2,0,P|145:112|149:172,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +147,152,89345,1,2,0:0:0:0: +147,152,89424,1,0,1:0:0:0: +51,365,89582,1,2,0:0:0:0: +56,221,89740,1,8,0:0:0:0: +226,236,89898,1,2,0:0:0:0: +0,0,90056,6,0,P|26:69|145:37,1,207.999990478516,0|8,1:0|0:0,0:0:0:0: +484,71,90529,2,0,P|419:79|363:90,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +159,237,90845,1,2,3:2:0:0: +107,231,90923,1,0,3:0:0:0: +56,221,91002,1,8,0:0:0:0: +486,354,91161,6,0,P|421:362|365:373,1,103.999995239258,2|4,0:0|1:2,0:0:0:0: +304,16,91477,1,2,0:0:0:0: +319,212,91635,5,8,0:0:0:0: +401,177,91793,1,2,0:0:0:0: +401,177,91872,1,2,0:2:0:0: +401,177,91950,1,2,1:2:0:0: +473,224,92108,5,2,0:0:0:0: +237,190,92266,1,8,0:0:0:0: +1,156,92424,1,2,0:0:0:0: +69,102,92582,6,0,P|61:45|50:-14,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +340,199,92898,2,0,P|332:142|321:83,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +42,351,93214,1,0,1:0:0:0: +46,355,93372,2,0,P|38:298|27:239,1,103.999995239258,2|8,0:0|0:0,0:0:0:0: +224,18,93687,1,2,0:0:0:0: +228,22,93845,5,2,1:2:0:0: +223,68,93924,1,2,0:2:0:0: +218,115,94003,1,2,0:2:0:0: +214,161,94082,1,2,0:2:0:0: +236,194,94161,1,10,0:2:0:0: +231,240,94240,1,2,0:2:0:0: +226,287,94319,1,2,0:2:0:0: +222,333,94398,1,2,0:2:0:0: +244,366,94477,5,2,1:2:0:0: +222,333,94556,1,2,0:2:0:0: +226,287,94635,1,2,0:2:0:0: +231,240,94714,1,2,0:2:0:0: +236,194,94793,1,10,0:2:0:0: +214,161,94872,1,2,0:2:0:0: +218,115,94950,1,2,0:2:0:0: +223,68,95029,1,2,0:2:0:0: +228,22,95108,6,0,P|172:29|104:37,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +436,341,95424,2,0,P|380:348|312:356,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +42,284,95740,5,0,1:0:0:0: +184,234,95898,1,2,3:2:0:0: +232,215,95976,1,0,3:0:0:0: +280,196,96055,1,8,0:0:0:0: +429,143,96214,1,2,0:0:0:0: +322,27,96372,6,0,P|266:20|199:16,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +287,244,96687,2,0,P|231:237|164:233,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +322,27,97003,6,0,P|266:20|199:16,1,103.999995239258,0|2,1:2|0:2,0:0:0:0: +287,244,97319,2,0,P|231:237|164:233,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +322,27,97635,6,0,P|266:20|199:16,1,103.999995239258,0|2,1:2|0:2,0:0:0:0: +287,244,97950,2,0,P|231:237|164:233,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +0,0,98266,5,0,1:0:0:0: +140,130,98424,1,0,1:0:0:0: +372,254,98582,5,8,0:0:0:0: +512,384,98740,1,0,1:0:0:0: +460,305,98898,6,0,P|455:245|451:170,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +143,328,99214,2,0,P|138:268|134:193,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +460,305,99529,6,0,P|455:245|451:170,1,103.999995239258,0|2,1:2|0:2,0:0:0:0: +143,328,99845,2,0,P|138:268|134:193,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +460,305,100161,6,0,P|455:245|451:170,1,103.999995239258,0|2,1:2|0:2,0:0:0:0: +143,328,100477,2,0,P|138:268|134:193,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +460,305,100793,5,0,1:0:0:0: +135,224,100950,2,0,P|138:276|143:328,1,103.999995239258,0|8,1:0|0:0,0:0:0:0: +142,327,101266,6,0,P|193:324|245:319,1,103.999995239258,0|4,1:0|0:0,0:0:0:0: +351,96,101582,1,2,0:0:0:0: +244,2,101740,6,0,P|256:51|240:100,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +447,136,102056,2,0,P|410:171|359:182,1,103.999995239258,0|2,1:2|0:0,0:0:0:0: +432,378,102372,2,0,P|382:364|348:325,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +239,100,102687,6,0,P|305:86|361:79,1,103.999995239258,0|2,1:2|0:0,0:0:0:0: +103,370,103003,2,0,P|37:356|-19:349,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +275,352,103319,5,0,1:2:0:0: +244,183,103477,1,2,0:0:0:0: +213,15,103635,1,8,0:0:0:0: +138,182,103793,2,0,P|124:232|118:284,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +482,186,104108,5,2,0:0:0:0: +486,190,104266,1,8,0:0:0:0: +452,16,104424,1,2,0:0:0:0: +278,50,104582,1,0,1:2:0:0: +312,224,104740,1,2,0:0:0:0: +364,300,104898,5,8,0:0:0:0: +405,92,105056,1,2,0:0:0:0: +196,51,105214,1,0,1:2:0:0: +156,260,105372,1,2,0:0:0:0: +222,340,105529,5,8,0:0:0:0: +316,118,105687,1,2,0:0:0:0: +93,22,105845,1,0,1:2:0:0: +0,245,106003,1,2,3:2:0:0: +0,245,106082,1,0,3:0:0:0: +0,245,106161,1,8,0:0:0:0: +98,197,106319,1,2,0:0:0:0: +19,131,106477,6,0,P|5:71|-1:13,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +387,108,106793,2,0,P|373:48|367:-10,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +461,246,107108,6,0,P|475:186|481:128,1,103.999995239258,0|2,1:2|0:2,0:0:0:0: +93,223,107424,2,0,P|107:163|113:105,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +19,384,107740,6,0,P|5:324|-1:266,1,103.999995239258,0|2,1:2|0:2,0:0:0:0: +387,361,108056,2,0,P|373:301|367:243,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +512,384,108372,5,0,1:0:0:0: +367,258,108529,1,0,1:0:0:0: +145,126,108687,5,8,0:0:0:0: +0,0,108844,1,0,1:0:0:0: +226,4,109003,6,0,P|163:-2|102:2,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +103,251,109319,2,0,P|40:245|-21:249,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +380,64,109635,6,0,P|317:58|256:62,1,103.999995239258,0|2,1:2|0:2,0:0:0:0: +257,311,109951,2,0,P|194:305|133:309,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +512,137,110266,6,0,P|449:131|388:135,1,103.999995239258,0|2,1:2|0:2,0:0:0:0: +389,384,110582,2,0,P|326:378|265:382,1,103.999995239258,8|2,0:2|0:2,0:0:0:0: +243,125,110898,5,0,1:0:0:0: +246,171,110976,1,0,1:0:0:0: +250,218,111055,1,0,1:0:0:0: +254,264,111134,1,0,1:0:0:0: +257,311,111213,1,8,0:0:0:0: +107,109,111372,6,0,P|116:52|121:-21,1,103.999995239258,2|4,1:2|1:2,0:0:0:0: +119,5,111687,1,2,0:0:0:0: +83,198,111845,6,0,P|134:197|190:149,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +257,311,112161,2,0,P|301:284|325:215,1,103.999995239258,0|2,1:2|0:0,0:0:0:0: +464,322,112477,2,0,P|489:277|476:205,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +394,2,112793,5,0,1:2:0:0: +411,171,112950,1,2,0:0:0:0: +497,63,113108,5,8,0:0:0:0: +309,93,113266,1,2,0:0:0:0: +233,260,113424,5,0,1:2:0:0: +152,223,113582,1,2,3:2:0:0: +107,207,113660,1,0,3:2:0:0: +64,192,113739,1,8,0:0:0:0: +447,192,113898,5,2,0:0:0:0: +447,192,113977,1,2,0:0:0:0: +447,192,114056,1,6,1:2:0:0: +391,56,114214,1,2,0:0:0:0: +256,0,114372,1,10,0:0:0:0: +120,56,114530,1,2,0:0:0:0: +64,192,114688,1,2,1:2:0:0: +120,327,114845,1,2,0:0:0:0: +256,383,115003,1,10,0:2:0:0: +391,327,115161,1,2,0:0:0:0: +447,192,115319,5,2,1:2:0:0: +391,328,115477,1,2,0:0:0:0: +256,384,115635,1,10,0:0:0:0: +120,328,115793,1,2,0:0:0:0: +64,192,115951,1,2,1:2:0:0: +120,57,116108,1,2,3:2:0:0: +120,57,116187,1,0,3:2:0:0: +120,57,116266,1,10,0:0:0:0: +256,1,116424,1,2,0:0:0:0: +391,57,116582,6,0,P|396:119|399:195,1,103.999995239258,4|2,1:0|0:0,0:0:0:0: +159,384,116898,1,8,0:0:0:0: +52,350,117056,1,2,0:0:0:0: +123,264,117214,1,0,1:0:0:0: +127,268,117372,2,0,P|183:274|243:295,1,103.999995239258,2|8,0:0|0:0,0:0:0:0: +492,36,117687,2,0,P|442:51|390:56,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +12,48,118003,5,2,0:0:0:0: +95,94,118161,1,8,0:0:0:0: +148,8,118319,1,2,0:0:0:0: +78,347,118477,6,0,P|209:336|405:319,3,312.000001190186,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +484,358,119108,6,0,P|486:269|497:217,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +189,12,119424,1,8,0:0:0:0: +202,103,119582,1,2,0:0:0:0: +221,198,119740,1,0,1:0:0:0: +154,290,119898,2,0,P|82:305|30:321,1,103.999995239258,2|8,0:0|0:0,0:0:0:0: +321,30,120214,2,0,P|371:43|422:53,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +36,149,120529,5,2,0:0:0:0: +89,74,120687,1,8,0:0:0:0: +22,12,120845,1,2,0:0:0:0: +259,319,121003,6,0,P|261:265|276:197,1,103.999995239258,2|0,1:2|3:0,0:0:0:0: +367,346,121240,1,0,3:0:0:0: +367,346,121319,2,0,P|369:292|384:224,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +378,243,121635,6,0,P|446:231|494:226,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +192,49,121950,1,8,0:0:0:0: +271,116,122108,1,2,0:0:0:0: +348,46,122266,1,0,1:0:0:0: +102,0,122424,2,0,P|92:63|91:113,1,103.999995239258,2|8,0:0|0:0,0:0:0:0: +259,319,122740,2,0,P|269:256|270:206,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +455,38,123056,5,2,0:0:0:0: +407,116,123214,1,8,0:0:0:0: +500,149,123372,1,2,0:0:0:0: +14,166,123529,6,0,P|145:155|341:138,3,312.000001190186,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +306,259,124161,5,0,1:0:0:0: +325,140,124319,1,2,0:0:0:0: +206,121,124477,1,8,0:0:0:0: +187,240,124635,1,2,0:0:0:0: +138,172,124793,5,0,1:0:0:0: +274,73,124951,1,2,0:0:0:0: +373,209,125109,1,8,0:0:0:0: +237,308,125267,1,2,0:0:0:0: +355,327,125424,5,0,1:0:0:0: +393,91,125582,1,2,0:0:0:0: +157,53,125740,1,8,0:0:0:0: +119,289,125898,1,2,0:0:0:0: +45,157,126056,5,0,1:0:0:0: +256,192,126214,1,0,3:0:0:0: +256,192,126293,1,0,3:0:0:0: +256,192,126371,1,8,3:2:0:0: +467,223,126529,1,2,0:0:0:0: +107,384,127793,6,0,P|230:190|498:271,1,480.000018310548,14|2,0:0|0:0,0:0:0:0: +452,219,128266,2,0,P|447:158|421:126,1,90.0000034332277,14|0,0:0|0:0,0:0:0:0: +387,37,128582,5,12,0:0:0:0: +234,66,128740,1,2,1:2:0:0: +99,91,128898,1,0,1:2:0:0: +2,109,129056,1,12,0:0:0:0: +256,192,129214,12,0,130477,0:0:0:0: diff --git a/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Osu's Extra].osu b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Osu's Extra].osu new file mode 100644 index 0000000..6d2bd09 --- /dev/null +++ b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Osu's Extra].osu @@ -0,0 +1,636 @@ +osu file format v14 + +[General] +AudioFilename: audio.mp3 +AudioLeadIn: 0 +PreviewTime: 75687 +Countdown: 0 +SampleSet: Soft +StackLeniency: 0.2 +Mode: 0 +LetterboxInBreaks: 0 +WidescreenStoryboard: 1 + +[Editor] +Bookmarks: 64161 +DistanceSpacing: 1 +BeatDivisor: 8 +GridSize: 16 +TimelineZoom: 3.099999 + +[Metadata] +Title:Happy Time wa Owaranai (Cut Ver.) +TitleUnicode:ハッピータイムは終わらない (Cut Ver.) +Artist:Nanamori-chu * Goraku-bu +ArtistUnicode:七森中☆ごらく部 +Creator:-Keitaro +Version:Osu's Extra +Source:ゆるゆり +Tags:japanese anime pop YuruYuri 三上枝織 大坪由佳 津田美波 大久保瑠美 Mikami Shiori Otsubo Yuka Tsuda Minami Okubo Rumi 赤座あかり Akaza Akari 歳納京子 Toshino Kyoko 船見結衣 Funami Yui 吉川ちなつ Yoshikawa Chinatsu ioexception deadcode ceo of osu ceo_of_osu +BeatmapID:2234458 +BeatmapSetID:1057015 + +[Difficulty] +HPDrainRate:5 +CircleSize:3.8 +OverallDifficulty:9 +ApproachRate:8 +SliderMultiplier:1.6 +SliderTickRate:1 + +[Events] +//Background and Video events +0,0,"Akari Yui Kyouko Chinatsu 486.jpg",0,0 +//Break Periods +//Storyboard Layer 0 (Background) +//Storyboard Layer 1 (Fail) +//Storyboard Layer 2 (Pass) +//Storyboard Layer 3 (Foreground) +//Storyboard Layer 4 (Overlay) +//Storyboard Sound Samples + +[TimingPoints] +1635,315.789473684211,4,2,22,32,1,0 +5424,-100,4,2,22,42,0,0 +5582,-100,4,2,22,62,0,0 +7950,-100,4,2,22,52,0,0 +8266,-133.333333333333,4,2,22,52,0,0 +10477,-133.333333333333,4,2,22,62,0,0 +17740,-100,4,2,22,62,0,0 +18056,-133.333333333333,4,2,22,62,0,0 +20582,-76.9230769230769,4,2,22,72,0,0 +40792,-100,4,2,22,62,0,0 +50424,-50,4,2,22,62,0,0 +50898,-83.3333333333333,4,2,22,72,0,0 +61358,-83.3333333333333,4,2,22,5,0,0 +61398,-83.3333333333333,4,2,22,72,0,0 +61990,-83.3333333333333,4,2,22,5,0,0 +62030,-83.3333333333333,4,2,22,72,0,0 +62621,-83.3333333333333,4,2,22,5,0,0 +62661,-83.3333333333333,4,2,22,72,0,0 +63253,-83.3333333333333,4,2,22,5,0,0 +63293,-83.3333333333333,4,2,22,72,0,0 +66411,-83.3333333333333,4,2,22,5,0,0 +66451,-83.3333333333333,4,2,22,72,0,0 +67042,-83.3333333333333,4,2,22,5,0,0 +67082,-83.3333333333333,4,2,22,72,0,0 +76161,-83.3333333333333,4,2,22,82,0,0 +83740,-117.647058823529,4,2,22,82,0,0 +85003,-66.6666666666667,4,2,22,82,0,0 +85674,-66.6666666666667,4,2,22,5,0,0 +85713,-66.6666666666667,4,2,22,82,0,0 +86266,-83.3333333333333,4,2,22,82,0,0 +96371,-50,4,2,22,82,0,0 +101266,-83.3333333333333,4,2,22,82,0,0 +102687,-41.6666666666667,4,2,22,82,0,0 +103713,-133.333333333333,4,2,22,82,0,0 +105213,-71.4285714285714,4,2,22,82,0,0 +105845,-50,4,2,22,82,0,0 +111371,-83.3333333333333,4,2,22,82,0,0 +112792,-50,4,2,22,82,0,0 +116582,-83.3333333333333,4,2,22,72,0,0 +124161,-83.3333333333333,4,2,22,82,0,0 +127792,-66.6666666666667,4,2,22,72,0,0 + + +[Colours] +Combo1 : 95,20,250 +Combo2 : 0,64,128 +Combo3 : 18,124,255 +Combo4 : 255,145,91 + +[HitObjects] +447,337,1635,5,2,0:0:0:0: +447,337,1950,1,2,0:0:0:0: +447,337,2266,1,2,0:0:0:0: +447,337,2424,1,2,0:0:0:0: +447,337,2582,1,2,0:0:0:0: +447,337,2740,1,2,0:0:0:0: +447,337,2898,1,2,0:0:0:0: +447,337,3213,1,2,0:0:0:0: +447,337,3529,1,2,0:0:0:0: +447,337,3845,1,2,0:0:0:0: +447,337,4161,1,2,0:0:0:0: +447,337,4477,1,2,0:0:0:0: +447,337,4792,1,2,0:0:0:0: +447,337,4950,1,2,0:0:0:0: +447,337,5108,1,2,0:0:0:0: +447,337,5266,1,2,0:0:0:0: +447,337,5424,1,6,0:0:0:0: +256,192,5582,12,2,7950,0:0:0:0: +439,168,8266,6,0,P|476:175|519:185,1,60.0000022888184,2|0,0:0|0:0,0:0:0:0: +384,79,8582,2,0,P|391:42|401:-1,1,60.0000022888184,2|0,0:0|0:0,0:0:0:0: +295,134,8898,2,0,P|258:127|215:117,1,60.0000022888184,2|0,0:0|0:0,0:0:0:0: +367,151,9213,1,2,0:0:0:0: +367,151,9529,1,2,0:0:0:0: +367,151,9687,1,2,0:0:0:0: +93,350,10003,6,0,P|86:307|82:273,2,60.0000022888184,2|2|2,0:0|0:0|0:0,0:0:0:0: +0,374,10477,2,0,P|240:363|493:351,1,480.000018310548,4|2,1:0|0:0,0:0:0:0: +443,344,12056,2,0,P|478:347|514:351,1,60.0000022888184,0|2,0:0|0:0,0:0:0:0: +503,350,12529,6,0,P|510:307|514:273,2,60.0000022888184,2|2|0,0:0|0:0|0:0,0:0:0:0: +473,172,13003,2,0,B|352:180|397:285|257:284,1,240.000009155274,4|0,1:0|0:0,0:0:0:0: +271,283,13792,1,0,0:0:0:0: +240,42,13950,5,2,0:0:0:0: +240,42,14108,1,0,0:0:0:0: +182,111,14266,2,0,B|2:80|2:80|167:-4,1,360.000013732911,4|0,1:2|0:0,0:0:0:0: +240,42,15371,1,0,0:0:0:0: +347,88,15529,6,0,P|205:110|148:242,1,300.000011444092,4|0,1:2|0:0,0:0:0:0: +147,241,16477,1,2,0:0:0:0: +147,241,16635,1,0,0:0:0:0: +0,319,16792,6,0,P|59:323|119:328,1,120.000004577637,4|0,1:2|0:0,0:0:0:0: +195,334,17266,2,0,P|255:338|315:343,1,120.000004577637 +391,349,17740,2,0,P|451:353|511:358,1,120.000004577637,2|0,0:0|0:0,0:0:0:0: +511,358,18056,6,0,P|503:290|492:239,1,120.000004577637,4|0,1:2|0:0,0:0:0:0: +444,17,18687,2,0,P|452:85|463:136,1,120.000004577637,4|0,1:2|0:0,0:0:0:0: +307,349,19319,6,0,L|228:341,1,60.0000022888184,4|0,1:2|0:0,0:0:0:0: +224,267,19635,2,0,L|145:259,1,60.0000022888184,4|0,1:2|0:0,0:0:0:0: +23,369,20108,5,2,0:0:0:0: +159,346,20266,2,0,P|125:351|83:357,1,60.0000022888184,2|2,0:0|0:0,0:0:0:0: +3,140,20582,6,0,P|68:124|110:231,1,155.999992858887,4|0,1:0|0:0,0:0:0:0: +120,185,20898,2,0,P|126:125|136:65,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +222,4,21213,1,0,1:0:0:0: +268,77,21371,1,2,0:0:0:0: +412,52,21529,1,8,0:0:0:0: +490,31,21687,2,0,P|497:64|491:101,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +301,286,21845,5,0,1:0:0:0: +282,167,22003,1,2,0:0:0:0: +301,286,22161,1,8,0:0:0:0: +282,167,22319,1,2,0:0:0:0: +61,312,22477,6,0,P|25:323|-3:336,1,51.999997619629,0|0,1:0|0:0,0:0:0:0: +142,361,22635,1,2,0:0:0:0: +370,361,22792,5,8,0:0:0:0: +450,311,22950,2,0,P|476:319|500:328,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +203,292,23108,6,0,P|198:233|195:165,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +78,0,23424,2,0,P|73:58|70:126,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +11,179,23740,1,0,1:0:0:0: +102,191,23898,1,2,0:2:0:0: +391,195,24056,5,8,0:0:0:0: +300,183,24214,1,2,0:0:0:0: +186,233,24371,6,0,P|261:225|223:107,1,207.999990478516,0|8,1:2|0:0,0:0:0:0: +102,191,24845,2,0,P|96:249|134:302,1,103.999995239258,2|0,0:0|1:2,0:0:0:0: +345,351,25161,1,2,0:0:0:0: +345,351,25240,1,2,0:0:0:0: +345,351,25319,1,10,0:0:0:0: +345,351,25477,1,2,0:0:0:0: +345,351,25635,6,0,P|281:365|223:370,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +299,195,25950,2,0,B|399:193|374:294|489:282,1,207.999990478516,8|0,0:0|1:2,0:0:0:0: +153,84,26424,1,2,0:0:0:0: +179,166,26582,2,0,P|252:160|283:68,1,155.999992858887,8|0,0:0|0:0,0:0:0:0: +287,92,26898,6,0,P|297:152|300:203,1,103.999995239258,0|2,1:2|0:0,0:0:0:0: +45,366,27213,2,0,P|35:306|32:255,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +99,16,27529,5,0,1:2:0:0: +87,136,27687,1,2,0:0:0:0: +87,136,27845,1,8,0:0:0:0: +321,372,28003,6,0,L|271:383,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +216,323,28161,5,4,1:2:0:0: +399,353,28319,1,2,0:0:0:0: +399,353,28477,5,8,0:0:0:0: +216,323,28635,1,2,0:0:0:0: +216,323,28792,5,0,1:2:0:0: +399,353,28950,1,2,0:0:0:0: +399,353,29108,5,8,0:0:0:0: +216,323,29266,1,2,0:0:0:0: +356,216,29424,5,0,1:2:0:0: +166,241,29582,1,2,0:0:0:0: +166,241,29740,5,8,0:0:0:0: +448,203,29898,1,2,0:0:0:0: +356,216,30056,5,0,1:2:0:0: +232,165,30213,1,2,3:2:0:0: +232,165,30292,1,0,3:0:0:0: +232,165,30371,1,8,0:0:0:0: +107,132,30529,2,0,L|89:180,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +190,355,30687,6,0,P|160:284|21:289,1,207.999990478516,4|8,1:0|0:0,0:0:0:0: +41,272,31161,1,2,0:0:0:0: +247,252,31319,2,0,P|298:240|350:239,1,103.999995239258,0|2,1:0|0:0,0:0:0:0: +247,252,31635,1,8,0:0:0:0: +70,71,31792,6,0,P|120:83|172:84,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +172,84,32108,1,2,0:0:0:0: +101,206,32266,1,8,0:0:0:0: +70,71,32424,1,2,0:0:0:0: +391,57,32582,5,8,0:0:0:0: +476,180,32740,1,8,0:0:0:0: +428,318,32898,1,8,0:0:0:0: +476,180,33056,1,8,0:0:0:0: +216,352,33213,6,0,P|288:327|328:324,1,103.999995239258,4|2,1:2|0:0,0:0:0:0: +229,87,33529,2,0,P|299:115|339:120,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +327,120,33845,1,0,1:0:0:0: +154,217,34003,2,0,L|286:224,1,103.999995239258,2|8,0:0|0:0,0:0:0:0: +457,235,34319,6,0,L|325:228,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +258,223,34635,1,2,0:0:0:0: +457,235,34792,1,8,0:0:0:0: +473,49,34950,1,2,0:0:0:0: +283,74,35108,6,0,L|389:61,1,103.999995239258,2|0,1:2|3:0,0:0:0:0: +133,95,35345,1,0,3:0:0:0: +156,93,35424,2,0,L|216:85,1,51.999997619629,8|0,0:0|0:0,0:0:0:0: +0,114,35582,2,0,L|83:104,1,51.999997619629,2|0,0:0|0:0,0:0:0:0: +41,320,35740,6,0,P|113:293|94:161,1,207.999990478516,4|8,1:2|0:0,0:0:0:0: +47,8,36213,2,0,P|36:65|54:112,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +50,107,36529,1,2,0:0:0:0: +313,45,36687,1,8,0:0:0:0: +304,140,36845,2,0,P|237:151|178:158,1,103.999995239258,2|0,0:0|1:0,0:0:0:0: +201,155,37161,1,2,0:0:0:0: +397,25,37319,1,8,0:0:0:0: +313,45,37477,1,2,0:0:0:0: +317,214,37635,5,8,0:0:0:0: +507,246,37792,1,8,0:0:0:0: +317,214,37950,1,8,0:0:0:0: +125,180,38108,1,8,0:0:0:0: +166,376,38266,5,0,1:0:0:0: +166,376,38424,1,2,0:0:0:0: +160,293,38582,2,0,P|223:282|272:279,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +6,50,38898,5,0,1:0:0:0: +6,50,39056,1,2,0:0:0:0: +0,133,39214,2,0,P|63:144|112:147,1,103.999995239258,8|2,0:0|0:0,0:0:0:0: +350,361,39529,5,0,1:0:0:0: +364,270,39687,1,2,0:0:0:0: +241,104,39845,5,8,0:0:0:0: +255,195,40003,1,2,0:0:0:0: +232,348,40161,5,0,1:0:0:0: +153,375,40319,1,2,3:2:0:0: +149,350,40398,1,0,3:2:0:0: +153,325,40477,1,8,0:0:0:0: +316,341,40635,1,2,0:0:0:0: +232,348,40792,5,2,0:0:0:0: +232,348,40950,2,0,P|153:357|49:368,1,160,2|2,0:0|0:0,0:0:0:0: +0,294,41424,2,0,P|39:261|48:205,2,80,2|0|2,0:0|0:0|0:0,0:0:0:0: +12,140,41898,1,0,0:0:0:0: +12,140,42056,2,0,P|60:214|162:225,1,160,2|0,0:0|0:0,0:0:0:0: +227,139,42529,2,0,L|215:80,2,40,2|0|0,0:0|0:0|0:0,0:0:0:0: +245,17,42845,2,0,P|203:16|151:42,1,80,2|0,0:0|0:0,0:0:0:0: +241,219,43161,1,2,0:0:0:0: +137,151,43319,5,0,0:0:0:0: +352,134,43477,1,2,0:0:0:0: +352,134,43635,2,0,P|347:71|324:30,1,80,0|2,0:0|0:0,0:0:0:0: +199,251,43950,1,2,0:0:0:0: +289,259,44108,2,0,B|302:176|233:193|272:73,1,160,2|2,0:0|0:0,0:0:0:0: +431,121,44582,1,2,0:0:0:0: +431,121,44740,2,0,L|346:134,1,80 +199,251,45056,2,0,P|206:300|231:345,1,80,2|0,0:0|0:0,0:0:0:0: +376,249,45371,1,2,0:0:0:0: +376,249,45450,1,2,0:0:0:0: +376,249,45529,2,0,P|362:310|334:343,1,80,0|2,0:0|0:0,0:0:0:0: +286,384,45845,5,0,0:0:0:0: +352,323,46003,1,2,0:0:0:0: +422,361,46161,2,0,P|378:332|329:320,1,80 +211,338,46477,2,0,P|132:343|34:354,1,160,2|2,0:0|0:0,0:0:0:0: +112,163,46950,1,0,0:0:0:0: +189,218,47108,6,0,B|119:259|119:259|29:230,1,160,2|2,0:0|0:0,0:0:0:0: +71,77,47582,2,0,P|117:79|158:83,1,80,2|0,0:0|0:0,0:0:0:0: +241,92,47898,2,0,P|287:94|328:98,1,80,2|0,0:0|0:0,0:0:0:0: +411,107,48213,1,2,0:0:0:0: +411,107,48371,6,0,P|457:109|498:113,1,80,2|0,0:0|0:0,0:0:0:0: +490,112,48687,1,0,0:0:0:0: +241,92,48845,1,2,0:0:0:0: +241,92,49003,2,0,P|287:94|328:98,1,80,2|0,0:0|0:0,0:0:0:0: +320,97,49319,1,2,0:0:0:0: +71,77,49635,6,0,P|117:79|158:83,1,80,2|0,0:0|0:0,0:0:0:0: +150,82,49951,1,2,0:0:0:0: +241,92,50108,2,0,P|287:94|328:98,1,80,0|2,0:0|0:0,0:0:0:0: +411,107,50582,6,0,P|457:109|498:113,1,80,8|0,0:0|0:0,0:0:0:0: +304,326,50898,5,4,1:2:0:0: +291,240,51056,1,2,0:0:0:0: +411,107,51213,2,0,P|402:170|386:224,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +214,297,51529,1,0,1:0:0:0: +374,282,51687,2,0,L|470:294,1,95.9999970703126,2|8,0:0|0:0,0:0:0:0: +60,243,52003,1,2,0:0:0:0: +35,323,52161,2,0,P|88:320|125:291,1,95.9999970703126,0|2,1:0|0:0,0:0:0:0: +23,168,52477,2,0,P|93:170|125:196,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +60,243,52792,5,0,1:0:0:0: +191,164,52950,1,2,0:0:0:0: +349,104,53108,5,8,0:0:0:0: +480,25,53266,1,2,0:0:0:0: +379,21,53424,5,4,1:2:0:0: +424,205,53582,2,0,P|433:123|488:14,1,191.999994140625,2|2,0:0|0:0,0:0:0:0: +264,196,54056,2,0,B|370:214|312:293|446:302,1,191.999994140625,0|8,1:2|0:0,0:0:0:0: +417,298,54529,1,2,0:0:0:0: +197,351,54687,1,0,1:2:0:0: +159,275,54845,2,0,P|206:272|254:278,1,95.9999970703126,2|8,0:0|0:0,0:0:0:0: +404,208,55161,2,0,L|472:203,1,47.9999985351563,2|0,0:0|0:0,0:0:0:0: +197,351,55319,5,0,1:2:0:0: +165,187,55477,1,2,0:0:0:0: +165,187,55556,1,2,0:0:0:0: +165,187,55635,1,8,0:0:0:0: +44,289,55793,1,2,0:0:0:0: +129,274,55950,1,4,1:2:0:0: +129,274,56108,6,0,P|192:320|292:257,1,191.999994140625,2|2,0:0|0:0,0:0:0:0: +285,273,56582,2,0,P|278:216|276:161,1,95.9999970703126,0|2,1:2|0:0,0:0:0:0: +29,15,56898,2,0,P|36:72|38:127,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +38,110,57135,1,2,0:0:0:0: +38,110,57213,5,0,1:2:0:0: +165,44,57371,1,2,0:0:0:0: +348,67,57529,1,8,0:0:0:0: +316,198,57687,1,2,0:0:0:0: +256,0,57845,5,0,1:2:0:0: +233,124,58003,1,2,0:0:0:0: +211,250,58161,1,8,0:0:0:0: +188,374,58319,1,2,0:0:0:0: +37,378,58477,6,0,P|-8:323|58:203,1,191.999994140625,0|8,1:2|0:0,0:0:0:0: +115,253,58950,2,0,P|189:251|229:248,1,95.9999970703126,2|0,0:0|1:0,0:0:0:0: +209,155,59266,2,0,B|304:161|269:240|388:252,1,191.999994140625,2|2,0:0|0:0,0:0:0:0: +475,210,59740,5,0,1:2:0:0: +408,153,60056,1,8,0:0:0:0: +490,123,60372,1,0,1:0:0:0: +475,210,60529,5,2,0:2:0:0: +408,153,60687,1,8,0:0:0:0: +490,123,60845,1,2,0:0:0:0: +405,367,61003,6,0,P|397:319|393:271,1,95.9999970703126,4|0,1:2|0:0,0:0:0:0: +290,109,61319,2,0,L|287:148,1,23.9999992675781,8|0,0:0|0:0,0:0:0:0: +405,367,61477,6,0,P|397:319|393:271,1,95.9999970703126,0|2,0:0|1:2,0:0:0:0: +290,109,61792,1,0,0:0:0:0: +290,109,61950,2,0,L|287:148,1,23.9999992675781,8|0,0:0|0:0,0:0:0:0: +405,367,62108,5,2,0:0:0:0: +405,367,62266,2,0,P|397:319|393:271,1,95.9999970703126,2|0,1:2|0:0,0:0:0:0: +189,175,62582,2,0,L|186:136,1,23.9999992675781,8|0,0:0|0:0,0:0:0:0: +405,367,62740,1,2,0:0:0:0: +317,336,62898,5,0,1:0:0:0: +483,298,63056,1,0,0:0:0:0: +189,175,63213,6,0,L|186:136,1,23.9999992675781,10|0,0:0|0:0,0:0:0:0: +149,372,63371,1,0,0:0:0:0: +399,223,63529,6,0,P|340:214|288:199,1,95.9999970703126,2|0,1:2|0:0,0:0:0:0: +412,148,63845,2,0,P|353:139|301:124,1,95.9999970703126,8|0,0:0|0:0,0:0:0:0: +113,223,64161,6,0,P|172:214|224:199,1,95.9999970703126,2|0,1:2|0:0,0:0:0:0: +100,148,64477,2,0,P|159:139|211:124,1,95.9999970703126,8|0,0:0|0:0,0:0:0:0: +404,192,64792,5,2,1:2:0:0: +301,50,64950,1,0,0:0:0:0: +134,103,65108,1,8,0:0:0:0: +134,279,65266,1,2,0:0:0:0: +301,333,65424,1,2,1:2:0:0: +136,364,65582,5,2,3:2:0:0: +174,356,65660,1,0,3:0:0:0: +212,349,65739,1,8,0:0:0:0: +384,315,65898,1,0,1:0:0:0: +6,225,66056,6,0,P|53:212|101:208,1,95.9999970703126,4|0,1:2|0:0,0:0:0:0: +328,222,66371,2,0,L|327:186,1,23.9999992675781,8|0,0:0|0:0,0:0:0:0: +7,225,66529,5,0,0:0:0:0: +7,225,66687,2,0,P|54:213|102:208,1,95.9999970703126,2|0,1:2|0:0,0:0:0:0: +328,222,67003,2,0,L|327:186,1,23.9999992675781,8|0,0:0|0:0,0:0:0:0: +7,225,67161,5,0,0:0:0:0: +7,225,67319,2,0,P|54:213|102:208,1,95.9999970703126,2|0,1:2|0:0,0:0:0:0: +423,240,67635,2,0,P|375:234|328:222,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +222,10,67950,5,0,1:0:0:0: +340,70,68108,1,0,1:0:0:0: +242,167,68266,1,10,0:0:0:0: +124,107,68424,1,0,1:0:0:0: +408,161,68582,6,0,B|316:174|353:252|250:264,1,191.999994140625,2|8,1:2|0:0,0:0:0:0: +254,263,69056,1,0,0:0:0:0: +426,255,69213,1,2,1:2:0:0: +426,255,69371,2,0,P|433:319|439:371,1,95.9999970703126,0|8,0:0|0:0,0:0:0:0: +192,124,69687,2,0,P|197:76|202:28,1,95.9999970703126,0|2,0:0|1:2,0:0:0:0: +202,28,70161,5,8,0:0:0:0: +233,190,70319,1,0,1:2:0:0: +248,278,70477,1,2,1:2:0:0: +259,333,70635,5,0,1:0:0:0: +265,357,70713,1,0,1:0:0:0: +267,369,70792,1,8,0:0:0:0: +269,378,70950,1,0,1:2:0:0: +269,378,71108,5,4,1:2:0:0: +309,142,71424,1,0,3:0:0:0: +74,102,71740,5,4,1:2:0:0: +309,142,72056,1,0,3:0:0:0: +269,378,72371,5,4,1:2:0:0: +309,142,72687,1,0,3:0:0:0: +74,102,73003,5,12,1:2:0:0: +309,142,73161,1,0,3:0:0:0: +269,378,73477,1,0,3:0:0:0: +404,131,73635,6,0,P|352:139|282:142,1,95.9999970703126,4|0,1:0|0:0,0:0:0:0: +182,355,73950,2,0,P|174:303|171:233,1,95.9999970703126,0|0,1:0|0:0,0:0:0:0: +404,131,74266,6,0,P|352:139|282:142,1,95.9999970703126,4|0,1:0|0:0,0:0:0:0: +182,355,74582,2,0,P|174:303|171:233,1,95.9999970703126,0|0,1:0|0:0,0:0:0:0: +404,131,74898,5,4,1:0:0:0: +404,131,75056,2,0,P|352:139|282:142,1,95.9999970703126,2|4,0:0|1:0,0:0:0:0: +182,355,75371,2,0,P|174:303|171:233,1,95.9999970703126,2|4,0:0|1:0,0:0:0:0: +171,259,75687,5,2,0:0:0:0: +289,275,75845,1,2,0:0:0:0: +404,290,76003,1,2,0:0:0:0: +95,337,76161,6,0,P|31:343|-22:352,1,95.9999970703126,4|0,1:0|0:0,0:0:0:0: +174,78,76477,1,8,0:0:0:0: +201,232,76635,1,2,0:0:0:0: +458,155,76792,1,0,1:0:0:0: +273,139,76950,2,0,P|320:145|368:149,1,95.9999970703126,2|8,0:0|0:0,0:0:0:0: +368,149,77266,1,2,0:0:0:0: +41,226,77424,5,0,1:0:0:0: +149,287,77582,1,2,0:0:0:0: +123,139,77740,1,8,0:0:0:0: +95,4,77898,1,2,0:0:0:0: +173,52,78056,5,0,1:0:0:0: +304,28,78213,1,2,0:0:0:0: +208,356,78371,5,8,0:0:0:0: +339,332,78528,1,2,0:0:0:0: +414,384,78687,5,4,1:2:0:0: +377,142,78845,1,2,0:0:0:0: +377,142,79003,2,0,P|386:198|393:258,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +139,363,79319,2,0,P|132:315|125:268,1,95.9999970703126,0|2,1:0|0:0,0:0:0:0: +51,337,79635,1,8,0:0:0:0: +90,188,79792,1,2,0:0:0:0: +19,24,79950,6,0,P|68:84|165:28,1,191.999994140625,0|8,1:0|0:0,0:0:0:0: +160,43,80424,1,2,0:0:0:0: +409,19,80582,2,0,P|335:24|289:37,1,95.9999970703126,0|2,1:0|3:2,0:0:0:0: +313,28,80819,1,0,3:0:0:0: +313,28,80898,1,8,0:0:0:0: +89,187,81056,6,0,P|137:179|185:178,1,95.9999970703126,2|4,0:0|1:2,0:0:0:0: +486,219,81371,1,2,0:0:0:0: +411,145,81529,1,8,0:0:0:0: +349,229,81687,1,2,0:0:0:0: +422,302,81845,1,0,1:0:0:0: +501,131,82003,1,2,0:0:0:0: +511,304,82161,1,8,0:0:0:0: +349,229,82319,1,2,0:0:0:0: +327,353,82477,5,0,1:0:0:0: +233,371,82635,1,2,0:0:0:0: +233,371,82792,1,8,0:0:0:0: +327,353,82950,5,2,0:0:0:0: +421,335,83108,1,0,1:0:0:0: +421,335,83265,1,2,0:0:0:0: +327,353,83424,5,8,0:0:0:0: +233,371,83582,1,2,0:0:0:0: +97,248,83740,6,0,P|54:246|7:253,7,68.0000012969971,4|2|8|2|0|2|8|2,1:2|0:0|0:0|0:0|1:0|0:0|0:0|0:0,0:0:0:0: +12,113,85003,6,0,P|101:146|135:48,1,180.000006866455,0|0,1:2|0:0,0:0:0:0: +181,240,85319,2,0,P|270:273|304:175,1,180.000006866455,8|0,0:0|0:0,0:0:0:0: +395,365,85635,2,0,L|423:357,1,30.0000011444092,0|0,1:0|0:0,0:0:0:0: +402,271,85792,5,2,0:0:0:0: +393,169,85950,1,2,0:0:0:0: +385,75,86108,1,2,0:0:0:0: +501,310,86266,6,0,P|507:244|516:191,1,95.9999970703126,4|2,1:0|0:0,0:0:0:0: +312,214,86582,2,0,P|308:261|301:309,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +501,310,86898,2,0,P|507:244|516:191,1,95.9999970703126,0|2,1:0|0:0,0:0:0:0: +312,214,87214,2,0,P|308:261|301:309,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +501,310,87529,1,0,1:0:0:0: +501,310,87687,2,0,P|507:244|516:191,1,95.9999970703126,2|8,0:0|0:0,0:0:0:0: +360,121,88003,1,2,0:0:0:0: +417,244,88161,5,0,1:0:0:0: +459,113,88319,1,2,0:0:0:0: +53,271,88477,5,8,0:0:0:0: +95,140,88635,1,2,0:0:0:0: +0,126,88792,6,0,P|61:133|106:142,1,95.9999970703126,4|2,1:2|0:0,0:0:0:0: +136,282,89108,2,0,P|197:289|242:298,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +0,208,89424,5,0,1:0:0:0: +40,364,89582,1,2,0:0:0:0: +129,50,89740,5,8,0:0:0:0: +169,206,89898,1,2,0:0:0:0: +329,199,90056,6,0,P|419:164|512:144,1,191.999994140625,0|8,1:0|0:0,0:0:0:0: +512,144,90529,1,2,0:0:0:0: +242,364,90687,2,0,P|186:346|131:339,1,95.9999970703126,0|2,1:0|3:2,0:0:0:0: +149,340,90924,1,0,3:0:0:0: +149,340,91003,1,8,0:0:0:0: +475,322,91161,1,2,0:0:0:0: +391,377,91319,6,0,P|381:321|370:263,1,95.9999970703126,4|2,1:2|0:0,0:0:0:0: +266,57,91635,2,0,P|256:113|245:171,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +248,151,91950,1,0,1:0:0:0: +6,143,92108,5,2,0:0:0:0: +76,107,92266,1,8,0:0:0:0: +145,72,92424,1,2,0:0:0:0: +161,323,92582,6,0,P|220:292|259:280,1,95.9999970703126,0|2,1:0|0:0,0:0:0:0: +248,151,92898,2,0,P|307:182|346:194,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +456,235,93213,5,0,1:0:0:0: +433,151,93371,1,2,0:0:0:0: +56,235,93529,5,8,0:0:0:0: +79,151,93687,1,2,0:0:0:0: +256,192,93845,5,2,1:2:0:0: +256,192,93924,1,2,0:2:0:0: +256,192,94003,1,2,0:2:0:0: +256,192,94082,1,2,0:2:0:0: +256,192,94161,1,10,0:2:0:0: +256,192,94240,1,2,0:2:0:0: +256,192,94319,1,2,0:2:0:0: +256,192,94398,1,2,0:2:0:0: +256,192,94477,5,2,1:2:0:0: +256,192,94556,1,2,0:2:0:0: +256,192,94635,1,2,0:2:0:0: +256,192,94714,1,2,0:2:0:0: +256,192,94793,1,10,0:2:0:0: +256,192,94872,1,2,0:2:0:0: +256,192,94951,1,2,0:2:0:0: +256,192,95030,1,2,0:2:0:0: +256,192,95108,5,0,1:0:0:0: +203,265,95266,1,2,0:0:0:0: +309,265,95424,5,8,0:0:0:0: +256,192,95582,1,2,0:0:0:0: +256,192,95740,5,0,1:0:0:0: +203,119,95898,1,2,3:2:0:0: +203,119,95977,1,0,3:0:0:0: +203,119,96056,1,8,0:0:0:0: +309,119,96213,1,2,0:0:0:0: +265,350,96371,6,0,P|256:185|244:5,5,320,4|8|0|8|0|8,1:2|0:2|1:2|0:2|1:2|0:2,0:0:0:0: +83,229,98266,5,0,1:0:0:0: +160,207,98424,1,0,1:0:0:0: +429,229,98582,5,8,0:0:0:0: +352,207,98740,1,0,1:0:0:0: +102,316,98898,6,0,B|182:294|255:271|255:271|339:300|426:321,5,320,4|8|0|8|0|8,1:2|0:2|1:2|0:2|1:2|0:2,0:0:0:0: +190,97,100792,5,0,1:0:0:0: +190,97,100950,1,0,1:0:0:0: +184,57,101028,1,0,1:0:0:0: +179,17,101107,1,8,0:0:0:0: +225,195,101266,6,0,P|174:188|117:182,1,95.9999970703126,0|4,1:0|0:0,0:0:0:0: +190,97,101582,1,2,0:0:0:0: +159,314,101740,2,0,P|278:272|380:250,2,191.999994140625,8|0|8,0:0|1:2|0:0,0:0:0:0: +446,314,102529,1,2,0:0:0:0: +446,314,102608,1,2,0:0:0:0: +446,314,102687,6,0,P|246:275|40:255,2,383.99998828125,0|8|0,1:2|0:0|1:2,0:0:0:0: +446,88,103635,5,8,0:0:0:0: +377,138,103792,2,0,P|349:134|302:123,1,60.0000022888184,2|0,0:0|1:0,0:0:0:0: +66,88,104108,5,2,0:0:0:0: +135,138,104266,2,0,P|163:132|210:123,5,60.0000022888184,8|2|0|2|8|2,0:0|0:0|1:2|0:0|0:0|0:0,0:0:0:0: +383,231,105213,6,0,P|327:218|274:208,3,111.999996582031,0|2|8|2,1:2|0:0|0:0|0:0,0:0:0:0: +92,348,105845,6,0,P|141:331|264:312,3,160,0|2|8|2,1:2|3:2|0:0|0:0,0:0:0:0: +374,371,106477,6,0,B|415:217|272:232|328:66,5,320,4|8|0|8|0|8,1:2|0:2|1:2|0:2|1:2|0:2,0:0:0:0: +445,222,108371,5,0,1:0:0:0: +512,177,108529,1,0,1:0:0:0: +67,222,108687,5,8,0:0:0:0: +0,177,108845,1,0,1:0:0:0: +13,290,109003,6,0,P|129:257|351:232,5,320,4|8|0|8|0|8,1:2|0:2|1:2|0:2|1:2|0:2,0:0:0:0: +492,362,110898,1,0,1:0:0:0: +492,362,111056,1,0,1:0:0:0: +451,335,111135,1,0,1:0:0:0: +494,312,111214,1,8,0:0:0:0: +326,232,111371,6,0,P|311:301|308:358,1,95.9999970703126,2|4,1:2|1:2,0:0:0:0: +340,144,111687,1,2,0:0:0:0: +451,335,111845,2,0,P|444:226|424:122,2,191.999994140625,8|0|8,0:0|1:2|0:0,0:0:0:0: +178,120,112792,6,0,P|349:103|505:85,2,320,0|8|0,1:2|0:0|1:2,0:0:0:0: +90,130,113582,1,2,0:0:0:0: +261,155,113740,1,8,0:0:0:0: +36,208,113898,1,2,3:2:0:0: +36,208,113977,1,0,3:2:0:0: +36,208,114056,2,0,P|38:148|53:-2,1,160,6|2,1:2|0:0,0:0:0:0: +502,3,114371,5,10,0:0:0:0: +406,73,114529,1,2,0:0:0:0: +315,139,114687,1,2,1:2:0:0: +197,245,114845,5,2,0:0:0:0: +106,311,115003,1,10,0:2:0:0: +10,381,115161,1,2,0:0:0:0: +9,369,115240,1,2,0:2:0:0: +9,357,115319,5,2,1:2:0:0: +105,287,115477,1,2,0:0:0:0: +196,221,115635,1,10,0:0:0:0: +320,163,115793,5,2,0:0:0:0: +411,97,115951,1,2,1:2:0:0: +507,27,116109,1,2,3:2:0:0: +507,27,116187,1,0,3:2:0:0: +507,27,116266,1,10,0:0:0:0: +411,0,116424,1,2,0:0:0:0: +487,208,116582,6,0,P|488:146|498:88,1,95.9999970703126,4|2,1:0|0:0,0:0:0:0: +391,340,116898,1,8,0:0:0:0: +310,334,117056,1,2,0:0:0:0: +227,324,117213,1,0,1:0:0:0: +146,318,117371,1,2,0:0:0:0: +140,151,117529,5,8,0:0:0:0: +221,157,117687,1,2,0:0:0:0: +304,167,117844,1,0,1:0:0:0: +385,173,118002,1,2,0:0:0:0: +38,378,118161,2,0,P|43:330|43:282,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +104,122,118477,5,8,0:0:0:0: +128,258,118635,1,8,0:0:0:0: +384,126,118792,5,8,0:0:0:0: +408,262,118950,1,8,0:0:0:0: +381,356,119108,6,0,B|422:333|422:333|476:345,1,95.9999970703126,4|2,1:2|0:0,0:0:0:0: +245,173,119424,1,8,0:0:0:0: +241,256,119582,1,2,0:0:0:0: +154,252,119740,1,0,1:0:0:0: +158,169,119898,1,2,0:0:0:0: +416,357,120056,5,8,0:0:0:0: +420,274,120214,1,2,0:0:0:0: +333,270,120372,1,0,1:0:0:0: +329,353,120530,1,2,0:0:0:0: +178,51,120687,2,0,B|137:74|137:74|89:63,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +13,47,121003,6,0,L|8:-17,1,47.9999985351563,2|0,1:2|0:0,0:0:0:0: +31,231,121161,1,0,3:0:0:0: +28,207,121239,1,0,3:0:0:0: +26,183,121319,2,0,L|21:119,1,47.9999985351563,8|0,0:0|0:0,0:0:0:0: +46,357,121477,2,0,L|41:293,1,47.9999985351563,2|0,0:0|0:0,0:0:0:0: +136,362,121635,6,0,P|145:291|156:242,1,95.9999970703126,4|2,1:2|0:0,0:0:0:0: +221,120,121950,1,8,0:0:0:0: +238,210,122108,1,2,0:0:0:0: +254,297,122266,1,0,1:0:0:0: +152,176,122424,1,2,0:0:0:0: +420,270,122582,5,8,0:0:0:0: +318,149,122740,1,2,0:0:0:0: +334,236,122898,1,0,1:0:0:0: +351,326,123056,1,2,0:0:0:0: +435,83,123214,2,0,P|430:130|422:178,1,95.9999970703126,8|2,0:0|0:0,0:0:0:0: +480,12,123529,5,8,0:0:0:0: +325,33,123687,1,8,0:0:0:0: +375,271,123845,5,8,0:0:0:0: +220,292,124003,1,8,0:0:0:0: +146,344,124161,5,0,1:0:0:0: +151,180,124319,1,2,0:0:0:0: +151,180,124477,5,8,0:0:0:0: +146,344,124635,1,2,0:0:0:0: +146,344,124792,5,0,1:0:0:0: +151,180,124950,1,2,0:0:0:0: +151,180,125108,5,8,0:0:0:0: +146,344,125266,1,2,0:0:0:0: +255,371,125424,5,0,1:0:0:0: +226,101,125582,1,2,0:0:0:0: +226,101,125740,5,8,0:0:0:0: +255,371,125898,1,2,0:0:0:0: +255,371,126056,5,0,1:0:0:0: +291,162,126213,1,0,3:0:0:0: +291,162,126292,1,0,3:0:0:0: +291,162,126371,1,0,3:0:0:0: +226,101,126529,1,2,0:0:0:0: +226,101,127792,6,0,B|68:74|68:74|129:172,1,240.000009155274,14|2,0:0|0:0,0:0:0:0: +326,252,128266,2,0,B|484:225|484:225|423:323,1,240.000009155274,14|12,0:0|0:0,0:0:0:0: +148,384,128740,1,2,1:2:0:0: +90,376,128819,1,0,3:0:0:0: +31,366,128898,1,12,0:0:0:0: +148,384,129056,1,0,1:2:0:0: +256,192,129213,12,0,130477,0:0:0:0: diff --git a/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Osu's Hard].osu b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Osu's Hard].osu new file mode 100644 index 0000000..bb3dcc9 --- /dev/null +++ b/happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Osu's Hard].osu @@ -0,0 +1,575 @@ +osu file format v14 + +[General] +AudioFilename: audio.mp3 +AudioLeadIn: 0 +PreviewTime:75687 +Countdown: 0 +SampleSet: Soft +StackLeniency: 0.2 +Mode: 0 +LetterboxInBreaks: 0 +WidescreenStoryboard: 1 + +[Editor] +DistanceSpacing: 0.8 +BeatDivisor: 4 +GridSize: 8 +TimelineZoom: 2.3 + +[Metadata] +Title:Happy Time wa Owaranai (Cut Ver.) +TitleUnicode:ハッピータイムは終わらない (Cut Ver.) +Artist:Nanamori-chu * Goraku-bu +ArtistUnicode:七森中☆ごらく部 +Creator:-Keitaro +Version:Osu's Hard +Source:ゆるゆり +Tags:japanese anime pop YuruYuri 三上枝織 大坪由佳 津田美波 大久保瑠美 Mikami Shiori Otsubo Yuka Tsuda Minami Okubo Rumi 赤座あかり Akaza Akari 歳納京子 Toshino Kyoko 船見結衣 Funami Yui 吉川ちなつ Yoshikawa Chinatsu ioexception deadcode ceo of osu ceo_of_osu +BeatmapID:2210723 +BeatmapSetID:1057015 + +[Difficulty] +HPDrainRate:5 +CircleSize:3.8 +OverallDifficulty:7 +ApproachRate:7.5 +SliderMultiplier:1.4 +SliderTickRate:1 + +[Events] +//Background and Video events +0,0,"Akari Yui Kyouko Chinatsu 486.jpg",0,0 +//Break Periods +//Storyboard Layer 0 (Background) +//Storyboard Layer 1 (Fail) +//Storyboard Layer 2 (Pass) +//Storyboard Layer 3 (Foreground) +//Storyboard Layer 4 (Overlay) +//Storyboard Sound Samples + +[TimingPoints] +1635,315.789473684211,4,2,22,32,1,0 +1635,-125,4,2,22,32,0,0 +2898,-100,4,2,22,32,0,0 +5424,-111.111111111111,4,2,22,42,0,0 +7950,-111.111111111111,4,2,22,52,0,0 +10477,-111.111111111111,4,2,22,62,0,0 +20582,-111.111111111111,4,2,22,72,0,0 +32582,-71.4285714285714,4,2,22,72,0,0 +33213,-111.111111111111,4,2,22,72,0,0 +37635,-71.4285714285714,4,2,22,72,0,0 +38266,-111.111111111111,4,2,22,72,0,0 +40792,-111.111111111111,4,2,22,62,0,0 +50898,-111.111111111111,4,2,22,72,0,0 +76161,-103.092783505155,4,2,22,82,0,0 +116582,-111.111111111111,4,2,22,72,0,0 +118477,-71.4285714285714,4,2,22,72,0,0 +119108,-111.111111111111,4,2,22,72,0,0 +123529,-71.4285714285714,4,2,22,72,0,0 +124160,-111.111111111111,4,2,22,82,0,0 +124161,-111.111111111111,4,2,22,82,0,0 +127792,-90.9090909090909,4,2,22,72,0,0 + + +[Colours] +Combo1 : 95,20,250 +Combo2 : 0,64,128 +Combo3 : 18,124,255 +Combo4 : 255,145,91 + +[HitObjects] +80,260,1635,6,0,P|141:252|198:296,1,112.205333333333,2|2,0:0|0:0,0:0:0:0: +278,353,2266,2,0,L|274:288,1,56.2800000000002,2|2,0:0|0:0,0:0:0:0: +359,346,2582,2,0,L|355:281,1,56.2800000000002,2|2,0:0|0:0,0:0:0:0: +393,215,2898,6,0,P|466:226|535:213,1,140.256666666667,2|2,0:0|0:0,0:0:0:0: +315,82,3529,2,0,P|245:68|176:80,1,140.256666666667,2|2,0:0|0:0,0:0:0:0: +66,128,4161,6,0,L|79:274,1,140.256666666667,2|2,0:0|0:0,0:0:0:0: +263,317,4792,6,0,L|192:308,1,70.3500000000002,2|2,0:0|0:0,0:0:0:0: +274,238,5108,2,0,L|202:229,1,70.3500000000002,2|2,0:0|0:0,0:0:0:0: +358,338,5424,6,0,P|392:316|500:314,1,126.230996154785,6|2,0:0|0:0,0:0:0:0: +207,311,6056,2,0,P|173:333|65:335,1,126.230996154785,2|2,0:0|0:0,0:0:0:0: +25,219,6687,6,0,L|16:73,1,126.230996154785,2|2,0:0|0:0,0:0:0:0: +139,0,7319,6,0,L|215:5,1,63.3149980773928,2|2,0:0|0:0,0:0:0:0: +133,78,7635,2,0,L|209:83,1,63.3149980773928,2|2,0:0|0:0,0:0:0:0: +296,15,7950,6,0,P|302:77|309:158,1,126.230996154785,2|2,0:0|0:0,0:0:0:0: +389,196,8582,2,0,P|383:258|376:339,1,126.230996154785,2|2,0:0|0:0,0:0:0:0: +309,384,9213,6,0,B|261:344|261:344|179:362,1,126.230996154785,2|2,0:0|0:0,0:0:0:0: +198,357,9687,1,2,0:0:0:0: +57,301,10003,5,2,0:0:0:0: +57,301,10161,2,0,L|51:218,1,63.3149980773928,2|2,0:0|0:0,0:0:0:0: +16,171,10477,6,0,P|46:148|136:161,1,126.230996154785,4|0,1:0|0:0,0:0:0:0: +176,215,10950,1,0,0:0:0:0: +216,295,11108,1,2,0:0:0:0: +216,295,11266,2,0,L|223:365,1,63.3149980773928,2|0,0:0|0:0,0:0:0:0: +300,268,11582,1,2,0:0:0:0: +300,268,11740,2,0,L|307:338,1,63.3149980773928,2|0,0:0|0:0,0:0:0:0: +380,240,12056,1,0,0:0:0:0: +380,240,12213,2,0,L|387:310,1,63.3149980773928,2|0,0:0|0:0,0:0:0:0: +459,190,12529,1,2,0:0:0:0: +425,108,12687,1,2,0:0:0:0: +463,183,12845,1,0,0:0:0:0: +429,101,13003,6,0,L|496:95,1,63.3149980773928,4|0,1:0|0:0,0:0:0:0: +388,31,13319,2,0,L|325:36,1,63.3149980773928,2|0,0:0|0:0,0:0:0:0: +253,85,13635,1,2,0:0:0:0: +188,123,13792,1,0,0:0:0:0: +116,99,13950,1,0,0:0:0:0: +77,33,14108,1,2,0:0:0:0: +77,33,14266,6,0,L|69:179,1,126.230996154785,4|0,1:2|0:0,0:0:0:0: +20,216,14740,2,0,L|12:362,2,126.031496154785,2|2|2,0:0|0:0|0:0,0:0:0:0: +111,253,15529,6,0,L|241:243,1,126.230996154785,4|0,1:2|0:0,0:0:0:0: +512,288,16319,1,2,0:0:0:0: +484,358,16477,1,0,0:0:0:0: +408,366,16635,1,2,0:0:0:0: +408,366,16792,6,0,L|403:236,1,126.230996154785,4|0,1:2|0:0,0:0:0:0: +324,371,17266,2,0,L|319:241,1,126.230996154785,2|0,0:0|0:0,0:0:0:0: +263,192,17740,2,0,B|226:200|226:200|199:228,1,63.3149980773928,2|0,0:0|0:0,0:0:0:0: +192,292,18056,6,0,L|50:278,1,126.230996154785,4|0,1:2|0:0,0:0:0:0: +66,104,18687,2,0,L|192:92,1,126.230996154785,4|0,1:2|0:0,0:0:0:0: +323,233,19319,6,0,L|248:245,1,63.3149980773928,4|0,1:2|0:0,0:0:0:0: +260,141,19635,2,0,L|323:151,1,63.3149980773928,4|0,1:2|0:0,0:0:0:0: +445,62,20108,5,2,0:0:0:0: +445,62,20266,1,2,0:0:0:0: +445,62,20424,1,2,0:0:0:0: +445,62,20582,6,0,L|459:134,1,63.3149980773928,4|2,1:0|0:0,0:0:0:0: +494,190,20898,2,0,L|480:262,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +457,334,21213,5,0,1:0:0:0: +379,301,21371,1,2,0:0:0:0: +457,334,21529,1,8,0:0:0:0: +379,301,21687,1,2,0:0:0:0: +333,370,21845,2,0,L|265:355,1,63.3149980773928,0|2,1:0|0:0,0:0:0:0: +208,297,22161,2,0,L|140:282,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +89,333,22477,5,0,1:0:0:0: +51,267,22635,2,0,B|37:233|37:233|61:126,1,126.230996154785,2|2,0:0|0:0,0:0:0:0: +40,71,23108,6,0,L|111:65,1,63.3149980773928,4|2,1:2|0:0,0:0:0:0: +157,6,23424,2,0,L|228:12,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +284,66,23740,5,0,1:0:0:0: +284,66,23898,1,2,0:2:0:0: +327,142,24056,1,8,0:0:0:0: +404,120,24213,1,2,0:0:0:0: +478,95,24371,6,0,B|512:128|512:128|496:215,1,126.230996154785,0|8,1:2|0:0,0:0:0:0: +483,280,24845,2,0,L|410:285,1,63.3149980773928,2|0,0:0|1:2,0:0:0:0: +344,288,25161,1,2,0:0:0:0: +336,318,25240,1,2,0:0:0:0: +328,348,25319,2,0,L|255:353,1,63.3149980773928,10|2,0:0|0:0,0:0:0:0: +190,296,25635,6,0,L|183:223,1,63.3149980773928,4|2,1:2|0:0,0:0:0:0: +184,233,25950,2,0,P|240:233|300:169,1,126.230996154785,8|0,0:0|1:2,0:0:0:0: +287,113,26424,1,2,0:0:0:0: +360,130,26582,1,8,0:0:0:0: +433,147,26740,1,2,0:0:0:0: +491,194,26898,6,0,L|498:112,1,63.3149980773928,0|2,1:2|0:0,0:0:0:0: +418,245,27213,2,0,L|425:327,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +334,222,27529,1,0,1:2:0:0: +334,222,27687,2,0,L|341:140,1,63.3149980773928,2|8,0:0|0:0,0:0:0:0: +273,297,28003,5,2,0:0:0:0: +273,297,28161,2,0,L|280:379,1,63.3149980773928,4|2,1:2|0:0,0:0:0:0: +191,304,28477,2,0,L|198:386,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +282,304,28792,6,0,L|289:386,1,63.3149980773928,0|2,1:2|0:0,0:0:0:0: +200,311,29108,2,0,L|207:393,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +113,255,29424,5,0,1:2:0:0: +169,205,29582,1,2,0:0:0:0: +238,235,29740,1,8,0:0:0:0: +294,185,29898,1,2,0:0:0:0: +372,278,30056,6,0,L|363:198,1,63.3149980773928,0|2,1:2|3:2,0:0:0:0: +388,193,30292,1,0,3:0:0:0: +411,172,30371,2,0,L|402:92,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +354,43,30687,6,0,B|389:24|389:24|496:39,1,126.230996154785,4|8,1:0|0:0,0:0:0:0: +491,131,31161,1,2,0:0:0:0: +450,194,31319,1,0,1:0:0:0: +503,247,31477,2,0,L|511:314,1,63.3149980773928,2|8,0:0|0:0,0:0:0:0: +431,346,31792,6,0,L|423:283,1,63.3149980773928,2|0,0:0|1:0,0:0:0:0: +356,247,32108,1,2,0:0:0:0: +282,264,32266,1,8,0:0:0:0: +275,339,32424,1,2,0:0:0:0: +196,356,32582,6,0,B|154:349|154:349|153:353|153:353|95:342,3,97.9999970092774,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +38,290,33213,6,0,B|50:244|50:244|31:145,1,126.230996154785,4|8,1:2|0:0,0:0:0:0: +24,92,33687,1,2,0:0:0:0: +86,50,33845,1,0,1:0:0:0: +148,92,34003,2,0,L|205:132,1,63.3149980773928,2|8,0:0|0:0,0:0:0:0: +275,122,34319,6,0,L|317:75,1,63.3149980773928,2|0,0:0|1:0,0:0:0:0: +370,21,34635,1,2,0:0:0:0: +440,49,34792,1,8,0:0:0:0: +506,86,34950,1,2,0:0:0:0: +472,166,35108,6,0,L|411:207,1,63.3149980773928,2|0,1:2|3:0,0:0:0:0: +414,232,35345,1,0,3:0:0:0: +409,263,35424,2,0,L|348:304,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +307,366,35740,6,0,P|265:337|168:340,1,126.230996154785,4|8,1:2|0:0,0:0:0:0: +114,311,36213,1,2,0:0:0:0: +95,236,36371,1,0,1:0:0:0: +150,185,36529,2,0,L|158:106,1,63.3149980773928,2|8,0:0|0:0,0:0:0:0: +215,73,36845,6,0,L|272:97,1,63.3149980773928,2|0,0:0|1:0,0:0:0:0: +344,75,37161,1,2,0:0:0:0: +399,128,37319,1,8,0:0:0:0: +355,190,37477,1,2,0:0:0:0: +373,273,37635,6,0,B|384:319|384:319|389:321|389:321|403:389,3,97.9999970092774,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +500,285,38266,5,0,1:0:0:0: +398,365,38582,6,0,L|401:292,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +317,360,38898,2,0,L|320:287,1,63.3149980773928,0|2,1:0|0:0,0:0:0:0: +240,234,39213,6,0,L|243:307,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +160,236,39529,2,0,L|163:309,1,63.3149980773928,0|2,1:0|0:0,0:0:0:0: +84,379,39845,6,0,L|87:306,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +2,360,40161,2,0,L|5:287,1,63.3149980773928,0|2,1:0|0:0,0:0:0:0: +20,270,40398,1,0,0:0:0:0: +36,243,40477,2,0,L|39:170,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +6,105,40792,5,2,0:0:0:0: +6,105,40950,2,0,P|47:90|125:133,1,125.999996154785,2|2,0:0|0:0,0:0:0:0: +197,51,41424,6,0,L|272:45,1,63.3149980773928,2|0,0:0|0:0,0:0:0:0: +214,128,41740,2,0,L|289:122,1,63.3149980773928,2|0,0:0|0:0,0:0:0:0: +346,13,42056,2,0,B|344:65|344:65|364:87|364:87|362:150,1,125.999996154785,2|0,0:0|0:0,0:0:0:0: +442,171,42529,2,0,L|451:243,1,63.3149980773928,2|2,0:0|0:0,0:0:0:0: +464,320,42845,1,2,0:0:0:0: +464,320,42924,1,0,0:0:0:0: +464,320,43003,2,0,L|473:392,1,63.3149980773928,0|2,0:0|0:0,0:0:0:0: +374,336,43319,5,0,0:0:0:0: +293,347,43477,1,2,0:0:0:0: +293,347,43635,2,0,L|222:354,1,63.3149980773928,0|2,0:0|0:0,0:0:0:0: +307,266,43950,1,2,0:0:0:0: +307,266,44108,2,0,L|172:279,1,125.999996154785,2|2,0:0|0:0,0:0:0:0: +181,278,44582,6,0,P|207:245|183:159,1,126.230996154785,2|0,0:0|0:0,0:0:0:0: +109,185,45056,2,0,L|100:116,1,63.3149980773928,2|2,0:0|0:0,0:0:0:0: +47,46,45371,1,2,0:0:0:0: +47,46,45450,1,0,0:0:0:0: +47,46,45529,2,0,L|116:37,1,63.3149980773928,0|2,0:0|0:0,0:0:0:0: +190,74,45845,5,0,0:0:0:0: +265,33,46003,1,2,0:0:0:0: +330,91,46161,1,0,0:0:0:0: +405,50,46319,1,0,0:0:0:0: +470,108,46477,2,0,B|491:141|491:141|468:235,1,125.999996154785,2|2,0:0|0:0,0:0:0:0: +395,216,46950,1,0,0:0:0:0: +320,206,47108,1,2,0:0:0:0: +320,206,47424,5,2,0:0:0:0: +395,216,47582,2,0,L|467:223,1,63.3149980773928,2|0,0:0|0:0,0:0:0:0: +483,300,47898,2,0,L|357:287,1,125.999996154785,2|2,0:0|0:0,0:0:0:0: +357,287,48371,6,0,P|316:334|245:333,1,126.230996154785,2|0,0:0|0:0,0:0:0:0: +184,304,48845,1,2,0:0:0:0: +104,279,49003,2,0,L|109:345,1,63.3149980773928,2|0,0:0|0:0,0:0:0:0: +31,349,49319,2,0,L|26:286,1,63.3149980773928,2|0,0:0|0:0,0:0:0:0: +54,215,49635,5,2,0:0:0:0: +82,34,49950,1,2,0:0:0:0: +172,46,50108,1,0,0:0:0:0: +172,46,50266,2,0,L|278:56,1,94.7729971160892,2|0,0:0|0:0,0:0:0:0: +303,60,50582,1,8,0:0:0:0: +446,11,50898,6,0,L|519:3,1,63.3149980773928,4|2,1:2|0:0,0:0:0:0: +447,94,51213,1,8,0:0:0:0: +471,165,51371,1,2,0:0:0:0: +429,228,51529,1,0,1:0:0:0: +429,228,51687,2,0,L|448:294,1,63.3149980773928,2|8,0:0|0:0,0:0:0:0: +395,344,52003,5,2,0:0:0:0: +319,335,52161,2,0,L|254:330,1,63.3149980773928,0|2,1:0|0:0,0:0:0:0: +185,359,52477,1,8,0:0:0:0: +110,346,52635,2,0,L|100:273,1,63.3149980773928,2|0,0:0|1:0,0:0:0:0: +103,354,52950,2,0,L|93:281,1,63.3149980773928,2|8,0:0|0:0,0:0:0:0: +22,246,53266,1,2,0:0:0:0: +35,167,53424,1,4,1:2:0:0: +35,167,53582,6,0,P|60:133|150:123,1,126.230996154785,2|2,0:0|0:0,0:0:0:0: +197,166,54056,2,0,P|258:162|300:117,1,126.230996154785,0|8,1:2|0:0,0:0:0:0: +283,33,54529,1,2,0:0:0:0: +368,0,54687,2,0,L|365:66,1,63.3149980773928,0|2,1:2|0:0,0:0:0:0: +435,116,55003,1,8,0:0:0:0: +506,145,55161,2,0,L|503:211,1,63.3149980773928,2|0,0:0|1:2,0:0:0:0: +512,153,55477,2,0,L|509:219,1,63.3149980773928,2|8,0:0|0:0,0:0:0:0: +478,298,55792,1,2,0:0:0:0: +478,298,55871,1,0,0:0:0:0: +478,298,55950,5,4,1:2:0:0: +419,362,56108,2,0,B|392:344|392:344|279:361,1,126.230996154785,2|2,0:0|0:0,0:0:0:0: +224,345,56582,2,0,P|214:305|235:269,1,63.3149980773928,0|2,1:2|0:0,0:0:0:0: +294,267,56898,2,0,P|301:236|290:207,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +222,175,57213,5,0,1:2:0:0: +148,190,57371,1,2,0:0:0:0: +74,206,57529,1,8,0:0:0:0: +59,132,57687,1,2,0:0:0:0: +43,58,57845,1,0,1:2:0:0: +43,58,58161,5,8,0:0:0:0: +59,132,58319,1,2,0:0:0:0: +256,192,58477,12,0,59740,1:2:0:0: +412,96,60056,5,8,0:0:0:0: +352,234,60371,2,0,L|282:240,1,63.3149980773928,0|2,1:0|0:2,0:0:0:0: +255,307,60687,2,0,L|185:313,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +133,360,61003,5,4,1:2:0:0: +74,311,61161,1,0,0:0:0:0: +205,223,61477,5,0,0:0:0:0: +146,174,61635,1,2,1:2:0:0: +146,174,61792,1,0,0:0:0:0: +286,97,62108,5,2,0:0:0:0: +227,48,62266,1,2,1:2:0:0: +286,97,62424,1,0,0:0:0:0: +312,22,62582,1,8,0:0:0:0: +312,22,62740,2,0,L|376:14,1,63.3149980773928,2|0,0:0|1:0,0:0:0:0: +456,4,63056,1,0,0:0:0:0: +410,80,63213,1,10,0:0:0:0: +431,152,63371,1,0,0:0:0:0: +454,223,63529,6,0,L|450:296,1,63.3149980773928,2|0,1:2|0:0,0:0:0:0: +375,218,63845,2,0,L|371:291,1,63.3149980773928,8|0,0:0|0:0,0:0:0:0: +445,227,64161,6,0,L|441:300,1,63.3149980773928,2|0,1:2|0:0,0:0:0:0: +366,222,64477,2,0,L|362:295,1,63.3149980773928,8|0,0:0|0:0,0:0:0:0: +273,262,64792,5,2,1:2:0:0: +196,279,64950,1,0,0:0:0:0: +217,201,65108,1,8,0:0:0:0: +196,279,65266,1,2,0:0:0:0: +140,222,65424,1,2,0:0:0:0: +197,78,65661,5,0,1:0:0:0: +208,92,65740,2,0,L|283:78,1,63.3149980773928,8|0,0:0|1:0,0:0:0:0: +328,24,66056,5,4,1:2:0:0: +400,42,66213,1,0,0:0:0:0: +345,175,66529,5,0,0:0:0:0: +422,198,66687,1,2,1:2:0:0: +422,198,66845,1,0,0:0:0:0: +352,331,67161,5,0,0:0:0:0: +427,350,67319,1,2,1:2:0:0: +355,339,67477,1,0,0:0:0:0: +429,357,67635,2,0,L|511:345,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +347,255,67950,5,0,1:0:0:0: +270,281,68108,1,0,1:0:0:0: +195,304,68266,1,10,0:0:0:0: +200,229,68424,1,0,1:0:0:0: +199,150,68582,6,0,B|182:103|182:103|200:12,1,126.230996154785,2|8,1:2|0:0,0:0:0:0: +268,2,69056,1,0,0:0:0:0: +337,28,69213,1,2,1:2:0:0: +407,54,69371,2,0,L|406:133,1,63.3149980773928,0|8,0:0|0:0,0:0:0:0: +402,193,69687,1,0,0:0:0:0: +472,219,69845,2,0,L|471:298,1,63.3149980773928,2|0,1:2|0:0,0:0:0:0: +484,357,70161,5,8,0:0:0:0: +408,360,70319,5,0,1:2:0:0: +332,363,70477,5,2,1:2:0:0: +256,366,70635,5,0,1:0:0:0: +180,369,70792,5,8,0:0:0:0: +104,372,70950,5,0,1:2:0:0: +28,375,71108,5,4,1:2:0:0: +99,81,71740,5,4,1:2:0:0: +401,81,72371,5,4,1:2:0:0: +473,375,73003,5,12,1:2:0:0: +412,328,73161,2,0,B|369:313|369:313|275:347,1,126.230996154785,0|0,3:0|3:0,0:0:0:0: +293,340,73635,6,0,L|287:201,1,126.230996154785,4|0,1:0|1:0,0:0:0:0: +287,213,74266,2,0,L|280:73,1,126.230996154785,4|0,1:0|1:0,0:0:0:0: +280,86,74898,6,0,L|275:4,1,62.9999980773926,4|2,1:0|0:0,0:0:0:0: +287,213,75213,2,0,L|282:131,1,62.9999980773926,4|2,1:0|0:0,0:0:0:0: +293,340,75529,2,0,L|288:258,1,62.9999980773926,4|2,1:0|0:0,0:0:0:0: +480,123,76161,6,0,P|458:171|371:171,1,136.04896987849,4|8,1:0|0:0,0:0:0:0: +307,131,76635,1,2,0:0:0:0: +255,203,76792,1,0,1:0:0:0: +255,203,76950,2,0,L|259:280,1,68.2395016059115,2|8,0:0|0:0,0:0:0:0: +164,214,77266,1,2,0:0:0:0: +164,214,77424,2,0,L|169:290,1,68.2395016059115,0|2,1:0|0:0,0:0:0:0: +74,224,77740,1,8,0:0:0:0: +74,224,77898,2,0,L|79:301,1,68.2395016059115,2|0,0:0|1:0,0:0:0:0: +57,124,78213,5,2,0:0:0:0: +128,73,78371,1,8,0:0:0:0: +57,124,78529,1,2,0:0:0:0: +128,73,78687,2,0,L|200:92,1,68.2395016059115,4|2,1:2|0:0,0:0:0:0: +285,91,79003,1,8,0:0:0:0: +334,26,79161,1,2,0:0:0:0: +416,26,79319,1,0,1:0:0:0: +467,89,79477,1,2,0:0:0:0: +450,168,79635,1,8,0:0:0:0: +377,204,79792,1,2,0:0:0:0: +303,169,79950,6,0,L|319:322,1,136.04896987849,0|8,1:0|0:0,0:0:0:0: +259,362,80424,2,0,L|178:356,1,68.2395016059115,2|0,0:0|1:0,0:0:0:0: +110,348,80740,1,2,3:2:0:0: +100,315,80819,1,0,3:0:0:0: +92,282,80898,2,0,L|10:276,1,68.2395016059115,8|2,0:0|0:0,0:0:0:0: +8,196,81213,6,0,P|43:169|55:130,1,68.2395016059115,4|2,1:2|0:0,0:0:0:0: +38,67,81529,2,0,L|193:51,1,136.04896987849,8|0,0:0|1:0,0:0:0:0: +255,47,82003,1,2,0:0:0:0: +255,128,82161,1,8,0:0:0:0: +255,47,82319,5,2,0:0:0:0: +255,128,82477,2,0,L|338:117,1,68.2395016059115,0|2,1:0|0:0,0:0:0:0: +401,107,82792,1,8,0:0:0:0: +322,119,82950,2,0,L|332:203,1,68.2395016059115,2|0,0:0|1:0,0:0:0:0: +340,268,83266,1,2,0:0:0:0: +330,186,83424,1,8,0:0:0:0: +340,268,83582,1,2,0:0:0:0: +348,353,83740,6,0,P|323:315|231:304,1,136.04896987849,4|8,1:2|0:0,0:0:0:0: +152,331,84213,2,0,P|143:289|158:257,1,68.2395016059115,2|0,0:0|1:0,0:0:0:0: +226,218,84529,2,0,P|236:175|220:143,1,68.2395016059115,2|8,0:0|0:0,0:0:0:0: +149,138,84845,2,0,P|140:95|155:63,1,68.2395016059115,2|0,0:0|1:2,0:0:0:0: +226,55,85161,5,2,0:0:0:0: +306,44,85319,5,8,0:0:0:0: +387,35,85477,5,2,0:0:0:0: +467,25,85635,5,0,1:0:0:0: +392,245,86266,5,4,1:0:0:0: +379,167,86424,1,2,0:0:0:0: +392,245,86582,5,8,0:0:0:0: +379,167,86740,1,2,0:0:0:0: +307,260,86898,5,0,1:0:0:0: +294,182,87056,1,2,0:0:0:0: +228,277,87214,5,8,0:0:0:0: +215,200,87372,1,2,0:0:0:0: +143,288,87529,6,0,L|128:193,2,67.9000016059113,0|2|8,1:0|0:0|0:0,0:0:0:0: +107,363,88003,1,2,0:0:0:0: +64,279,88161,1,0,1:0:0:0: +143,288,88319,1,2,0:0:0:0: +218,258,88477,1,8,0:0:0:0: +262,190,88635,1,2,0:0:0:0: +264,109,88792,6,0,L|336:107,1,68.2395016059115,4|2,1:2|0:0,0:0:0:0: +364,255,89108,2,0,L|354:182,1,68.2395016059115,8|2,0:0|0:0,0:0:0:0: +355,188,89424,2,0,L|427:178,1,68.2395016059115,0|2,1:0|0:0,0:0:0:0: +498,173,89740,2,0,P|506:138|494:98,1,67.9000016059113,8|2,0:0|0:0,0:0:0:0: +473,30,90056,6,0,P|418:51|342:5,1,136.04896987849,0|8,1:0|0:0,0:0:0:0: +269,24,90529,2,0,L|265:101,1,68.2395016059115,2|0,0:0|1:0,0:0:0:0: +181,53,90845,1,2,3:2:0:0: +181,53,90924,1,0,3:0:0:0: +181,53,91003,2,0,L|177:131,1,68.2395016059115,8|2,0:0|0:0,0:0:0:0: +144,215,91319,6,0,B|175:226|175:226|226:209,1,67.9000016059113,4|2,1:2|0:0,0:0:0:0: +208,214,91635,2,0,B|262:172|262:172|352:211,1,136.04896987849,8|0,0:0|1:0,0:0:0:0: +456,203,92108,1,2,0:0:0:0: +395,258,92266,1,8,0:0:0:0: +456,203,92424,1,2,0:0:0:0: +476,120,92582,6,0,L|470:48,1,68.2395016059115,0|2,1:0|0:0,0:0:0:0: +392,128,92898,2,0,L|386:57,1,68.2395016059115,8|2,0:0|0:0,0:0:0:0: +297,17,93213,5,0,1:0:0:0: +297,17,93371,2,0,L|291:89,1,68.2395016059115,2|8,0:0|0:0,0:0:0:0: +215,9,93687,1,2,0:0:0:0: +215,9,93845,6,0,L|209:81,1,68.2395016059115,2|2,1:2|0:2,0:0:0:0: +114,170,94161,1,10,0:2:0:0: +196,165,94319,5,2,0:2:0:0: +114,170,94477,6,0,P|102:138|121:91,1,68.2395016059115,2|2,1:2|0:2,0:0:0:0: +190,15,94792,1,10,0:2:0:0: +108,20,94950,5,2,0:2:0:0: +190,15,95108,6,0,P|202:47|183:94,1,68.2395016059115,0|2,1:0|0:0,0:0:0:0: +109,105,95424,6,0,P|102:138|114:170,1,68.2395016059115,8|2,0:0|0:0,0:0:0:0: +162,249,95740,6,0,L|234:240,1,67.9000016059113,0|2,1:0|3:2,0:0:0:0: +240,247,95977,1,0,3:0:0:0: +251,252,96056,1,8,0:0:0:0: +323,204,96213,1,2,0:0:0:0: +399,234,96371,6,0,L|394:311,1,68.2395016059115,4|2,1:2|0:0,0:0:0:0: +476,310,96687,2,0,L|480:242,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +395,237,97003,6,0,L|397:314,1,68.2395016059115,0|2,1:2|0:2,0:0:0:0: +479,306,97319,2,0,L|477:238,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +392,241,97635,6,0,L|401:318,1,68.2395016059115,0|2,1:2|0:2,0:0:0:0: +482,302,97950,2,0,L|474:234,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +474,153,98266,5,0,1:0:0:0: +392,146,98424,1,0,1:0:0:0: +347,77,98582,1,8,0:0:0:0: +265,70,98740,1,0,1:0:0:0: +199,118,98898,6,0,L|116:125,1,68.2395016059115,4|2,1:2|0:0,0:0:0:0: +122,41,99213,2,0,L|189:35,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +195,121,99529,6,0,L|112:120,1,68.2395016059115,0|2,1:2|0:2,0:0:0:0: +125,37,99845,2,0,L|192:38,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +191,124,100161,6,0,L|108:116,1,68.2395016059115,0|2,1:2|0:2,0:0:0:0: +128,34,100477,2,0,L|196:41,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +278,49,100792,5,0,1:0:0:0: +352,17,100950,1,0,1:0:0:0: +367,47,101029,1,0,1:0:0:0: +383,77,101108,1,8,0:0:0:0: +464,87,101266,6,0,L|455:170,1,68.2395016059115,0|4,1:0|0:0,0:0:0:0: +457,236,101582,1,2,0:0:0:0: +382,203,101740,1,8,0:0:0:0: +307,235,101898,1,2,0:0:0:0: +232,268,102056,2,0,L|147:256,1,68.2395016059115,0|2,1:2|0:0,0:0:0:0: +223,348,102371,2,0,L|137:336,1,68.2395016059115,8|2,0:0|0:0,0:0:0:0: +75,269,102687,6,0,L|160:257,1,68.2395016059115,0|2,1:2|0:0,0:0:0:0: +65,190,103003,2,0,L|151:178,1,68.2395016059115,8|2,0:0|0:0,0:0:0:0: +229,187,103319,6,0,L|144:175,1,68.2395016059115,0|2,1:2|0:0,0:0:0:0: +239,107,103635,1,8,0:0:0:0: +239,107,103792,2,0,L|154:95,2,68.2395016059115,2|0|2,0:0|1:0|0:0,0:0:0:0: +107,36,104266,5,8,0:0:0:0: +107,36,104424,1,2,0:0:0:0: +32,71,104582,5,0,1:2:0:0: +32,71,104740,1,2,0:0:0:0: +92,132,104898,5,8,0:0:0:0: +92,132,105056,1,2,0:0:0:0: +18,167,105214,5,0,1:2:0:0: +18,167,105371,1,2,0:0:0:0: +78,228,105529,5,8,0:0:0:0: +78,228,105687,1,2,0:0:0:0: +4,263,105845,5,0,1:2:0:0: +74,313,106003,1,2,3:2:0:0: +98,335,106082,1,0,3:0:0:0: +123,358,106161,1,8,0:0:0:0: +214,355,106319,1,2,0:0:0:0: +293,339,106477,6,0,L|286:264,1,68.2395016059115,4|2,1:2|0:0,0:0:0:0: +367,265,106792,2,0,L|374:332,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +289,335,107108,6,0,L|288:260,1,68.2395016059115,0|2,1:2|0:2,0:0:0:0: +370,268,107424,2,0,L|371:335,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +287,331,107740,6,0,L|292:256,1,68.2395016059115,0|2,1:2|0:2,0:0:0:0: +373,272,108056,2,0,L|367:339,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +464,260,108371,5,0,1:0:0:0: +424,190,108529,1,0,1:0:0:0: +463,117,108687,1,8,0:0:0:0: +423,46,108845,1,0,1:0:0:0: +342,36,109003,6,0,L|255:47,1,68.2395016059115,4|2,1:2|0:0,0:0:0:0: +286,126,109319,2,0,L|352:117,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +337,33,109635,6,0,L|252:52,1,68.2395016059115,0|2,1:2|0:2,0:0:0:0: +289,127,109950,2,0,L|355:113,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +333,31,110266,6,0,L|249:58,1,68.2395016059115,0|2,1:2|0:2,0:0:0:0: +293,129,110582,2,0,L|358:109,1,68.2395016059115,8|2,0:2|0:2,0:0:0:0: +384,188,110898,5,0,1:0:0:0: +345,259,111056,1,0,1:0:0:0: +313,247,111135,1,0,1:0:0:0: +281,234,111213,1,8,0:0:0:0: +205,206,111371,2,0,L|169:282,1,68.2395016059115,2|4,1:2|1:2,0:0:0:0: +110,317,111687,5,2,0:0:0:0: +110,317,111845,2,0,L|40:323,1,68.2395016059115,8|2,0:0|0:0,0:0:0:0: +101,236,112161,2,0,L|31:243,1,68.2395016059115,0|2,1:2|0:0,0:0:0:0: +93,156,112477,2,0,L|23:162,1,68.2395016059115,8|2,0:0|0:0,0:0:0:0: +186,238,112792,6,0,L|256:245,1,68.2395016059115,0|2,1:2|0:0,0:0:0:0: +194,158,113108,2,0,L|264:164,1,68.2395016059115,8|2,0:0|0:0,0:0:0:0: +203,77,113424,1,0,1:2:0:0: +203,77,113582,2,0,L|273:84,1,68.2395016059115,2|8,0:0|0:0,0:0:0:0: +342,43,113898,6,0,L|412:36,1,68.2395016059115,2|6,0:0|1:2,0:0:0:0: +489,23,114213,1,2,0:0:0:0: +460,98,114371,5,10,0:0:0:0: +460,98,114529,1,2,0:0:0:0: +482,176,114687,5,2,1:2:0:0: +482,176,114845,1,2,0:0:0:0: +403,196,115003,5,10,0:2:0:0: +403,196,115161,1,2,0:0:0:0: +425,274,115319,5,2,1:2:0:0: +425,274,115477,1,2,0:0:0:0: +347,297,115635,5,10,0:0:0:0: +347,297,115792,1,2,0:0:0:0: +369,375,115950,5,2,1:2:0:0: +285,358,116108,1,2,3:2:0:0: +251,353,116187,1,0,3:2:0:0: +221,353,116266,2,0,L|141:344,1,68.2395016059115,10|2,0:0|0:0,0:0:0:0: +79,363,116582,6,0,B|48:338|48:338|64:227,1,126.230996154785,4|8,1:0|0:0,0:0:0:0: +58,176,117056,1,2,0:0:0:0: +124,140,117213,1,0,1:0:0:0: +197,104,117371,2,0,L|213:12,1,63.3149980773928,2|8,0:0|0:0,0:0:0:0: +283,42,117687,6,0,L|293:104,1,63.3149980773928,2|0,0:0|1:0,0:0:0:0: +367,141,118003,1,2,0:0:0:0: +433,177,118161,1,8,0:0:0:0: +411,250,118319,1,2,0:0:0:0: +343,307,118477,6,0,B|298:297|298:297|297:302|297:302|227:285,3,97.9999970092774,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +182,336,119108,6,0,P|128:306|114:233,1,126.230996154785,4|8,1:2|0:0,0:0:0:0: +164,178,119582,1,2,0:0:0:0: +237,194,119740,1,0,1:0:0:0: +309,215,119898,2,0,L|339:287,1,63.3149980773928,2|8,0:0|0:0,0:0:0:0: +403,246,120213,6,0,L|380:187,1,63.3149980773928,2|0,0:0|1:0,0:0:0:0: +417,122,120529,1,2,0:0:0:0: +459,60,120687,1,8,0:0:0:0: +385,41,120845,1,2,0:0:0:0: +311,22,121003,6,0,L|298:96,1,63.3149980773928,2|0,1:2|3:0,0:0:0:0: +270,93,121240,1,0,3:0:0:0: +240,103,121319,2,0,L|177:92,1,63.3149980773928,8|2,0:0|0:0,0:0:0:0: +105,69,121635,6,0,B|74:90|74:90|90:205,1,126.230996154785,4|8,1:2|0:0,0:0:0:0: +63,254,122108,1,2,0:0:0:0: +136,235,122266,1,0,1:0:0:0: +199,276,122424,2,0,L|205:346,1,63.3149980773928,2|8,0:0|0:0,0:0:0:0: +278,269,122740,2,0,L|282:331,1,63.3149980773928,2|0,0:0|1:0,0:0:0:0: +346,371,123056,1,2,0:0:0:0: +419,353,123213,1,8,0:0:0:0: +458,288,123371,1,2,0:0:0:0: +437,201,123529,6,0,B|388:196|388:196|388:200|388:200|318:192,3,97.9999970092774,8|8|8|8,0:0|0:0|0:0|0:0,0:0:0:0: +259,178,124161,5,0,1:0:0:0: +259,178,124319,1,2,0:0:0:0: +206,240,124477,5,8,0:0:0:0: +206,240,124635,1,2,0:0:0:0: +142,190,124792,5,0,1:0:0:0: +142,190,124950,1,2,0:0:0:0: +89,252,125108,5,8,0:0:0:0: +89,252,125266,1,2,0:0:0:0: +97,328,125424,5,0,1:0:0:0: +155,376,125582,5,2,0:0:0:0: +230,368,125740,5,8,0:0:0:0: +278,310,125898,5,2,0:0:0:0: +271,235,126056,5,0,1:0:0:0: +213,187,126213,5,0,3:0:0:0: +137,194,126371,5,0,3:0:0:0: +89,252,126529,5,2,0:0:0:0: +89,252,127792,6,0,B|134:221|134:221|332:261,1,231.179673716228,14|14,0:0|0:0,0:0:0:0: +512,214,128582,5,12,0:0:0:0: +431,238,128740,1,2,1:2:0:0: +377,302,128898,1,0,1:2:0:0: +361,384,129056,1,12,0:0:0:0: +256,192,129213,12,0,130477,0:0:0:0: diff --git a/happy-time/audio.mp3 b/happy-time/audio.mp3 new file mode 100644 index 0000000..2e8a14d Binary files /dev/null and b/happy-time/audio.mp3 differ diff --git a/happy-time/normal-hitfinish22.wav b/happy-time/normal-hitfinish22.wav new file mode 100644 index 0000000..6da712c Binary files /dev/null and b/happy-time/normal-hitfinish22.wav differ diff --git a/happy-time/normal-hitnormal22.wav b/happy-time/normal-hitnormal22.wav new file mode 100644 index 0000000..56dc888 Binary files /dev/null and b/happy-time/normal-hitnormal22.wav differ diff --git a/happy-time/soft-hitclap22.wav b/happy-time/soft-hitclap22.wav new file mode 100644 index 0000000..1ad8a94 Binary files /dev/null and b/happy-time/soft-hitclap22.wav differ diff --git a/happy-time/soft-hitwhistle22.wav b/happy-time/soft-hitwhistle22.wav new file mode 100644 index 0000000..9ec7c0d Binary files /dev/null and b/happy-time/soft-hitwhistle22.wav differ diff --git a/happy-time/soft-sliderslide22.wav b/happy-time/soft-sliderslide22.wav new file mode 100644 index 0000000..878bf23 Binary files /dev/null and b/happy-time/soft-sliderslide22.wav differ diff --git a/src/audio.rs b/src/audio.rs new file mode 100644 index 0000000..87ffbb3 --- /dev/null +++ b/src/audio.rs @@ -0,0 +1,79 @@ +use std::ffi::CString; +use std::path::Path; +use std::ptr; + +use anyhow::Result; +use bass::constants::*; + +pub struct AudioEngine { + current_device: AudioDevice, +} + +impl AudioEngine { + pub fn new() -> Result { + let current_device = AudioDevice::init_default()?; + Ok(AudioEngine { current_device }) + } + + pub fn play(&self, sound: &Sound) { + let handle = sound.handle(); + unsafe { bass::BASS_ChannelPlay(handle, 0) }; + } + + pub fn pause(&self, sound: &Sound) { + let handle = sound.handle(); + unsafe { bass::BASS_ChannelPause(handle) }; + } +} + +pub struct AudioDevice { + id: i32, +} + +impl AudioDevice { + pub fn init_default() -> Result { + Self::init(-1) + } + + pub fn init(id: i32) -> Result { + let result = unsafe { bass::BASS_Init(id, 44100, 0, ptr::null(), ptr::null()) }; + if result != 1 { + bail!("initialization failed"); + } + Ok(AudioDevice { id }) + } +} + +impl Drop for AudioDevice { + fn drop(&mut self) { + unsafe { bass::BASS_Free() }; + } +} + +pub struct Sound { + handle: u32, +} + +impl Sound { + pub fn create(path: impl AsRef) -> Result { + let path = path.as_ref(); + let path_str = path.to_str().unwrap(); + let path_cstr = CString::new(path_str.as_bytes()).unwrap(); + let handle = + unsafe { bass::BASS_StreamCreateFile(0, path_cstr.into_raw() as *mut _, 0, 0, 0) }; + + Ok(Sound { handle }) + } + + pub fn handle(&self) -> u32 { + self.handle + } + + pub fn position(&self) -> Result { + let time = unsafe { + let pos_bytes = bass::BASS_ChannelGetPosition(self.handle, BASS_POS_BYTE); + bass::BASS_ChannelBytes2Seconds(self.handle, pos_bytes) + }; + Ok(time) + } +} diff --git a/src/game.rs b/src/game.rs new file mode 100644 index 0000000..46a9254 --- /dev/null +++ b/src/game.rs @@ -0,0 +1,113 @@ +use std::fs::File; +use std::io::Read; +use std::path::Path; + +use anyhow::Result; +use ggez::{ + event::{EventHandler, KeyCode, KeyMods}, + graphics::{self, DrawMode, DrawParam, FillOptions, StrokeOptions, FilterMode, Mesh, Text, WHITE}, + nalgebra::Point2, + Context, GameError, GameResult, +}; +use libosu::{Beatmap, HitObject}; + +use crate::audio::{AudioEngine, Sound}; + +pub struct Game { + is_playing: bool, + audio_engine: AudioEngine, + song: Option, + beatmap: Beatmap, + hit_objects: Vec, +} + +impl Game { + pub fn new() -> Result { + let audio_engine = AudioEngine::new()?; + let beatmap = Beatmap::default(); + let hit_objects = Vec::new(); + Ok(Game { + is_playing: false, + audio_engine, + beatmap, + hit_objects, + song: None, + }) + } + + pub fn load_beatmap(&mut self, path: impl AsRef) -> Result<()> { + let path = path.as_ref(); + + let mut file = File::open(&path)?; + let mut contents = String::new(); + file.read_to_string(&mut contents)?; + self.beatmap = Beatmap::from_osz(&contents)?; + + let dir = path.parent().unwrap(); + self.song = Sound::create(dir.join(&self.beatmap.audio_filename)).map(Some)?; + + Ok(()) + } + + pub fn toggle_playing(&mut self) { + if self.is_playing { + self.is_playing = false; + self.audio_engine.pause(self.song.as_ref().unwrap()); + } else { + self.is_playing = true; + self.audio_engine.play(self.song.as_ref().unwrap()); + } + } + + fn priv_draw(&mut self, ctx: &mut Context) -> Result<()> { + graphics::clear(ctx, [0.0, 0.0, 0.0, 1.0].into()); + + let time = self.song.as_ref().unwrap().position()?; + let text = Text::new(format!("time: {}", time).as_ref()); + graphics::queue_text(ctx, &text, [0.0, 0.0], Some(WHITE)); + graphics::draw_queued_text(ctx, DrawParam::default(), None, FilterMode::Linear)?; + + let mut visible_hitobjects = Vec::new(); + let approach_time = 0.75; + for ho in self.beatmap.hit_objects.iter() { + let ho_time = (ho.start_time.0 as f64) / 1000.0; + if ho_time - approach_time < time && ho_time > time { + visible_hitobjects.push(ho); + } + } + + info!("# hitobjects: {} / {}", visible_hitobjects.len(), self.beatmap.hit_objects.len()); + for ho in visible_hitobjects.iter() { + let ho_time = (ho.start_time.0 as f64) / 1000.0; + let circ = Mesh::new_circle(ctx, DrawMode::Fill(FillOptions::default()), [ho.pos.0 as f32, ho.pos.1 as f32], 10.0, 1.0, WHITE)?; + graphics::draw(ctx, &circ, DrawParam::default())?; + + let time_diff = ho_time - time; + let approach_r = 10.0 * (1.0 + 2.0 * time_diff as f32 / 0.75); + let approach = Mesh::new_circle(ctx, DrawMode::Stroke(StrokeOptions::default()), [ho.pos.0 as f32, ho.pos.1 as f32], approach_r, 1.0, WHITE)?; + graphics::draw(ctx, &approach, DrawParam::default())?; + } + + graphics::present(ctx)?; + Ok(()) + } +} + +impl EventHandler for Game { + fn update(&mut self, _ctx: &mut Context) -> GameResult { + Ok(()) + } + + fn key_up_event(&mut self, _: &mut Context, keycode: KeyCode, _: KeyMods) { + if let KeyCode::Space = keycode { + self.toggle_playing(); + } + } + + fn draw(&mut self, ctx: &mut Context) -> GameResult { + if let Err(err) = self.priv_draw(ctx) { + return Err(GameError::RenderError(err.to_string())); + }; + Ok(()) + } +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..6902e68 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,36 @@ +#[macro_use] +extern crate anyhow; +#[macro_use] +extern crate log; +extern crate bass_sys as bass; + +mod audio; +mod game; + +use anyhow::Result; +use ggez::{ + conf::{WindowMode, WindowSetup}, + event, ContextBuilder, +}; + +use crate::game::Game; + +fn main() -> Result<()> { + stderrlog::new() + .module("editor") + .module("bass_sys") + .verbosity(2) + .init() + .unwrap(); + + let cb = ContextBuilder::new("super_simple", "ggez") + .window_setup(WindowSetup::default().title("OSU editor")) + .window_mode(WindowMode::default().dimensions(1024.0, 768.0)); + + let (ctx, event_loop) = &mut cb.build()?; + let mut game = Game::new()?; + game.load_beatmap("happy-time/Nanamori-chu Goraku-bu - Happy Time wa Owaranai (Cut Ver.) (-Keitaro) [Osu's Expert].osu")?; + event::run(ctx, event_loop, &mut game)?; + + Ok(()) +}