public LoopCreationViewModel(ISoundPlayer soundPlayer, IInstrumentManager instrumentManager, IOrpheeFileExporter orpheeFileExporter) { this.DisplayedTrack = new OrpheeTrack(0, Channel.Channel1); this._soundPlayer = soundPlayer; this.InstrumentManager = instrumentManager; this._orpheeFileExporter = orpheeFileExporter; this.DisplayedTrack.CurrentInstrument = this.InstrumentManager.CurrentInstrument; this.ToggleButtonNoteCommand = new DelegateCommand<IToggleButtonNote>(ToggleButtonNoteExec); this.AddColumnsCommand = new DelegateCommand(AddColumnsCommandExec); this.RemoveAColumnCommand = new DelegateCommand(RemoveAColumnCommandExec); this.SaveButtonCommand = new DelegateCommand(SaveButtonCommandExec); this.LoadButtonCommand = new DelegateCommand(LoadButtonCommandExec); }
public WhenFileExporterIsCalled() { this.PlayerParameters = new PlayerParameters() { TimeSignatureNominator = 4, TimeSignatureDenominator = 4, TimeSignatureClocksPerBeat = 24, Tempo = 120, TimeSignatureNumberOf32ThNotePerBeat = 4 }; this.OrpheeTrack = new OrpheeTrack(0, Channel.Channel1) { PlayerParameters = this.PlayerParameters, CurrentInstrument = Instrument.OrchestralHarp }; this.OrpheeFile = new OrpheeFile(); this.OrpheeFile.AddNewTrack(this.OrpheeTrack); this.OrpheeFileExporter = new OrpheeFileExporter(new FileHeaderWriter(new SwapManager()), new TrackHeaderWriter(new TimeSignatureMessageWriter(), new TempoMessageWriter(), new SwapManager()), new NoteMessageWriter(new ProgramChangeMessageWriter(), new EndOfTrackMessageWriter())); }
public WhenNoteMessageWriterIsCalled() { this.FileHeaderWriterMock = new Mock<IFileHeaderWriter>(); this.NoteMessageWriterMock = new Mock<INoteMessageWriter>(); this.SwapManagerMock = new Mock<ISwapManager>(); this.TrackHeaderWriterMock = new Mock<ITrackHeaderWriter>(); this.OrpheeFileExporter = new OrpheeFileExporter(this.FileHeaderWriterMock.Object, this.TrackHeaderWriterMock.Object, this.NoteMessageWriterMock.Object); this.EndOfTrackMessageWriterMock = new Mock<IEndOfTrackMessageWriter>(); this.ProgramChangeMessageWriterMock = new Mock<IProgramChangeMessageWriter>(); this.DeltaTimeRetriever = new DeltaTimeRetriever(); this.OrpheeFile = new OrpheeFile(); this.OrpheeTrack = new OrpheeTrack(0, Channel.Channel5) { CurrentInstrument = Instrument.AcousticGuitarSteel, }; this.OrpheeTrack.NoteMap[0][0].IsChecked = true; this.OrpheeTrack.NoteMap[0][0].ColumnIndex = 0; this.OrpheeTrack.NoteMap[0][0].LineIndex = 0; this.OrpheeTrack.NoteMap[0][0].Note = Note.C4; this.OrpheeFile.AddNewTrack(this.OrpheeTrack); this.NoteMessageWriter = new NoteMessageWriter(this.ProgramChangeMessageWriterMock.Object, this.EndOfTrackMessageWriterMock.Object); var result = InitializeFile("NoteMessageTests.test").Result; }