⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 outdlg.cpp

📁 信道仿真源代码
💻 CPP
字号:
// OutDlg.cpp : implementation file
//////////////////////////////////////////////////////////////////////
// Copyright 2000.    Moe Wheatley AE4JY  <ae4jy@mindspring.com>
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
////

#include "stdafx.h"
#include "pathsim.h"
#include "OutDlg.h"
#include "pathsimdoc.h"
#include "wave.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// COutDlg dialog


COutDlg::COutDlg(CWnd* pParent /*=NULL*/)
	: CDialog(COutDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(COutDlg)
	m_OutputSelect = -1;
	//}}AFX_DATA_INIT
}


void COutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(COutDlg)
	DDX_Control(pDX, IDC_OUTFILESEL, m_OutFileSelectCtrl);
	DDX_Control(pDX, IDC_OUTFILENAME, m_OutFileNameCtrl);
	DDX_Radio(pDX, IDC_SOUNDOUT, m_OutputSelect);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(COutDlg, CDialog)
	//{{AFX_MSG_MAP(COutDlg)
	ON_BN_CLICKED(IDC_OUTFILESEL, OnOutfilesel)
	ON_BN_CLICKED(IDC_SOUNDOUT, OnSoundout)
	ON_BN_CLICKED(IDC_WAVEOUT, OnWaveout)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COutDlg message handlers

BOOL COutDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	if(m_OutputSelect==USE_SOUNDCARD)
	{
		m_OutFileNameCtrl.EnableWindow(FALSE);
		m_OutFileSelectCtrl.EnableWindow(FALSE);
	}
	m_OutFileNameCtrl.SetWindowText(m_OutFilePath);	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void COutDlg::OnOutfilesel() 
{
//  handler code here for getting Output filename
CString sFilter = "Wave Files (*.wav)|*.wav||";
CFileDialog Dlgfile( TRUE, "wav", m_OutFilePath, 
			OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,
			(LPCTSTR)sFilter, this );
	if( Dlgfile.DoModal() == IDOK)
	{
		m_OutFilePath = Dlgfile.GetPathName();
		m_OutFileName = Dlgfile.GetFileName();
	}
	m_OutFileNameCtrl.SetWindowText(m_OutFilePath);
}

void COutDlg::OnSoundout() 
{
	m_OutFileNameCtrl.EnableWindow(FALSE);
	m_OutFileSelectCtrl.EnableWindow(FALSE);
}

void COutDlg::OnWaveout() 
{
	m_OutFileNameCtrl.EnableWindow(TRUE);
	m_OutFileSelectCtrl.EnableWindow(TRUE);
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -