From 21cbbdc3e70873997a553f03e019f8235f1ed203 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Fri, 17 Dec 2021 04:26:11 +0300
Subject: [PATCH 10/24] EXPERIMENTAL: bdcreate: add m2ts profiles, part 1

---
 cinelerra-5.1/cinelerra/bdcreate.C   | 31 ++++++++++++++++++++++++++++
 cinelerra-5.1/cinelerra/bdcreate.h   | 14 +++++++++++++
 cinelerra-5.1/cinelerra/bdcreate.inc |  1 +
 3 files changed, 46 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C
index 20a953e2..67745a8d 100644
--- a/cinelerra-5.1/cinelerra/bdcreate.C
+++ b/cinelerra-5.1/cinelerra/bdcreate.C
@@ -66,6 +66,7 @@ static struct bd_profile {
 	const char *name;
 } bd_profiles[] = {
 	{"bluray.m2ts"},
+	{"bluray_lpcm.m2ts"},
 };
 
 
@@ -211,6 +212,7 @@ CreateBD_Thread::CreateBD_Thread(MWindow *mwindow)
 	this->use_resize_tracks = 0;
 	this->use_labeled = 0;
 	this->use_farmed = 0;
+	this->use_termux = 0;
 
 	this->bd_size = BD_SIZE;
 	this->bd_width = BD_WIDTH;
@@ -453,6 +455,7 @@ BC_Window* CreateBD_Thread::new_gui()
 	use_resize_tracks = 0;
 	use_labeled = 0;
 	use_farmed = 0;
+	use_termux = 0;
 	use_standard = !strcmp(mwindow->default_std(),"NTSC") ?
 		 BD_1920x1080_2997i : BD_1920x1080_25i;
 	bd_size = BD_SIZE;
@@ -728,6 +731,7 @@ CreateBD_GUI::CreateBD_GUI(CreateBD_Thread *thread, int x, int y, int w, int h)
 	disk_space = 0;
 	standard = 0;
 	scale = 0;
+	profile = 0;
 	need_deinterlace = 0;
 	need_inverse_telecine = 0;
 	need_resize_tracks = 0;
@@ -785,6 +789,18 @@ void CreateBD_GUI::create_objects()
 	media_size->update(media_sizes[0]->get_text());
 	disk_space->update();
 	y += disk_space->get_h() + pady/2;
+	
+	title = new BC_Title(x, y, _("Profile:"), MEDIUMFONT, YELLOW);
+	add_subwindow(title);
+	y +=  title->get_h()+pady;
+	profile = new CreateBD_Profile(this, x1, y);
+	profile->create_objects();
+	profiles.append(new BC_ListBoxItem("bluray.m2ts"));
+	profiles.append(new BC_ListBoxItem("bluray_lpcm.m2ts"));
+	profile->update_list(&profiles);
+	profile->update(profiles[0]->get_text());
+	
+	
 	title = new BC_Title(x, y, _("Format:"), MEDIUMFONT, YELLOW);
 	add_subwindow(title);
 	standard = new CreateBD_Format(this, title->get_w() + padx, y);
@@ -1128,3 +1144,18 @@ int CreateBD_MediaSize::handle_event()
 	return 1;
 }
 
+CreateBD_Profile::CreateBD_Profile(CreateBD_GUI *gui, int x, int y)
+ : BC_PopupTextBox(gui, 0, 0, x, y, xS(70),yS(50))
+{
+	this->gui = gui;
+}
+
+CreateBD_Profile::~CreateBD_Profile()
+{
+}
+
+int CreateBD_Profile::handle_event()
+{
+	return 1;
+}
+
diff --git a/cinelerra-5.1/cinelerra/bdcreate.h b/cinelerra-5.1/cinelerra/bdcreate.h
index 89ee83bb..81f11120 100644
--- a/cinelerra-5.1/cinelerra/bdcreate.h
+++ b/cinelerra-5.1/cinelerra/bdcreate.h
@@ -62,6 +62,7 @@ public:
 	int use_wide_audio, use_farmed;
 	int use_histogram, use_labeled;
 	int use_standard;
+	int use_termux;
 
 	int64_t bd_size;
 	int bd_width;
@@ -232,6 +233,8 @@ public:
 	CreateBD_OK *ok;
 	int cancel_x, cancel_y, cancel_w, cancel_h;
 	CreateBD_Cancel *cancel;
+	ArrayList<BC_ListBoxItem *> profiles;
+	CreateBD_Profile *profile;
 };
 
 class CreateBD_FormatItem : public BC_MenuItem
@@ -290,4 +293,15 @@ public:
 	CreateBD_GUI *gui;
 };
 
+class CreateBD_Profile : public BC_PopupTextBox
+{
+public:
+	CreateBD_Profile(CreateBD_GUI *gui, int x, int y);
+	~CreateBD_Profile();
+	int handle_event();
+
+	CreateBD_GUI *gui;
+};
+
+
 #endif
diff --git a/cinelerra-5.1/cinelerra/bdcreate.inc b/cinelerra-5.1/cinelerra/bdcreate.inc
index d44320c6..5db9568b 100644
--- a/cinelerra-5.1/cinelerra/bdcreate.inc
+++ b/cinelerra-5.1/cinelerra/bdcreate.inc
@@ -41,5 +41,6 @@ class CreateBD_GUI;
 class CreateBD_FormatItem;
 class CreateBD_Format;
 class CreateBD_MediaSize;
+class CreateBD_Profile;
 
 #endif
-- 
2.34.1

