ff_audio_options[0] = 0;
ff_video_options[0] = 0;
ff_audio_bitrate = 0;
+ ff_audio_quality = -1;
ff_video_bitrate = 0;
ff_video_quality = -1;
strcpy(ff_audio_options, asset->ff_audio_options);
strcpy(ff_video_options, asset->ff_video_options);
ff_audio_bitrate = asset->ff_audio_bitrate;
+ ff_audio_quality = asset->ff_audio_quality;
ff_video_bitrate = asset->ff_video_bitrate;
ff_video_quality = asset->ff_video_quality;
!strcmp(acodec, asset.acodec));
if(result && format == FILE_FFMPEG)
result = !strcmp(ff_audio_options, asset.ff_audio_options) &&
- ff_audio_bitrate == asset.ff_audio_bitrate;
-
+ ff_audio_bitrate == asset.ff_audio_bitrate &&
+ ff_audio_quality == asset.ff_audio_quality;
}
GET_DEFAULT("FF_AUDIO_OPTIONS", ff_audio_options);
ff_audio_bitrate = GET_DEFAULT("FF_AUDIO_BITRATE", ff_audio_bitrate);
+ ff_audio_quality = GET_DEFAULT("FF_AUDIO_QUALITY", ff_audio_quality);
GET_DEFAULT("FF_VIDEO_OPTIONS", ff_video_options);
ff_video_bitrate = GET_DEFAULT("FF_VIDEO_BITRATE", ff_video_bitrate);
ff_video_quality = GET_DEFAULT("FF_VIDEO_QUALITY", ff_video_quality);
UPDATE_DEFAULT("FF_AUDIO_OPTIONS", ff_audio_options);
UPDATE_DEFAULT("FF_AUDIO_BITRATE", ff_audio_bitrate);
+ UPDATE_DEFAULT("FF_AUDIO_QUALITY", ff_audio_quality);
UPDATE_DEFAULT("FF_VIDEO_OPTIONS", ff_video_options);
UPDATE_DEFAULT("FF_VIDEO_BITRATE", ff_video_bitrate);
UPDATE_DEFAULT("FF_VIDEO_QUALITY", ff_video_quality);
fprintf(fp," fformat=\"%s\"\n", fformat);
fprintf(fp," ff_audio_options=\"%s\"\n", ff_audio_options);
fprintf(fp," ff_audio_bitrate=%d\n", ff_audio_bitrate);
+ fprintf(fp," ff_audio_quality=%d\n", ff_audio_quality);
fprintf(fp," ff_video_options=\"%s\"\n", ff_video_options);
fprintf(fp," ff_video_bitrate=%d\n", ff_video_bitrate);
fprintf(fp," ff_video_quality=%d\n", ff_video_quality);
char ff_audio_options[BCTEXTLEN];
char ff_video_options[BCTEXTLEN];
int ff_audio_bitrate;
+ int ff_audio_quality;
int ff_video_bitrate;
int ff_video_quality;
#include "transportque.h"
#include "vframe.h"
-
-static const char *list_titles[] =
-{
- _("Enabled"),
- _("Output"),
- _("EDL"),
- _("Elapsed")
-};
-
-static int list_widths[] =
-{
- 50,
- 100,
- 200,
- 100
+// Farmed is not present if not preferences->use_renderfarm
+int BatchRenderThread::column_widths[] = { 42, 42, 42, 222, 222, 150 };
+const char *BatchRenderThread::column_titles[] = {
+ _("Enabled"), _("Labeled"), _("Farmed"), _("Output"), _("EDL"), _("Elapsed")
};
BatchRenderMenuItem::BatchRenderMenuItem(MWindow *mwindow)
}
-
-
-
-
-
-
-BatchRenderJob::BatchRenderJob(Preferences *preferences, int strategy)
+BatchRenderJob::BatchRenderJob(Preferences *preferences, int labeled, int farmed)
{
this->preferences = preferences;
- this->strategy = strategy;
- file_per_label = 0;
+ this->labeled = labeled;
+ this->farmed = farmed >= 0 ? farmed : preferences->use_renderfarm;
asset = new Asset;
edl_path[0] = 0;
enabled = 1;
void BatchRenderJob::copy_from(BatchRenderJob *src)
{
+ enabled = src->enabled;
+ farmed = src->farmed;
+ labeled = src->labeled;
asset->copy_from(src->asset, 0);
strcpy(edl_path, src->edl_path);
- strategy = src->strategy;
- enabled = src->enabled;
elapsed = 0;
}
{
int result = 0;
+ enabled = file->tag.get_property("ENABLED", enabled);
+ farmed = file->tag.get_property("FARMED", farmed);
+ labeled = file->tag.get_property("STRATEGY", labeled);
edl_path[0] = 0;
file->tag.get_property("EDL_PATH", edl_path);
- strategy = file->tag.get_property("STRATEGY", get_strategy());
- enabled = file->tag.get_property("ENABLED", enabled);
elapsed = file->tag.get_property("ELAPSED", elapsed);
result = file->read_tag();
- if(!result)
- {
- if(file->tag.title_is("ASSET"))
- {
+ if( !result ) {
+ if( file->tag.title_is("ASSET") ) {
file->tag.get_property("SRC", asset->path);
asset->read(file, 0);
// The compression parameters are stored in the defaults to reduce
void BatchRenderJob::save(FileXML *file)
{
- file->tag.set_property("EDL_PATH", edl_path);
- file->tag.set_property("STRATEGY", get_strategy());
file->tag.set_property("ENABLED", enabled);
+ file->tag.set_property("FARMED", farmed);
+ file->tag.set_property("LABELED", labeled);
+ file->tag.set_property("EDL_PATH", edl_path);
file->tag.set_property("ELAPSED", elapsed);
file->append_tag();
file->append_newline();
- asset->write(file,
- 0,
- "");
+ asset->write(file, 0, "");
// The compression parameters are stored in the defaults to reduce
// coding maintenance. The defaults must now be stuffed into the XML for
// unique storage.
BC_Hash defaults;
- asset->save_defaults(&defaults,
- "",
- 0,
- 1,
- 0,
- 0,
- 0);
+ asset->save_defaults(&defaults, "", 0, 1, 0, 0, 0);
char *string;
defaults.save_string(string);
file->append_text(string);
int BatchRenderJob::get_strategy()
{
- return strategy >= 0 ? strategy :
- Render::get_strategy(preferences->use_renderfarm, file_per_label);
+// if set, overrides farmed, labeled
+ int use_renderfarm = farmed && preferences->use_renderfarm ? 1 : 0;
+ return Render::get_strategy(use_renderfarm, labeled);
}
default_job = new BatchRenderJob(mwindow->preferences);
load_jobs(batch_path, mwindow->preferences);
load_defaults(mwindow->defaults);
- this->gui = new BatchRenderGUI(mwindow,
- this,
- mwindow->session->batchrender_x,
- mwindow->session->batchrender_y,
- mwindow->session->batchrender_w,
- mwindow->session->batchrender_h);
+ this->gui = new BatchRenderGUI(mwindow, this,
+ mwindow->session->batchrender_x, mwindow->session->batchrender_y,
+ mwindow->session->batchrender_w, mwindow->session->batchrender_h);
this->gui->create_objects();
return this->gui;
}
if( !path[0] ) create_path(path);
file.read_from_file(path);
- while(!result)
- {
- if(!(result = file.read_tag()))
- {
- if(file.tag.title_is("JOBS"))
- {
+ while( !result ) {
+ if( !(result = file.read_tag()) ) {
+ if( file.tag.title_is("JOBS") ) {
warn = file.tag.get_property("WARN", 1);
}
- else if(file.tag.title_is("JOB"))
- {
- BatchRenderJob *job;
- jobs.append(job = new BatchRenderJob(preferences));
+ else if( file.tag.title_is("JOB") ) {
+ BatchRenderJob *job = new BatchRenderJob(preferences);
+ jobs.append(job);
job->load(&file);
}
}
file.append_tag();
file.append_newline();
- for(int i = 0; i < jobs.total; i++)
- {
+ for( int i = 0; i < jobs.total; i++ ) {
file.tag.set_title("JOB");
jobs.values[i]->save(&file);
}
void BatchRenderThread::load_defaults(BC_Hash *defaults)
{
- if(default_job)
- {
+ if( default_job ) {
default_job->asset->load_defaults(defaults,
"BATCHRENDER_", 1, 1, 1, 1, 1);
}
- for(int i = 0; i < BATCHRENDER_COLUMNS; i++)
- {
+ for( int i = 0; i < BATCHRENDER_COLUMNS; i++ ) {
char string[BCTEXTLEN];
sprintf(string, "BATCHRENDER_COLUMN%d", i);
- column_width[i] = defaults->get(string, list_widths[i]);
+ list_width[i] = defaults->get(string, column_widths[i]);
}
}
for( int i=0; i<BATCHRENDER_COLUMNS; ++i ) {
char string[BCTEXTLEN];
sprintf(string, "BATCHRENDER_COLUMN%d", i);
- defaults->update(string, column_width[i]);
+ defaults->update(string, list_width[i]);
}
// defaults->update("BATCHRENDER_JOB", current_job);
if( mwindow )
void BatchRenderThread::delete_job()
{
- if(current_job < jobs.total && current_job >= 0)
- {
+ if( current_job < jobs.total && current_job >= 0 ) {
jobs.remove_object_number(current_job);
- if(current_job > 0) current_job--;
+ if( current_job > 0 ) current_job--;
gui->create_list(1);
gui->change_job();
}
BatchRenderJob* BatchRenderThread::get_current_job()
{
- BatchRenderJob *result;
- if(current_job >= jobs.total || current_job < 0)
- {
- result = default_job;
- }
- else
- {
- result = jobs.values[current_job];
- }
- return result;
+ return current_job >= 0 && current_job < jobs.total ?
+ jobs.values[current_job] : default_job;
}
void BatchRenderThread::calculate_dest_paths(ArrayList<char*> *paths,
Preferences *preferences)
{
- for(int i = 0; i < jobs.total; i++)
- {
+ for( int i = 0; i < jobs.total; i++ ) {
BatchRenderJob *job = jobs.values[i];
- if(job->enabled && *job->edl_path != '@')
- {
+ if( job->enabled && *job->edl_path != '@' ) {
PackageDispatcher *packages = new PackageDispatcher;
// Load EDL
//PRINT_TRACE
// Test EDL files for existence
- if(test_edl_files()) return;
+ if( test_edl_files() ) return;
//PRINT_TRACE
int result = ConfirmSave::test_files(0, &paths);
paths.remove_all_objects();
// Abort on any existing file because it's so hard to set this up.
- if(result) return;
+ if( result ) return;
//PRINT_TRACE
render = new Render(0);
//PRINT_TRACE
- render->start_batches(&jobs,
- boot_defaults,
- preferences);
+ render->start_batches(&jobs, boot_defaults, preferences);
//PRINT_TRACE
}
void BatchRenderThread::start_rendering()
{
- if(is_rendering) return;
+ if( is_rendering ) return;
is_rendering = 1;
save_jobs(batch_path);
gui->button_disable();
// Test EDL files for existence
- if(test_edl_files()) return;
+ if( test_edl_files() ) return;
// Predict all destination paths
ArrayList<char*> paths;
paths.remove_all_objects();
// User cancelled
- if(result)
- {
+ if( result ) {
is_rendering = 0;
gui->button_enable();
return;
void BatchRenderThread::stop_rendering()
{
- if(!is_rendering) return;
+ if( !is_rendering ) return;
mwindow->render->stop_operation();
is_rendering = 0;
}
void BatchRenderThread::update_active(int number)
{
gui->lock_window("BatchRenderThread::update_active");
- if(number >= 0)
- {
+ if( number >= 0 ) {
current_job = number;
rendering_job = number;
}
- else
- {
+ else {
rendering_job = -1;
is_rendering = 0;
}
double elapsed_time)
{
gui->lock_window("BatchRenderThread::update_done");
- if(number < 0)
- {
+ if( number < 0 ) {
gui->button_enable();
}
- else
- {
+ else {
jobs.values[number]->enabled = 0;
jobs.values[number]->elapsed = elapsed_time;
- if(create_list) gui->create_list(1);
+ if( create_list ) gui->create_list(1);
}
gui->unlock_window();
}
void BatchRenderThread::move_batch(int src, int dst)
{
BatchRenderJob *src_job = jobs.values[src];
- if(dst < 0) dst = jobs.total - 1;
+ if( dst < 0 ) dst = jobs.total - 1;
- if(dst != src)
- {
- for(int i = src; i < jobs.total - 1; i++)
+ if( dst != src ) {
+ for( int i = src; i < jobs.total - 1; i++ )
jobs.values[i] = jobs.values[i + 1];
-// if(dst > src) dst--;
- for(int i = jobs.total - 1; i > dst; i--)
+// if( dst > src ) dst--;
+ for( int i = jobs.total - 1; i > dst; i-- )
jobs.values[i] = jobs.values[i - 1];
jobs.values[dst] = src_job;
gui->create_list(1);
{
this->mwindow = mwindow;
this->thread = thread;
+ use_renderfarm = 0;
}
BatchRenderGUI::~BatchRenderGUI()
format_tools = new BatchFormat(mwindow, this, thread->get_current_asset());
format_tools->set_w(get_w() / 2);
+ BatchRenderJob *current_job = thread->get_current_job();
format_tools->create_objects(x1, y1, 1, 1, 1, 1, 0, 1, 0, 0,
- &thread->get_current_job()->file_per_label, 0);
-
+ ¤t_job->labeled, 0);
+ if( mwindow->preferences->use_renderfarm ) {
+ use_renderfarm = new BatchRenderUseFarm(thread, x1, y1,
+ ¤t_job->farmed);
+ add_subwindow(use_renderfarm);
+ y1 += use_renderfarm->get_h() + 10;
+ }
// input EDL
add_subwindow(edl_path_title = new BC_Title(x2, y2, _("EDL Path:")));
y2 += edl_path_title->get_h() + mwindow->theme->widget_border;
output_path_title->reposition_window(x1, y1);
y1 += output_path_title->get_h() + mwindow->theme->widget_border;
format_tools->reposition_window(x1, y1);
-
+ if( use_renderfarm )
+ use_renderfarm->reposition_window(x1, y1);
// input EDL
x = x2, y = y2;
edl_path_title->reposition_window(x, y);
void BatchRenderGUI::create_list(int update_widget)
{
- for(int i = 0; i < BATCHRENDER_COLUMNS; i++)
- {
- list_columns[i].remove_all_objects();
+ for( int i = 0; i < BATCHRENDER_COLUMNS; i++ ) {
+ list_items[i].remove_all_objects();
}
- for(int i = 0; i < thread->jobs.total; i++)
- {
+ const char **column_titles = BatchRenderThread::column_titles;
+ list_columns = 0;
+ list_titles[list_columns] = column_titles[ENABLED_COL];
+ list_width[list_columns++] = thread->list_width[ENABLED_COL];
+ list_titles[list_columns] = column_titles[LABELED_COL];
+ list_width[list_columns++] = thread->list_width[LABELED_COL];
+ if( mwindow->preferences->use_renderfarm ) {
+ list_titles[list_columns] = column_titles[FARMED_COL];
+ list_width[list_columns++] = thread->list_width[FARMED_COL];
+ }
+ list_titles[list_columns] = column_titles[OUTPUT_COL];
+ list_width[list_columns++] = thread->list_width[OUTPUT_COL];
+ list_titles[list_columns] = column_titles[EDL_COL];
+ list_width[list_columns++] = thread->list_width[EDL_COL];
+ list_titles[list_columns] = column_titles[ELAPSED_COL];
+ list_width[list_columns++] = thread->list_width[ELAPSED_COL];
+
+ for( int i = 0; i < thread->jobs.total; i++ ) {
BatchRenderJob *job = thread->jobs.values[i];
char string[BCTEXTLEN];
- BC_ListBoxItem *enabled = new BC_ListBoxItem(job->enabled ?
- (char*)"X" :
- (char*)" ");
- BC_ListBoxItem *item1 = new BC_ListBoxItem(job->asset->path);
- BC_ListBoxItem *item2 = new BC_ListBoxItem(job->edl_path);
- BC_ListBoxItem *item3;
- if(job->elapsed)
- item3 = new BC_ListBoxItem(
- Units::totext(string,
- job->elapsed,
- TIME_HMS2));
- else
- item3 = new BC_ListBoxItem(_("Unknown"));
- list_columns[0].append(enabled);
- list_columns[1].append(item1);
- list_columns[2].append(item2);
- list_columns[3].append(item3);
- if(i == thread->current_job)
- {
+ BC_ListBoxItem *enabled = new BC_ListBoxItem(job->enabled ? "X" : " ");
+ BC_ListBoxItem *labeled = new BC_ListBoxItem(job->labeled ? "X" : " ");
+ BC_ListBoxItem *farmed = !mwindow->preferences->use_renderfarm ? 0 :
+ new BC_ListBoxItem(job->farmed ? "X" : " ");
+ BC_ListBoxItem *out_path = new BC_ListBoxItem(job->asset->path);
+ BC_ListBoxItem *edl_path = new BC_ListBoxItem(job->edl_path);
+ BC_ListBoxItem *elapsed = new BC_ListBoxItem(!job->elapsed ? _("Unknown") :
+ Units::totext(string, job->elapsed, TIME_HMS2));
+ int col = 0;
+ list_items[col++].append(enabled);
+ list_items[col++].append(labeled);
+ if( farmed ) list_items[col++].append(farmed);
+ list_items[col++].append(out_path);
+ list_items[col++].append(edl_path);
+ list_items[col].append(elapsed);
+ if( i == thread->current_job ) {
enabled->set_selected(1);
- item1->set_selected(1);
- item2->set_selected(1);
- item3->set_selected(1);
+ labeled->set_selected(1);
+ if( farmed ) farmed->set_selected(1);
+ out_path->set_selected(1);
+ edl_path->set_selected(1);
+ elapsed->set_selected(1);
}
- if(i == thread->rendering_job)
- {
+ if( i == thread->rendering_job ) {
enabled->set_color(RED);
- item1->set_color(RED);
- item2->set_color(RED);
- item3->set_color(RED);
+ labeled->set_color(RED);
+ if( farmed ) farmed->set_color(RED);
+ out_path->set_color(RED);
+ edl_path->set_color(RED);
+ elapsed->set_color(RED);
}
}
- if(update_widget)
- {
- batch_list->update(list_columns,
- list_titles,
- thread->column_width,
- BATCHRENDER_COLUMNS,
- batch_list->get_xposition(),
- batch_list->get_yposition(),
- batch_list->get_highlighted_item(), // Flat index of item cursor is over
- 1, // set all autoplace flags to 1
- 1);
+ if( update_widget ) {
+ batch_list->update(list_items, list_titles, list_width, list_columns,
+ batch_list->get_xposition(), batch_list->get_yposition(),
+ batch_list->get_highlighted_item(), 1, 1);
}
}
void BatchRenderGUI::change_job()
{
BatchRenderJob *job = thread->get_current_job();
- format_tools->update(job->asset, &job->file_per_label);
+ format_tools->update(job->asset, &job->labeled);
+ if( use_renderfarm ) use_renderfarm->update(&job->farmed);
edl_path_text->update(job->edl_path);
}
-
-
-
-
-
-
-BatchFormat::BatchFormat(MWindow *mwindow,
- BatchRenderGUI *gui,
- Asset *asset)
+BatchFormat::BatchFormat(MWindow *mwindow, BatchRenderGUI *gui, Asset *asset)
: FormatTools(mwindow, gui, asset)
{
this->gui = gui;
return 1;
}
-
-
-
-
-
-
-
-
-
-
BatchRenderEDLPath::BatchRenderEDLPath(BatchRenderThread *thread,
- int x,
- int y,
- int w,
- char *text)
- : BC_TextBox(x,
- y,
- w,
- 1,
- text)
+ int x, int y, int w, char *text)
+ : BC_TextBox(x, y, w, 1, text)
{
this->thread = thread;
}
return 1;
}
-
-
-
-
-
BatchRenderNew::BatchRenderNew(BatchRenderThread *thread,
int x,
int y)
return 1;
}
-BatchRenderDelete::BatchRenderDelete(BatchRenderThread *thread,
- int x,
- int y)
+BatchRenderDelete::BatchRenderDelete(BatchRenderThread *thread, int x, int y)
: BC_GenericButton(x, y, _("Delete"))
{
this->thread = thread;
-BatchRenderSaveList::BatchRenderSaveList(BatchRenderThread *thread,
- int x,
- int y)
+BatchRenderSaveList::BatchRenderSaveList(BatchRenderThread *thread, int x, int y)
: BC_GenericButton(x, y, _("Save Jobs"))
{
this->thread = thread;
BatchRenderSaveList::~BatchRenderSaveList()
{
startup_lock->lock("BatchRenderSaveList::~BrowseButton");
- if(gui)
- {
+ if( gui ) {
gui->lock_window();
gui->set_done(1);
gui->unlock_window();
int BatchRenderSaveList::handle_event()
{
- if(Thread::running())
- {
- if(gui)
- {
+ if( Thread::running() ) {
+ if( gui ) {
gui->lock_window();
gui->raise_window();
gui->unlock_window();
filewindow.create_objects();
int result2 = filewindow.run_window();
- if(!result2) {
+ if( !result2 ) {
strcpy(thread->batch_path, filewindow.get_submitted_path());
thread->gui->batch_path->update(thread->batch_path);
thread->mwindow->defaults->update("DEFAULT_BATCHLOADPATH", thread->batch_path);
}
int BatchRenderSaveList::keypress_event() {
- if (get_keypress() == 's' ||
- get_keypress() == 'S') return handle_event();
+ if( get_keypress() == 's' ||
+ get_keypress() == 'S' ) return handle_event();
return 0;
}
-
-
BatchRenderLoadList::BatchRenderLoadList(BatchRenderThread *thread,
int x,
int y)
BatchRenderLoadList::~BatchRenderLoadList()
{
startup_lock->lock("BatchRenderLoadList::~BrowseButton");
- if(gui) {
+ if( gui ) {
gui->lock_window();
gui->set_done(1);
gui->unlock_window();
int BatchRenderLoadList::handle_event()
{
- if(Thread::running()) {
- if(gui) {
+ if( Thread::running() ) {
+ if( gui ) {
gui->lock_window();
gui->raise_window();
gui->unlock_window();
filewindow.create_objects();
int result2 = filewindow.run_window();
- if(!result2) {
+ if( !result2 ) {
strcpy(thread->batch_path, filewindow.get_submitted_path());
thread->gui->batch_path->update(thread->batch_path);
thread->mwindow->defaults->update("DEFAULT_BATCHLOADPATH", thread->batch_path);
}
int BatchRenderLoadList::keypress_event() {
- if (get_keypress() == 'o' ||
- get_keypress() == 'O') return handle_event();
+ if( get_keypress() == 'o' ||
+ get_keypress() == 'O' ) return handle_event();
return 0;
}
}
-
-
BatchRenderList::BatchRenderList(BatchRenderThread *thread,
- int x,
- int y,
- int w,
- int h)
- : BC_ListBox(x,
- y,
- w,
- h,
- LISTBOX_TEXT,
- thread->gui->list_columns,
- list_titles,
- thread->column_width,
- BATCHRENDER_COLUMNS,
- 0,
- 0,
- LISTBOX_SINGLE,
- ICON_LEFT,
- 1)
+ int x, int y, int w, int h)
+ : BC_ListBox(x, y, w, h, LISTBOX_TEXT, thread->gui->list_items,
+ thread->gui->list_titles, thread->gui->list_width, thread->gui->list_columns,
+ 0, 0, LISTBOX_SINGLE, ICON_LEFT, 1)
{
this->thread = thread;
dragging_item = 0;
{
thread->current_job = get_selection_number(0, 0);
thread->gui->change_job();
- if(get_cursor_x() < thread->column_width[0])
- {
- BatchRenderJob *job = thread->get_current_job();
+ int cursor_x = get_cursor_x();
+ BatchRenderJob *job = thread->get_current_job();
+ int col_x = 0, changed = 1;
+ if( cursor_x < (col_x += thread->list_width[ENABLED_COL]) )
job->enabled = !job->enabled;
+ else if( cursor_x < (col_x += thread->list_width[LABELED_COL]) )
+ job->labeled = job->edl_path[0] != '@' ? !job->labeled : 0;
+ else if( thread->gui->use_renderfarm &&
+ cursor_x < (col_x += thread->list_width[FARMED_COL]) )
+ job->farmed = job->edl_path[0] != '@' ? !job->farmed : 0;
+ else
+ changed = 0;
+ if( changed ) {
thread->gui->create_list(1);
+ thread->gui->change_job();
}
return 1;
}
int BatchRenderList::column_resize_event()
{
- for(int i = 0; i < BATCHRENDER_COLUMNS; i++)
- {
- thread->column_width[i] = get_column_width(i);
+ for( int i = 0; i < BATCHRENDER_COLUMNS; i++ ) {
+ thread->list_width[i] = get_column_width(i);
}
return 1;
}
int BatchRenderList::drag_start_event()
{
- if(BC_ListBox::drag_start_event())
- {
+ if( BC_ListBox::drag_start_event() ) {
dragging_item = 1;
return 1;
}
int BatchRenderList::drag_motion_event()
{
- if(BC_ListBox::drag_motion_event())
- {
+ if( BC_ListBox::drag_motion_event() ) {
return 1;
}
return 0;
int BatchRenderList::drag_stop_event()
{
- if(dragging_item)
- {
+ if( dragging_item ) {
int src = get_selection_number(0, 0);
int dst = get_highlighted_item();
- if(src != dst)
- {
+ if( src != dst ) {
thread->move_batch(src, dst);
}
BC_ListBox::drag_stop_event();
-
-
-
-
-
-
-
-
-
-
-BatchRenderStart::BatchRenderStart(BatchRenderThread *thread,
- int x,
- int y)
- : BC_GenericButton(x,
- y,
- _("Start"))
+BatchRenderStart::BatchRenderStart(BatchRenderThread *thread, int x, int y)
+ : BC_GenericButton(x, y, _("Start"))
{
this->thread = thread;
}
return 1;
}
-BatchRenderStop::BatchRenderStop(BatchRenderThread *thread,
- int x,
- int y)
- : BC_GenericButton(x,
- y,
- _("Stop"))
+BatchRenderStop::BatchRenderStop(BatchRenderThread *thread, int x, int y)
+ : BC_GenericButton(x, y, _("Stop"))
{
this->thread = thread;
}
return 1;
}
-
-BatchRenderCancel::BatchRenderCancel(BatchRenderThread *thread,
- int x,
- int y)
- : BC_GenericButton(x,
- y,
- _("Close"))
+BatchRenderCancel::BatchRenderCancel(BatchRenderThread *thread, int x, int y)
+ : BC_GenericButton(x, y, _("Close"))
{
this->thread = thread;
}
int BatchRenderCancel::keypress_event()
{
- if(get_keypress() == ESC)
- {
+ if( get_keypress() == ESC ) {
unlock_window();
thread->stop_rendering();
lock_window("BatchRenderCancel::keypress_event");
return 0;
}
+BatchRenderUseFarm::BatchRenderUseFarm(BatchRenderThread *thread, int x, int y, int *output)
+ : BC_CheckBox(x, y, *output, _("Use render farm"))
+{
+ this->thread = thread;
+ this->output = output;
+}
+
+int BatchRenderUseFarm::handle_event()
+{
+ *output = get_value();
+ thread->gui->create_list(1);
+ return 1;
+}
+
+void BatchRenderUseFarm::update(int *output)
+{
+ this->output = output;
+ BC_CheckBox::update(*output);
+}
+
#include "render.inc"
#include "timeentry.h"
-#define BATCHRENDER_COLUMNS 4
-
-
-
+enum {
+ ENABLED_COL, LABELED_COL, FARMED_COL,
+ OUTPUT_COL, EDL_COL, ELAPSED_COL,
+ BATCHRENDER_COLUMNS
+};
class BatchRenderMenuItem : public BC_MenuItem
{
class BatchRenderJob
{
public:
- BatchRenderJob(Preferences *preferences, int strategy=-1);
+ BatchRenderJob(Preferences *preferences, int labeled=0, int farmed=-1);
~BatchRenderJob();
void copy_from(BatchRenderJob *src);
char edl_path[BCTEXTLEN];
// Destination file for output
Asset *asset;
- int strategy;
- int file_per_label;
+ int labeled, farmed;
int enabled;
// Amount of time elapsed in last render operation
double elapsed;
Preferences *preferences;
Render *render;
BatchRenderGUI *gui;
- int column_width[BATCHRENDER_COLUMNS];
+
+ static const char *column_titles[BATCHRENDER_COLUMNS];
+ static int column_widths[BATCHRENDER_COLUMNS];
+ int list_width[BATCHRENDER_COLUMNS];
// job being edited
int current_job;
// job being rendered
MWindow *mwindow;
};
+class BatchRenderUseFarm : public BC_CheckBox
+{
+public:
+ BatchRenderUseFarm(BatchRenderThread *thread, int x, int y, int *output);
+ int handle_event();
+ void update(int *output);
+
+ BatchRenderThread *thread;
+ int *output;
+};
+
class BatchRenderGUI : public BC_Window
{
void button_enable();
void button_disable();
- ArrayList<BC_ListBoxItem*> list_columns[BATCHRENDER_COLUMNS];
+ ArrayList<BC_ListBoxItem*> list_items[BATCHRENDER_COLUMNS];
+ const char *list_titles[BATCHRENDER_COLUMNS];
+ int list_width[BATCHRENDER_COLUMNS], list_columns;
MWindow *mwindow;
BatchRenderThread *thread;
BatchRenderCancel *cancel_button;
BatchRenderCurrentEDL *use_current_edl;
BatchRenderUpdateEDL *update_selected_edl;
+ BatchRenderUseFarm *use_renderfarm;
};
return 1;
}
- BatchRenderJob *job = new BatchRenderJob(mwindow->preferences);
+ BatchRenderJob *job = new BatchRenderJob(mwindow->preferences, use_label_chapters);
jobs->append(job);
strcpy(&job->edl_path[0], xml_filename);
Asset *asset = job->asset;
asset->ff_video_bitrate = vid_bitrate;
asset->ff_video_quality = -1;
- job = new BatchRenderJob(mwindow->preferences);
+ job = new BatchRenderJob(mwindow->preferences, 0, 0);
jobs->append(job);
job->edl_path[0] = '@';
strcpy(&job->edl_path[1], script_filename);
reset(); // Globals must be reset
#ifndef LOCALTIME
- putenv ((char *) "TZ=UTC");
+// putenv ((char *) "TZ=UTC");
#endif
#ifdef LOCALEDIR
setlocale (LC_CTYPE, "");
fprintf(fp,"\n");
const char *exec_path = File::get_cinlib_path();
fprintf(fp,"PATH=$PATH:%s\n",exec_path);
- if( mwindow->preferences->use_renderfarm )
- fprintf(fp,"cat > $1/dvd.m2v $1/dvd.m2v0*\n");
- if( !use_ffmpeg ) {
- fprintf(fp,"mplex -M -f 8 -o $1/dvd.mpg $1/dvd.m2v $1/dvd.ac3\n");
- fprintf(fp,"\n");
+ if( mwindow->preferences->use_renderfarm ||
+ (use_label_chapters && edl->labels ) ) {
+ if( !use_ffmpeg ) {
+ fprintf(fp, "cat > $1/dvd.m2v $1/dvd.m2v0*\n");
+ fprintf(fp, "mplex -M -f 8 -o $1/dvd.mpg $1/dvd.m2v $1/dvd.ac3\n");
+ }
+ else
+ fprintf(fp, "ffmpeg -f concat -safe 0 -i <(for f in \"$1/dvd.mpg0\"*; do "
+ "echo \"file '$f'\"; done) -c copy -y $1/dvd.mpg\n");
}
fprintf(fp,"rm -rf $1/iso\n");
fprintf(fp,"mkdir -p $1/iso\n");
return 1;
}
- BatchRenderJob *job = new BatchRenderJob(mwindow->preferences);
+ BatchRenderJob *job = new BatchRenderJob(mwindow->preferences, use_label_chapters);
jobs->append(job);
strcpy(&job->edl_path[0], xml_filename);
Asset *asset = job->asset;
asset->vmpeg_preset = 8;
asset->vmpeg_field_order = 0;
asset->vmpeg_pframe_distance = 0;
- job = new BatchRenderJob(mwindow->preferences, SINGLE_PASS);
+ job = new BatchRenderJob(mwindow->preferences, 0, 0);
jobs->append(job);
strcpy(&job->edl_path[0], xml_filename);
asset = job->asset;
asset->ac3_bitrate = dvd_kaudio_rate;
}
- job = new BatchRenderJob(mwindow->preferences);
+ job = new BatchRenderJob(mwindow->preferences, 0, 0);
jobs->append(job);
job->edl_path[0] = '@';
strcpy(&job->edl_path[1], script_filename);
sprintf(arg, "%d", asset->ff_audio_bitrate);
av_dict_set(&sopts, "b", arg, 0);
}
+ else if( asset->ff_audio_quality >= 0 ) {
+ ctx->global_quality = asset->ff_audio_quality * FF_QP2LAMBDA;
+ ctx->qmin = ctx->qmax = asset->ff_audio_quality;
+ ctx->mb_lmin = ctx->qmin * FF_QP2LAMBDA;
+ ctx->mb_lmax = ctx->qmax * FF_QP2LAMBDA;
+ ctx->flags |= CODEC_FLAG_QSCALE;
+ char arg[BCSTRLEN];
+ av_dict_set(&sopts, "flags", "+qscale", 0);
+ sprintf(arg, "%d", asset->ff_audio_quality);
+ av_dict_set(&sopts, "qscale", arg, 0);
+ sprintf(arg, "%d", ctx->global_quality);
+ av_dict_set(&sopts, "global_quality", arg, 0);
+ }
int aidx = ffaudio.size();
int fidx = aidx + ffvideo.size();
FFAudioStream *aud = new FFAudioStream(this, st, aidx, fidx);
*rp = 0;
}
-void File::setenv_path(char *result, const char *var, const char *path)
+void File::setenv_path(const char *var, const char *path, int overwrite)
{
- char *env = getenv(var);
- if( env ) return;
char env_path[BCTEXTLEN];
getenv_path(env_path, path);
- sprintf(result, "%s=%s", var, env_path);
- putenv(result);
+ setenv(var, env_path, overwrite);
}
-char File::cinexe_path[BCTEXTLEN];
-char File::cinpkg_path[BCTEXTLEN];
-char File::cindat_path[BCTEXTLEN];
-char File::cinlib_path[BCTEXTLEN];
-char File::cincfg_path[BCTEXTLEN];
-char File::cinplg_path[BCTEXTLEN];
-char File::cinlad_path[BCTEXTLEN];
-char File::cinlcl_path[BCTEXTLEN];
-char File::cinbwr_path[BCTEXTLEN];
-
void File::init_cin_path()
{
char env_path[BCTEXTLEN], env_pkg[BCTEXTLEN];
// these values are advertised for forks/shell scripts
get_exe_path(env_path, env_pkg);
- snprintf(cinexe_path, sizeof(cinexe_path), "CIN_PATH=%s", env_path);
- putenv(cinexe_path);
- snprintf(cinpkg_path, sizeof(cinpkg_path), "CIN_PKG=%s", env_pkg);
- putenv(cinpkg_path);
-
- setenv_path(cindat_path, "CIN_DAT", CINDAT_DIR);
- setenv_path(cinlib_path, "CIN_LIB", CINLIB_DIR);
- setenv_path(cincfg_path, "CIN_CONFIG", CONFIG_DIR);
- setenv_path(cinplg_path, "CIN_PLUGIN", PLUGIN_DIR);
- setenv_path(cinlad_path, "CIN_LADSPA", LADSPA_DIR);
- setenv_path(cinlcl_path, "CIN_LOCALE", LOCALE_DIR);
- setenv_path(cinbwr_path, "CIN_BROWSER", CIN_BROWSER);
+ setenv_path("CIN_PATH", env_path, 1);
+ setenv_path("CIN_PKG", env_pkg, 1);
+ setenv_path("CIN_DAT", CINDAT_DIR, 0);
+ setenv_path("CIN_LIB", CINLIB_DIR, 0);
+ setenv_path("CIN_CONFIG", CONFIG_DIR, 0);
+ setenv_path("CIN_PLUGIN", PLUGIN_DIR, 0);
+ setenv_path("CIN_LADSPA", LADSPA_DIR, 0);
+ setenv_path("CIN_LOCALE", LOCALE_DIR, 0);
+ setenv_path("CIN_BROWSER", CIN_BROWSER, 0);
}
static void init_cin_path();
static void get_exe_path(char *result, char *bnp=0);
static void getenv_path(char *result, const char *path);
- static void setenv_path(char *result, const char *var, const char *path);
- static char cinexe_path[BCTEXTLEN], cinpkg_path[BCTEXTLEN];
- static char cindat_path[BCTEXTLEN], cinlib_path[BCTEXTLEN];
- static char cincfg_path[BCTEXTLEN], cinplg_path[BCTEXTLEN];
- static char cinlad_path[BCTEXTLEN], cinlcl_path[BCTEXTLEN];
- static char cinbwr_path[BCTEXTLEN];
+ static void setenv_path(const char *var, const char *path, int overwrite);
static const char *get_cin() { return getenv("CIN_PKG"); }
static const char *get_cin_path() { return getenv("CIN_PATH"); }
static const char *get_cindat_path() { return getenv("CIN_DAT"); }
static const char *get_plugin_path() { return getenv("CIN_PLUGIN"); }
static const char *get_ladspa_path() { return getenv("CIN_LADSPA"); }
static const char *get_locale_path() { return getenv("CIN_LOCALE"); }
+ static const char *get_render_path() { return getenv("CIN_RENDER"); }
static const char *get_browser_path() { return getenv("CIN_BROWSER"); }
static const char *default_probes[];
int FFMpegAudioBitrate::handle_event()
{
int ret = FFMpegAudioNum::handle_event();
+ Asset *asset = window()->asset;
+ if( asset->ff_audio_bitrate > 0 )
+ window()->quality->disable();
+ else if( !window()->quality->get_textbox()->is_hidden() )
+ window()->quality->enable();
+ return ret;
+}
+
+int FFMpegAudioQuality::handle_event()
+{
+ int ret = FFMpegAudioNum::handle_event();
+ Asset *asset = window()->asset;
+ if( asset->ff_audio_quality >= 0 )
+ window()->bitrate->disable();
+ else if( !window()->bitrate->get_textbox()->is_hidden() )
+ window()->bitrate->enable();
return ret;
}
bitrate->create_objects();
bitrate->set_increment(1000);
bitrate->set_boundaries((int64_t)0, (int64_t)INT_MAX);
+ y += bitrate->get_h() + 5;
+ quality = new FFMpegAudioQuality(this, x, y, _("Quality:"), &asset->ff_audio_quality);
+ quality->create_objects();
+ quality->set_increment(1);
+ quality->set_boundaries((int64_t)-1, (int64_t)51);
- y += bitrate->get_h() + 10;
+ y += quality->get_h() + 10;
BC_Title *title = new BC_Title(x, y, _("Audio Options:"));
add_subwindow(title);
show_window(1);
bitrate->update_param("cin_bitrate", asset->ff_audio_options);
+ quality->update_param("cin_quality", asset->ff_audio_options);
+
+ if( asset->ff_audio_bitrate > 0 ) quality->disable();
+ else if( asset->ff_audio_quality >= 0 ) bitrate->disable();
unlock_window();
}
popup->audio_options->set_text_row(0);
popup->bitrate->update_param("cin_bitrate", asset->ff_audio_options);
+ popup->quality->update_param("cin_quality", asset->ff_audio_options);
return 1;
}
int handle_event();
};
+class FFMpegAudioQuality : public FFMpegAudioNum
+{
+public:
+ FFMpegAudioQuality(BC_Window *window, int x, int y, char *title_text, int *output)
+ : FFMpegAudioNum(window, x, y, title_text, output) {}
+ int handle_event();
+};
+
class FFMpegVideoNum : public FFMpegConfigNum
{
public:
ArrayList<BC_ListBoxItem*> presets;
FFMPEGConfigAudioPopup *preset_popup;
FFMpegAudioBitrate *bitrate;
+ FFMpegAudioQuality *quality;
FFAudioOptions *audio_options;
BC_WindowBase *parent_window;
Asset *asset;
delete [] packages;
}
if (default_asset)
- delete default_asset;
+ default_asset->remove_user();
}
if (default_asset->audio_data)
{
audio_asset = new Asset(packages[local_current_package]->path);
+ audio_asset->format = FILE_OGG;
local_current_package++;
audio_file_gen = new File();
if (default_asset->video_data)
{
video_asset = new Asset(packages[local_current_package]->path);
+ video_asset->format = FILE_OGG;
local_current_package++;
video_file_gen = new File();
ogg_stream_clear(&video_in_stream);
video_file_gen->close_file();
delete video_file_gen;
- delete video_asset;
+ if( video_asset ) video_asset->remove_user();
video_asset = new Asset(packages[local_current_package]->path);
+ video_asset->format = FILE_OGG;
local_current_package++;
video_file_gen = new File();
ogg_stream_clear(&audio_in_stream);
audio_file_gen->close_file();
delete audio_file_gen;
- delete audio_asset;
+ if( audio_asset )
+ audio_asset->remove_user();
}
if (default_asset->video_data)
{
ogg_stream_clear(&video_in_stream);
video_file_gen->close_file();
delete video_file_gen;
- delete video_asset;
+ if( video_asset )
+ video_asset->remove_user();
}
output_file_gen->close_file();
delete output_file_gen;
-// Now delete the temp files
- for(int i = 0; i < total_packages; i++)
- unlink(packages[i]->path);
+// don't delete the temp files, for now
+// for(int i = 0; i < total_packages; i++)
+// unlink(packages[i]->path);
return 0;
}
vparams_button = 0;
aparams_thread = 0;
vparams_thread = 0;
- channels_tumbler = 0;
audio_switch = 0;
video_switch = 0;
path_textbox = 0;
format_text = 0;
audio_title = 0;
video_title = 0;
- channels_title = 0;
- channels_button = 0;
- multiple_files = 0;
+ labeled_files = 0;
w = window->get_w();
recording = 0;
SET_TRACE
if(vparams_thread) delete vparams_thread;
SET_TRACE
- if(channels_tumbler) delete channels_tumbler;
}
void FormatTools::create_objects(
ylev = y;
y += aparams_button->get_h() + 10;
-// Audio channels only used for recording.
-// if(prompt_audio_channels)
-// {
-// window->add_subwindow(channels_title = new BC_Title(x, y, _("Number of audio channels to record:")));
-// x += 260;
-// window->add_subwindow(channels_button = new FormatChannels(x, y, this));
-// x += channels_button->get_w() + 5;
-// window->add_subwindow(channels_tumbler = new BC_ITumbler(channels_button, 1, MAXCHANNELS, x, y));
-// y += channels_button->get_h() + 20;
-// x = init_x;
-// }
-
//printf("FormatTools::create_objects 6\n");
aparams_thread = new FormatAThread(this);
}
x = init_x;
if( file_per_label ) {
- multiple_files = new FormatMultiple(mwindow, x, y, file_per_label);
- window->add_subwindow(multiple_files);
- y += multiple_files->get_h() + 10;
+ labeled_files = new FormatFilePerLabel(this, x, y, file_per_label);
+ window->add_subwindow(labeled_files);
+ y += labeled_files->get_h() + 10;
}
//printf("FormatTools::create_objects 12\n");
{
this->asset = asset;
this->file_per_label = file_per_label;
- if( file_per_label ) multiple_files->update(file_per_label);
+ if( file_per_label ) labeled_files->update(file_per_label);
if( path_textbox ) path_textbox->update(asset->path);
format_text->update(File::formattostr(asset->format));
update_format();
x = init_x;
y += aparams_button->get_h() + 10;
- if(prompt_audio_channels)
- {
- channels_title->reposition_window(x, y);
- x += 260;
- channels_button->reposition_window(x, y);
- x += channels_button->get_w() + 5;
- channels_tumbler->reposition_window(x, y);
- y += channels_button->get_h() + 20;
- x = init_x;
- }
}
}
if( file_per_label ) {
- multiple_files->reposition_window(x, y);
- y += multiple_files->get_h() + 10;
+ labeled_files->reposition_window(x, y);
+ y += labeled_files->get_h() + 10;
}
init_y = y;
int FormatAParams::handle_event()
{
format->set_audio_options();
+ format->handle_event();
return 1;
}
int FormatVParams::handle_event()
{
format->set_video_options();
+ format->handle_event();
return 1;
}
int FormatAudio::handle_event()
{
format->asset->audio_data = get_value();
+ format->handle_event();
return 1;
}
int FormatVideo::handle_event()
{
format->asset->video_data = get_value();
+ format->handle_event();
return 1;
}
load_items(File::formattostr(format->asset->format));
format->update_format();
}
+ format->handle_event();
}
return 1;
}
format->update_extension();
format->close_format_windows();
format->update_format();
+ format->handle_event();
}
return 1;
}
-
-
-FormatChannels::FormatChannels(int x, int y, FormatTools *format)
- : BC_TextBox(x, y, 100, 1, format->asset->channels)
-{
- this->format = format;
-}
-
-FormatChannels::~FormatChannels()
-{
-}
-
-int FormatChannels::handle_event()
-{
- format->asset->channels = atol(get_text());
- return 1;
-}
-
-
-FormatToTracks::FormatToTracks(int x, int y, int *output)
- : BC_CheckBox(x, y, *output, _("Overwrite project with output"))
-{
- this->output = output;
-}
-
-FormatToTracks::~FormatToTracks()
-{
-}
-
-int FormatToTracks::handle_event()
-{
- *output = get_value();
- return 1;
-}
-
-
-FormatMultiple::FormatMultiple(MWindow *mwindow, int x, int y, int *output)
+FormatFilePerLabel::FormatFilePerLabel(FormatTools *format,
+ int x, int y, int *output)
: BC_CheckBox(x, y, *output, _("Create new file at each label"))
{
+ this->format = format;
this->output = output;
- this->mwindow = mwindow;
}
-FormatMultiple::~FormatMultiple()
+FormatFilePerLabel::~FormatFilePerLabel()
{
}
-int FormatMultiple::handle_event()
+int FormatFilePerLabel::handle_event()
{
*output = get_value();
+ format->handle_event();
return 1;
}
-void FormatMultiple::update(int *output)
+void FormatFilePerLabel::update(int *output)
{
this->output = output;
set_value(*output ? 1 : 0);
#include "file.inc"
#include "ffmpeg.h"
#include "formatpopup.h"
+#include "formattools.inc"
#include "mwindow.inc"
-class FormatAParams;
-class FormatVParams;
-class FormatAThread;
-class FormatVThread;
-class FormatChannels;
-class FormatPathButton;
-class FormatPathText;
-class FormatFormat;
-class FormatFFMPEG;
-class FFMpegType;
-class FormatAudio;
-class FormatVideo;
-class FormatMultiple;
-
class FormatTools
{
public:
BC_TextBox *format_text;
FormatFFMPEG *format_ffmpeg;
FFMpegType *ffmpeg_type;
- BC_ITumbler *channels_tumbler;
BC_Title *audio_title;
- BC_Title *channels_title;
- FormatChannels *channels_button;
FormatAudio *audio_switch;
BC_Title *video_title;
FormatVideo *video_switch;
- FormatMultiple *multiple_files;
+ FormatFilePerLabel *labeled_files;
ArrayList<PluginServer*> *plugindb;
MWindow *mwindow;
};
-class FormatChannels : public BC_TextBox
-{
-public:
- FormatChannels(int x, int y, FormatTools *format);
- ~FormatChannels();
- int handle_event();
- FormatTools *format;
-};
-
-class FormatToTracks : public BC_CheckBox
-{
-public:
- FormatToTracks(int x, int y, int *output);
- ~FormatToTracks();
- int handle_event();
- int *output;
-};
-
-class FormatMultiple : public BC_CheckBox
+class FormatFilePerLabel : public BC_CheckBox
{
public:
- FormatMultiple(MWindow *mwindow, int x, int y, int *output);
- ~FormatMultiple();
+ FormatFilePerLabel(FormatTools *format, int x, int y, int *output);
+ ~FormatFilePerLabel();
int handle_event();
void update(int *output);
+
+ FormatTools *format;
int *output;
- MWindow *mwindow;
};
#define FORMATTOOLS_INC
class FormatTools;
+class FormatPathText;
+class FormatFormat;
+class FormatFFMPEG;
+class FFMpegType;
+class FormatAParams;
+class FormatVParams;
+class FormatAThread;
+class FormatVThread;
+class FormatAudio;
+class FormatVideo;
+class FormatFilePerLabel;
#endif
get_derived_attributes(default_asset, defaults);
// to_tracks = defaults->get("RENDER_EFFECT_TO_TRACKS", 1);
load_mode = defaults->get("RENDER_EFFECT_LOADMODE", LOADMODE_PASTE);
- file_per_label = defaults->get("RENDER_FILE_PER_LABEL", 0);
+ use_labels = defaults->get("RENDER_FILE_PER_LABEL", 0);
// get plugin information
int need_plugin = !strlen(title) ? 1 : 0;
// save defaults
save_derived_attributes(default_asset, defaults);
defaults->update("RENDER_EFFECT_LOADMODE", load_mode);
- defaults->update("RENDER_EFFECT_FILE_PER_LABEL", file_per_label);
+ defaults->update("RENDER_EFFECT_FILE_PER_LABEL", use_labels);
mwindow->save_defaults();
// get plugin server to use and delete the plugin list
default_asset->height = mwindow->edl->session->output_h;
}
- int strategy = Render::get_strategy(mwindow->preferences->use_renderfarm, file_per_label);
+ int strategy = Render::get_strategy(mwindow->preferences->use_renderfarm, use_labels);
// Process the total length in fragments
ArrayList<MenuEffectPacket*> packets;
if(!result)
add_subwindow(file_title = new BC_Title(
mwindow->theme->menueffect_file_x,
mwindow->theme->menueffect_file_y,
- (char*)(menueffects->file_per_label ?
+ (char*)(menueffects->use_labels ?
_("Select the first file to render to:") :
_("Select a file to render to:"))));
this,
asset);
format_tools->create_objects(x, y, asset->audio_data, asset->video_data,
- 0, 0, 0, 1, 0, 0, &menueffects->file_per_label, 0);
+ 0, 0, 0, 1, 0, 0, &menueffects->use_labels, 0);
loadmode = new LoadMode(mwindow, this, x, y, &menueffects->load_mode, 1);
loadmode->create_objects();
MenuEffects *menu_item;
char title[BCTEXTLEN];
int realtime, load_mode;
- int file_per_label;
+ int use_labels;
// GUI Plugins to delete
ArrayList<PluginServer*> *dead_plugins;
#include "mwindow.h"
#include "performanceprefs.h"
#include "preferences.h"
+#include <ctype.h>
#include <string.h>
#include "theme.h"
1,
0, // Select compressors to be offered
0, // Prompt for recording options
- 0, // prompt for file_per_label
+ 0, // prompt for use labels
1); // Supply file formats for background rendering
x = xmargin1;
PrefsRenderFarmNodes::PrefsRenderFarmNodes(PreferencesWindow *pwindow,
PerformancePrefs *subwindow, int x, int y)
- : BC_ListBox(x, y, 340, 230, LISTBOX_TEXT)
+ : BC_ListBox(x, y, 340, 230, LISTBOX_TEXT, 0,0,0,1, 0,0, LISTBOX_MULTIPLE)
{
for( int i=0; i<PerformancePrefs::TOTAL_COLUMNS; ++i ) {
titles[i] = _(default_titles[i]);
{
subwindow->hot_node = get_selection_number(1, 0);
subwindow->edit_node->update(get_selection(1, 0)->get_text());
- subwindow->edit_port->update(get_selection(2, 0)->get_text());
+ const char *text = get_selection(2, 0)->get_text();
+ subwindow->edit_port->update(text);
+ pwindow->thread->preferences->renderfarm_port = atol(text);
if(get_cursor_x() < widths[0])
{
pwindow->thread->preferences->renderfarm_enabled.values[subwindow->hot_node] =
PrefsRenderFarmNewNode::PrefsRenderFarmNewNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y)
- : BC_GenericButton(x, y, _("Add Node"))
+ : BC_GenericButton(x, y, _("Add Nodes"))
{
this->pwindow = pwindow;
this->subwindow = subwindow;
}
int PrefsRenderFarmNewNode::handle_event()
{
- pwindow->thread->preferences->add_node(subwindow->edit_node->get_text(),
- pwindow->thread->preferences->renderfarm_port,
- 1,
- 0.0);
+ const char *name = subwindow->edit_node->get_text();
+ char *cp = (char*)subwindow->edit_port->get_text();
+ int64_t start_port = strtol(cp, &cp, 0), end_port = start_port;
+ while( isspace(*cp) ) ++cp;
+ if( *cp++ == '-' )
+ end_port = strtol(cp, &cp, 0);
+ for( int port=start_port; port<=end_port; ++port ) {
+ pwindow->thread->preferences->add_node(name, port, 1, 0.0);
+ }
+ pwindow->thread->preferences->renderfarm_port = end_port;
+ subwindow->edit_port->update(end_port);
pwindow->thread->preferences->reset_rates();
subwindow->generate_node_list();
subwindow->update_node_list();
PrefsRenderFarmDelNode::PrefsRenderFarmDelNode(PreferencesWindow *pwindow, PerformancePrefs *subwindow, int x, int y)
- : BC_GenericButton(x, y, _("Delete Node"))
+ : BC_GenericButton(x, y, _("Delete Nodes"))
{
this->pwindow = pwindow;
this->subwindow = subwindow;
}
int PrefsRenderFarmDelNode::handle_event()
{
- if( subwindow->hot_node >= 0 ) {
- pwindow->thread->preferences->delete_node(subwindow->hot_node);
-
- subwindow->generate_node_list();
- subwindow->update_node_list();
- subwindow->hot_node = -1;
+ ArrayList<BC_ListBoxItem *> &item_list = subwindow->nodes[0];
+ for( int i=item_list.size(); --i>=0; ) {
+ if( !item_list[i]->get_selected() ) continue;
+ pwindow->thread->preferences->delete_node(i);
}
+ subwindow->generate_node_list();
+ subwindow->update_node_list();
+ subwindow->hot_node = -1;
return 1;
}
shbtn_prefs.append(new ShBtnPref(_("Original Manual"), "$CIN_BROWSER file://$CIN_DAT/doc/cinelerra.html", 0));
shbtn_prefs.append(new ShBtnPref(_("Setting Shell Commands"), "$CIN_BROWSER file://$CIN_DAT/doc/ShellCmds.html", 0));
shbtn_prefs.append(new ShBtnPref(_("Shortcuts"), "$CIN_BROWSER file://$CIN_DAT/doc/shortcuts.html", 0));
+ shbtn_prefs.append(new ShBtnPref(_("RenderMux"), "$CIN_DAT/doc/RenderMux.sh",0));
shbtns_total = 0;
}
for( int i=0; i<shbtns_total; ++i ) {
}
mwindow->reset_android_remote();
- int ffmpeg_early_probe = mwindow->preferences->get_file_probe_armed("FFPMEG_Early");
+ int ffmpeg_early_probe = mwindow->preferences->get_file_probe_armed("FFMPEG_Early");
mwindow->gui->ffmpeg_toggle->update(ffmpeg_early_probe);
mwindow->gui->ffmpeg_toggle->set_tooltip(ffmpeg_early_probe ?
FFMPEG_EARLY_TIP : FFMPEG_LATE_TIP);
1,
0, // Select compressors to be offered
1, // Prompt for recording options
- 0, // prompt for file_per_label
+ 0, // prompt for use labels
0); // Supply file formats for background rendering
realtime_toc = new RecordRealtimeTOC(mwindow, pwindow,
// add to recentlist only on OK
render_window->render_format->path_recent->
add_item(File::formattostr(asset->format), asset->path);
+ setenv("CIN_RENDER", asset->path, 1);
}
render_window = 0;
}
return 0;
}
-int Render::get_strategy(int use_renderfarm, int file_per_label)
+int Render::get_strategy(int use_renderfarm, int use_labels)
{
return use_renderfarm ?
- (file_per_label ? FILE_PER_LABEL_FARM : SINGLE_PASS_FARM) :
- (file_per_label ? FILE_PER_LABEL : SINGLE_PASS ) ;
+ (use_labels ? FILE_PER_LABEL_FARM : SINGLE_PASS_FARM) :
+ (use_labels ? FILE_PER_LABEL : SINGLE_PASS ) ;
}
int Render::get_strategy()
{
- return get_strategy(preferences->use_renderfarm, file_per_label);
+ return get_strategy(preferences->use_renderfarm, use_labels);
}
void Render::start_progress()
int Render::load_defaults(Asset *asset)
{
- file_per_label = mwindow->defaults->get("RENDER_FILE_PER_LABEL", 0);
+ use_labels = mwindow->defaults->get("RENDER_FILE_PER_LABEL", 0);
load_mode = mwindow->defaults->get("RENDER_LOADMODE", LOADMODE_NEW_TRACKS);
range_type = mwindow->defaults->get("RENDER_RANGE_TYPE", RANGE_PROJECT);
{
char string_name[100];
sprintf(string_name, "RENDER_%i_FILE_PER_LABEL", profile_slot);
- file_per_label = mwindow->defaults->get(string_name, 0);
+ use_labels = mwindow->defaults->get(string_name, 0);
// Load mode is not part of the profile
// printf(string_name, "RENDER_%i_LOADMODE", profile_slot);
// load_mode = mwindow->defaults->get(string_name, LOADMODE_NEW_TRACKS);
int Render::save_defaults(Asset *asset)
{
- mwindow->defaults->update("RENDER_FILE_PER_LABEL", file_per_label);
+ mwindow->defaults->update("RENDER_FILE_PER_LABEL", use_labels);
mwindow->defaults->update("RENDER_LOADMODE", load_mode);
mwindow->defaults->update("RENDER_RANGE_TYPE", range_type);
double total_length;
RenderFarmServer *farm_server = 0;
FileSystem fs;
- //int done = 0;
const int debug = 0;
render->in_progress = 1;
test_overwrite);
}
- //done = 0;
render->total_rendered = 0;
if(!render->result)
// Exit point
if(!package)
{
- //done = 1;
break;
}
-
-
- Timer timer;
- timer.update();
-
if(package_renderer.render_package(package))
render->result = 1;
{
render->load_profile(profile_slot, asset);
update_range_type(render->range_type);
- render_format->update(asset, &render->file_per_label);
+ render_format->update(asset, &render->use_labels);
}
int x = 10, y = 10;
lock_window("RenderWindow::create_objects");
add_subwindow(new BC_Title(x, y,
- (char*)(render->file_per_label ?
+ (char*)(render->use_labels ?
_("Select the first file to render to:") :
_("Select a file to render to:"))));
y += 25;
render_format = new RenderFormat(mwindow, this, asset);
render_format->create_objects(x, y,
- 1, 1, 1, 1, 0, 1, 0, 0, &render->file_per_label, 0);
+ 1, 1, 1, 1, 0, 1, 0, 0, &render->use_labels, 0);
BC_Title *title;
add_subwindow(title = new BC_Title(x, y, _("Render range:")));
// This should be integrated into the Asset Class.
static int check_asset(EDL *edl, Asset &asset);
// strategy to conform with using renderfarm.
- static int get_strategy(int use_renderfarm, int file_per_label);
+ static int get_strategy(int use_renderfarm, int use_labels);
int get_strategy();
// Force filename to have a 0 padded number if rendering to a list.
int check_numbering(Asset &asset);
PlayableTracks *playable_tracks;
PackageDispatcher *packages;
Mutex *package_lock, *counter_lock;
- int file_per_label;
+ int use_labels;
int range_type;
// Total selection to render in seconds
double total_start, total_end;
sprintf(string_name, "RENDER_%i_FILE_PER_LABEL", profile_slot);
mwindow->defaults->update(string_name,
- rwindow->render->file_per_label ? FILE_PER_LABEL : SINGLE_PASS);
+ rwindow->render->use_labels ? FILE_PER_LABEL : SINGLE_PASS);
sprintf(string_name, "RENDER_%i_LOADMODE", profile_slot);
mwindow->defaults->update(string_name, rwindow->render->load_mode);
sprintf(string_name, "RENDER_%i_RANGE_TYPE", profile_slot);
sprintf(string_name, "RENDER_%i_", profile_slot);
rwindow->asset->save_defaults(mwindow->defaults,
- string_name,
- 1,
- 1,
- 1,
- 1,
- 1);
+ string_name, 1, 1, 1, 1, 1);
mwindow->save_defaults();
return 0;
add_subwindow(cmd_name);
cmd_text = new BC_ScrollTextBox(this, x1, y, get_w()-x1-20, 4, pref->commands);
cmd_text->create_objects();
- y += cmd_text->get_h() + 8;
+ y += cmd_text->get_h() + 16;
add_subwindow(st_err_warn = new ShBtnErrWarn(this, x1, y));
y = get_h() - ShBtnTextOK::calculate_h() - 10;
add_subwindow(new ShBtnTextOK(this, x, y));
cp -a cinelerra.html $(TARGET_DIR)/.
cp -a Features5.pdf $(TARGET_DIR)/.
cp -a shortcuts.html $(TARGET_DIR)/.
+ cp -a RenderMux.sh $(TARGET_DIR)/.
clean:
rm -f $(OUTPUT) $(IMAGES)
--- /dev/null
+# Render output mux-ed into a single file
+ffmpeg -f concat -safe 0 -i <(for f in "$CIN_RENDER"0*; do echo "file '$f'"; done) -c copy -y $CIN_RENDER