{
char *cp = text;
FFMPEG ffmpeg(0);
- cp += sprintf(cp, "file path: %s\n", path);
+ cp += sprintf(cp, _("file path: %s\n"), path);
struct stat st;
int ret = 0;
if( stat(path, &st) < 0 ) {
- cp += sprintf(cp, " err: %s\n", strerror(errno));
+ cp += sprintf(cp, _(" err: %s\n"), strerror(errno));
ret = 1;
}
else {
- cp += sprintf(cp, " %jd bytes\n", st.st_size);
+ cp += sprintf(cp, _(" %jd bytes\n"), st.st_size);
}
if( !ret ) ret = ffmpeg.init_decoder(path);
if( !ret ) ret = ffmpeg.open_decoder();
if( !ret ) {
- cp += sprintf(cp, "info:\n");
+ cp += sprintf(cp, _("info:\n"));
ffmpeg.info(cp, BCTEXTLEN-(cp-text));
}
else
- sprintf(cp, "== open failed\n");
+ sprintf(cp, _("== open failed\n"));
}
int FileFFMPEG::get_video_info(int track, int &pid, double &framerate,
return BC_YUV420P;
}
-static void load_options(const char *path, char *bfr, int len)
-{
- *bfr = 0;
- FILE *fp = fopen(path, "r");
- if( !fp ) return;
- fgets(bfr, len, fp); // skip hdr
- len = fread(bfr, 1, len-1, fp);
- if( len < 0 ) len = 0;
- bfr[len] = 0;
- fclose(fp);
-}
-
//======
-extern void get_exe_path(char *result); // from main.C
FFMPEGConfigAudio::FFMPEGConfigAudio(BC_WindowBase *parent_window, Asset *asset)
- : BC_Window(PROGRAM_NAME ": Audio Preset",
+ : BC_Window(_(PROGRAM_NAME ": Audio Preset"),
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
420, 420)
FileSystem fs;
char option_path[BCTEXTLEN];
- FFMPEG::set_option_path(option_path, "/audio");
+ FFMPEG::set_option_path(option_path, "audio");
fs.update(option_path);
int total_files = fs.total_files();
for(int i = 0; i < total_files; i++) {
const char *name = fs.get_entry(i)->get_name();
if( asset->fformat[0] != 0 ) {
const char *ext = strrchr(name,'.');
- if( !ext ) ext = name;
- else if( !strcmp("opts", ++ext) ) continue;
- if( strcmp(asset->fformat, ext) ) continue;
+ if( !ext ) continue;
+ if( strcmp(asset->fformat, ++ext) ) continue;
}
presets.append(new BC_ListBoxItem(name));
}
y += 25;
if( !asset->ff_audio_options[0] && asset->acodec[0] ) {
FFMPEG::set_option_path(option_path, "audio/%s", asset->acodec);
- load_options(option_path, asset->ff_audio_options,
+ FFMPEG::load_options(option_path, asset->ff_audio_options,
sizeof(asset->ff_audio_options));
}
add_subwindow(audio_options = new FFAudioOptions(this, x, y, get_w()-x-20, 10,
Asset *asset = popup->asset;
char option_path[BCTEXTLEN];
FFMPEG::set_option_path(option_path, "audio/%s", asset->acodec);
- load_options(option_path, asset->ff_audio_options,
+ FFMPEG::load_options(option_path, asset->ff_audio_options,
sizeof(asset->ff_audio_options));
popup->audio_options->update(asset->ff_audio_options);
return 1;
//======
FFMPEGConfigVideo::FFMPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset)
- : BC_Window(PROGRAM_NAME ": Video Preset",
+ : BC_Window(_(PROGRAM_NAME ": Video Preset"),
parent_window->get_abs_cursor_x(1),
parent_window->get_abs_cursor_y(1),
420, 420)
preset_popup = 0;
bitrate = 0;
+ quality = 0;
video_options = 0;
}
const char *name = fs.get_entry(i)->get_name();
if( asset->fformat[0] != 0 ) {
const char *ext = strrchr(name,'.');
- if( !ext ) ext = name;
- else if( !strcmp("opts", ++ext) ) continue;
- if( strcmp(asset->fformat, ext) ) continue;
+ if( !ext ) continue;
+ if( strcmp(asset->fformat, ++ext) ) continue;
}
presets.append(new BC_ListBoxItem(name));
}
y += 25;
if( !asset->ff_video_options[0] && asset->vcodec[0] ) {
FFMPEG::set_option_path(option_path, "video/%s", asset->vcodec);
- load_options(option_path, asset->ff_video_options,
+ FFMPEG::load_options(option_path, asset->ff_video_options,
sizeof(asset->ff_video_options));
}
add_subwindow(video_options = new FFVideoOptions(this, x, y, get_w()-x-20, 10,
Asset *asset = popup->asset;
char option_path[BCTEXTLEN];
FFMPEG::set_option_path(option_path, "video/%s", asset->vcodec);
- load_options(option_path, asset->ff_video_options,
+ FFMPEG::load_options(option_path, asset->ff_video_options,
sizeof(asset->ff_video_options));
popup->video_options->update(asset->ff_video_options);
return 1;