Exemplo n.º 1
0
        public void ReadPatternData(Stream stream, string moduleID, uint numberOfChannels, uint numberOfSamples)
        {
            if (moduleID == "FLT8") // StarTrekker is slightly different
            {
                for (int row = 0; row < 64; row++)
                {
                    ModulePatternRow pRow = new ModulePatternRow();
                    for (int channel = 0; channel < 4; channel++)
                    {
                        pRow.patternChannels.Add(CreateNewPatternChannel(stream, numberOfSamples));
                    }
                    for (int channel = 4; channel < 8; channel++)
                    {
                        pRow.patternChannels.Add(new MOD_PatternChannel());
                    }

                    patternRows.Add(pRow);
                }
                for (int row = 0; row < 64; row++)
                {
                    for (int channel = 4; channel < 8; channel++)
                    {
                        patternRows[row].patternChannels[channel] = CreateNewPatternChannel(stream, numberOfSamples);
                    }
                }
            }
            else
            {
                for (int row = 0; row < 64; row++)
                {
                    ModulePatternRow pRow = new ModulePatternRow();
                    for (int channel = 0; channel < numberOfChannels; channel++)
                    {
                        pRow.patternChannels.Add(CreateNewPatternChannel(stream, numberOfSamples));
                    }

                    patternRows.Add(pRow);
                }
            }
        }
Exemplo n.º 2
0
        public void ReadPatternData(Stream stream, string moduleID, uint numberOfChannels, uint numberOfSamples)
        {
            headerLength = ModuleUtils.ReadDWord(stream);
            packingType  = ModuleUtils.ReadByte(stream);
            numberOfRows = ModuleUtils.ReadWord(stream);
            packedSize   = ModuleUtils.ReadWord(stream);

            long patternEndPosition = stream.Position + packedSize;

            patternRows.Clear();
            for (int row = 0; row < numberOfRows; row++)
            {
                ModulePatternRow pRow = new ModulePatternRow();
                for (int channel = 0; channel < numberOfChannels; channel++)
                {
                    pRow.patternChannels.Add(CreateNewPatternChannel(stream, numberOfSamples));
                }

                patternRows.Add(pRow);
            }

            stream.Seek(patternEndPosition, SeekOrigin.Begin);
        }