private SfAudioMarker AddMarkerToFile(SfAudioMarker marker) { int idx = _markers.Add(marker); marker = _markers[idx]; _outputHelper?.ToScriptWindow($"Added Marker idx={idx} ({marker.Start} '{marker.Name}', type={marker.Type})"); return(marker); }
private SplitTrackDefinition CreateTrackInList(int newTrackNumber, SfAudioMarker newRegion) { _splitTrackList.RenumberMarkers(newTrackNumber + 1); var newTrack = _splitTrackList.AddNew(newRegion, newTrackNumber, _options); _splitTrackList.RenumberMarkers(); return(newTrack); }
public static void SetMarkerEnd(SfAudioMarker marker, long ccEndIn) { if (marker == null || ccEndIn < marker.Start) { return; } marker.Length = ccEndIn - marker.Start; }
public SfAudioMarker CreateFadeOutEnd(int track, long startPosition) { string name = _markerNameBuilder.GetFadeOutEndMarkerName(track); SfAudioMarker marker = new SfAudioMarker(startPosition) { Name = name }; return(AddMarkerToFile(marker)); }
public SfAudioMarker CreateRegion(int track, long startPosition, long length) { string name = _markerNameBuilder.GetRegionMarkerName(track); SfAudioMarker marker = new SfAudioMarker(startPosition, length) { Name = name }; return(AddMarkerToFile(marker)); }
public bool IsTrackFadeOutEndMarker(SfAudioMarker marker, int track) { if (!IsTrackFadeOutEndMarker(marker)) { return(false); } Match m = FadeOutEndNameRegex.Match(marker.Name); return(int.Parse(m.Groups[1].Value).Equals(track)); }
public SplitTrackList InitTracks(VinylRipOptions options) { List <SfAudioMarker> trackRegions = GetTrackRegions(); SetListBounds(trackRegions.Count); for (int trackNumber = trackRegions.Count; trackNumber > 0; trackNumber--) { SfAudioMarker trackRegion = trackRegions[trackNumber - 1]; AddNew(trackRegion, trackNumber, options); } return(this); }
public SplitTrackDefinition AddNew(SfAudioMarker trackRegionMarker, int trackNumber, VinylRipOptions options) { SplitTrackDefinition track = new SplitTrackDefinition(this, _file, options, _markerFactory, _regionFactory, _output); this[trackNumber - 1] = track; track.Number = trackNumber; track.TrackRegion = trackRegionMarker; track.FadeInEndMarker = GetTrackFadeInEndMarker(track.Number, options.DefaultTrackFadeInLengthInSamples); var fadeOutLengthInSamples = _file.SecondsToPosition(options.DefaultTrackFadeOutLengthInSeconds); track.FadeOutEndMarker = GetTrackFadeOutEndMarker(track.Number, fadeOutLengthInSamples); return(track); }
public SplitTrackDefinition( SplitTrackList splitTrackList, ISfFileHost file, VinylRipOptions options, ICreateFadeMarkers markerFactory, ICreateTrackRegions regionFactory, IOutputHelper output) { _options = options; _splitTrackList = splitTrackList; _originalFile = file; _markerFactory = markerFactory; _regionFactory = regionFactory; _output = output; _trackRegionMarker = new SfAudioMarker(); _trackRegionMarker.Type = MarkerType.Region; }
public void Remove(SfAudioMarker marker) { var idx = File.Markers.IndexOf(marker); File.Markers.RemoveAt(idx); }
public int Add(SfAudioMarker marker) => File.Markers.Add(marker);
public static long GetMarkerEnd(SfAudioMarker marker) { return(marker.Start + marker.Length); }
public bool IsTrackFadeOutEndMarker(SfAudioMarker marker) { return(!marker.HasLength && FadeOutEndNameRegex.IsMatch(marker.Name)); }
public bool IsTrackRegion(SfAudioMarker marker) { return(marker.HasLength && RegionNameRegex.IsMatch(marker.Name)); }