예제 #1
0
 /// <summary>
 /// Wrapper for an Action Track.
 /// </summary>
 public Track_Wrapper(ACB_Track acbTrack, ACB_Wrapper root, Cue_Wrapper _cueWrapper, ActionTrackType actionType)
 {
     CueWrapper      = _cueWrapper;
     TrackRef        = acbTrack;
     WrapperRoot     = root;
     Type            = TrackType.ActionTrack;
     ActionTrackType = actionType;
 }
예제 #2
0
        //Action
        public void UndoablePasteAction(Cue_Wrapper cue)
        {
            List <IUndoRedo> undos = PasteAction(cue);

            if (undos.Count > 0)
            {
                UndoManager.Instance.AddUndo(new CompositeUndo(undos, "Paste Action"));
            }
        }
예제 #3
0
 /// <summary>
 /// Wrapper for a Track.
 /// </summary>
 public Track_Wrapper(ACB_Waveform waveform, ACB_Wrapper root, Cue_Wrapper _cueWrapper, ACB_Track track = null, ACB_ReferenceItem refItems = null)
 {
     TrackRef        = track;
     CueWrapper      = _cueWrapper;
     WaveformWrapper = new Waveform_Wrapper(waveform, root);
     WrapperRoot     = root;
     Type            = TrackType.Track;
     refItemsRef     = refItems;
 }
예제 #4
0
        public void UndoableDeleteCue(Cue_Wrapper cue)
        {
            List <IUndoRedo> undos = new List <IUndoRedo>();

            undos.Add(new UndoableListRemove <ACB_Cue>(AcbFile.Cues, cue.CueRef, AcbFile.Cues.IndexOf(cue.CueRef)));
            AcbFile.Cues.Remove(cue.CueRef);
            undos.Add(new UndoableListRemove <Cue_Wrapper>(Cues, cue, Cues.IndexOf(cue)));
            Cues.Remove(cue);

            UndoManager.Instance.AddUndo(new CompositeUndo(undos, $"Delete Cue: {cue.CueRef.Name}"));
        }
예제 #5
0
        public List <IUndoRedo> PasteAction(Cue_Wrapper cue)
        {
            List <IUndoRedo> undos = new List <IUndoRedo>();

            if (!CanPasteAction())
            {
                return(undos);
            }

            CopiedAction action = (CopiedAction)Clipboard.GetData(ACB_File.CLIPBOARD_ACB_ACTION);

            if (action != null && cue != null)
            {
                undos.AddRange(AcbFile.AddActionToCue(cue.CueRef, action));
            }

            cue.Refresh();
            undos.Add(new UndoActionDelegate(cue, "Refresh", true));

            return(undos);
        }
예제 #6
0
        public List <IUndoRedo> PasteTrack(Cue_Wrapper cue)
        {
            List <IUndoRedo> undos = new List <IUndoRedo>();

            if (!CanPasteTrack())
            {
                return(undos);
            }

            CopiedTrack track = (CopiedTrack)Clipboard.GetData(ACB_File.CLIPBOARD_ACB_TRACK);

            if (track != null && cue != null)
            {
                undos.AddRange(AcbFile.AddTrackToCue(cue.CueRef, track.TrackBytes, track.Streaming, track.Loop, track.encodeType));
            }

            cue.Refresh();
            undos.Add(new UndoActionDelegate(cue, "Refresh", true));

            return(undos);
        }
예제 #7
0
        public List <IUndoRedo> AddCue(string name, ReferenceType type, byte[] trackBytes, bool streaming, bool loop, bool is3Dsound, EncodeType encodeType, out int cueId)
        {
            List <IUndoRedo> undos = new List <IUndoRedo>();

            ACB_Cue acbCue;

            undos.AddRange(AcbFile.AddCue(name, type, trackBytes, streaming, loop, encodeType, out acbCue));

            if (is3Dsound)
            {
                AcbFile.Add3dDefToCue(acbCue);
            }

            Cue_Wrapper wrapper = new Cue_Wrapper(acbCue, this);

            Cues.Add(wrapper);
            undos.Add(new UndoableListAdd <Cue_Wrapper>(Cues, wrapper, ""));
            undos.Add(GetRefreshDelegate());

            cueId = (int)acbCue.ID;
            return(undos);
        }