Ejemplo n.º 1
0
        private void InitializeComponent()
        {
            this.nextBtn1         = new buttonPlay.NextBtn();
            this.roundedTrackBar1 = new SoundTrackBar.RoundedTrackBar();
            this.playBtn1         = new buttonPlay.PlayBtn();
            this.prevBtn1         = new buttonPlay.PrevBtn();
            this.volumeTrackBar1  = new SoundTrackBar.VolumeTrackBar();
            this.musicTrackBar1   = new SoundTrackBar.MusicTrackBar();
            this.soundSpectrum1   = new SoundSpectrumVisualisation.SoundSpectrum();
            this.SuspendLayout();
            //
            // nextBtn1
            //
            this.nextBtn1.Location = new System.Drawing.Point(260, 192);
            this.nextBtn1.Name     = "nextBtn1";
            this.nextBtn1.Size     = new System.Drawing.Size(50, 50);
            this.nextBtn1.TabIndex = 0;
            this.nextBtn1.Text     = "nextBtn1";

            //
            // roundedTrackBar1
            //

            this.roundedTrackBar1.Location     = new System.Drawing.Point(145, 165);
            this.roundedTrackBar1.MaximumValue = 100;
            this.roundedTrackBar1.MinimumValue = 0;
            this.roundedTrackBar1.Name         = "roundedTrackBar1";
            this.roundedTrackBar1.Size         = new System.Drawing.Size(110, 110);
            this.roundedTrackBar1.TabIndex     = 0;
            this.roundedTrackBar1.Text         = "roundedTrackBar1";
            this.roundedTrackBar1.Theme        = System.Drawing.Color.Empty;
            this.roundedTrackBar1.Value        = 0;
            //
            // playBtn1
            //

            this.playBtn1.Location = new System.Drawing.Point(170, 190);
            this.playBtn1.Name     = "playBtn1";
            this.playBtn1.Size     = new System.Drawing.Size(60, 60);
            this.playBtn1.TabIndex = 0;
            this.playBtn1.Text     = "playBtn1";

            playBtn1.Click += PlayBtn1_Click;
            //
            // prevBtn1
            //
            this.prevBtn1.Location = new System.Drawing.Point(95, 192);
            this.prevBtn1.Name     = "prevBtn1";
            this.prevBtn1.Size     = new System.Drawing.Size(50, 50);
            this.prevBtn1.TabIndex = 0;
            this.prevBtn1.Text     = "prevBtn1";

            //
            // volumeTrackBar1
            //

            this.volumeTrackBar1.Location     = new System.Drawing.Point(355, 225);
            this.volumeTrackBar1.MaximumValue = 100;
            this.volumeTrackBar1.MinimumValue = 0;
            this.volumeTrackBar1.Name         = "volumeTrackBar1";
            this.volumeTrackBar1.Size         = new System.Drawing.Size(20, 60);
            this.volumeTrackBar1.TabIndex     = 0;
            this.volumeTrackBar1.Text         = "volumeTrackBar1";
            this.volumeTrackBar1.Value        = 0;
            //
            // musicTrackBar1
            //

            this.musicTrackBar1.Location     = new System.Drawing.Point(25, 270);
            this.musicTrackBar1.MaximumValue = 100;
            this.musicTrackBar1.MinimumValue = 0;
            this.musicTrackBar1.Name         = "musicTrackBar1";
            this.musicTrackBar1.Size         = new System.Drawing.Size(310, 20);
            this.musicTrackBar1.TabIndex     = 0;
            this.musicTrackBar1.Text         = "musicTrackBar1";
            this.musicTrackBar1.Theme        = System.Drawing.Color.Empty;
            this.musicTrackBar1.Value        = 0;
            //
            // soundSpectrum1
            //

            this.soundSpectrum1.H_S_Size    = 1F;
            this.soundSpectrum1.Location    = new System.Drawing.Point(25, 10);
            this.soundSpectrum1.MaximumSize = this.soundSpectrum1.MinimumSize = this.soundSpectrum1.Size = new System.Drawing.Size(350, 150);
            this.soundSpectrum1.Name        = "soundSpectrum1";
            this.soundSpectrum1.Size        = new System.Drawing.Size(100, 100);
            this.soundSpectrum1.TabIndex    = 0;
            this.soundSpectrum1.Text        = "soundSpectrum1";
            this.soundSpectrum1.Theme       = System.Drawing.Color.Red;

            //
            // MusicPlayer
            //
            MinimumSize = MaximumSize = Size = new System.Drawing.Size(400, 300);
            this.Controls.Add(this.nextBtn1);

            this.Controls.Add(this.playBtn1);
            this.Controls.Add(this.roundedTrackBar1);
            this.Controls.Add(this.prevBtn1);
            this.Controls.Add(this.volumeTrackBar1);
            this.Controls.Add(this.musicTrackBar1);
            this.Controls.Add(this.soundSpectrum1);
            this.ResumeLayout(true);
            BackColor = Color.Black;
        }
        private void InitializeComponent()
        {
            //Регулятор звука
            volumeTrackBar1 = new SoundTrackBar.VolumeTrackBar(cont);
            //Обычный трек бар
            roundedTrackBar1 = new SoundTrackBar.RoundedTrackBar(cont);
            //Круглый трек бар в минимизированном виде
            musicTrackBar1 = new SoundTrackBar.MusicTrackBar(cont);
            BackColor      = Color.Black;
            if (comp_rect_list == null)
            {
                comp_rect_list = new List <Rectangle>();
                comp_name_list = new List <string>();
                comp_rect_list.Add(new Rectangle(275, 255, 25, 8));
                comp_name_list.Add("00:00");
                comp_rect_list.Add(new Rectangle(1, 190, 20, 20));
                comp_name_list.Add("ili");
                comp_rect_list.Add(new Rectangle(1, 215, 20, 20));
                comp_name_list.Add("f");
                comp_rect_list.Add(new Rectangle(1, 240, 20, 20));
                comp_name_list.Add(":=");
                comp_rect_list.Add(new Rectangle(1, 265, 20, 20));
                comp_name_list.Add("st");
                comp_rect_list.Add(new Rectangle(260, 192, 60, 50));
                comp_name_list.Add("> >");
                comp_rect_list.Add(new Rectangle(145, 165, 110, 110));
                comp_name_list.Add("rTrackBar");
                comp_rect_list.Add(new Rectangle(170, 190, 60, 60));
                comp_name_list.Add("| |");
                comp_rect_list.Add(new Rectangle(85, 192, 60, 50));
                comp_name_list.Add("< <");
                comp_rect_list.Add(new Rectangle(355, 225, 20, 60));
                comp_name_list.Add("V");
                comp_rect_list.Add(new Rectangle(25, 270, 310, 20));
                comp_name_list.Add("trackBar");
                comp_rect_list.Add(new Rectangle(25, 10, 350, 150));
                comp_name_list.Add("ililililili");
                comp_rect_list.Add(new Rectangle(2, 300, 398, 150));
                comp_name_list.Add("1.-\n2.-\n3.-");
            }

            this.count_time.Location = comp_rect_list[0].Location;
            this.count_time.Text     = "00:00/00:00";

            this.spectreBtn1.Location = comp_rect_list[1].Location;
            this.spectreBtn1.Size     = comp_rect_list[1].Size;
            this.spectreBtn1.Click   += SpectreBtn1_Click;

            this.loadFileBtn1.Location = comp_rect_list[2].Location;
            this.loadFileBtn1.Size     = comp_rect_list[2].Size;
            this.loadFileBtn1.Click   += LoadFileBtn1_Click;

            this.musicListBtn1.Location = comp_rect_list[3].Location;
            this.musicListBtn1.Size     = comp_rect_list[3].Size;
            this.musicListBtn1.Click   += MusicListBtn1_Click;

            this.ChangeStyleBtn1.Location = comp_rect_list[4].Location;
            this.ChangeStyleBtn1.Size     = comp_rect_list[4].Size;
            this.ChangeStyleBtn1.Click   += ChangeStyleBtn1_Click;

            this.nextBtn1.Location = comp_rect_list[5].Location;
            this.nextBtn1.Name     = "nextBtn1";
            this.nextBtn1.Size     = comp_rect_list[5].Size;
            this.nextBtn1.TabIndex = 0;
            this.nextBtn1.Text     = "nextBtn1";

            //
            // roundedTrackBar1
            //

            this.roundedTrackBar1.Location     = comp_rect_list[6].Location;
            this.roundedTrackBar1.MaximumValue = 100;
            this.roundedTrackBar1.MinimumValue = 0;
            this.roundedTrackBar1.Name         = "roundedTrackBar1";
            this.roundedTrackBar1.Size         = comp_rect_list[6].Size;
            this.roundedTrackBar1.TabIndex     = 0;
            this.roundedTrackBar1.Text         = "roundedTrackBar1";
            this.roundedTrackBar1.Theme        = System.Drawing.Color.Empty;
            this.roundedTrackBar1.Value        = 0;
            //
            // playBtn1
            //

            this.playBtn1.Location = comp_rect_list[7].Location;
            this.playBtn1.Name     = "playBtn1";
            this.playBtn1.Size     = comp_rect_list[7].Size;
            this.playBtn1.TabIndex = 0;
            this.playBtn1.Text     = "playBtn1";

            playBtn1.Click += PlayBtn1_Click;
            //
            // prevBtn1
            //
            this.prevBtn1.Location = comp_rect_list[8].Location;
            this.prevBtn1.Name     = "prevBtn1";
            this.prevBtn1.Size     = comp_rect_list[8].Size;
            this.prevBtn1.TabIndex = 0;
            this.prevBtn1.Text     = "prevBtn1";
            //prevBtn1.Click += NextBtn1_Click;

            //
            // volumeTrackBar1
            //

            this.volumeTrackBar1.Location     = comp_rect_list[9].Location;
            this.volumeTrackBar1.MaximumValue = 100;
            this.volumeTrackBar1.MinimumValue = 0;
            this.volumeTrackBar1.Name         = "volumeTrackBar1";
            this.volumeTrackBar1.Size         = comp_rect_list[9].Size;
            this.volumeTrackBar1.TabIndex     = 0;
            this.volumeTrackBar1.Text         = "volumeTrackBar1";
            this.volumeTrackBar1.Value        = 0;
            //
            // musicTrackBar1
            //

            this.musicTrackBar1.Location     = comp_rect_list[10].Location;
            this.musicTrackBar1.MaximumValue = 100;
            this.musicTrackBar1.MinimumValue = 0;
            this.musicTrackBar1.Name         = "musicTrackBar1";
            this.musicTrackBar1.Size         = comp_rect_list[10].Size;
            this.musicTrackBar1.TabIndex     = 0;
            this.musicTrackBar1.Text         = "musicTrackBar1";
            this.musicTrackBar1.Theme        = System.Drawing.Color.Empty;
            this.musicTrackBar1.Value        = 0;
            //
            // soundSpectrum1
            //

            this.soundSpectrum1.H_S_Size          = 1F;
            this.soundSpectrum1.Location          = comp_rect_list[11].Location;
            this.soundSpectrum1.Size              = comp_rect_list[11].Size;
            this.soundSpectrum1.Name              = "soundSpectrum1";
            this.soundSpectrum1.TabIndex          = 0;
            this.soundSpectrum1.Text              = "soundSpectrum1";
            this.soundSpectrum1.Theme             = System.Drawing.Color.Red;
            this.musicList1.SelectedIndexChanged += MusicList1_SelectedIndexChanged;
            //
            // MusicPlayer
            //
            MinimumSize              = Size = new System.Drawing.Size(400, 450);
            this.musicList1.Size     = comp_rect_list[12].Size;
            this.musicList1.Location = comp_rect_list[12].Location;
            this.Controls.Add(this.nextBtn1);
            this.Controls.Add(this.ChangeStyleBtn1);
            this.Controls.Add(this.musicListBtn1);
            this.Controls.Add(this.spectreBtn1);
            this.Controls.Add(this.loadFileBtn1);
            this.Controls.Add(musicList1);
            this.Controls.Add(this.playBtn1);
            this.Controls.Add(this.roundedTrackBar1);
            this.Controls.Add(this.prevBtn1);
            this.Controls.Add(this.volumeTrackBar1);
            this.Controls.Add(this.musicTrackBar1);
            this.Controls.Add(this.soundSpectrum1);
            this.Controls.Add(this.count_time);
            Application.ApplicationExit += Application_ApplicationExit;
            this.ResumeLayout(true);
            roundedTrackBar1.Visible = false;


            prevBtn1.Click += PrevBtn1_Click;
            nextBtn1.Click += NextBtn1_Click;
            musicList1.MouseDoubleClick += MusicList1_MouseDoubleClick;
            //roundedTrackBar1.va
            t1.Tick    += printTime;
            t1.Interval = 200;
        }