Ejemplo n.º 1
0
    public void CalcSong()
    {
        switch (tracktype)
        {
        case TrackType.pattern:
            chan = parent.chan;
            if (childs == null)
            {
                return;
            }
            CalcPattern();
            break;

        case TrackType.track:

            chan       = new zChannel();
            chan.name  = name;
            chan.instr = new zInstrument(zInstrumentType.FM);

            chan.patterns = CalcPatLen();
            patterns      = chan.patterns;
            foreach (var child in childs)
            {
                child.CalcSong();
            }
            parent.seq.Put(pos, chan);
            break;

        case TrackType.song:
            foreach (var child in childs)
            {
                child.CalcSong();
            }
            parent.seq = seq;
            break;

        case TrackType.trackcontainer:
            seq        = new zSequence(pos, len, div);
            parent.seq = seq;
            foreach (var child in childs)
            {
                child.CalcSong();
            }
            break;

        case TrackType.bbtrack:

            break;

        case TrackType.bbtco:

            break;
        }

        //return null;
    }
Ejemplo n.º 2
0
    public void Put(int pos, zChannel channel)
    {
        int       index = pos / div;
        zTimeTick s     = sequence[index];

        if (s == null)
        {
            s = new zTimeTick();
        }
        if (s.channels == null)
        {
            s.channels = new List <zChannel>();
        }
        if (s.channels.Contains(channel))
        {
            return;
        }
        s.channels.Add(channel);
        sequence[index] = s;
    }