shithub: aacenc

Download patch

ref: fb8a80fe67f1f45374b735f15a2a49ed0c9bdf8c
parent: 2fbc12a1a1ee88dc8e023bcdb71a6e6f440781aa
author: menno <menno>
date: Wed Feb 28 14:09:56 EST 2001

Support for TNS in frontends

--- a/frontend/faacgui.rc
+++ b/frontend/faacgui.rc
@@ -86,7 +86,9 @@
     LTEXT           "bps/ch",IDC_STATIC,218,76,24,8
     LTEXT           "Hz",IDC_STATIC,218,96,10,8
     CONTROL         "Use LFE channel",IDC_USELFE,"Button",BS_AUTOCHECKBOX | 
-                    BS_LEFTTEXT | WS_DISABLED | WS_TABSTOP,13,89,71,10
+                    BS_LEFTTEXT | WS_DISABLED | WS_TABSTOP,13,102,71,10
+    CONTROL         "Use TNS",IDC_USETNS,"Button",BS_AUTOCHECKBOX | 
+                    BS_LEFTTEXT | WS_TABSTOP,13,90,71,10
 END
 
 
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: main.c,v 1.5 2001/02/26 13:55:29 oxygene Exp $
+ * $Id: main.c,v 1.6 2001/02/28 19:09:56 menno Exp $
  */
 
 #ifdef _WIN32
@@ -77,6 +77,7 @@
 		printf("USAGE: %s -options infile outfile\n", argv[0]);
 		printf("Options:\n");
 		printf("  -nm   Don\'t use mid/side coding\n");
+		printf("  -tns  Use TNS coding\n");
 		printf("  -bwX  Set the bandwidth, X in Hz\n");
 		printf("  -brX  Set the bitrate per channel, X in bps\n\n");
 		return 1;
@@ -117,6 +118,10 @@
 		for (i = 1; i < argc-2; i++) {
 			if ((argv[i][0] == '-') || (argv[i][0] == '/')) {
 				switch(argv[i][1]) {
+				case 't': case 'T':
+					if ((argv[i][2] == 'n') || (argv[i][2] == 'N'))
+						myFormat->useTns = 1;
+				break;
 				case 'n': case 'N':
 					if ((argv[i][2] == 'm') || (argv[i][2] == 'M'))
 						myFormat->allowMidside = 0;
--- a/frontend/maingui.c
+++ b/frontend/maingui.c
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: maingui.c,v 1.6 2001/02/25 18:41:16 menno Exp $
+ * $Id: maingui.c,v 1.7 2001/02/28 19:09:56 menno Exp $
  */
 
 #include <windows.h>
@@ -137,6 +137,7 @@
 		config = faacEncGetCurrentConfiguration(hEncoder);
 
 		config->allowMidside = IsDlgButtonChecked(hWnd, IDC_ALLOWMIDSIDE) == BST_CHECKED ? 1 : 0;
+		config->useTns = IsDlgButtonChecked(hWnd, IDC_USETNS) == BST_CHECKED ? 1 : 0;
 		GetDlgItemText(hWnd, IDC_BITRATE, szTemp, sizeof(szTemp));
 		config->bitRate = atoi(szTemp);
 		GetDlgItemText(hWnd, IDC_BANDWIDTH, szTemp, sizeof(szTemp));
@@ -177,6 +178,7 @@
 			faacEncConfigurationPtr config = faacEncGetCurrentConfiguration(hEncoder);
 
 			config->allowMidside = IsDlgButtonChecked(hWnd, IDC_ALLOWMIDSIDE) == BST_CHECKED ? 1 : 0;
+			config->useTns = IsDlgButtonChecked(hWnd, IDC_USETNS) == BST_CHECKED ? 1 : 0;
 			config->useLfe = IsDlgButtonChecked(hWnd, IDC_USELFE) == BST_CHECKED ? 1 : 0;
 			GetDlgItemText(hWnd, IDC_BITRATE, szTemp, sizeof(szTemp));
 			config->bitRate = atoi(szTemp);
@@ -314,6 +316,7 @@
 
 		CheckDlgButton(hWnd, IDC_ALLOWMIDSIDE, TRUE);
 		CheckDlgButton(hWnd, IDC_USELFE, FALSE);
+		CheckDlgButton(hWnd, IDC_USETNS, TRUE);
 		SetDlgItemText(hWnd, IDC_BITRATE, "64000");
 		SetDlgItemText(hWnd, IDC_BANDWIDTH, "18000");
 
--- a/frontend/resource.h
+++ b/frontend/resource.h
@@ -14,6 +14,7 @@
 #define IDC_BANDWIDTH                   1009
 #define IDC_BITRATE                     1010
 #define IDC_USELFE                      1011
+#define IDC_USETNS                      1012
 
 // Next default values for new objects
 //