{ "1280x720 50p", 1280,720, 50., 1, ILACE_MODE_NOTINTERLACED },
{ "1280x720 24p", 1280,720, 24., 1, ILACE_MODE_NOTINTERLACED },
{ "1280x720 23.976p", 1280,720, 23.976, 1, ILACE_MODE_NOTINTERLACED },
+ { "720x576 25i", 720,576, 25., 0, ILACE_MODE_BOTTOM_FIRST },
{ "720x576 25p*", 720,576, 25., 0, ILACE_MODE_NOTINTERLACED },
- { "720x576 25i", 720,576, 25., 0, ILACE_MODE_TOP_FIRST },
- { "720x480 29.97p*", 720,480, 29.97, 0, ILACE_MODE_NOTINTERLACED },
{ "720x480 29.97i", 720,480, 29.97, 0, ILACE_MODE_BOTTOM_FIRST },
+ { "720x480 29.97p*", 720,480, 29.97, 0, ILACE_MODE_NOTINTERLACED },
};
const int64_t CreateBD_Thread::BD_SIZE = 25000000000;
close_window();
}
-void CreateBD_Thread::get_udfs_mount(char *udfs, char *mopts, char *mntpt)
+int CreateBD_Thread::get_udfs_mount(char *udfs, char *mopts, char *mntpt)
{
+ int ret = 0;
// default: mount -t udf -o loop $1/bd.udfs $1/udfs
strcpy(udfs,"$1/bd.udfs");
strcpy(mopts,"-t udf -o loop $1/bd.udfs ");
strcpy(mntpt,"$1/udfs");
const char *home = getenv("HOME");
- if( !home ) return;
+ if( !home ) return ret;
FILE *fp = fopen("/etc/fstab","r");
- if( !fp ) return;
+ if( !fp ) return ret;
int len = strlen(home);
char line[BCTEXTLEN], typ[BCTEXTLEN], file[BCTEXTLEN];
char mpnt[BCTEXTLEN], opts[BCTEXTLEN];
strcpy(udfs, file);
strcpy(mopts, "");
strcpy(mntpt, mpnt);
+ ret = 1;
break;
}
}
fclose(fp);
+ return ret;
}
int CreateBD_Thread::create_bd_jobs(ArrayList<BatchRenderJob*> *jobs, const char *asset_dir)
return 1;
}
char udfs[BCTEXTLEN], mopts[BCTEXTLEN], mntpt[BCTEXTLEN];
- get_udfs_mount(udfs, mopts, mntpt);
+ int is_usr_mnt = get_udfs_mount(udfs, mopts, mntpt);
const char *exec_path = File::get_cinlib_path();
fprintf(fp,"#!/bin/bash -ex\n");
fprintf(fp,"PATH=$PATH:%s\n",exec_path);
fprintf(fp,"mount %s%s\n", mopts, mntpt);
fprintf(fp,"bdwrite %s $1/bd.m2ts\n",mntpt);
fprintf(fp,"umount %s\n",mntpt);
+ if( is_usr_mnt )
+ fprintf(fp,"mv -f %s $1/bd.udfs\n", udfs);
fprintf(fp,"echo To burn bluray, load writable media and run:\n");
- fprintf(fp,"echo for WORM: growisofs -dvd-compat -Z /dev/bd=%s\n", udfs);
- fprintf(fp,"echo for RW: dd if=%s of=/dev/bd bs=2048000\n",udfs);
+ fprintf(fp,"echo for WORM: growisofs -dvd-compat -Z /dev/bd=$1/bd.udfs\n");
+ fprintf(fp,"echo for RW: dd if=$1/bd.udfs of=/dev/bd bs=2048000\n");
fprintf(fp,"kill $$\n");
fprintf(fp,"\n");
fclose(fp);
static const int BD_MAX_BITRATE, BD_CHANNELS, BD_WIDE_CHANNELS;
static const double BD_FRAMERATE, BD_SAMPLERATE, BD_KAUDIO_RATE;
static const int BD_INTERLACE_MODE;
- static void get_udfs_mount(char *udfs, char *mopts, char *mntpt);
+ static int get_udfs_mount(char *udfs, char *mopts, char *mntpt);
public:
CreateBD_Thread(MWindow *mwindow);
~CreateBD_Thread();
#include "theme.h"
-
-
BrowseButton::BrowseButton(Theme *theme,
BC_WindowBase *parent_window,
BC_TextBox *textbox,
void BrowseButton::run()
{
BrowseButtonWindow browsewindow(theme,
- this,
+ get_x() - BC_WindowBase::get_resources()->filebox_w / 2,
+ get_y() - BC_WindowBase::get_resources()->filebox_h / 2,
parent_window,
textbox->get_text(),
title,
startup_lock->unlock();
}
-
-
-
-
-
-BrowseButtonWindow::BrowseButtonWindow(Theme *theme,
- BrowseButton *button,
- BC_WindowBase *parent_window,
- const char *init_directory,
- const char *title,
- const char *caption,
- int want_directory)
- : BC_FileBox(button->x -
- BC_WindowBase::get_resources()->filebox_w / 2,
- button->y -
- BC_WindowBase::get_resources()->filebox_h / 2,
- init_directory,
- title,
- caption,
-// Set to 1 to get hidden files.
- want_directory,
-// Want only directories
- want_directory,
- 0,
- theme->browse_pad)
+BrowseButtonWindow::BrowseButtonWindow(Theme *theme, int x, int y,
+ BC_WindowBase *parent_window, const char *init_directory,
+ const char *title, const char *caption, int want_directory)
+ : BC_FileBox(x, y, init_directory, title, caption,
+ want_directory, // Set to 1 to get hidden files.
+ want_directory, // Want only directories
+ 0, theme->browse_pad)
{
}
{
public:
BrowseButtonWindow(Theme *theme,
- BrowseButton *button,
+ int x, int y,
BC_WindowBase *parent_window,
const char *init_directory,
const char *title,
void ColorWindow::change_values()
{
- float r = ((thread->output & 0xff0000) >> 16) / 255.;
- float g = ((thread->output & 0xff00) >> 8) / 255.;
- float b = ((thread->output & 0xff)) / 255.;
+ float r = ((thread->output>>16) & 0xff) / 255.;
+ float g = ((thread->output>>8) & 0xff) / 255.;
+ float b = ((thread->output>>0) & 0xff) / 255.;
rgb.r = r; rgb.g = g; rgb.b = b;
aph = (float)thread->alpha / 255;
update_rgb(rgb.r, rgb.g, rgb.b);
int PaletteWheel::button_press_event()
{
- if(get_cursor_x() >= 0 && get_cursor_x() < get_w() &&
+ if( get_cursor_x() >= 0 && get_cursor_x() < get_w() &&
get_cursor_y() >= 0 && get_cursor_y() < get_h() &&
- is_event_win())
- {
+ is_event_win() ) {
button_down = 1;
cursor_motion_event();
return 1;
int PaletteWheel::cursor_motion_event()
{
int x1, y1, distance;
- if(button_down && is_event_win())
- {
- window->hsv.h = get_angle(get_w() / 2,
- get_h() / 2,
- get_cursor_x(),
- get_cursor_y());
+ if( button_down && is_event_win() ) {
+ float h = get_angle(get_w()/2, get_h()/2, get_cursor_x(), get_cursor_y());
+ bclamp(h, 0, 359.999); window->hsv.h = h;
x1 = get_w() / 2 - get_cursor_x();
y1 = get_h() / 2 - get_cursor_y();
distance = (int)sqrt(x1 * x1 + y1 * y1);
- if(distance > get_w() / 2) distance = get_w() / 2;
- window->hsv.s = (float)distance / (get_w() / 2);
+ float s = (float)distance / (get_w() / 2);
+ bclamp(s, 0, 1); window->hsv.s = s;
window->update_hsv();
window->update_display();
window->handle_event();
int PaletteWheel::button_release_event()
{
- if(button_down)
- {
+ if( button_down ) {
button_down = 0;
return 1;
}
{
// Upper right
//printf("PaletteWheel::create_objects 1\n");
- float h;
- float s;
- float v = 1;
+ float h, s, v = 1;
float r, g, b;
float x1, y1, x2, y2;
float distance;
int highlight_g = (get_resources()->button_light & 0xff00) >> 8;
int highlight_b = (get_resources()->button_light & 0xff);
- for(y2 = 0; y2 < get_h(); y2++)
- {
+ for( y2 = 0; y2 < get_h(); y2++ ) {
unsigned char *row = (unsigned char*)frame.get_rows()[(int)y2];
- for(x2 = 0; x2 < get_w(); x2++)
- {
+ for( x2 = 0; x2 < get_w(); x2++ ) {
distance = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
- if(distance > x1)
- {
+ if( distance > x1 ) {
row[(int)x2 * 4] = default_r;
row[(int)x2 * 4 + 1] = default_g;
row[(int)x2 * 4 + 2] = default_b;
row[(int)x2 * 4 + 3] = 0;
}
else
- if(distance > x1 - 1)
- {
+ if( distance > x1 - 1 ) {
int r_i, g_i, b_i;
- if(get_h() - y2 < x2)
- {
+ if( get_h() - y2 < x2 ) {
r_i = highlight_r;
g_i = highlight_g;
b_i = highlight_b;
}
- else
- {
+ else {
r_i = 0;
g_i = 0;
b_i = 0;
row[(int)x2 * 4 + 2] = b_i;
row[(int)x2 * 4 + 3] = 255;
}
- else
- {
+ else {
h = get_angle(x1, y1, x2, y2);
s = distance / x1;
HSV::hsv_to_rgb(r, g, b, h, s, v);
x = w = get_w() / 2;
y = h = get_h() / 2;
- if(hue > 0 && hue < 90)
- {
+ if( hue > 0 && hue < 90 ) {
x = (int)(w - w * cos(torads(90 - hue)) * saturation);
y = (int)(h - h * sin(torads(90 - hue)) * saturation);
}
- else
- if(hue > 90 && hue < 180)
- {
+ else if( hue > 90 && hue < 180 ) {
x = (int)(w - w * cos(torads(hue - 90)) * saturation);
y = (int)(h + h * sin(torads(hue - 90)) * saturation);
}
- else
- if(hue > 180 && hue < 270)
- {
+ else if( hue > 180 && hue < 270 ) {
x = (int)(w + w * cos(torads(270 - hue)) * saturation);
y = (int)(h + h * sin(torads(270 - hue)) * saturation);
}
- else
- if(hue > 270 && hue < 360)
- {
+ else if( hue > 270 && hue < 360 ) {
x = (int)(w + w * cos(torads(hue - 270)) * saturation);
y = (int)(h - w * sin(torads(hue - 270)) * saturation);
}
- else
- if(hue == 0)
- {
+ else if( hue == 0 ) {
x = w;
y = (int)(h - h * saturation);
}
- else
- if(hue == 90)
- {
+ else if( hue == 90 ) {
x = (int)(w - w * saturation);
y = h;
}
- else
- if(hue == 180)
- {
+ else if( hue == 180 ) {
x = w;
y = (int)(h + h * saturation);
}
- else
- if(hue == 270)
- {
+ else if( hue == 270 ) {
x = (int)(w + w * saturation);
y = h;
}
int PaletteWheel::get_angle(float x1, float y1, float x2, float y2)
{
float result = -atan2(x2 - x1, y1 - y2) * (360 / M_PI / 2);
- if (result < 0)
+ if( result < 0 )
result += 360;
return (int)result;
}
int PaletteWheelValue::button_press_event()
{
//printf("PaletteWheelValue::button_press 1 %d\n", is_event_win());
- if(get_cursor_x() >= 0 && get_cursor_x() < get_w() &&
+ if( get_cursor_x() >= 0 && get_cursor_x() < get_w() &&
get_cursor_y() >= 0 && get_cursor_y() < get_h() &&
- is_event_win())
- {
+ is_event_win() ) {
//printf("PaletteWheelValue::button_press 2\n");
button_down = 1;
cursor_motion_event();
int PaletteWheelValue::cursor_motion_event()
{
- if(button_down && is_event_win())
- {
+ if( button_down && is_event_win() ) {
//printf("PaletteWheelValue::cursor_motion 1\n");
- window->hsv.v = 1.0 - (float)(get_cursor_y() - 2) / (get_h() - 4);
+ float v = 1.0 - (float)(get_cursor_y() - 2) / (get_h() - 4);
+ bclamp(v, 0, 1); window->hsv.v = v;
window->update_hsv();
window->update_display();
window->handle_event();
int PaletteWheelValue::button_release_event()
{
- if(button_down)
- {
+ if( button_down ) {
//printf("PaletteWheelValue::button_release 1\n");
button_down = 0;
return 1;
float r_f, g_f, b_f;
int i, j, r, g, b;
- for(i = get_h() - 3; i >= 2; i--)
- {
+ for( i = get_h() - 3; i >= 2; i-- ) {
unsigned char *row = (unsigned char*)frame->get_rows()[i];
HSV::hsv_to_rgb(r_f, g_f, b_f, hue, saturation,
1.0 - (float)(i - 2) / (get_h() - 4));
r = (int)(r_f * 255);
g = (int)(g_f * 255);
b = (int)(b_f * 255);
- for(j = 0; j < get_w(); j++)
- {
+ for( j = 0; j < get_w(); j++ ) {
row[j * 3] = r;
row[j * 3 + 1] = g;
row[j * 3 + 2] = b;
this->window = window;
this->output = &output;
set_increment(0.01);
+ set_precision(2);
}
PalletteNum::~PalletteNum()
len = !cp ? strlen(path) : cp-path;
char index_path[BCTEXTLEN], plugin_path[BCTEXTLEN];
memcpy(plugin_path, path, len); plugin_path[len] = 0;
+ if( cp ) ++len;
char *plugin_dir = FileSystem::basepath(plugin_path);
strcpy(plugin_path, plugin_dir); delete [] plugin_dir;
create_defaults_path(index_path, LADSPA_FILE);
color_trc=gamma28
colorspace=bt470bg
# must be last for bdcreate.C
-x264opts cabac=1:keyint=25:min-keyint=4:qpmin=3:qpmax=33:qp_step=4:merange=8:tff
+x264opts cabac=1:keyint=25:min-keyint=4:qpmin=3:qpmax=33:qp_step=4:merange=8:bff
*/
#include "bcdisplayinfo.h"
+#include "bcdialog.h"
#include "bcsignals.h"
#include "browsebutton.h"
#include "clip.h"
TitleWindow::~TitleWindow()
{
ungrab(client->server->mwindow->cwindow->gui);
- delete fonts_popup;
+ delete color_popup;
+ delete png_popup;
for( int i=0; i<fonts.size(); ++i )
delete fonts[i]->get_icon();
x += background_path->get_w() + margin;
add_tool(background_browse = new BrowseButton(
client->server->mwindow->theme, this, background_path,
- x, y, 0, _("background media"), _("Select background media path")));
+ x, y, "", _("background media"), _("Select background media path")));
x += background_browse->get_w() + 3*margin;
add_tool(loop_playback = new TitleLoopPlayback(client, x, y));
y += loop_playback->get_h() + 10;
cur_popup->create_objects();
add_tool(fonts_popup = new TitleFontsPopup(client, this));
color_popup = new TitleColorPopup(client, this);
+ png_popup = new TitlePngPopup(client, this);
show_window(1);
update();
window->color_popup->activate();
return 1;
}
+ if( !strcmp(item_text, _("png file")) ) {
+ window->png_popup->activate();
+ return 1;
+ }
char txt[BCSTRLEN];
sprintf(txt, "<%s>", item_text);
int adv = strlen(txt);
window->insert_ibeam(txt, strlen(txt));
}
+TitlePngPopup::TitlePngPopup(TitleMain *client, TitleWindow *window)
+ : BC_DialogThread()
+{
+ this->client = client;
+ this->window = window;
+}
+
+TitlePngPopup::~TitlePngPopup()
+{
+ close_window();
+}
+
+void TitlePngPopup::handle_done_event(int result)
+{
+ if( result ) return;
+ BrowseButtonWindow *gui = (BrowseButtonWindow *)get_gui();
+ const char *path = gui->get_submitted_path();
+ char txt[BCSTRLEN]; sprintf(txt, "<png %s>",path);
+ window->insert_ibeam(txt, strlen(txt));
+}
+
+BC_Window *TitlePngPopup::new_gui()
+{
+ BC_DisplayInfo display_info;
+ int x = display_info.get_abs_cursor_x();
+ int y = display_info.get_abs_cursor_y();
+
+ BC_Window *gui = new BrowseButtonWindow(client->server->mwindow->theme,
+ x-25, y-100, window, "", _("Png file"), _("Png path"), 0);
+ gui->create_objects();
+ return gui;
+}
+
+int TitlePngPopup::activate()
+{
+ BC_DialogThread::start();
+ return 1;
+}
+
class TitleCurSubMenuItem;
class TitleFontsPopup;
class TitleColorPopup;
+class TitlePngPopup;
class TitleWindow : public PluginClientWindow
{
TitleCurPopup *cur_popup;
TitleFontsPopup *fonts_popup;
TitleColorPopup *color_popup;
+ TitlePngPopup *png_popup;
int color_x, color_y;
int outline_color_x, outline_color_y;
int color_value;
};
+class TitlePngPopup : public BC_DialogThread
+{
+public:
+ TitlePngPopup(TitleMain *client, TitleWindow *window);
+ ~TitlePngPopup();
+
+ void handle_done_event(int result);
+ BC_Window* new_gui();
+ int activate();
+
+ TitleMain *client;
+ TitleWindow *window;
+};
+
#endif