void QTapeView::createTape(const QString &sFileName) { LPCTSTR lpszFile = qPrintable(sFileName); m_hTapeWavPcmFile = WavPcmFile_Create(lpszFile, 44100); if (m_hTapeWavPcmFile == INVALID_HANDLE_VALUE) return; //TODO: Report error m_sTapeFile = sFileName; m_okTapeInserted = true; m_okTapeRecording = true; m_buttonPlay->setEnabled(true); m_buttonPlay->setText(_T("Record")); m_buttonRewind->setEnabled(true); m_labelFile->setText(lpszFile); this->updatePosition(); m_buttonSave->setText(_T("Close WAV")); m_buttonOpen->setEnabled(false); }
void TapeView_CreateTape(LPCTSTR lpszFile) { m_hTapeWavPcmFile = WavPcmFile_Create(lpszFile, 44100); if (m_hTapeWavPcmFile == INVALID_HANDLE_VALUE) return; //TODO: Report error _tcscpy_s(m_szTapeFile, MAX_PATH, lpszFile); m_okTapeInserted = TRUE; m_okTapeRecording = TRUE; EnableWindow(m_hwndTapePlay, TRUE); SetWindowText(m_hwndTapePlay, _T("Record")); EnableWindow(m_hwndTapeRewind, TRUE); SetWindowText(m_hwndTapeFile, lpszFile); TapeView_UpdatePosition(); TapeView_ClearGraph(); SetWindowText(m_hwndTapeSave, _T("Close WAV")); EnableWindow(m_hwndTapeOpen, FALSE); }