Exemplo n.º 1
0
        public SF2(string engine = "", string bank = "", string rom = "", ushort rom_revision_major = 0, ushort rom_revision_minor = 0, string date = "", string designer = "", string products = "", string copyright = "", string comment = "", string tools = "")
        {
            SFVersionTag rom_revision = rom_revision_major == 0 && rom_revision_minor == 0 ? null : new SFVersionTag(rom_revision_major, rom_revision_minor);

            infoChunk  = new InfoListChunk(this, engine, bank, rom, rom_revision, date, designer, products, copyright, comment, tools);
            soundChunk = new SdtaListChunk(this);
            hydraChunk = new PdtaListChunk(this);
        }
Exemplo n.º 2
0
        internal InfoListChunk(SF2 inSf2, string engine, string bank, string rom, SFVersionTag rom_revision, string date, string designer, string products, string copyright, string comment, string tools)
            : base(inSf2, "INFO")
        {
            sub_chunks = new List <SF2Chunk>() // Mandatory sub-chunks
            {
                new VersionSubChunk(inSf2, "ifil", new SFVersionTag(2, 1)),
                new HeaderSubChunk(inSf2, "isng", string.IsNullOrEmpty(engine) ? "EMU8000" : engine),
                new HeaderSubChunk(inSf2, "INAM", string.IsNullOrEmpty(bank) ? "General MIDI" : bank),
            };

            // Optional sub-chunks
            if (!string.IsNullOrEmpty(rom))
            {
                sub_chunks.Add(new HeaderSubChunk(inSf2, "irom", rom));
            }
            if (rom_revision != null)
            {
                sub_chunks.Add(new VersionSubChunk(inSf2, "iver", rom_revision));
            }
            if (!string.IsNullOrEmpty(date))
            {
                sub_chunks.Add(new HeaderSubChunk(inSf2, "ICRD", date));
            }
            if (!string.IsNullOrEmpty(designer))
            {
                sub_chunks.Add(new HeaderSubChunk(inSf2, "IENG", designer));
            }
            if (!string.IsNullOrEmpty(products))
            {
                sub_chunks.Add(new HeaderSubChunk(inSf2, "IPRD", products));
            }
            if (!string.IsNullOrEmpty(copyright))
            {
                sub_chunks.Add(new HeaderSubChunk(inSf2, "ICOP", copyright));
            }
            if (!string.IsNullOrEmpty(comment))
            {
                sub_chunks.Add(new HeaderSubChunk(inSf2, "ICMT", comment, 0x10000));
            }
            if (!string.IsNullOrEmpty(tools))
            {
                sub_chunks.Add(new HeaderSubChunk(inSf2, "ISFT", tools));
            }

            foreach (var sub in sub_chunks)
            {
                Size += sub.Size + 8;
            }
        }
Exemplo n.º 3
0
 internal VersionSubChunk(SF2 inSf2, string subchunk_type, SFVersionTag version) : base(inSf2, subchunk_type)
 {
     revision = version;
     Size    += SFVersionTag.Size;
 }