16
16
* License along with this library; if not, write to the Free Software
17
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
* $Id: maingui.c,v 1.20 2003/03/27 17:11:33 knik Exp $
19
* $Id: maingui.c,v 1.21 2007/03/19 19:57:40 menno Exp $
22
22
#include <windows.h>
93
93
unsigned int sampleRate, numChannels;
96
if ((infile = wav_open_read(inputFilename)) == NULL)
96
if ((infile = wav_open_read(inputFilename, 0)) == NULL)
99
99
/* determine input file parameters */
131
131
GetDlgItemText(hWnd, IDC_OUTPUTFILENAME, outputFilename, sizeof(outputFilename));
133
133
/* open the input file */
134
if ((infile = wav_open_read(inputFilename)) != NULL)
134
if ((infile = wav_open_read(inputFilename, 0)) != NULL)
136
136
/* determine input file parameters */
137
137
unsigned int sampleRate = infile->samplerate;
204
204
unsigned int bytesInput = 0;
205
205
DWORD numberOfBytesWritten = 0;
207
207
unsigned char *bitbuf;
208
208
char HeaderText[50];
209
209
char Percentage[5];
211
pcmbuf = (short*)LocalAlloc(0, inputSamples*sizeof(short));
211
pcmbuf = (short*)LocalAlloc(0, inputSamples*sizeof(int));
212
212
bitbuf = (unsigned char*)LocalAlloc(0, maxOutputBytes*sizeof(unsigned char));
214
214
SendDlgItemMessage(hWnd, IDC_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM(0, 1024));
219
219
int bytesWritten;
220
220
UINT timeElapsed, timeEncoded;
222
bytesInput = wav_read_short(infile, pcmbuf, inputSamples) * sizeof(short);
222
bytesInput = wav_read_int24(infile, pcmbuf, inputSamples, NULL) * sizeof(int);
224
SendDlgItemMessage (hWnd, IDC_PROGRESS, PBM_SETPOS, (unsigned long)((float)totalBytesRead * 1024.0f / (infile->samples*2*numChannels)), 0);
224
SendDlgItemMessage (hWnd, IDC_PROGRESS, PBM_SETPOS, (unsigned long)((float)totalBytesRead * 1024.0f / (infile->samples*sizeof(int)*numChannels)), 0);
226
226
/* Percentage for Dialog Output */
227
_itoa((int)((float)totalBytesRead * 100.0f / (infile->samples*2*numChannels)),Percentage,10);
227
_itoa((int)((float)totalBytesRead * 100.0f / (infile->samples*sizeof(int)*numChannels)),Percentage,10);
228
228
lstrcpy(HeaderText,"FAAC GUI: ");
229
229
lstrcat(HeaderText,Percentage);
230
230
lstrcat(HeaderText,"%");
233
233
totalBytesRead += bytesInput;
235
235
timeElapsed = (GetTickCount () - startTime) / 10;
236
timeEncoded = 100.0 * totalBytesRead / (sampleRate * numChannels * sizeof (short));
236
timeEncoded = 100.0 * totalBytesRead / (sampleRate * numChannels * sizeof (int));
238
238
if (timeElapsed > (lastUpdated + 20))
335
335
SendMessage(GetDlgItem(hWnd, IDC_MPEGVERSION), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"MPEG4");
336
336
SendMessage(GetDlgItem(hWnd, IDC_MPEGVERSION), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"MPEG2");
337
SendMessage(GetDlgItem(hWnd, IDC_MPEGVERSION), CB_SETCURSEL, 1, 0);
337
SendMessage(GetDlgItem(hWnd, IDC_MPEGVERSION), CB_SETCURSEL, 0, 0);
339
SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"Main");
339
// SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"Main");
340
340
SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"Low Complexity");
341
SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"LTP");
342
SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_SETCURSEL, 1, 0);
341
// SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_ADDSTRING, 0, (LPARAM)(LPCTSTR)"LTP");
342
SendMessage(GetDlgItem(hWnd, IDC_OBJECTTYPE), CB_SETCURSEL, 0, 0);
344
344
CheckDlgButton(hWnd, IDC_ALLOWMIDSIDE, TRUE);
345
345
CheckDlgButton(hWnd, IDC_USELFE, FALSE);