示例#1
0
        private void Window_Load(object sender, EventArgs e)
        {
            // temp static to initialize some panels
            window = this;

            Size screen = Screen.PrimaryScreen.WorkingArea.Size;

            this.MinimumSize      = new Size(760, 460);
            this.Location         = new Point(0, 0);//new Point(screen.Width / 4, screen.Height / 4);
            this.ClientSize       = new Size(screen.Width - 15, screen.Height - 35);
            this.ShowScrollHeight = this.ClientSize.Height - HEADER_HEIGHT;

            ScrollBar          = new VScrollBar();
            ScrollBar.Location = new Point(this.ClientSize.Width - ScrollBar.Width, HEADER_HEIGHT);
            ScrollBar.Height   = this.ShowScrollHeight;
            ScrollBar.AutoSize = true;
            ScrollBar.Scroll  += new ScrollEventHandler(Scroll_Move);

            bttnPanel = new ButtonPanel(new Point(0, MENU_HEIGHT), this.ClientSize);

            scrollPanel = new ScrollPanel(this);

            this.Controls.Add(ScrollBar);
            //this.Controls.Add(bttnPanel);
            this.Controls.Add(scrollPanel);
        }
        public AudioPanel(ScrollPanel parent, Point position)
        {
            this.ParentRef   = parent;
            this.BackColor   = Color.FromArgb(255, 25, 25, 25);
            this.MinimumSize = new Size(0, 240);
            this.ClientSize  = new Size(ParentRef.Width - (2 * PADDING), AudioPanel.MONO_HEIGHT - (2 * PADDING));
            this.Location    = new Point(position.X + PADDING, position.Y + (PADDING / 2));

            Init(position);
        }
示例#3
0
        public void Record_Click(object sender, EventArgs e)
        {
            if (Service.DLLWrapper.Safe)
            {
                if (panel.PanelData.RIFFData.SubChunkSize == 0)
                {
                    recording = !recording;
                    if (recording)
                    {
                        play.Enabled = false;
                        record.Text  = "Stop";
                        WavPackager packager = new WavPackager(null);
                        RIFFData    riff     = packager.GenerateRIFFData(panel);
                        panel.PanelData.RIFFData = riff;
                        Service.DLLWrapper.Record(riff);
                    }
                    else
                    {
                        play.Enabled = true;
                        Enable_Record(false);
                        RIFFData riff = panel.PanelData.RIFFData;
                        riff.Data                = Service.DLLWrapper.RecordStop();
                        riff.SubChunkSize        = riff.Data.Length;
                        panel.PanelData.RIFFData = riff;

                        panel.PanelData.SplitWavData();
                        panel.ClearAllCharts();

                        panel.PanelData.RawChartData.Add(panel.PanelData.GetReadableChannel(0));

                        Workers.ChartRenderWorker worker = new Workers.ChartRenderWorker(panel, 0, true);
                        worker.RunWorkerAsync();

                        if (panel.PanelData.RawChannelData.Count > 1)
                        {
                            panel.Menu.manager.Stereo_Click();
                            panel.Menu.manager.Mono.Enabled = false;

                            panel.PanelData.RawChartData.Add(panel.PanelData.GetReadableChannel(1));

                            Workers.ChartRenderWorker worker2 = new Workers.ChartRenderWorker(panel, 1, true);
                            worker2.RunWorkerAsync();
                        }
                        else
                        {
                            panel.Menu.manager.Mono_Click();
                            panel.Menu.manager.Stereo.Enabled = false;
                        }
                    }

                    panel.Menu.manager.Open_Click();
                }
                else
                {
                    ScrollPanel scroll = (ScrollPanel)panel.ParentRef;
                    scroll.Click_AddChannel(null, EventArgs.Empty);
                    scroll.audioPanels.Last.Value.PlayBar.Record_Click(null, EventArgs.Empty);
                }
            }
            else
            {
                Console.WriteLine("Unsafe Record action attempted and ignored.");
            }
        }