#include "filesystem.h"
#include "formattools.h"
#include "language.h"
+#ifdef HAVE_DV
#include "libdv.h"
+#endif
#include "libmjpeg.h"
#include "maxchannels.h"
#include "mwindow.h"
this->mwindow = mwindow;
this->window = window;
this->asset = asset;
- this->plugindb = mwindow->plugindb;
aparams_button = 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;
prompt_audio_channels = 0;
prompt_video = 0;
prompt_video_compression = 0;
- strategy = 0;
+ file_per_label = 0;
locked_compressor = 0;
video_driver = 0;
}
SET_TRACE
if(vparams_thread) delete vparams_thread;
SET_TRACE
- if(channels_tumbler) delete channels_tumbler;
}
void FormatTools::create_objects(
int prompt_video_compression,
const char *locked_compressor,
int recording,
- int *strategy,
+ int *file_per_label,
int brender,
int horizontal_layout)
{
this->prompt_audio_channels = prompt_audio_channels;
this->prompt_video = prompt_video;
this->prompt_video_compression = prompt_video_compression;
- this->strategy = strategy;
+ this->file_per_label = file_per_label;
//printf("FormatTools::create_objects 1\n");
-// Modify strategy depending on render farm
- if(strategy)
- {
- if(mwindow->preferences->use_renderfarm)
- {
- if(*strategy == FILE_PER_LABEL)
- *strategy = FILE_PER_LABEL_FARM;
- else
- if(*strategy == SINGLE_PASS)
- *strategy = SINGLE_PASS_FARM;
- }
- else
- {
- if(*strategy == FILE_PER_LABEL_FARM)
- *strategy = FILE_PER_LABEL;
- else
- if(*strategy == SINGLE_PASS_FARM)
- *strategy = SINGLE_PASS;
- }
- }
-
if(!recording)
{
int px = x;
format_button->create_objects();
x += format_button->get_w() + 5;
window->add_subwindow(ffmpeg_type = new FFMpegType(x, y, 70, 1, asset->fformat));
- FFMPEG::set_asset_format(asset, asset->fformat);
+ FFMPEG::set_asset_format(asset, mwindow->edl, asset->fformat);
x += ffmpeg_type->get_w();
window->add_subwindow(format_ffmpeg = new FormatFFMPEG(x, y, this));
format_ffmpeg->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);
}
//printf("FormatTools::create_objects 11\n");
x = init_x;
- if(strategy)
- {
- window->add_subwindow(multiple_files = new FormatMultiple(mwindow, x, y, strategy));
- y += multiple_files->get_h() + 10;
+ if( file_per_label ) {
+ 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");
format_text->update(File::formattostr(asset->format));
switch(driver) {
+#ifdef HAVE_DV
case CAPTURE_IEC61883:
case CAPTURE_FIREWIRE:
locked_compressor = (char*)CODEC_TAG_DVSD;
break;
-
+#endif
case VIDEO4LINUX2JPEG:
locked_compressor = (char*)CODEC_TAG_MJPEG;
break;
}
}
-void FormatTools::update(Asset *asset, int *strategy)
+void FormatTools::update(Asset *asset, int *file_per_label)
{
this->asset = asset;
- this->strategy = strategy;
-
- if(path_textbox)
- path_textbox->update(asset->path);
+ this->file_per_label = 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();
- if(strategy)
- {
- multiple_files->update(strategy);
- }
close_format_windows();
}
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;
- }
}
x = init_x;
}
- if(strategy)
- {
- multiple_files->reposition_window(x, y);
- y += multiple_files->get_h() + 10;
+ if( file_per_label ) {
+ 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;
}
FormatFFMPEG::FormatFFMPEG(int x, int y, FormatTools *format)
- : FFMPEGPopup(format->plugindb, x, y)
+ : FFMPEGPopup(x, y)
{
this->format = format;
}
format->ffmpeg_type->update(text);
format->asset->ff_audio_options[0] = 0;
format->asset->ff_video_options[0] = 0;
- FFMPEG::set_asset_format(format->asset, text);
+ FFMPEG::set_asset_format(format->asset, format->mwindow->edl, text);
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"))
+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;
}
-FormatToTracks::~FormatToTracks()
+FormatFilePerLabel::~FormatFilePerLabel()
{
}
-int FormatToTracks::handle_event()
+int FormatFilePerLabel::handle_event()
{
*output = get_value();
+ format->handle_event();
return 1;
}
-
-FormatMultiple::FormatMultiple(MWindow *mwindow, int x, int y, int *output)
- : BC_CheckBox(x,
- y,
- (*output == FILE_PER_LABEL) || (*output == FILE_PER_LABEL_FARM),
- _("Create new file at each label"))
-{
- this->output = output;
- this->mwindow = mwindow;
-}
-
-FormatMultiple::~FormatMultiple()
-{
-}
-
-int FormatMultiple::handle_event()
-{
- if(get_value())
- {
- if(mwindow->preferences->use_renderfarm)
- *output = FILE_PER_LABEL_FARM;
- else
- *output = FILE_PER_LABEL;
- }
- else
- {
- if(mwindow->preferences->use_renderfarm)
- *output = SINGLE_PASS_FARM;
- else
- *output = SINGLE_PASS;
- }
- return 1;
-}
-
-void FormatMultiple::update(int *output)
+void FormatFilePerLabel::update(int *output)
{
this->output = output;
- if(*output == FILE_PER_LABEL_FARM ||
- *output ==FILE_PER_LABEL)
- set_value(1);
- else
- set_value(0);
+ set_value(*output ? 1 : 0);
}