/// <summary> /// /// </summary> /// <param name="writer"></param> private void WriteLongListToFile(TextWriter writer) { foreach (IPatch patch in from combiBank in SelectedCombiBanks from combi in combiBank.Patches where combiBank.IsLoaded && combi.UseInList(IgnoreInitCombis, FilterOnText, FilterText, FilterCaseSensitive, ListFilterOnFavorites, false) select combi) { ICombi combi = (ICombi)patch; // Gather info for header. string categoryString = combi.CategoryAsName; //var subCategory = combi.GetParam("SubCategory"); string subCategoryString = combi.SubCategoryAsName; IParameter favorite = combi.PcgRoot.AreFavoritesSupported ? combi.GetParam(ParameterNames.CombiParameterName.Favorite) : null; string favoriteString = (favorite == null) ? "-" : (favorite.Value) ? "Yes" : "No"; IParameter paramTempo = combi.GetParam(ParameterNames.CombiParameterName.Tempo); dynamic tempo = paramTempo == null ? "-" : string.Format("{0,6:0.00}", paramTempo.Value); // Print header. writer.WriteLine("+------------+-----------------------------+----------------------------+--------------------------------+------------+-------+---------------------------------+"); // ReSharper disable RedundantStringFormatCall writer.WriteLine(string.Format(new CultureInfo("en-US"), // ReSharper restore RedundantStringFormatCall "|Combi {0,-6}|Name:{1,-24}|Cat:{2,-24}|Sub Cat:{3,-24}|Tempo:{4,-6}|Fav:{5,-3}| |", combi.Id, combi.Name, categoryString, subCategoryString, tempo, favoriteString)); writer.WriteLine("+------------+-----------------------------+----------------------------+--------------------------------+------------+-------+---------------------------------+"); writer.WriteLine("|Timbres List |"); writer.WriteLine("+---+----------+------------------------+------------------------+------------------------+---+---+----+----+----+---------+-------+----+----+---+-----+---+----+"); writer.WriteLine("|Tim|Program |Name of the program |Category |Sub Category |Vol|Sta|Mute|Prio|MIDI|Key Zone |Veloc. |OSC |OSC |Tra| De- |Por|Bend|"); writer.WriteLine("|bre| | | | |ume|tus| |rity|Ch. | |Zone |Mode|Sel.|nsp|tune |tam|Rng.|"); writer.WriteLine("+---+----------+------------------------+------------------------+------------------------+---+---+----+----+----+---------+-------+----+----+---+-----+---+----+"); // Print timbres.); for (int index = 0; index < combi.Timbres.TimbresCollection.Count; index++) { PrintTimbre(writer, combi, index); } // Print footer. writer.WriteLine("+---+----------+------------------------+------------------------+------------------------+---+---+----+----+----+---------+-------+----+----+---+-----+---+----+\r\n"); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void WindowEditLoaded(object sender, RoutedEventArgs e) { textBoxId.Text = _patch.Id; textBoxName.Text = _patch.Name; if (_patch.Root.AreFavoritesSupported) { threeStateCheckBoxIsFavorite.IsChecked = _patch.GetParam( ParameterNames.CombiParameterName.Favorite).Value; } else { threeStateCheckBoxIsFavorite.Visibility = Visibility.Hidden; } // Set control texts for categories. if (!_patch.PcgRoot.HasCombiCategories) { labelCategory.Visibility = Visibility.Hidden; comboBoxCategory.Visibility = Visibility.Hidden; labelSubCategory.Visibility = Visibility.Hidden; comboBoxSubCategory.Visibility = Visibility.Hidden; return; } if (!_patch.PcgRoot.UsesCategoriesAndSubCategories) { labelCategory.Content = Strings.Genre_control; labelSubCategory.Content = Strings.CategoryControl; } FillCategories(); Check(); }