Exemple #1
0
 public void CreateNewMap(int size, LibraySample libraySample)
 {
     this.Map1 = new Map(size, libraySample);
     this.Map1.CreateMapWithSamples();
     this.Map2 = new Map(size, libraySample);
     this.Map2.CreateMapWithSamples();
 }
Exemple #2
0
 public Map(int size, LibraySample currentLibrarySample)
 {
     this.Size = size;
     this.Cells = new Cell[size, size];
     this.LayerCells = new Dictionary<int,List<Cell>>();
     this.CurrentLibrarySample = currentLibrarySample;
     this.DrainPlayedSample();
 }
Exemple #3
0
 public SampleModel(LibraySample libraySample, string name, Color color, int length, int sampleModelId)
 {
     this.LibraySample = libraySample;
     this.Name = name;
     this.Color = color;
     this.Length = length;
     this.SampleModelId = sampleModelId;
 }
Exemple #4
0
        private void CreateSampleModel()
        {
            ListLibraySample = new List<LibraySample>();

            string directory = Path.Combine(Application.StartupPath, "Samples");

            foreach (String subDirectory in Directory.GetDirectories(directory))
            {
                LibraySample libraySample = new LibraySample(Path.GetFileName(subDirectory));
                this.ListLibraySample.Add(libraySample);

                foreach (String file in Directory.GetFiles(Path.Combine(directory, subDirectory)))
                {
                    Color color = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256));
                    SampleModel sampleModel = new SampleModel(libraySample, Path.GetFileNameWithoutExtension(file), color, 1, libraySample.ListSampleModel.Count);
                    sampleModel.SoundSource = _soundEngine.AddSoundSourceFromFile(
                    Application.StartupPath + "\\" + "Samples" + "\\" + libraySample.Name + "\\" + sampleModel.Name + ".wav");

                    libraySample.ListSampleModel.Add(sampleModel);
                }
            }
        }