How to create a waveform display supplement

zhaozj2021-02-11  231

(1) Create a dialog-based application;

(2) Place a picture box on the dialog box settings ID: IDC_STATIC_AUDIO

(3) Add the following code to the application:

Bool caudiobardlg :: onInitdialog () {

. . . . . . . . . . . . . . . . . . . . // TODO: Add extra initialization here CRect rect; GetDlgItem (IDC_STATIC_AUDIO) -> GetWindowRect (rect); ScreenToClient (rect); m_AudioShowCtrl.Create (NULL, NULL, WS_VISIBLE | WS_CHILD, rect, this, IDC_STATIC_AUDIO, NULL); m_AudioShowCtrl. SetRange (0,100);

. . . . . . . . . . . . . . . . . . . . . . . . . . . Return True; // Return True UnsS you set the focus to a control

Void caudiobardlg :: ONMYTEST () {// Todo: add your control notification handler code herE m_bstartstop = true;

IF (m_bstartstop) Settimer (1,500, null); Else Killtimer (1);

Void caudiobardlg :: ONTIMER (uint nidevent) {// Todo: add your message handler code here and / or call default ctime t = ctime :: getcurrenttime (); int nrandM;

SRAND (T.getSecond ());

Do {nrandom = rand ();} while (nrandom <0 || nrandom> 100);

m_audioshowctrl.setpos (nrandom);

CDIALOG :: ONTIMER (Nidevent);

转载请注明原文地址:https://www.9cbs.com/read-4501.html

New Post(0)