1414//along with Foobar. If not, see
1515//<http: //www.gnu.org/licenses />.
1616using AudioCuesheetEditor . Model . Entity ;
17- using AudioCuesheetEditor . Model . IO ;
1817using AudioCuesheetEditor . Model . IO . Audio ;
1918using AudioCuesheetEditor . Model . IO . Export ;
2019using AudioCuesheetEditor . Model . Options ;
@@ -39,11 +38,8 @@ public class CuesheetSectionAddRemoveEventArgs(CuesheetSection section) : EventA
3938 public CuesheetSection Section { get ; } = section ;
4039 }
4140
42- public class Cuesheet ( TraceChangeManager ? traceChangeManager = null ) : Validateable < Cuesheet > , ICuesheetEntity , ITraceable
41+ public class Cuesheet ( TraceChangeManager ? traceChangeManager = null ) : Validateable < Cuesheet > , ITraceable , ICuesheet
4342 {
44- public const String MimeType = "text/*" ;
45- public const String FileExtension = ".cue" ;
46-
4743 private readonly object syncLock = new ( ) ;
4844
4945 private List < Track > tracks = [ ] ;
@@ -62,7 +58,6 @@ public class Cuesheet(TraceChangeManager? traceChangeManager = null) : Validatea
6258 public event EventHandler < TrackAddRemoveEventArgs > ? TrackRemoved ;
6359 public event EventHandler < CuesheetSectionAddRemoveEventArgs > ? SectionAdded ;
6460 public event EventHandler < CuesheetSectionAddRemoveEventArgs > ? SectionRemoved ;
65- public event EventHandler ? CuesheetImported ;
6661
6762 [ JsonInclude ]
6863 public IReadOnlyCollection < Track > Tracks
@@ -176,7 +171,7 @@ public TimeSpan? RecordingTime
176171 }
177172
178173 [ JsonIgnore ]
179- public Boolean IsImporting { get ; private set ; }
174+ public Boolean IsImporting { get ; set ; }
180175
181176 [ JsonInclude ]
182177 public IReadOnlyCollection < CuesheetSection > Sections
@@ -393,27 +388,6 @@ public void MoveTrack(Track track, MoveDirection moveDirection)
393388 }
394389 }
395390
396- public void Import ( Cuesheet cuesheet , ApplicationOptions applicationOptions , TraceChangeManager ? traceChangeManager = null )
397- {
398- //Since we use a stack for several changes we need to lock execution for everything else
399- lock ( syncLock )
400- {
401- IsImporting = true ;
402- //We are doing a bulk edit, so inform the TraceChangeManager
403- if ( traceChangeManager != null )
404- {
405- traceChangeManager . BulkEdit = true ;
406- }
407- CopyValues ( cuesheet , applicationOptions ) ;
408- if ( traceChangeManager != null )
409- {
410- traceChangeManager . BulkEdit = false ;
411- }
412- IsImporting = false ;
413- }
414- CuesheetImported ? . Invoke ( this , EventArgs . Empty ) ;
415- }
416-
417391 public void StartRecording ( )
418392 {
419393 recordingStart = DateTime . UtcNow ;
@@ -554,32 +528,6 @@ private void ReCalculateTrackProperties(Track trackToCalculate)
554528 }
555529 }
556530
557- /// <summary>
558- /// Copy values from import cuesheet to this cuesheet
559- /// </summary>
560- /// <param name="cuesheet">Reference to import cuesheet</param>
561- /// <param name="applicationOptions">Reference to application options</param>
562- private void CopyValues ( Cuesheet cuesheet , ApplicationOptions applicationOptions )
563- {
564- Artist = cuesheet . Artist ;
565- Title = cuesheet . Title ;
566- Audiofile = cuesheet . Audiofile ;
567- CDTextfile = cuesheet . CDTextfile ;
568- Cataloguenumber = cuesheet . Cataloguenumber ;
569- foreach ( var importTrack in cuesheet . Tracks )
570- {
571- //We don't want to copy the cuesheet reference since we are doing a copy and want to assign the track to this object
572- var track = new Track ( importTrack , false ) ;
573- AddTrack ( track , applicationOptions ) ;
574- }
575- // Copy sections
576- foreach ( var splitPoint in cuesheet . Sections )
577- {
578- var newSplitPoint = AddSection ( ) ;
579- newSplitPoint . CopyValues ( splitPoint ) ;
580- }
581- }
582-
583531 private void Track_RankPropertyValueChanged ( object ? sender , string e )
584532 {
585533 if ( sender is Track trackRaisedEvent )
0 commit comments