コード例 #1
0
ファイル: Program.cs プロジェクト: AlexShkor/GestoMusic
        public static void Main()
        {
            var gesturesObserver = new GesturesObserver();
            var samplesFactory = new SamplesFactory();
            var gitare = samplesFactory.GetGitare();
            var plate = samplesFactory.GetGitare();
            var tube = samplesFactory.GetGitare();
            var drum = samplesFactory.GetGitare();
            var metronom = samplesFactory.GetMetronom();

            //gesturesObserver.TrackGesture(GestureType.SwipeLeft, gitare);
            //gesturesObserver.TrackGesture(GestureType.SwipeRight, plate);
            //gesturesObserver.TrackGesture(GestureType.WaveLeft, tube);
            //gesturesObserver.TrackGesture(GestureType.WaveRight, drum);

            metronom.Play();

            while (true)
            {
                Thread.Sleep(100);
            }
        }
コード例 #2
0
        private GesturesObserver CreateObserver(SamplesFactory samplesFactory)
        {
            var gesturesObserver = new GesturesObserver();

            gesturesObserver.TrackDiscretGesture(GestureType.HammerLeft, samplesFactory.GetDrumHandLeft());
            gesturesObserver.TrackDiscretGesture(GestureType.HammerRight, samplesFactory.GetDrumHandRight());
            gesturesObserver.TrackDiscretGesture(GestureType.StepLeft, samplesFactory.GetDrumLegLeft());
            gesturesObserver.TrackDiscretGesture(GestureType.StepRight, samplesFactory.GetDrumLegRight());
            gesturesObserver.TrackDiscretGesture(GestureType.Head, samplesFactory.GetDrumHead());
            gesturesObserver.TrackDiscretGesture(GestureType.JoinedHands, samplesFactory.GetGuitarLoop());
            gesturesObserver.TrackDiscretGesture(GestureType.Menu, samplesFactory.GetPianoLoop());

            _settings = new HandUpContiniousGestureSettings();
            gesturesObserver.TrackContinuesGesture(_settings, samplesFactory.Wawe());

            gesturesObserver.GestureSamplePlayed += GestureSamplePlayed;
            return gesturesObserver;
        }