public WavePartElement(UPart part) : base() { partImageTrans = new TranslateTransform(); this.Part = part; partBitmap = BitmapFactory.New( (int)System.Windows.SystemParameters.VirtualScreenWidth, (int)UIConstants.TrackMaxHeight); partImage = new PartImage() { RenderTransform = partImageTrans, IsHitTestVisible = false }; partImage.Arrange(new Rect(0, 0, partBitmap.PixelWidth, partBitmap.PixelHeight)); partImage.Source = partBitmap; this.RemoveVisualChild(partVisual); this.AddVisualChild(partImage); if (((UWavePart)Part).Peaks == null) { worker = new BackgroundWorker() { WorkerReportsProgress = true }; worker.DoWork += BuildPeaksAsync; worker.ProgressChanged += BuildPeaksProgressChanged; worker.RunWorkerCompleted += BuildPeaksCompleted; worker.RunWorkerAsync((UWavePart)Part); } }
public MovePartCommand(UProject project, UPart part, int position, int trackNo) : base(project, part) { newPos = position; newTrackNo = trackNo; oldPos = part.position; oldTrackNo = part.trackNo; }
public WavePartElement(UPart part) : base() { partImageTrans = new TranslateTransform(); this.Part = part; partBitmap = BitmapFactory.New( (int)System.Windows.SystemParameters.VirtualScreenWidth, (int)UIConstants.TrackMaxHeight); partImage = new PartImage() { RenderTransform = partImageTrans, IsHitTestVisible = false }; partImage.Arrange(new Rect(0, 0, partBitmap.PixelWidth, partBitmap.PixelHeight)); partImage.Source = partBitmap; this.RemoveVisualChild(partVisual); this.AddVisualChild(partImage); if (((UWavePart)Part).Peaks == null) { var scheduler = TaskScheduler.FromCurrentSynchronizationContext(); Task.Run(() => { ((UWavePart)Part).BuildPeaks(this); Dispatcher.Invoke(() => { RedrawPart(); }); }).ContinueWith((task) => { if (task.IsFaulted) { Log.Information($"{task.Exception}"); throw task.Exception; } }, CancellationToken.None, TaskContinuationOptions.OnlyOnFaulted, scheduler); } }
public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer) { UPart result = null; if (dictionary.ContainsKey("notes")) { result = new UVoicePart(); var _result = result as UVoicePart; var notes = dictionary["notes"] as ArrayList; foreach (var note in notes) { _result.Notes.Add(serializer.ConvertToType <UNote>(note)); } } else if (dictionary.ContainsKey("path")) { result = Wave.CreatePart(dictionary["path"] as string); } if (result != null) { result.Name = dictionary["name"] as string; result.Comment = dictionary["comment"] as string; result.TrackNo = Convert.ToInt32(dictionary["trackno"]); result.PosTick = Convert.ToInt32(dictionary["pos"]); result.DurTick = Convert.ToInt32(dictionary["dur"]); } return(result); }
public MovePartCommand(UProject project, UPart part, int newPos, int newTrackNo) { this.project = project; this.part = part; this.newPos = newPos; this.newTrackNo = newTrackNo; this.oldPos = part.PosTick; this.oldTrackNo = part.TrackNo; }
public PartResizeEditState(Canvas canvas, MainWindowViewModel vm, UPart part) : base(canvas, vm) { this.part = part; var tracksVm = vm.TracksViewModel; if (!tracksVm.SelectedParts.Contains(part)) { tracksVm.DeselectParts(); } }
private void LoadPart(UPart part, UProject project) { if (!(part is UVoicePart)) { return; } UnloadPart(); Part = part as UVoicePart; OnPartModified(); }
private void BuildVoicePartDone(SequencingSampleProvider source, UPart part, UProject project) { lock (lockObject) { trackSources[part.TrackNo].AddSource( source, TimeSpan.FromMilliseconds(project.TickToMillisecond(part.PosTick))); pendingParts--; } if (pendingParts == 0) { StartPlayback(); } }
public ResizePartCommand(UProject project, UPart part, int duration) : base(project, part) { newDur = duration; oldDur = part.Duration; }
public ResizePartCommand(UProject project, UPart part, int newDur) { this.project = project; this.part = part; this.newDur = newDur; this.oldDur = part.DurTick; }
public RemovePartCommand(UProject project, UPart part) { this.project = project; this.part = part; }
public PartRefreshEvent(UPart part) { this.part = part; }
public ReplacePartCommand(UProject project, UPart part, UPart newPart) : base(project, part) { index = project.parts.IndexOf(part); this.newPart = newPart; }
public LoadPartNotification(UPart part, UProject project) { this.part = part; this.project = project; }
public RenamePartCommand(UProject project, UPart part, string name) : base(project, part) { newName = name; oldName = part.name; }
public FocusNoteNotification(UPart part, UNote note) { this.part = part; this.note = note; }
public PartRedrawEvent(UPart part) { this.part = part; }
public RemovePartCommand(UProject project, UPart part) : base(project, part) { }
public AddPartCommand(UProject project, UPart part) : base(project, part) { }