コード例 #1
0
 public Wave(string filePath, MainWindow mainWindowInst, TopToolbars tbs)
 {
     scale     = 1;
     this.tbs  = tbs;
     mouseDown = false;
     InitializeComponent();
     Show.IsEnabled = false;
     win            = mainWindowInst;
     name           = System.IO.Path.GetFileNameWithoutExtension(filePath);
     if (File.Exists(filePath))
     {
         this.filePath = filePath;
         using (fs = File.OpenRead(filePath))
         {
             ReadHeader();
             SetWaveGrid();
             ExtractSamples();
             DrawWave(waveSamples);
             SetInfo();
         }
         SaveHeader();
     }
     else
     {
         throw new ArgumentException("Invalid FilePath", filePath);
     }
 }
コード例 #2
0
 //Loads a wave file from win32 recording. Wave is only held in memory at this time.
 //Does not save it yet.
 public Wave(MainWindow mainWindowInst, TopToolbars tbs)
 {
     scale = 1;
     SaveHeader();
     fg        = null;
     this.tbs  = tbs;
     filePath  = "";
     mouseDown = false;
     InitializeComponent();
     win            = mainWindowInst;
     Show.IsEnabled = false;
     h = getRecordHead();
     convertPtrToArray(getData());
     SetWaveGrid();
     DrawWave(waveSamples);
     SetInfo();
 }
コード例 #3
0
        public MainWindow()
        {
            InitializeComponent();
            Console.WriteLine("initailiezed");
            this.Title = "3931 Project";
            initWave();
            mainGrid.Measure(new Size(800, 450));
            mainGrid.Arrange(new Rect(0, 0, 800, 450));
            //string filePath = "C:\\Users\\Kemal Holubeshen\\source\\repos\\" +
            //    "UIMilestone\\UIMilestone\\Resources\\DugaDugaDuga.wav";
            TimeDisplay td = new TimeDisplay();

            innerPanel.Children.Add(td);
            tools = new TopToolbars(this);
            mainGrid.Children.Add(tools);

            //w = new Wave(filePath, this);
            //Wave x = new Wave(filePath, this);
            //innerPanel.Children.Add(w);
            //innerPanel.Children.Add(x);
        }