コード例 #1
0
ファイル: MilkForm.cs プロジェクト: MHansonDev/MilkGen
    int WaveBrighten;                             // Brightens WaveForm
                                                  // [1 = All colors scalled till either r/g/b reaches 1]
                                                  // [0 = Normal]



    public MilkForm()
    {
        // Create Shape & Wave Tabs
        shapeTabs = new ShapeTabs(this);
        waveTabs  = new WaveTabs(this);

        // Create New Preset Button
        Button newPreset = new Button();

        newPreset.Text     = "New";
        newPreset.Location = new Point(7, 19);
        newPreset.Click   += newPresetClicked;

        // Create Preset Selection Button
        Button browseButton = new Button();

        browseButton.Text     = "Open";
        browseButton.Location = new Point(7, 45);
        browseButton.Click   += browsePresetClicked;

        // Create Preset Save Button
        Button showSave = new Button();

        showSave.Location   = new Point(652, 11);
        showSave.Image      = new Bitmap("C:\\Users\\User\\Desktop\\Dev\\Milkdrop\\save.jpg");
        showSave.ImageAlign = ContentAlignment.MiddleCenter;
        showSave.Width      = 25;
        showSave.Height     = 26;
        showSave.FlatStyle  = FlatStyle.Flat;
        showSave.FlatAppearance.BorderSize = 0;
        showSave.Click += showSaveBox;

        // Create Save Name Panel
        saveBox             = new Panel();
        saveBox.Location    = new Point(474, 18);
        saveBox.Size        = new Size(165, 70);
        saveBox.BackColor   = Color.Black;
        saveBox.ForeColor   = Color.White;
        saveBox.BorderStyle = BorderStyle.Fixed3D;
        saveBox.BringToFront();
        saveBox.Visible = false;

        // Create New Preset Name TextBox
        presetNameTB          = new TextBox();
        presetNameTB.Location = new Point(30, 10);
        presetNameTB.Text     = "test";
        presetNameTB.Parent   = saveBox;

        // Create Save Button
        Button save = new Button();

        save.Location = new Point(39, 38);
        save.Text     = "Save";
        save.Parent   = saveBox;
        save.Click   += panelSaveClicked;

        // Create Cancel Quit Button
        Button cancel = new Button();

        cancel.Location   = new Point(142, 2);
        cancel.Width      = 16;
        cancel.Height     = 16;
        cancel.Image      = new Bitmap("C:\\Users\\User\\Desktop\\Dev\\Milkdrop\\close.jpg");
        cancel.ImageAlign = ContentAlignment.MiddleCenter;
        cancel.UseVisualStyleBackColor = true;
        cancel.FlatStyle = FlatStyle.Flat;
        cancel.FlatAppearance.BorderSize = 0;
        cancel.Parent = saveBox;
        cancel.Click += cancelSave;

        // Add Preset Selection Controls
        Controls.Add(newPreset);
        Controls.Add(browseButton);
        Controls.Add(showSave);
        Controls.Add(saveBox);


        // Window Properties
        BackColor = Color.Black;
        ForeColor = Color.White;
        Size      = new Size(700, 600);


        // Basic settings control group box
        GroupBox buttonBox = new GroupBox();

        buttonBox.Parent    = this;
        buttonBox.BackColor = Color.Black;
        buttonBox.ForeColor = Color.White;
        buttonBox.Dock      = DockStyle.Top;
        buttonBox.Text      = " General Settings ";


        // General Setting Value Boxes
        GSettingBox zoomGB    = new GSettingBox(this, buttonBox, 90, 20, "zoom", 0, 200, 100);
        GSettingBox rotGB     = new GSettingBox(this, buttonBox, 90, 45, "rot", 0, 200, 100);
        GSettingBox warpGB    = new GSettingBox(this, buttonBox, 90, 70, "warp", 0, 200, 100);
        GSettingBox decayGB   = new GSettingBox(this, buttonBox, 170, 20, "decay", 0, 100, 90);
        GSettingBox gammaGB   = new GSettingBox(this, buttonBox, 170, 45, "gamma", 0, 200, 100);
        GSettingBox motionGB  = new GSettingBox(this, buttonBox, 170, 70, "motion", 0, 100, 50);
        GSettingBox stretchGB = new GSettingBox(this, buttonBox, 250, 20, "stretch", 0, 200, 100);
        GSettingBox waveGB    = new GSettingBox(this, buttonBox, 250, 45, "wave", 0, 50, 0);


        this.Text = "Milkdrop2 Visualization Generator";
        resetParameters();
    }
コード例 #2
0
    public ReactBox(MilkForm m, TabPage t, ShapeTabs sTabs, WaveTabs wTabs, Shape s, Wave w, int sIndx, string setL)
    {
        mForm        = m;
        tab          = t;
        shapeTabs    = sTabs;
        shape        = s;
        settingIndx  = sIndx;
        this.Visible = false;


        // Create Reaction Label Font
        Font rFont = new Font("Courier New", 15, FontStyle.Bold);

        // React Label
        Label rLabel = new Label();

        rLabel.Text     = setL + " Reaction";
        rLabel.Location = new Point(10, 10);
        rLabel.AutoSize = true;
        rLabel.Font     = rFont;
        this.Controls.Add(rLabel);


        // Quit Button
        Button quitButton = new Button();

        quitButton.Image      = new Bitmap("C:\\Users\\User\\Desktop\\Dev\\Milkdrop\\back.jpg");
        quitButton.ImageAlign = ContentAlignment.MiddleCenter;
        quitButton.UseVisualStyleBackColor = true;
        quitButton.Location  = new Point(265, 5);
        quitButton.Size      = new Size(17, 17);
        quitButton.FlatStyle = FlatStyle.Flat;
        quitButton.FlatAppearance.BorderSize = 0;
        quitButton.Click += quitClicked;
        this.Controls.Add(quitButton);


        // Reaction Selection
        rCmBx          = new ComboBox();
        rCmBx.Parent   = this;
        rCmBx.Location = new Point(110, 50);
        rCmBx.Items.Add("Increase");
        rCmBx.Items.Add("Decrease");
        rCmBx.Items.Add("Do Nothing");
        rCmBx.SelectedValue = "Do Nothing";


        // Bass Reaction RadioButton;
        bassRButton                 = new RadioButton();
        bassRButton.Location        = new Point(10, 95);
        bassRButton.Text            = "Bass Reactive";
        bassRButton.CheckedChanged += new System.EventHandler(this.reactionChecked);
        this.Controls.Add(bassRButton);

        // Mid Reaction RadioButton;
        midRButton                 = new RadioButton();
        midRButton.Location        = new Point(10, 114);
        midRButton.Text            = "Mid Reactive";
        midRButton.CheckedChanged += new System.EventHandler(this.reactionChecked);
        this.Controls.Add(midRButton);

        // Treb Reaction RadioButton
        trebRButton                 = new RadioButton();
        trebRButton.Location        = new Point(10, 133);
        trebRButton.Text            = "Treb Reactive";
        trebRButton.CheckedChanged += new System.EventHandler(this.reactionChecked);
        this.Controls.Add(trebRButton);

        // Oscillation Reaction RadioButton
        oscRButton                 = new RadioButton();
        oscRButton.Location        = new Point(10, 152);
        oscRButton.Text            = "Oscillation";
        oscRButton.CheckedChanged += new System.EventHandler(this.reactionChecked);
        this.Controls.Add(oscRButton);

        // Beat Detection RadioButton
        beatRButton                 = new RadioButton();
        beatRButton.Location        = new Point(10, 171);
        beatRButton.Text            = "Beat Detection";
        beatRButton.CheckedChanged += new System.EventHandler(this.reactionChecked);
        this.Controls.Add(beatRButton);


        // Reaction Intensity TrackBar
        intensity               = new TrackBar();
        intensity.Orientation   = Orientation.Horizontal;
        intensity.Location      = new Point(120, 130);
        intensity.Size          = new Size(100, 10);
        intensity.TickStyle     = TickStyle.None;
        intensity.BackColor     = Color.Black;
        intensity.Padding       = new Padding(2, 2, 2, 2);
        intensity.Margin        = new Padding(0, 5, 0, 5);
        intensity.TickFrequency = 10;
        intensity.Maximum       = 0;
        intensity.Minimum       = -30;
        intensity.Value         = -10;
        intensity.ValueChanged += new EventHandler(intensityChanged);
        this.Controls.Add(intensity);


        // Separator Bevel Line
        Label sepLine = new Label();

        sepLine.Location    = new Point(0, 90);
        sepLine.AutoSize    = false;
        sepLine.Height      = 2;
        sepLine.Width       = 300;
        sepLine.BorderStyle = BorderStyle.Fixed3D;
        this.Controls.Add(sepLine);


        // Intensity Label
        Label intensityL = new Label();

        intensityL.Text     = "INTENSITY";
        intensityL.Location = new Point(130, 110);
        this.Controls.Add(intensityL);


        // React Button
        Button reactButton = new Button();

        reactButton.Text     = "REACT";
        reactButton.Location = new Point(230, 165);
        reactButton.Size     = new Size(60, 24);
        reactButton.Click   += reactClicked;
        reactButton.BringToFront();
        this.Controls.Add(reactButton);


        // ReactBox Settings
        this.Size        = new Size(300, 200);
        this.Location    = new Point(6, 40);
        this.BackColor   = Color.Black;
        this.ForeColor   = Color.White;
        this.BorderStyle = BorderStyle.Fixed3D;
        this.Parent      = tab;
        this.BringToFront();
    }
コード例 #3
0
    /////////////////////////////


    // Constructor
    // Parameters: Shape Tabs and Main Form
    public Shape(MilkForm m, TabPage t, ShapeTabs tC, string num, float x, float y)
    {
        tab        = t;
        mForm      = m;
        tabControl = tC;
        shapeNum   = num;

        perFrameNum = 1;

        // Create Settings
        settings = new Setting[20];

        // X Position Setting
        settings[0] = new Setting("x", x, 10);
        // Y Position Setting
        settings[1] = new Setting("y", y, 10);
        // Sides Setting
        settings[2] = new Setting("sides", 3, (float)0.25);
        // Size Setting
        settings[3] = new Setting("rad", (float)0.2, 10);
        // Angle Setting
        settings[4] = new Setting("ang", 0, (float)0.25);
        // Inner Red Setting
        settings[5] = new Setting("r", 0, 10);
        // Outer Red Setting
        settings[6] = new Setting("r2", 0, 10);
        // Inner Green Setting
        settings[7] = new Setting("g", 0, 10);
        // Outer Green Setting
        settings[8] = new Setting("g2", 0, 10);
        // Inner Blue Setting
        settings[9] = new Setting("b", 1, 10);
        // Outer Blue Setting
        settings[10] = new Setting("b2", 1, 10);
        // Border Red Setting
        settings[11] = new Setting("border_r", 0, 10);
        // Border Green Setting
        settings[12] = new Setting("border_g", 0, 10);
        // Border Blue Setting
        settings[13] = new Setting("border_b", 0, 10);
        // Border Opacity Setting
        settings[14] = new Setting("border_a", 0, 10);
        // Inner Opacity Setting
        settings[15] = new Setting("a", 0, 10);
        // Outer Opacity Setting
        settings[16] = new Setting("a2", 0, 10);
        // Border Thick Setting
        settings[17] = new Setting("thick", 0, 0);
        // Additive Setting
        settings[18] = new Setting("additive", 0, 0);
        // Textured Setting
        settings[19] = new Setting("textured", 0, 0);


        // Shape Font;
        Font shapeFont = new Font("Arial", 10, FontStyle.Bold);

        // Create Enable CheckBox
        enable                 = new CheckBox();
        enabled                = false;
        enable.Location        = new Point(10, 4);
        enable.Text            = "Enabled";
        enable.Parent          = tab;
        enable.Font            = shapeFont;
        enable.CheckedChanged += new EventHandler(enableChk);

        // Create SettingStrip For Various Settings
        ////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////
        //
        // X Position SettingStrip
        Separator sep0 = new Separator(new Point(0, 35), "tab", tab);

        xSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 55), "X Position", 0, 100, 50, 0);
        Separator sep1 = new Separator(new Point(0, 95), "tab", tab);

        // Y Position SettingStrip
        ySS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 115), "Y Position", 0, 100, 50, 1);
        Separator sep2 = new Separator(new Point(0, 155), "tab", tab);

        // Sides SettingStrip
        sidesSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 175), "Sides", 3, 40, 3, 2);
        Separator sep3 = new Separator(new Point(0, 215), "tab", tab);

        // Size SettingStrip
        sizeSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 235), "Size", 0, 100, 20, 3);
        Separator sep4 = new Separator(new Point(0, 275), "tab", tab);

        // Angle SettingStrip
        angleSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 295), "Angle", 0, 628, 0, 4);
        Separator sep5 = new Separator(new Point(0, 335), "tab", tab);

        // Inner Red SettingStrip
        iRedSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 355), "Inner Red", 0, 100, 0, 5);
        Separator sep6 = new Separator(new Point(0, 395), "tab", tab);

        // Outer Red SettingStrip
        oRedSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 415), "Outer Red", 0, 100, 0, 6);
        Separator sep7 = new Separator(new Point(0, 455), "tab", tab);

        // Inner Green SettingStrip
        iGreenSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 475), "Inner Green", 0, 100, 0, 7);
        Separator sep8 = new Separator(new Point(0, 515), "tab", tab);

        // Outer Green SettingStrip
        oGreenSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 535), "Outer Green", 0, 100, 0, 8);
        Separator sep9 = new Separator(new Point(0, 575), "tab", tab);

        // Inner Blue SettingStrip
        iBlueSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 595), "Inner Blue", 0, 100, 100, 9);
        Separator sep10 = new Separator(new Point(0, 635), "tab", tab);

        // Outer Blue SettingStrip
        oBlueSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 655), "Outer Blue", 0, 100, 100, 10);
        Separator sep11 = new Separator(new Point(0, 695), "tab", tab);

        // Border Red SettingStrip
        bRedSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 715), "Border Red", 0, 100, 0, 11);
        Separator sep12 = new Separator(new Point(0, 755), "tab", tab);

        // Border Green SettingStrip
        bGreenSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 775), "Border Green", 0, 100, 0, 12);
        Separator sep13 = new Separator(new Point(0, 815), "tab", tab);

        // Border Blue SettingStrip
        bBlueSS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 835), "Border Blue", 0, 100, 100, 13);
        Separator sep14 = new Separator(new Point(0, 875), "tab", tab);

        // Border Opacity SettingStrip
        bOpacitySS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 895), "Border Opacity", 0, 100, 0, 14);
        Separator sep15 = new Separator(new Point(0, 935), "tab", tab);

        // Inner Opacity SettingStrip
        iOpacitySS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 955), "Inner Opacity", 0, 100, 100, 15);
        Separator sep16 = new Separator(new Point(0, 995), "tab", tab);

        oOpacitySS = new SettingStrip(mForm, tab, 0, tC, null, this, null, new Point(100, 1015), "Outer Opacity", 0, 100, 100, 16);
    }
コード例 #4
0
    // Constructor
    public SettingStrip(MilkForm m, TabPage t, int swT, ShapeTabs sTabs, WaveTabs wTabs, Shape s, Wave w, Point tL, string tt, int tMin, int tMax, int tVal, int indx)
    {
        mForm     = m;
        tab       = t;
        shape     = s;
        tBarTxt   = "   " + tt;
        shapeTabs = sTabs;
        waveTabs  = wTabs;
        shape     = s;
        wave      = w;
        stripIndx = indx;
        swType    = swT;

        Font tblFont = new Font("Arial", 8, FontStyle.Bold);

        // Initialize TrackBar
        tBar               = new TrackBar();
        tBar.Parent        = tab;
        tBar.Text          = tt;
        tBar.Orientation   = Orientation.Horizontal;
        tBar.Size          = new Size(84, 16);
        tBar.TickStyle     = TickStyle.None;
        tBar.BackColor     = Color.Black;
        tBar.ForeColor     = Color.Black;
        tBar.Padding       = new Padding(2, 2, 2, 2);
        tBar.Margin        = new Padding(0, 5, 0, 5);
        tBar.Left          = 1;
        tBar.TickFrequency = 10;
        tBar.Minimum       = tMin;
        tBar.Maximum       = tMax;
        tBar.Value         = tVal;
        tBar.ValueChanged += new EventHandler(tick);

        // Create TrackBar Setting Label
        tBarSetL          = new Label();
        tBarSetL.Text     = tBarTxt;
        tBarSetL.Location = new Point(tL.X - 105, tL.Y + 2);
        tBarSetL.Size     = new Size(100, 20);
        tBarSetL.Font     = tblFont;
        tBarSetL.Parent   = tab;

        // Create TrackBar Value Label
        tBarValL = new Label();
        if (tBarTxt.Contains("Sides"))
        {
            tBarValL.Text = tVal.ToString();
        }
        else
        {
            tBarValL.Text = ((float)tVal / (float)100.0).ToString();
        }
        tBarValL.Location    = new Point(tL.X + 103, tL.Y + 3);
        tBarValL.Parent      = tab;
        tBarValL.Size        = new Size(28, 17);
        tBarValL.BorderStyle = BorderStyle.Fixed3D;

        // Ceate UserControl
        uControl             = new UserControl();
        uControl.Size        = new Size(93, 27);
        uControl.BackColor   = Color.Black;
        uControl.Location    = new Point(tL.X + 5, tL.Y);
        uControl.Parent      = tab;
        uControl.BorderStyle = BorderStyle.Fixed3D;
        uControl.Controls.Add(tBar);

        // Set TrackBar Location Inside UserControl
        tBar.Location = new Point(3, 0);

        // Create Reaction Button
        react            = new Button();
        react.Image      = new Bitmap("C:\\Users\\User\\Desktop\\Dev\\Milkdrop\\react.jpg");
        react.ImageAlign = ContentAlignment.MiddleCenter;
        react.UseVisualStyleBackColor = true;
        react.Width     = 65;
        react.Height    = 12;
        react.Location  = new Point(tL.X + 139, tL.Y + 5);
        react.Parent    = tab;
        react.Font      = tblFont;
        react.TabStop   = false;
        react.FlatStyle = FlatStyle.Flat;
        react.FlatAppearance.BorderSize = 0;
        react.Click += reactClick;

        // Create Reaction Box
        rBox = new ReactBox(mForm, tab, sTabs, wTabs, shape, wave, stripIndx, tt);
    }