コード例 #1
0
        private void smtBeep_Click(object sender, EventArgs e)
        {
            // Using new classes
            _audioList.Append();
            _audioList.ToListViewItemCollection(listPending);

            lblTotalTime.Text = $"總時長:{MsToTime(_audioList.totalDuration)}";
            btnExport.Enabled = true;
            listPending.Items[listPending.Items.Count - 1].EnsureVisible();
        }
コード例 #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            // // Generate audio with ffmpeg
            // var proc = new Process {
            //     StartInfo = new ProcessStartInfo {
            //         FileName = "./ffmpeg-4.3.1-win32-static/bin/ffmpeg.exe",
            //         Arguments = $"-f lavfi -i anullsrc=r=11025:cl=mono -t " +
            //                     $"{numMins.Value * 60 + numSecs.Value} " +
            //                     $" {TempPath}/{Sequence}.m4a",
            //         UseShellExecute = false,
            //         CreateNoWindow = true,
            //     }
            // };
            // proc.Start();
            // proc.WaitForExit();
            //
            // // Set value
            // FilePath = $"{TempPath}/{Sequence}.m4a";
            // AudioLength = Convert.ToInt32(numMins.Value * 60 + numSecs.Value) * 1000;

            // Using new classes
            if (passInList.Append((long)(numMins.Value * 60000 + numSecs.Value * 1000)) == null)
            {
                MessageBox.Show("無法新增音訊,程式遇到錯誤。", "失敗", MessageBoxButtons.OK);
                DialogResult = DialogResult.Cancel;
                Close();
            }

            // Close
            DialogResult = DialogResult.OK;
            Close();
        }
コード例 #3
0
        // Click on OK button
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;

            // Add new item to list
            _audioList.Append(_filename, trbIn.Value, trbOut.Value);

            Close();
        }