Exemplo n.º 1
0
        private void ReadFromJson(string jsonData)
        {
            var saveService = new PersistencyService();

            saveService.CreateDataFromJsonProject(AudioDefines.XAudio, AudioDefines.WaveFormat, AudioDefines.VoicePool, jsonData);

            MasterPan    = saveService.MasterTrackPan;
            MasterVolume = saveService.MasterTrackVolume;
            MasterBpm    = saveService.MasterTrackBpm;

            Tracks = new ConcurrentBag <Track>(saveService.Tracks);
            TrackViewModels.Clear();

            foreach (var track in Tracks)
            {
                TrackViewModels.Add(new TrackStepViewModel(track));
            }

            if (TrackViewModels.Any())
            {
                CurrentTrackViewModel = TrackViewModels.First();
            }
        }