public Part genPart(CommandSelections selection) { Part part = Part.createInstance(SongInfo.createDefault(), InstrumentInfo.createDefault(), selection.BPM, selection.NumBeats, selection.BeatType); selection.SelectedPart = part; return(part); }
public ChangeSongInfoAtr(CommandSelections selections) { Part = selections.SelectedPart; Name = selections.Name; Artist = selections.Artist; Album = selections.Album; }
public int?genCorrectedPosition(CommandSelections selection) { int init = (int)selection.Position; foreach (Chord chord in Chords) { if (FirstMeasure.Equals(SecondMeasure) && (chord.Position.Index == init || chord.Position.Index + 1 == init)) { return(null); } } int first_position = (from chord in Chords select chord.Position.Index).Min(); if (init > first_position) { foreach (Chord chord in Chords) { if (SecondMeasure.ModelCollection.Contains(chord)) { init -= 1; } } } return(init); }
public void runFactory(StartingFactory fac, Part part) { reader = fac.Reader; info = fac.Info; info.Position.reset(); selected = createSelected(); converter = createMouseStateConverter(); selections = createCommandSelections(); executor = createExecutor(); tree = createTree(); handler = createHandler(); updater = createUpdater(); length_view = createLengthView(); delete_view = createDeleteView(); add_item_view = createAddItemView(); canvas_view = createCanvasView(); property_view = createPropertyView(); fret_view = createFretView(); select_view = createNoteSelectView(); time_sig_view = createBPMTimeSigView(); part_view = createPartMenuView(); visuals_view = createVisualsView(); scroll_view = createScollView(); main_view = createMainView(); initView(part); }
public ChangeMultipleChordPositionAtr(CommandSelections selection) { FirstMeasure = selection.SelectedMeasure.FirstOrDefault(); SecondMeasure = selection.SelectedMeasure.LastOrDefault(); Chords = selection.SelectedChord; Position = genCorrectedPosition(selection); }
public ChangeMeasureTimeSigAtr(CommandSelections selection) { Part = selection.SelectedPart; Measure = selection.SelectedMeasure.FirstOrDefault(); NumBeats = selection.NumBeats; BeatType = selection.BeatType; }
public AddNoteToPartAtr(CommandSelections selection) { Part = selection.SelectedPart; Measure = genMeasure(selection); Chord = genChord(selection); Note = genNote(selection); }
public ChangeMultipleChordPositionNewMeasureAtr(CommandSelections selection) { Part = selection.SelectedPart; FirstMeasure = selection.SelectedMeasure.FirstOrDefault(); SecondMeasure = genSecondMeasure(selection); Chords = selection.SelectedChord; Position = 0; }
public ChangeNotePositionAtr(CommandSelections selection) { Measure = selection.SelectedMeasure.FirstOrDefault(); FirstChord = selection.SelectedChord[0] as NoteChord; SecondChord = selection.SelectedChord[1] as NoteChord; Note = selection.SelectedNote.FirstOrDefault(); NoteString = selection.String; }
public ChangeNotePositionNewChordAtr(CommandSelections selection) { FirstMeasure = selection.SelectedMeasure[0]; SecondMeasure = selection.SelectedMeasure[1]; FirstChord = selection.SelectedChord.FirstOrDefault() as NoteChord; SecondChord = genChord(selection); Note = selection.SelectedNote.FirstOrDefault(); NoteString = selection.String; }
public ChangeNotePositionNewMeasureAtr(CommandSelections selection) { Part = selection.SelectedPart; FirstMeasure = selection.SelectedMeasure.FirstOrDefault(); SecondMeasure = genMeasure(selection); FirstChord = selection.SelectedChord.FirstOrDefault() as NoteChord; SecondChord = genChord(selection); Note = selection.SelectedNote.FirstOrDefault(); NoteString = selection.String; }
public LengthView(CommandSelections sel, Dictionary <string, string> length_image_uri, Dictionary <string, string> tuplet_image_uri) { selections = sel; selections.PropertyChanged += handleLengthChanged; LengthImages = getLengthImages(length_image_uri); TupletImages = genTupletImages(tuplet_image_uri); Length = NoteLength.None; TupletType = TupletType.None; }
public List <Length> genTupletLengths(CommandSelections selections) { var lengths = new List <Length>(); foreach (Chord chord in Chords) { lengths.Add(TupleLength.createInstance(chord.Length.NoteType, Type)); } return(lengths); }
public ChangeChordPositionAtr(CommandSelections selection) { Chord = selection.SelectedChord.FirstOrDefault(); FirstMeasure = selection.SelectedMeasure[0]; SecondMeasure = selection.SelectedMeasure[1]; Position = selection.Position; if (Position < Chord.Position.Index) { Position++; } }
public BPMTimeSigView(CommandSelections s, GuiCommandExecutor e, Selected se, Dictionary <string, string> length_uri, Dictionary <string, string> other_uri, int b, int n, NoteLength bl) { selections = s; executor = e; selected = se; selections.PropertyChanged += handlePropertyChanged; BPM = b; NumBeats = n; BeatType = bl; LengthImages = getLengthImages(length_uri); getOtherImages(other_uri); initCommands(); }
public IEffect genEffect(CommandSelections selection) { IEffect effect = null; switch (selection.SelectedEffectType) { case EffectType.Bend: effect = Bend.createInstance(selection.BendAmount ?? .5, selection.Returns ?? false); break; case EffectType.Pinch_Harmonic: effect = PinchHarmonic.createInstance(); break; case EffectType.Vibrato: effect = Vibrato.createInstance(selection.Wide ?? false); break; } selection.SelectedEffect = effect; return(effect); }
public int?genCorrectedPosition(CommandSelections selection) { int init = (int)selection.Position; foreach (Measure Measure in Measures) { if (Measure.Position.Index == init) { return(null); } } int first_pos = (from Measure measure in Measures select measure.Position.Index).Min(); if (init > first_pos) { init -= (Measures.Count() - 1); } return(init); }
public IMultiEffect genEffect(CommandSelections selection) { Note first = selection.SelectedNote[0]; Note second = selection.SelectedNote[1]; IMultiEffect effect = null; switch (selection.SelectedEffectType) { case EffectType.Slide: effect = Slide.createInstance(first, second, selection.Legato ?? false); break; case EffectType.HOPO: effect = HOPO.createInstance(first, second); break; case EffectType.Tie: effect = Tie.createInstance(first, second); break; } selection.SelectedEffect = effect; return(effect); }
public void populateCommandSelections(CommandSelections selections) { selections.ClearModel(); if (PartNode != null) { selections.SelectedPart = PartNode.getPart(); } foreach (MeasureTreeNode node in MeasureNodes) { selections.SelectedMeasure.Add(node.getMeasure()); } foreach (ChordTreeNode node in ChordNodes) { selections.SelectedChord.Add(node.getChord()); } foreach (NoteTreeNode node in NoteNodes) { selections.SelectedNote.Add(node.getNote()); } if (EffectNode != null) { selections.SelectedEffect = EffectNode.getEffect(); } }
public ChangeInstrumentInfoBld(CommandSelections selections) { attributes = new ChangeInstrumentInfoAtr(selections); }
public ChangeSongInfoBld(CommandSelections selections) { attributes = new ChangeSongInfoAtr(selections); }
public CreateTupletFromNotesBld(CommandSelections selections) { attributes = new CreateTupletFromNotesAtr(selections); }
public ChangeMeasureBpmBld(CommandSelections selection) { attributes = new ChangeMeasureBpmAtr(selection); }
public ChangeMeasureTimeSigBld(CommandSelections selection) { attributes = new ChangeMeasureTimeSigAtr(selection); }
public AddRestChordToPartBld(CommandSelections selection) { attributes = new AddRestChordToPartAtr(selection); }
public RemoveMultipleMeasuresFromPartBld(CommandSelections selection) { attributes = new RemoveMultipleMeasuresFromPartAtr(selection); }
public AddMeasureToPartBld(CommandSelections selection) { attributes = new AddMeasureToPartAtr(selection); }
public GuiCommandExecutor(CommandExecutor ex, CommandSelections s, VisualInfo v_info) { executor = ex; selections = s; info = v_info; }
public static IActionBuilder getBuilderFromType(CommandType type, CommandSelections selections) { switch (type) { case CommandType.AddMeasureToPart: return(new AddMeasureToPartBld(selections)); case CommandType.AddRestToMeasure: return(new AddRestChordToMeasureBld(selections)); case CommandType.AddRestToPart: return(new AddRestChordToPartBld(selections)); case CommandType.AddNoteToChord: return(new AddNoteToChordBld(selections)); case CommandType.AddNoteToMeasure: return(new AddNoteToMeasureBld(selections)); case CommandType.AddNoteToPart: return(new AddNoteToPartBld(selections)); case CommandType.RemoveNoteFromChord: return(new RemoveNoteFromChordBld(selections)); case CommandType.RemoveMultipleNotesFromChord: return(new RemoveMultipleNotesFromChordBld(selections)); case CommandType.RemoveChordFromMeasure: return(new RemoveChordFromMeasureBld(selections)); case CommandType.RemoveMultipleChordsFromMeasure: return(new RemoveMultipleChordsFromMeasureBld(selections)); case CommandType.ChangeChordLength: return(new ChangeChordLengthBld(selections)); case CommandType.ChangeNoteString: return(new ChangeNoteStringBld(selections)); case CommandType.ChangeNoteFret: return(new ChangeNoteFretBld(selections)); case CommandType.ChangeNotePosition: return(new ChangeNotePositionBld(selections)); case CommandType.ChangeNotePositionNewChord: return(new ChangeNotePositionNewChordBld(selections)); case CommandType.ChangeNotePositionNewMeasure: return(new ChangeNotePositionNewMeasureBld(selections)); case CommandType.ChangeChordPosition: return(new ChangeChordPositionBld(selections)); case CommandType.ChangeChordPositionNewMeasure: return(new ChangeChordPositionNewMeasureBld(selections)); case CommandType.ChangeMultipleChordPosition: return(new ChangeMultipleChordPositionBld(selections)); case CommandType.ChangeMultipleChordPositionNewMeasure: return(new ChangeMultipleChordPositionNewMeasureBld(selections)); case CommandType.AddPalmMuteEffect: return(new AddPalmMuteEffectBld(selections)); case CommandType.AddSingleNoteEffect: return(new AddSingleNoteEffectBld(selections)); case CommandType.RemoveNoteEffect: return(new RemoveNoteEffectBld(selections)); case CommandType.AddMultiNoteEffect: return(new AddMultiNoteEffectBld(selections)); case CommandType.RemoveMeasureFromPart: return(new RemoveMeasureFromPartBld(selections)); case CommandType.RemoveMultipleMeasuresFromPart: return(new RemoveMultipleMeasuresFromPartBld(selections)); case CommandType.ChangeMeasurePosition: return(new ChangeMeasurePositionBld(selections)); case CommandType.ChangeMultipleMeasurePosition: return(new ChangeMultipleMeasurePositionBld(selections)); case CommandType.ChangeMeasureBPM: return(new ChangeMeasureBpmBld(selections)); case CommandType.ChangeMeasureTimeSig: return(new ChangeMeasureTimeSigBld(selections)); case CommandType.CreateTupletFromNotes: return(new CreateTupletFromNotesBld(selections)); case CommandType.ChangeSongInfo: return(new ChangeSongInfoBld(selections)); case CommandType.ChangeInstrumentInfo: return(new ChangeInstrumentInfoBld(selections)); default: return(null); } }
public ChangeMultipleMeasurePositionBld(CommandSelections selection) { attributes = new ChangeMultipleMeasurePositionAtr(selection); }