FFMpegConfigNum::FFMpegConfigNum(BC_Window *window,
int x, int y, char *title_text, int *output)
- : BC_TumbleTextBox(window, (int64_t)*output,
- (int64_t)-1, (int64_t)25000000, 100, y, 100)
+ : BC_TumbleTextBox(window, *output, -1, INT_MAX, 100, y, 100)
{
this->window = window;
this->x = x; this->y = y;
{
char value[BCTEXTLEN];
if( !FileFFMPEG::get_ff_option(param, opts, value) ) {
- if( (*output = atol(value)) < 0 ) {
+ if( (*output = atoi(value)) < 0 ) {
disable(1);
return 0;
}
- BC_TumbleTextBox::update(value);
}
+ BC_TumbleTextBox::update((int64_t)*output);
enable();
return 1;
}
int FFMpegConfigNum::handle_event()
{
- *output = atol(get_text());
+ *output = atoi(get_text());
return 1;
}
{
int ret = FFMpegVideoNum::handle_event();
Asset *asset = window()->asset;
- if( asset->ff_video_bitrate )
+ if( asset->ff_video_bitrate > 0 )
window()->quality->disable();
- else
+ else if( !window()->quality->get_textbox()->is_hidden() )
window()->quality->enable();
return ret;
}
{
int ret = FFMpegVideoNum::handle_event();
Asset *asset = window()->asset;
- if( asset->ff_video_quality )
+ if( asset->ff_video_quality >= 0 )
window()->bitrate->disable();
- else
+ else if( !window()->bitrate->get_textbox()->is_hidden() )
window()->bitrate->enable();
return ret;
}
bitrate = new FFMpegAudioBitrate(this, x, y, _("Bitrate:"), &asset->ff_audio_bitrate);
bitrate->create_objects();
bitrate->set_increment(1000);
+ bitrate->set_boundaries((int64_t)0, (int64_t)INT_MAX);
y += bitrate->get_h() + 10;
BC_Title *title = new BC_Title(x, y, _("Audio Options:"));
audio_options->create_objects();
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
+ show_window(1);
bitrate->update_param("cin_bitrate", asset->ff_audio_options);
- show_window(1);
- bitrate->handle_event();
unlock_window();
}
{
strcpy(popup->asset->acodec, get_text());
Asset *asset = popup->asset;
+ asset->ff_audio_bitrate = 0;
char option_path[BCTEXTLEN];
FFMPEG::set_option_path(option_path, "audio/%s", asset->acodec);
FFMPEG::load_options(option_path, asset->ff_audio_options,
preset_popup = new FFMPEGConfigVideoPopup(this, x, y);
preset_popup->create_objects();
- if( asset->ff_video_bitrate && asset->ff_video_quality ) {
- asset->ff_video_bitrate = 0;
- asset->ff_video_quality = 0;
+ if( asset->ff_video_bitrate > 0 && asset->ff_video_quality >= 0 ) {
+ asset->ff_video_bitrate = 0; asset->ff_video_quality = -1;
}
y += 50;
bitrate = new FFMpegVideoBitrate(this, x, y, _("Bitrate:"), &asset->ff_video_bitrate);
bitrate->create_objects();
bitrate->set_increment(100000);
+ bitrate->set_boundaries((int64_t)0, (int64_t)INT_MAX);
y += bitrate->get_h() + 5;
quality = new FFMpegVideoQuality(this, x, y, _("Quality:"), &asset->ff_video_quality);
quality->create_objects();
quality->set_increment(1);
- quality->set_boundaries((int64_t)0, (int64_t)31);
+ quality->set_boundaries((int64_t)-1, (int64_t)51);
y += quality->get_h() + 10;
BC_Title *title = new BC_Title(x, y, _("Video Options:"));
video_options->create_objects();
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
+ show_window(1);
bitrate->update_param("cin_bitrate", asset->ff_video_options);
quality->update_param("cin_quality", asset->ff_video_options);
- show_window(1);
- if( asset->ff_video_bitrate )
- quality->disable();
- if( asset->ff_video_quality )
- bitrate->disable();
+ if( asset->ff_video_bitrate > 0 ) quality->disable();
+ else if( asset->ff_video_quality >= 0 ) bitrate->disable();
unlock_window();
}
strcpy(popup->asset->vcodec, get_text());
Asset *asset = popup->asset;
char option_path[BCTEXTLEN];
+ asset->ff_video_bitrate = 0; asset->ff_video_quality = -1;
FFMPEG::set_option_path(option_path, "video/%s", asset->vcodec);
FFMPEG::load_options(option_path, asset->ff_video_options,
sizeof(asset->ff_video_options));
add_subwindow(recent_popup = new BC_FileBoxRecent(this, x, y));
add_subwindow(directory_title = new BC_FileBoxDirectoryText(x, y, this));
- directory_title->reposition_window(x, y,
- get_w() - recent_popup->get_w() - 20, 1);
- recent_popup->reposition_window(
- x + directory_title->get_w(), y,
- directory_title->get_w(), 200);
+ directory_title->reposition_window(x, y, get_w() - recent_popup->get_w() - 20, 1);
+ x += directory_title->get_w() + 8;
+ recent_popup->reposition_window(x, y, directory_title->get_w(), 200);
x = 10;
y += directory_title->get_h() + 5;
get_w() - recent_popup->get_w() - 20,
1);
recent_popup->reposition_window(
- directory_title->get_x() + directory_title->get_w(),
+ directory_title->get_x() + directory_title->get_w() + 8,
directory_title->get_y(),
directory_title->get_w() + recent_popup->get_w(),
recent_popup->get_h());