コード例 #1
0
ファイル: ShakeIt.cs プロジェクト: soundanny23/stoffi
        /// <summary>
        /// Creates an instance of the ShakeIt plugin class.
        /// </summary>
        /// <param name="id">A unique string identifying the plugin</param>
        /// <param name="version">The version of the plugin, specified in the assembly</param>
        public ShakeIt(string id, Version version)
            : base(id, version, new Version(0, 4))
        {
            Author  = "Simplare";
            Website = "http://dev.stoffiplayer.com/wiki/PluginAPI";

            minimumVolume = new Setting
            {
                ID        = "MinimumVolume",
                Type      = typeof(System.Double),
                Value     = (Object)0.0,
                Maximum   = (Object)100.0,
                IsVisible = true
            };

            maximumVolume = new Setting
            {
                ID        = "MaximumVolume",
                Type      = typeof(System.Double),
                Value     = (Object)100.0,
                Maximum   = (Object)100.0,
                IsVisible = true
            };

            viscosity = new Setting
            {
                ID        = "Viscosity",
                Type      = typeof(System.Double),
                Value     = (Object)6.5,
                Maximum   = (Object)10.0,
                IsVisible = true
            };

            sensitivity = new Setting
            {
                ID        = "Sensitivity",
                Type      = typeof(System.Double),
                Value     = (Object)5.0,
                Maximum   = (Object)10.0,
                IsVisible = true
            };

            Settings.Add(minimumVolume);
            Settings.Add(maximumVolume);
            Settings.Add(sensitivity);
            Settings.Add(viscosity);

            foreach (Setting s in Settings)
            {
                s.PropertyChanged += new PropertyChangedEventHandler(Setting_PropertyChanged);
            }

            deviceStatus = new StatusLabel
            {
                Label  = "KinectStatus",
                Status = DanceAnalyzer.IsConnected ? "Connected" : "NotConnected"
            };

            StatusLabels.Add(deviceStatus);

            DanceAnalyzer.PropertyChanged += new PropertyChangedEventHandler(DanceAnalyzer_PropertyChanged);
            DanceAnalyzer.Connect         += new EventHandler(DanceAnalyzer_Connect);
            DanceAnalyzer.Disconnect      += new EventHandler(DanceAnalyzer_Disconnect);

            DanceAnalyzer.Viscosity   = (Double)viscosity.Value;
            DanceAnalyzer.Sensitivity = (Double)sensitivity.Value;
        }
コード例 #2
0
ファイル: ShakeIt.cs プロジェクト: uQr/stoffi
        /// <summary>
        /// Creates an instance of the ShakeIt plugin class.
        /// </summary>
        /// <param name="id">A unique string identifying the plugin</param>
        /// <param name="version">The version of the plugin, specified in the assembly</param>
        public ShakeIt(string id, Version version)
            : base(id, version, new Version(0, 4))
        {
            Author = "Simplare";
            Website = "http://dev.stoffiplayer.com/wiki/PluginAPI";

            minimumVolume = new Setting
            {
                ID = "MinimumVolume",
                Type = typeof(System.Double),
                Value = (Object)0.0,
                Maximum = (Object)100.0,
                IsVisible = true
            };

            maximumVolume = new Setting
            {
                ID = "MaximumVolume",
                Type = typeof(System.Double),
                Value = (Object)100.0,
                Maximum = (Object)100.0,
                IsVisible = true
            };

            viscosity = new Setting
            {
                ID = "Viscosity",
                Type = typeof(System.Double),
                Value = (Object)6.5,
                Maximum = (Object)10.0,
                IsVisible = true
            };

            sensitivity = new Setting
            {
                ID = "Sensitivity",
                Type = typeof(System.Double),
                Value = (Object)5.0,
                Maximum = (Object)10.0,
                IsVisible = true
            };

            Settings.Add(minimumVolume);
            Settings.Add(maximumVolume);
            Settings.Add(sensitivity);
            Settings.Add(viscosity);

            foreach (Setting s in Settings)
                s.PropertyChanged += new PropertyChangedEventHandler(Setting_PropertyChanged);

            deviceStatus = new StatusLabel
            {
                Label = "KinectStatus",
                Status = DanceAnalyzer.IsConnected ? "Connected" : "NotConnected"
            };

            StatusLabels.Add(deviceStatus);

            DanceAnalyzer.PropertyChanged += new PropertyChangedEventHandler(DanceAnalyzer_PropertyChanged);
            DanceAnalyzer.Connect += new EventHandler(DanceAnalyzer_Connect);
            DanceAnalyzer.Disconnect += new EventHandler(DanceAnalyzer_Disconnect);

            DanceAnalyzer.Viscosity = (Double)viscosity.Value;
            DanceAnalyzer.Sensitivity = (Double)sensitivity.Value;
        }