Exemplo n.º 1
0
    public void Update_Periphery()
    {
        List <Sound_Instance_Mono> new_Peripheric = new List <Sound_Instance_Mono>();

        for (float x = 1; x <= Data.Repetitions; x++)
        {
            for (float y = 0; y < Data.Length_Steps; y++)
            {
                float key = y * 0.125f + Data.Start_Time + x * (Data.Length + 0.125f);
                Sound_Instance_Mono core      = Sound.Instances[Data.Start_Time + y * 0.125f];
                Sound_Instance_Mono periphery = Sound.Instances[key];

                periphery.Set_Repeated(core);
                new_Peripheric.Add(periphery);
            }
        }

        foreach (Sound_Instance_Mono instance in Sound_Instances_Peripheric)
        {
            if (!new_Peripheric.Exists(a => a == instance))
            {
                instance.Set_Repeated(null);
            }
        }

        Sound_Instances_Peripheric = new_Peripheric;
    }
Exemplo n.º 2
0
    public void Change_Repetitions_Amount(uint repetitions_target)
    {
        List <Sound_Instance_Mono> cores       = Sound_Instances_Core;
        List <Sound_Instance_Mono> peripheries = Sound_Instances_Peripheric;
        uint repetitions_current = Data.Repetitions;

        int loop_steps = Data.Length_Steps;

        if (repetitions_target < repetitions_current)
        {
            for (uint x = repetitions_current; x > repetitions_target; x--)
            {
                for (int y = loop_steps - 1; y >= 0; y--)
                {
                    Sound_Instance_Mono periphery = peripheries[(int)(x - 1) * loop_steps + y];
                    periphery.Set_Repeated(null);
                    peripheries.Remove(periphery);
                }
            }
        }
        else
        {
            for (uint x = repetitions_current + 1; x <= repetitions_target; x++)
            {
                for (int y = 0; y < loop_steps; y++)
                {
                    Sound_Instance_Mono periphery = Sound.Instances[((int)x * loop_steps + y) * Rhythm_Player.Singleton.Step];
                    Sound_Instance_Mono core      = cores[y];

                    if (!periphery.Repeated)
                    {
                        periphery.Set_Repeated(core);
                        peripheries.Add(periphery);
                    }
                    else
                    {
                        Data.Repetitions = x;
                        Message.ShowMessage("Error, superposición entre bucles");
                        return;
                    }
                }
            }
        }

        Data.Repetitions = repetitions_target;
    }