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

📄 encdialog.cpp

📁 dsp上用c语言实现的aac音频算法的编解码器代码
💻 CPP
📖 第 1 页 / 共 3 页
字号:
			char buffer[MAX_PATH];#ifdef USE_IMPORT_TAG				cfg.TagImport=IsDlgButtonChecked(hWndDlg,IDC_CHK_IMPORTTAG) ? 1 : 0;	#ifdef USE_PATHEXT				GetDlgItemText(hWndDlg, IDC_E_SOURCEPATH, buffer, MAX_PATH);				cfg.TagSrcPath=strdup(buffer);				GetDlgItemText(hWndDlg, IDC_E_SOURCEEXT, buffer, MAX_PATH);				cfg.TagSrcExt=strdup(buffer);	#endif#endif				GetDlgItemText(hWndDlg, IDC_E_ARTIST, buffer, MAX_PATH);				cfg.Tag.artist=strdup(buffer);				GetDlgItemText(hWndDlg, IDC_E_TITLE, buffer, MAX_PATH);				cfg.Tag.title=strdup(buffer);				GetDlgItemText(hWndDlg, IDC_E_ALBUM, buffer, MAX_PATH);				cfg.Tag.album=strdup(buffer);				GetDlgItemText(hWndDlg, IDC_E_YEAR, buffer, MAX_PATH);				cfg.Tag.year=strdup(buffer);				GetDlgItemText(hWndDlg, IDC_CB_GENRE, buffer, MAX_PATH);				cfg.Tag.genre=strdup(buffer);				GetDlgItemText(hWndDlg, IDC_E_WRITER, buffer, MAX_PATH);				cfg.Tag.writer=strdup(buffer);				GetDlgItemText(hWndDlg, IDC_E_COMMENT, buffer, MAX_PATH);				cfg.Tag.comment=strdup(buffer);				GetDlgItemText(hWndDlg, IDC_E_ARTFILE, buffer, MAX_PATH);				cfg.Tag.artFilename=strdup(buffer);				cfg.Tag.trackno=GetDlgItemInt(hWndDlg, IDC_E_TRACK, 0, FALSE);				cfg.Tag.ntracks=GetDlgItemInt(hWndDlg, IDC_E_NTRACKS, 0, FALSE);				cfg.Tag.discno=GetDlgItemInt(hWndDlg, IDC_E_DISK, 0, FALSE);				cfg.Tag.ndiscs=GetDlgItemInt(hWndDlg, IDC_E_NDISKS, 0, FALSE);				cfg.Tag.compilation=(BYTE)GetDlgItemInt(hWndDlg, IDC_E_COMPILATION, 0, FALSE);				cfg.Tag.compilation=IsDlgButtonChecked(hWndDlg, IDC_CHK_COMPILATION) ? 1 : 0;				EndDialog(hWndDlg, TRUE);//(DWORD)hCfg);			}			break;			        case IDCANCEL:			// Ignore data values entered into the controls        			// and dismiss the dialog window returning FALSE			EndDialog(hWndDlg, FALSE);			break;		case IDC_BTN_ABOUT:			DialogBox((HINSTANCE)hInstance,(LPCSTR)MAKEINTRESOURCE(IDD_ABOUT), (HWND)hWndDlg, (DLGPROC)DialogMsgProcAbout);			break;		case IDC_BTN_LICENSE:			{			char *license =				"\nPlease note that the use of this software may require the payment of patent royalties.\n"				"You need to consider this issue before you start building derivative works.\n"				"We are not warranting or indemnifying you in any way for patent royalities!\n"				"YOU ARE SOLELY RESPONSIBLE FOR YOUR OWN ACTIONS!\n"				"\n"				"FAAC is based on the ISO MPEG-4 reference code. For this code base the\n"				"following license applies:\n"				"\n"/*				"This software module was originally developed by\n"				"\n"				"FirstName LastName (CompanyName)\n"				"\n"				"and edited by\n"				"\n"				"FirstName LastName (CompanyName)\n"				"FirstName LastName (CompanyName)\n"				"\n"*/				"in the course of development of the MPEG-2 NBC/MPEG-4 Audio standard\n"				"ISO/IEC 13818-7, 14496-1,2 and 3. This software module is an\n"				"implementation of a part of one or more MPEG-2 NBC/MPEG-4 Audio tools\n"				"as specified by the MPEG-2 NBC/MPEG-4 Audio standard. ISO/IEC gives\n"				"users of the MPEG-2 NBC/MPEG-4 Audio standards free license to this\n"				"software module or modifications thereof for use in hardware or\n"				"software products claiming conformance to the MPEG-2 NBC/ MPEG-4 Audio\n"				"standards. Those intending to use this software module in hardware or\n"				"software products are advised that this use may infringe existing\n"				"patents. The original developer of this software module and his/her\n"				"company, the subsequent editors and their companies, and ISO/IEC have\n"				"no liability for use of this software module or modifications thereof\n"				"in an implementation. Copyright is not released for non MPEG-2\n"				"NBC/MPEG-4 Audio conforming products. The original developer retains\n"				"full right to use the code for his/her own purpose, assign or donate\n"				"the code to a third party and to inhibit third party from using the\n"				"code for non MPEG-2 NBC/MPEG-4 Audio conforming products. This\n"				"copyright notice must be included in all copies or derivative works.\n"				"\n"				"Copyright (c) 1997.\n"				"\n"				"For the changes made for the FAAC project the GNU Lesser General Public\n"				"License (LGPL), version 2 1991 applies:\n"				"\n"				"FAAC - Freeware Advanced Audio Coder\n"				"Copyright (C) 2001-2004 The individual contributors\n"				"\n"				"This library is free software; you can redistribute it and/or modify it under the terms of\n"				"the GNU Lesser General Public License as published by the Free Software Foundation;\n"				"either version 2.1 of the License, or (at your option) any later version.\n"				"\n"				"This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n"				"without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"				"See the GNU Lesser General Public License for more details.\n"				"\n"				"You should have received a copy of the GNU Lesser General Public\n"				"License along with this library; if not, write to the Free Software\n"				"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n";				MessageBox(hWndDlg,license,"FAAC libray License",MB_OK|MB_ICONINFORMATION);			}			break;#ifdef USE_OUTPUT_FOLDER		case IDC_BTN_BROWSE:			{			BROWSEINFO bi;			ITEMIDLIST *idlist;				GetDlgItemText(hWndDlg, IDC_E_BROWSE, config_AACoutdir, MAX_PATH);				bi.hwndOwner = hWndDlg;				bi.pidlRoot = 0;				bi.pszDisplayName = config_AACoutdir;				bi.lpszTitle = "Select a directory for aac/mp4 file output:";				bi.ulFlags = BIF_RETURNONLYFSDIRS;				bi.lpfn = BrowseCallbackProc;				bi.lParam = (LPARAM)config_AACoutdir;								idlist = SHBrowseForFolder(&bi);				if(idlist)				{					SHGetPathFromIDList(idlist, config_AACoutdir);					SetDlgItemText(hWndDlg, IDC_E_BROWSE, config_AACoutdir);				}			}			break;#endif					case IDC_BTN_ARTFILE:			{			OPENFILENAME ofn;			char ArtFilename[MAX_PATH]="";				GetDlgItemText(hWndDlg, IDC_E_ARTFILE, ArtFilename, MAX_PATH);				ofn.lStructSize			= sizeof(OPENFILENAME);				ofn.hwndOwner			= (HWND)hWndDlg;				ofn.lpstrFilter			= "Cover art files (*.gif,*jpg,*.png)\0*.gif;*.jpg;*.png\0";				ofn.lpstrCustomFilter	= NULL;				ofn.nFilterIndex		= 1;				ofn.lpstrFile			= ArtFilename;				ofn.nMaxFile			= MAX_PATH; //sizeof ArtFilename;				ofn.lpstrFileTitle		= NULL;				ofn.nMaxFileTitle		= 0;				ofn.lpstrInitialDir		= NULL;				ofn.lpstrTitle			= "Select cover art file";				ofn.Flags				= OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_ENABLESIZING;				ofn.lpstrDefExt			= NULL;//"jpg";				ofn.hInstance			= hInstance;				if(GetOpenFileName(&ofn))					SetDlgItemText(hWndDlg, IDC_E_ARTFILE, ArtFilename);			}			break;#ifdef USE_IMPORT_TAG		case IDC_BTN_BROWSEIMPORT:			{			char path[MAX_PATH];			BROWSEINFO bi;			ITEMIDLIST *idlist;				GetDlgItemText(hWndDlg, IDC_E_SOURCEPATH, path, MAX_PATH);				bi.hwndOwner = hWndDlg;				bi.pidlRoot = 0;				bi.pszDisplayName = path;				bi.lpszTitle = "Select the folder where source files are stored:";				bi.ulFlags = BIF_RETURNONLYFSDIRS;				bi.lpfn = BrowseCallbackProc;				bi.lParam = (LPARAM)path;								idlist=SHBrowseForFolder(&bi);				if(idlist)				{					SHGetPathFromIDList(idlist, path);					SetDlgItemText(hWndDlg, IDC_E_SOURCEPATH, path);				}			}			break;#endif					case IDC_RADIO_MPEG4:			EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_LTP), !IsDlgButtonChecked(hWndDlg,IDC_CHK_AUTOCFG));			break;					case IDC_RADIO_MPEG2:			EnableWindow(GetDlgItem(hWndDlg, IDC_RADIO_LTP), FALSE);			DISABLE_LTP			break;		case IDC_CHK_AUTOCFG:			{			BYTE Enabled=IsDlgButtonChecked(hWndDlg,IDC_CHK_AUTOCFG);				DISABLE_CTRLS_ENC(!Enabled);				if(!Enabled)					SendMessage(hWndDlg, WM_INITDIALOG, 0L, 0L);				else				{					SetDlgItemInt(hWndDlg, IDC_CB_QUALITY, DEF_QUALITY, FALSE);					SetDlgItemInt(hWndDlg, IDC_CB_BITRATE, DEF_BITRATE, FALSE);					SetDlgItemInt(hWndDlg, IDC_CB_BANDWIDTH, DEF_BANDWIDTH, FALSE);					CheckDlgButton(hWndDlg,IDC_RADIO_MPEG4,FALSE);					CheckDlgButton(hWndDlg,IDC_RADIO_MPEG2,FALSE);					if(DEF_MPEGVER==MPEG4)						CheckDlgButton(hWndDlg,IDC_RADIO_MPEG4,TRUE);					else						CheckDlgButton(hWndDlg,IDC_RADIO_MPEG2,TRUE);										CheckDlgButton(hWndDlg,IDC_RADIO_MAIN,FALSE);					CheckDlgButton(hWndDlg,IDC_RADIO_LOW,FALSE);					CheckDlgButton(hWndDlg,IDC_RADIO_SSR,FALSE);					CheckDlgButton(hWndDlg,IDC_RADIO_LTP,FALSE);					switch(DEF_PROFILE)					{					case MAIN:						CheckDlgButton(hWndDlg,IDC_RADIO_MAIN,TRUE);						break;					case LOW:						CheckDlgButton(hWndDlg,IDC_RADIO_LOW,TRUE);						break;					case SSR:						CheckDlgButton(hWndDlg,IDC_RADIO_SSR,TRUE);						break;					case LTP:						CheckDlgButton(hWndDlg,IDC_RADIO_LTP,TRUE);						DISABLE_LTP						break;					}										CheckDlgButton(hWndDlg,IDC_RADIO_RAW,FALSE);					CheckDlgButton(hWndDlg,IDC_RADIO_ADTS,FALSE);					switch(DEF_HEADER)					{					case RAW:						CheckDlgButton(hWndDlg,IDC_RADIO_RAW,TRUE);						break;					case ADTS:						CheckDlgButton(hWndDlg,IDC_RADIO_ADTS,TRUE);						break;					}										CheckDlgButton(hWndDlg, IDC_CHK_ALLOWMIDSIDE, DEF_MIDSIDE);					CheckDlgButton(hWndDlg, IDC_CHK_USETNS, DEF_TNS);					CheckDlgButton(hWndDlg, IDC_CHK_USELFE, DEF_LFE);					if(DEF_USEQUALTY)						CheckDlgButton(hWndDlg,IDC_RADIO_QUALITY,true);					else						CheckDlgButton(hWndDlg,IDC_RADIO_BITRATE,true);					if(DEF_QUALITY<10)						SetDlgItemInt(hWndDlg, IDC_CB_QUALITY, 10, FALSE);					else						if(DEF_QUALITY>500)							SetDlgItemInt(hWndDlg, IDC_CB_QUALITY, 500, FALSE);						else							SetDlgItemInt(hWndDlg, IDC_CB_QUALITY, DEF_QUALITY, FALSE);					switch(DEF_BITRATE)					{					case 0:						SendMessage(GetDlgItem(hWndDlg, IDC_CB_BITRATE), CB_SETCURSEL, 0, 0);//						SetDlgItemInt(hWndDlg, IDC_CB_BITRATE, 128, FALSE);						break;					default:						SetDlgItemInt(hWndDlg, IDC_CB_BITRATE, DEF_BITRATE, FALSE);						break;					}					switch(DEF_BANDWIDTH)					{					case 0:						SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_SETCURSEL, 0, 0);						break;					case 0xffffffff:						SendMessage(GetDlgItem(hWndDlg, IDC_CB_BANDWIDTH), CB_SETCURSEL, 1, 0);						break;					default:						SetDlgItemInt(hWndDlg, IDC_CB_BANDWIDTH, DEF_BANDWIDTH, FALSE);						break;					}										SendMessage(GetDlgItem(hWndDlg, IDC_CB_EXT), CB_SETCURSEL, DEF_WRITEMP4, 0);//					DISABLE_CTRLS_ENC(!Enabled);				}			}			break;		case IDC_CHK_TAG:		case IDC_CB_EXT:			{			char TagImport=IsDlgButtonChecked(hWndDlg,IDC_CHK_IMPORTTAG);			char TagEnabled=IsDlgButtonChecked(hWndDlg,IDC_CHK_TAG);				ENABLE_TAG(TagEnabled && !TagImport);			char Enabled=SendMessage(GetDlgItem(hWndDlg, IDC_CB_EXT), CB_GETCURSEL, 0, 0)!=0;				ENABLE_AACTAGS(TagEnabled && !TagImport && Enabled);			}			break;#ifdef USE_IMPORT_TAG		case IDC_CHK_IMPORTTAG:			SendMessage(hWndDlg, WM_COMMAND, IDC_CHK_TAG, 0);			break;#endif		}		break; // End of WM_COMMAND	default: 		return FALSE;	}		return TRUE;} // End of DIALOGSMsgProc                                      

⌨️ 快捷键说明

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