-// Copyright 2005-6 Ben Hutchings <ben@decadentplace.org.uk>.
+// Copyright 2005-6 Ben Hutchings <ben@decadent.org.uk>.
// See the file "COPYING" for licence details.
#include <cassert>
// We can try using any of these encoders to convert PNG to MPEG.
enum mpeg_encoder
{
- mpeg_encoder_ffmpeg, // ffmpeg - doesn't work yet
+ mpeg_encoder_ffmpeg, // ffmpeg
mpeg_encoder_mjpegtools_old, // mjpegtools before version 1.8
mpeg_encoder_mjpegtools_new // mjpegtools from version 1.8
};
dvd_contents::pgc_ref add_menu(const std::string & uri);
dvd_contents::pgc_ref add_title(const std::string & uri);
void load_next_page();
+ bool on_idle();
void on_net_state_change(const char * uri, gint flags, guint status);
bool browser_is_busy() const
{
add(browser_widget_);
browser_widget_.show();
+ Glib::signal_idle().connect(
+ SigC::slot(*this, &webdvd_window::on_idle));
browser_widget_.signal_net_state().connect(
SigC::slot(*this, &webdvd_window::on_net_state_change));
add_menu(main_page_uri);
- load_next_page();
}
bool webdvd_window::is_finished() const
browser_widget_.load_uri(uri);
}
+ bool webdvd_window::on_idle()
+ {
+ load_next_page();
+ return false; // don't call again thankyou
+ }
+
void webdvd_window::on_net_state_change(const char * uri,
gint flags, guint status)
{
// ranging from 10 to 25 inches wide, for a resolution of
// 24-60 dpi. I therefore declare the average horizontal
// resolution to be 40 dpi. The vertical resolution will be
- // slightly higher (PAL/SECAM) or lower (NTSC), but
- // unfortunately Mozilla doesn't support non-square pixels
- // (and neither do fontconfig or Xft anyway).
+ // slightly different but unfortunately Mozilla doesn't
+ // support non-square pixels (and neither do fontconfig or Xft
+ // anyway).
check(pref_service->GetDefaultBranch("browser.display",
getter_AddRefs(pref_branch)));
check(pref_branch->SetIntPref("screen_resolution", 40));
bool preview_mode = false;
std::string menu_url;
std::string output_dir;
- mpeg_encoder encoder = mpeg_encoder_mjpegtools_new;
+ mpeg_encoder encoder = mpeg_encoder_ffmpeg;
// Do initial option parsing. We have to do this before
// letting Gtk parse the arguments since we may need to spawn
// Run the browser/converter
webdvd_window window(frame_params, menu_url, output_dir, encoder);
- Gtk::Main::run(window);
+ window.show();
+ window.signal_hide().connect(SigC::slot(&Gtk::Main::quit));
+ Gtk::Main::run();
return ((preview_mode || window.is_finished())
? EXIT_SUCCESS