Exemplo n.º 1
0
        public Engine(Matrix3D camera)
        {
            var ambient  = 0.00;
            var diffuse  = 0.95;
            var scale    = 75;
            var distance = 100.0;

            this.camera = camera;


            this.screen = new Screen(width, height);
            this.window = new Window(width, height, scale, distance, camera);

            var randomFactory      = new RandomFactory();
            var hemiSamplerFactory = new HemiSamplerFactory();
            var triangleSampler    = new TriangleSampler(randomFactory);
            var primitives         = new Construction();
            var illumination       = new Illumination(primitives, randomFactory, triangleSampler);

            var seedFactory = new Random();

            this.tracer = new Tracer(primitives, new Emissive(Constant.WHITE, ambient, 1.0), randomFactory, hemiSamplerFactory);

            ExampleUtil.buildCornelBox(primitives, illumination, diffuse, tracer, randomFactory, hemiSamplerFactory);
        }
Exemplo n.º 2
0
    public static void Main()
    {
        // call this so we can savely use the m_capabilities array later
        ExampleUtil.InitCaps();

        // show what's supported
        ExampleUtil.PrintCaps();

        // try the summary-only case
        Notification n = new Notification("Summary-only", "");

        n.Show();
    }
Exemplo n.º 3
0
    public static void Main()
    {
        // call this so we can savely use the m_capabilities array later
        ExampleUtil.InitCaps();

        // show what's supported
        ExampleUtil.PrintCaps();

        // try the summary-body case
        Notification n = new Notification("Totem",
                                          "This is a superfluous notification.");

        n.Show();
    }
Exemplo n.º 4
0
    public static void Main()
    {
        // call this so we can savely use the m_capabilities array later
        ExampleUtil.InitCaps();

        // show what's supported
        ExampleUtil.PrintCaps();

        // try the icon-summary case
        Notification n = new Notification("WiFi connection lost",
                                          "",          // this needs to be empty
                                          "notification-network-wireless-disconnected");

        n.Show();
    }
Exemplo n.º 5
0
    public static void Main()
    {
        // call this so we can savely use the m_capabilities array later
        ExampleUtil.InitCaps();

        // show what's supported
        ExampleUtil.PrintCaps();

        // try the icon-summary-body case
        Notification n = new Notification("Cole Raby",
                                          "Hey pal, what's up with the party next weekend? Will you join me and Anna?",
                                          "notification-message-im");

        n.Show();
    }
Exemplo n.º 6
0
    public static void Main()
    {
        // call this so we can savely use the m_capabilities array later
        ExampleUtil.InitCaps();

        // show what's supported
        ExampleUtil.PrintCaps();

        // try the icon-value case, usually used for synchronous bubbles
        if (ExampleUtil.HasCap(ExampleUtil.Capability.CAP_SYNCHRONOUS))
        {
            pushNotification("notification-keyboard-brightness-low",
                             25);

            pushNotification("notification-keyboard-brightness-medium",
                             50);

            pushNotification("notification-keyboard-brightness-high",
                             75);

            pushNotification("notification-keyboard-brightness-full",
                             100);

            // trigger "overshoot"-effect
            pushNotification("notification-keyboard-brightness-full",
                             101);

            pushNotification("notification-keyboard-brightness-high",
                             75);

            pushNotification("notification-keyboard-brightness-medium",
                             50);

            pushNotification("notification-keyboard-brightness-low",
                             25);

            pushNotification("notification-keyboard-brightness-off",
                             0);

            // trigger "undershoot"-effect
            pushNotification("notification-keyboard-brightness-off",
                             -1);
        }
        else
        {
            Console.WriteLine("The daemon does not support the x-canonical-private-synchronous hint!");
        }
    }
Exemplo n.º 7
0
    public static void Main()
    {
        // call this so we can savely use the m_capabilities array later
        ExampleUtil.InitCaps();

        // show what's supported
        ExampleUtil.PrintCaps();

        // try the append-hint
        if (ExampleUtil.HasCap(ExampleUtil.Capability.CAP_APPEND))
        {
            pushNotification("Cole Raby",
                             "Hey Bro Coly!",
                             "notification-message-im");

            pushNotification("Cole Raby",
                             "What's up dude?",
                             "notification-message-im");

            pushNotification("Cole Raby",
                             "Did you watch the air-race in Oshkosh last week?",
                             "notification-message-im");

            pushNotification("Cole Raby",
                             "Phil owned the place like no one before him!",
                             "notification-message-im");

            pushNotification("Cole Raby",
                             "Did really everything in the race work according to regulations?",
                             "notification-message-im");

            pushNotification("Cole Raby",
                             "Somehow I think to remember Burt Williams did cut corners and was not punished for this.",
                             "notification-message-im");

            pushNotification("Cole Raby",
                             "Hopefully the referees will watch the videos of the race.",
                             "notification-message-im");

            pushNotification("Cole Raby",
                             "Burt could get fined with US$ 50000 for that rule-violation :)",
                             "notification-message-im");
        }
        else
        {
            Console.WriteLine("The daemon does not support the x-canonical-append hint!");
        }
    }
        static void Main()
        {
            OutputDevice outputDevice = ExampleUtil.ChooseOutputDeviceFromConsole();

            if (outputDevice == null)
            {
                Console.WriteLine("Warning, there is no sound device found!");
            }
            if (outputDevice != null)
            {
                outputDevice.Open();
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMain(outputDevice));
        }
Exemplo n.º 9
0
    static void Leds()
    {
        // InputDevice inputDevice0 = ExampleUtil.ChooseInputDeviceFromConsole();
        // Console.Clear();
        // OutputDevice outputDevice0 = ExampleUtil.ChooseOutputDeviceFromConsole();
        outputDevice.Open();


        // Initialize buttonpress func
        Thread buttonpress = new Thread(OnPressThread);

        buttonpress.Start();

        Console.Clear();
        Console.WriteLine("Enter 'exit' to close process");
        Console.WriteLine("");

        //Leeed

        LoadFile();
        outputDevice.SendNoteOn(Channel.Channel1, Pitch.C9, 14);
        outputDevice.SendNoteOn(Channel.Channel1, Pitch.GSharp7, 60);

        outputDevice.SendNoteOn(Channel.Channel1, Pitch.GSharpNeg1, 14);
        outputDevice.SendNoteOn(Channel.Channel1, Pitch.C1, 30);
        outputDevice.SendNoteOn(Channel.Channel1, Pitch.E2, 49);
        outputDevice.SendNoteOn(Channel.Channel1, Pitch.GSharp3, 60);

        while (true)
        {
            string a = Console.ReadLine();
            if (a == "exit")
            {
                outputDevice.Close();
                inputDevice.StopReceiving();
                inputDevice.Close();
                inputDevice.RemoveAllEventHandlers();
                // All done.
                Console.WriteLine();
                ExampleUtil.PressAnyKeyToContinue();
                break;
            }
        }
    }
Exemplo n.º 10
0
        public void ClassOnly()
        {
            // Need to have some code in this project that actually uses the assembly or else it won't get added to the assembly's GetReferencedAssemblies.
            ExampleUtil.GetYear();

            Assert.IsNotNull(ChessTestContext);
            Assert.IsNotNull(ChessTestContext.Options.IncludedAssemblies, "ChessTestContext.Options.IncludedAssemblies");

            string msg = " is an assembly reference, but shouldn't be automatically instrumented because it's in the GAC.";

            Assert.IsFalse(ChessTestContext.Options.IncludedAssemblies.Contains("Microsoft.Concurrency.UnitTestingFramework"), "Microsoft.Concurrency.UnitTestingFramework" + msg);
            Assert.IsFalse(ChessTestContext.Options.IncludedAssemblies.Contains("System"), "System" + msg);
            Assert.IsFalse(ChessTestContext.Options.IncludedAssemblies.Contains("System.Core"), "System.Core" + msg);
            Assert.IsFalse(ChessTestContext.Options.IncludedAssemblies.Contains("System.Data"), "System.Data" + msg);
            Assert.IsFalse(ChessTestContext.Options.IncludedAssemblies.Contains("System.Data.DataSetExtensions"), "System.Data.DataSetExtensions" + msg);
            Assert.IsFalse(ChessTestContext.Options.IncludedAssemblies.Contains("System.Drawing"), "System.Drawing" + msg);
            Assert.IsFalse(ChessTestContext.Options.IncludedAssemblies.Contains("System.Xml"), "System.Xml" + msg);
            Assert.IsFalse(ChessTestContext.Options.IncludedAssemblies.Contains("System.Xml.Linq"), "System.Xml.Linq" + msg);
        }
Exemplo n.º 11
0
    public static void Main()
    {
        // call this so we can savely use the m_capabilities array later
        ExampleUtil.InitCaps();

        // show what's supported
        ExampleUtil.PrintCaps();

        // try the icon-sonly case
        if (ExampleUtil.HasCap(ExampleUtil.Capability.CAP_LAYOUT_ICON_ONLY))
        {
            Notification n = new Notification("Eject",              // for a11y-reasons supply something meaning full
                                              "",                   // this needs to be empty!
                                              "notification-device-eject");
            n.AddHint("x-canonical-private-icon-only", "");
            n.Show();
        }
        else
        {
            Console.WriteLine("The daemon does not support the x-canonical-private-icon-only hint!");
        }
    }
Exemplo n.º 12
0
    public static void Main()
    {
        // call this so we can savely use the m_capabilities array later
        ExampleUtil.InitCaps();

        // show what's supported
        ExampleUtil.PrintCaps();

        // try the icon-summary-body case
        Notification n = new Notification(
            "Inital notification",
            "This is the original content of this notification-bubble.",
            "notification-message-im");

        n.Show();
        Mono.Unix.Native.Syscall.sleep(3);          // simulate app activity

        // update the current notification with new content
        n.Summary  = "Updated notification";
        n.Body     = "Here the same bubble with new title- and body-text, even the icon can be changed on the update.";
        n.IconName = "notification-message-email";
        n.Show();
        Mono.Unix.Native.Syscall.sleep(6);          // wait longer now

        // create a new bubble using the icon-summary-body layout
        n = new Notification(
            "Initial layout",
            "This bubble uses the icon-title-body layout.",
            "notification-message-im");
        n.Show();
        Mono.Unix.Native.Syscall.sleep(3);          // simulate app activity

        // now update current bubble again, but change the layout
        n.Summary  = "Updated layout";
        n.Body     = "After the update we now have a bubble using the title-body layout.";
        n.IconName = " ";
        n.Show();
    }
Exemplo n.º 13
0
        private void Form1_Load(object sender, EventArgs e)
        {
            savedMelodysList = new List <Melody>();
            savedMelodysList = Parser.GetAllMelodys();
            for (int i = 0; i < savedMelodysList.Count; i++)
            {
                savedMelodysComboBox.Items.Add(savedMelodysList[i].Name + "(" + savedMelodysList[i].ScaleName.ToString() + ")");
            }
            if (savedMelodysComboBox.Items.Count != 0)
            {
                savedMelodysComboBox.SelectedIndex = 0;
            }
            nameLabel.Text         = "Сгенерируйте мелодию!";
            notesTextBox.Text      = "";
            rhythmTextBox.Text     = "";
            notesCountTextBox.Text = "16";

            //Melody.Number = melodyList.Count + 1;

            generatedMelodysList = new List <Melody>();

            gridButtons = new int[6, 16];

            /* Гаммы можно менять, но их длина должна оставаться прежней.
             * В противном случае, нужно произвести изменения в файле MyRandom.cs
             */
            minorScale = new int[7] {
                2, 1, 2, 2, 1, 2, 2
            };
            majorScale = new int[7] {
                2, 2, 1, 2, 2, 2, 1
            };
            flamencoScale = new int[7] {
                1, 3, 1, 2, 1, 3, 1
            };
            bluesScale     = new int[] { 3, 2, 1, 1, 3, 2 };
            flamenco2Scale = new int[7] {
                1, 3, 1, 2, 1, 2, 2
            };

            int[]     scaleIntervals = minorScale;
            ScaleName scaleName      = ScaleName.Minor;

            selectedScale = new MyScale(scaleName, scaleIntervals);

            tonica = Note.A3;

            scaleComboBox.SelectedIndex = 0;

            buttons       = new Button[6, 16];
            player        = new MediaPlayer();
            player.Volume = 0.3;
            outputDevice  = ExampleUtil.ChooseOutputDeviceFromConsole();
            outputDevice.Open();
            outputDevice.SendProgramChange(Channel.Channel1, Instrument.AcousticGuitarSteel);

            grifNotes = new Note[6, 16];

            //Заполняем 6 струну
            for (int i = 0; i < grifNotes.GetLength(1); i++)
            {
                grifNotes[5, i] = (Note)(40 + i);
            }
            //Заполняем 5 струну
            for (int i = 0; i < grifNotes.GetLength(1); i++)
            {
                grifNotes[4, i] = (Note)(45 + i);
            }
            //Заполняем 4 струну
            for (int i = 0; i < grifNotes.GetLength(1); i++)
            {
                grifNotes[3, i] = (Note)(50 + i);
            }
            //Заполняем 3 струну
            for (int i = 0; i < grifNotes.GetLength(1); i++)
            {
                grifNotes[2, i] = (Note)(55 + i);
            }
            //Заполняем 2 струну
            for (int i = 0; i < grifNotes.GetLength(1); i++)
            {
                grifNotes[1, i] = (Note)(59 + i);
            }
            //Заполняем 1 струну
            for (int i = 0; i < grifNotes.GetLength(1); i++)
            {
                grifNotes[0, i] = (Note)(64 + i);
            }

            int tabindex = 4;

            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < 16; j++)
                {
                    buttons[i, j]          = (Button)this.Controls["s" + (i + 1).ToString() + j.ToString()];
                    buttons[i, j].TabIndex = tabindex;
                    tabindex++;
                }
            }

            //Создание надписей над аппликатурой
            labels = new Label[6, 16]; this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < 16; j++)
                {
                    labels[i, j]           = new Label();
                    labels[i, j].AutoSize  = true;
                    labels[i, j].Font      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
                    labels[i, j].ForeColor = System.Drawing.Color.Black;
                    Point p = new Point();
                    p.X = buttons[i, j].Location.X;// +buttons[i, j].Width / 2;
                    p.Y = buttons[i, j].Location.Y;
                    labels[i, j].Location = p;
                    labels[i, j].Name     = "label" + i.ToString() + j.ToString();
                    labels[i, j].Size     = new System.Drawing.Size(15, 13);
                    //labels[i, j].TabIndex = 113;
                    labels[i, j].Text      = "T";
                    labels[i, j].Visible   = false;
                    labels[i, j].BackColor = System.Drawing.Color.Transparent;
                    this.Controls.Add(labels[i, j]);
                    labels[i, j].BringToFront();
                }
            }

            for (int j = 0; j < 6; j++)
            {
                for (int k = 0; k < 16; k++)
                {
                    buttons[j, k].Click += grif_Click;
                }
            }
        }
Exemplo n.º 14
0
 static bool IsInVR()
 {
     return(ExampleUtil.isPresent());
 }