public void DragOver(IDropInfo dropInfo)
        {
            dropInfo.DropTargetAdorner = DropTargetAdorners.Insert;
            var dataObject = dropInfo.Data as IDataObject;

            if (dataObject != null && dataObject.GetDataPresent(DataFormats.FileDrop))
            {
                dropInfo.Effects = DragDropEffects.Copy;
            }

            if (dropInfo.Data.GetType() == typeof(FileNameItem))
            {
                dropInfo.DropTargetAdorner = DropTargetAdorners.Insert;
                dropInfo.Effects           = DragDropEffects.Copy;
            }

            if (Mementor.IsInBatch)
            {
                Mementor.EndBatch();
            }

            /*if ((dropInfo.Data is PupilViewModel || dropInfo.Data is IEnumerable<PupilViewModel>) && dropInfo.TargetItem is SchoolViewModel)
             * {
             *  dropInfo.DropTargetAdorner = DropTargetAdorners.Highlight;
             *  dropInfo.Effects = DragDropEffects.Move;
             * }*/
        }
Exemple #2
0
 private void MouseDown()
 {
     if (Mementor != null)
     {
         Mementor.PropertyChange(this, "Amount");
     }
 }
        public Composition(ObservableCollection <OSCMessenger> oscmessengers)
        {
            Name           = string.Empty;
            Messengers     = oscmessengers;
            MessageAddress = "/Layer";

            LayerNames = new List <string>();
            LayerIndex = new List <int>();
            Layers     = new ObservableCollection <Layer>();
            Layers.CollectionChanged += ContentCollectionChanged;

            MasterBeat = new MasterBeat(Messengers, Mementor);
            Camera     = new Camera(Messengers, MasterBeat, Mementor);
            Mementor   = new Mementor();

            ReloadCompositionCommand = new RelayCommand(p => ReloadComposition(p));
            AddLayerCommand          = new RelayCommand(p => AddLayer());
            RemoveLayerCommand       = new RelayCommand(p => RemoveLayer());
            DeleteLayerCommand       = new RelayCommand(p => DeleteLayer(p));
            DuplicateLayerCommand    = new RelayCommand(p => DuplicateLayer(p));
            CopyLayerCommand         = new RelayCommand(p => CopyLayer());
            PasteLayerCommand        = new RelayCommand(p => PasteLayer());
            SaveCompositionCommand   = new RelayCommand(p => Save());
            OpenCompositionCommand   = new RelayCommand(p => Open());
        }
Exemple #4
0
 public Beat(ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor)
     : base(oscmessengers, mementor)
 {
     ResetCommand    = new RelayCommand(p => Reset());
     MultiplyCommand = new RelayCommand(p => Multiply());
     DivideCommand   = new RelayCommand(p => Divide());
 }
        private void DeleteItem(object filenameitem)
        {
            FileNameItem fni = filenameitem as FileNameItem;

            Mementor.ElementRemove(FilePaths, fni);
            FilePaths.Remove(fni);
        }
 public OSCControl
 (
     ObservableCollection <OSCMessenger> messengers,
     Mementor mementor
 )
     : base(messengers, mementor)
 {
     Messengers = messengers ?? throw new ArgumentNullException(nameof(messengers));
 }
Exemple #7
0
 public MasterBeat(ObservableCollection <OSCMessenger> messengers, Mementor mementor)
     : this
     (
         mementor : mementor,
         messengers : messengers,
         period : 0.0,
         multiplier : 1
     )
 {
 }
 private void ClearUnselected()
 {
     Mementor.Batch(() =>
     {
         for (int i = FilePaths.Count - 1; i >= 0; i--)
         {
             if (!FilePaths[i].FileIsSelected)
             {
                 Mementor.ElementRemove(FilePaths, FilePaths[i]);
                 FilePaths.Remove(FilePaths[i]);
             }
         }
     });
 }
Exemple #9
0
 public MasterBeat
 (
     Mementor mementor,
     ObservableCollection <OSCMessenger> messengers,
     double period,
     int multiplier
 )
     : base(messengers, mementor)
 {
     Messengers     = messengers ?? throw new ArgumentNullException(nameof(messengers));
     Period         = period;
     Multiplier     = multiplier;
     ResyncCommand  = new RelayCommand(p => Resync());
     TapCommand     = new RelayCommand(p => Tap());
     MessageAddress = "/MasterBeat/";
     tapPeriods     = new List <double>();
     tapTime        = new List <double>();
 }
        public void Drop(IDropInfo dropInfo)
        {
            var dataObject = dropInfo.Data as DataObject;

            if (dataObject != null)
            {
                if (dataObject.ContainsFileDropList())
                {
                    Mementor.BeginBatch();
                    var filedrop = dataObject.GetFileDropList();
                    foreach (string str in filedrop)
                    {
                        foreach (string fm in FileMask)
                        {
                            if (System.IO.Path.GetExtension(str).ToUpperInvariant() == fm)
                            {
                                FileNameItem lbfn = new FileNameItem(Mementor)
                                {
                                    FileName = str, FileIsSelected = false
                                };
                                FilePaths.Add(lbfn);
                                Mementor.ElementAdd(FilePaths, lbfn);
                            }
                        }
                    }
                    Mementor.EndBatch();
                }
            }


            if (dropInfo.DragInfo != null)
            {
                if (dropInfo.DragInfo.VisualSource != dropInfo.VisualTarget && dropInfo.Data.GetType() == typeof(FileNameItem))
                {
                    FileNameItem filenameitem    = dropInfo.Data as FileNameItem;
                    FileNameItem newfilenameitem = filenameitem.Clone() as FileNameItem;
                    FilePaths.Insert(dropInfo.InsertIndex, newfilenameitem);
                    Mementor.ElementAdd(FilePaths, newfilenameitem);
                }
            }
        }
 public GeometryFX(string messageaddress, ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor) : base(oscmessengers, mementor)
 {
     MessageAddress = String.Format("{0}{1}/", messageaddress, nameof(GeometryFX));
     Explode        = new Slider(MessageAddress + nameof(Explode), oscmessengers, mementor);
 }
Exemple #12
0
 public static Mementor New()
 {
     return Mementor = new Mementor();
 }
 public GeometryRotation(string messageaddress, ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor) : base(oscmessengers, mementor)
 {
     MessageAddress = String.Format("{0}/", messageaddress);
     Mode           = default;
     RotationX      = true;
     RotationY      = true;
     RotationZ      = true;
 }
 public RangeControl(ObservableCollection <OSCMessenger> oscmessengers, string messageaddress, Mementor mementor) : base(oscmessengers, mementor)
 {
     MessageAddress = messageaddress + "/";
     Range          = new Slider(MessageAddress + nameof(Range), oscmessengers, mementor);
     Modifier       = ((RangeModifier)0).ToString();
 }
Exemple #15
0
 public static Mementor New()
 {
     return(Mementor = new Mementor());
 }
Exemple #16
0
        public BeatModifier(string messageaddress, ObservableCollection <OSCMessenger> oscmessengers, Beat beat, Mementor mementor)
            : base(oscmessengers, mementor)
        {
            MessageAddress = String.Format("{0}{1}/", messageaddress, nameof(BeatModifier));

            MasterBeat          = beat;
            Multiplier          = 1.0;
            ChanceToHit         = new Slider(MessageAddress + nameof(ChanceToHit), oscmessengers, mementor);
            ChanceToHit.Amount  = 1.0;
            beat.PeriodChanged += (s, newvalue) =>
            {
                OnPeriodChanged(Period);
                Notify(nameof(Period));
                Notify(nameof(BPM));
            };
        }
 public GeometryTranslate(string messageaddress, ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor)
     : base(oscmessengers, mementor)
 {
     MessageAddress = String.Format("{0}/", messageaddress);
     Mode           = default;
 }
 public Counter(string messageaddress, ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor) : base(oscmessengers, mementor)
 {
     MessageAddress = String.Format("{0}{1}/", messageaddress, nameof(Counter));
     Count          = 1;
     AddCommand     = new RelayCommand(p => Add());
     SubCommand     = new RelayCommand(p => Sub());
 }
 private void ClearAll()
 {
     Mementor.PropertyChange(this, "FilePaths");
     FilePaths.Clear();
 }
Exemple #20
0
        public Camera(ObservableCollection <OSCMessenger> oscmessengers, MasterBeat masterBeat, Mementor mementor)
            : base(oscmessengers, mementor)
        {
            MessageAddress = "/Camera/";

            Rotation = ((CameraRotation)0).ToString();
            LookAt   = ((CameraLookAt)0).ToString();
            View     = ((CameraView)0).ToString();

            BeatModifier = new BeatModifier(MessageAddress, oscmessengers, masterBeat, mementor);
            FOV          = new Slider(MessageAddress + nameof(FOV), oscmessengers, mementor);
            Zoom         = new Slider(MessageAddress + nameof(Zoom), oscmessengers, mementor);
        }
 public ViewModel(ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor)
 {
     Messengers = oscmessengers ?? throw new ArgumentNullException(nameof(oscmessengers));
     Mementor   = mementor;
 }
Exemple #22
0
        public Texture(string messageaddress, ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor)
            : base(oscmessengers, mementor)
        {
            MessageAddress = String.Format("{0}{1}/", messageaddress, nameof(Texture));

            FileSelector = new FileSelector(MessageAddress, "Single", new List <string> {
                ".PNG", ".JPG", ".MOV", ".TXT"
            }, oscmessengers, mementor);

            Brightness = new Slider(MessageAddress + nameof(Brightness), oscmessengers, mementor);
            Contrast   = new Slider(MessageAddress + nameof(Contrast), oscmessengers, mementor);
            Invert     = new Slider(MessageAddress + nameof(Invert), oscmessengers, mementor);
            InvertMode = ((TextureInvertMode)0).ToString();
            Hue        = new Slider(MessageAddress + nameof(Hue), oscmessengers, mementor);
            Saturation = new Slider(MessageAddress + nameof(Saturation), oscmessengers, mementor);
            Luminosity = new Slider(MessageAddress + nameof(Luminosity), oscmessengers, mementor);
            Keying     = new Slider(MessageAddress + nameof(Keying), oscmessengers, mementor);
            Scale      = new Slider(MessageAddress + nameof(Scale), oscmessengers, mementor);
            Rotate     = new Slider(MessageAddress + nameof(Rotate), oscmessengers, mementor);
            Pan        = new Slider(MessageAddress + nameof(Pan), oscmessengers, mementor);
            Tilt       = new Slider(MessageAddress + nameof(Tilt), oscmessengers, mementor);

            //CopySelfCommand = new RelayCommand(p => CopySelf());
            //PasteSelfCommand = new RelayCommand(p => PasteSelf());
            ResetCommand = new RelayCommand(p => Reset());
        }
Exemple #23
0
 public static void End()
 {
     Mementor.Dispose();
     Mementor = null;
 }
Exemple #24
0
 public FileNameItem(Mementor mementor)
 {
     MessageAddress = string.Empty;
     Mementor       = mementor;
 }
Exemple #25
0
        public Slider(string messageaddress, ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor) : base(oscmessengers, mementor)
        {
            MessageAddress = String.Format("{0}/", messageaddress);
            Amount         = 0.0;

            AddCommand       = new RelayCommand(p => Add());
            SubCommand       = new RelayCommand(p => Sub());
            MouseDownCommand = new RelayCommand(p => MouseDown());
        }
Exemple #26
0
 public static void End()
 {
     Mementor.Dispose();
     Mementor = null;
 }
Exemple #27
0
 public void Setup()
 {
     m = Session.New();
 }
Exemple #28
0
 public void Setup()
 {
     m = Session.New();
 }
Exemple #29
0
        public Coloration(string messageaddress, ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor, Beat masterbeat)
            : base(oscmessengers, mementor)
        {
            MessageAddress = String.Format("{0}{1}/", messageaddress, nameof(Coloration));

            ObjColor = Utils.HexStringToColor("#FF00FF");
            BgColor  = Utils.HexStringToColor("#FF00FF");

            BeatModifier = new BeatModifier(MessageAddress, oscmessengers, masterbeat, mementor);

            Hue        = new RangeControl(oscmessengers, MessageAddress + nameof(Hue), mementor);
            Saturation = new RangeControl(oscmessengers, MessageAddress + nameof(Saturation), mementor);
            Value      = new RangeControl(oscmessengers, MessageAddress + nameof(Value), mementor);

            //CopySelfCommand = new RelayCommand(p => CopySelf());
            //PasteSelfCommand = new RelayCommand(p => PasteSelf());
            ResetCommand     = new RelayCommand(p => Reset());
            MouseDownCommand = new RelayCommand(p => MouseDown());
        }
Exemple #30
0
        public PostFX(string messageaddress, ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor) : base(oscmessengers, mementor)
        {
            MessageAddress = String.Format("{0}{1}/", messageaddress, nameof(PostFX));

            Feedback = new Slider(MessageAddress + nameof(Feedback), oscmessengers, mementor);
            Blur     = new Slider(MessageAddress + nameof(Blur), oscmessengers, mementor);

            Transforms = ((PostFXTransforms)0).ToString();
            View       = ((PostFXView)0).ToString();

            //CopySelfCommand = new RelayCommand(p => CopySelf());
            //PasteSelfCommand = new RelayCommand(p => PasteSelf());
            ResetCommand = new RelayCommand(p => Reset());
        }
Exemple #31
0
        public Mask(Beat masterbeat, string messageaddress, ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor)
            : base(oscmessengers, mementor)
        {
            MessageAddress = String.Format("{0}{1}/", messageaddress, nameof(Mask));

            Enable = false;

            BeatModifier = new BeatModifier(MessageAddress, oscmessengers, masterbeat, mementor);
            Geometry     = new Geometry(MessageAddress, oscmessengers, mementor);
            Texture      = new Texture(MessageAddress, oscmessengers, mementor);
            PostFX       = new PostFX(MessageAddress, oscmessengers, mementor);

            //CopySelfCommand = new RelayCommand(p => CopySelf());
            //PasteSelfCommand = new RelayCommand(p => PasteSelf());
            ResetCommand = new RelayCommand(p => Reset());

            CopyTextureCommand   = new RelayCommand(p => CopyTexture());
            PasteTextureCommand  = new RelayCommand(p => PasteTexture());
            CopyGeometryCommand  = new RelayCommand(p => CopyGeometry());
            PasteGeometryCommand = new RelayCommand(p => PasteGeometry());
            CopyPostFXCommand    = new RelayCommand(p => CopyPostFX());
            PastePostFXCommand   = new RelayCommand(p => PastePostFX());
        }
Exemple #32
0
        public Layer(MasterBeat masterBeat, string layername, ObservableCollection <OSCMessenger> messengers, int index, Mementor mementor)
            : base(messengers, mementor)
        {
            MessageAddress = layername;

            LayerName = layername;
            Index     = index;
            Index     = 0;
            Enabled   = false;
            BlendMode = ((BlendMode)0).ToString();

            Fade         = new Slider(MessageAddress + nameof(Fade), messengers, mementor);
            BeatModifier = new BeatModifier(MessageAddress, messengers, masterBeat, mementor);
            Content      = new Content(BeatModifier, MessageAddress, messengers, mementor);
            Mask         = new Mask(BeatModifier, MessageAddress, messengers, mementor);
            Coloration   = new Coloration(MessageAddress, messengers, mementor, BeatModifier);
            PostFX       = new PostFX(MessageAddress, messengers, mementor);

            CopyContentCommand     = new RelayCommand(p => CopyContent());
            PasteContentCommand    = new RelayCommand(p => PasteContent());
            CopyMaskCommand        = new RelayCommand(p => CopyMask());
            PasteMaskCommand       = new RelayCommand(p => PasteMask());
            CopyColorationCommand  = new RelayCommand(p => CopyColoration());
            PasteColorationCommand = new RelayCommand(p => PasteColoration());
        }
        public FileSelector(string messageaddress, string selectionmode, List <string> filemask, ObservableCollection <OSCMessenger> oscmessengers, Mementor mementor)
            : base(oscmessengers, mementor)
        {
            MessageAddress = messageaddress;

            SelectionMode = selectionmode;
            FileMask      = filemask;
            FilePaths     = new ObservableCollection <FileNameItem>();

            ClearSelectedCommand   = new RelayCommand(p => ClearSelected());
            ClearUnselectedCommand = new RelayCommand(p => ClearUnselected());
            ClearAllCommand        = new RelayCommand(p => ClearAll());
            DeleteItemCommand      = new RelayCommand(p => DeleteItem(p));
        }