25 #ifndef __SYNFIG_PREVIEW_H 
   26 #define __SYNFIG_PREVIEW_H 
   32 #include <gtkmm/drawingarea.h> 
   33 #include <gtkmm/table.h> 
   34 #include <gtkmm/adjustment.h> 
   35 #include <gtkmm/image.h> 
   36 #include <gdkmm/pixbuf.h> 
   37 #include <gtkmm/dialog.h> 
   38 #include <gtkmm/scrollbar.h> 
   39 #include <gtkmm/checkbutton.h> 
   41 #include <gtkmm/tooltip.h> 
   42 #include <gtkmm/alignment.h> 
   43 #include <gtkmm/comboboxtext.h> 
   45 #include <synfig/time.h> 
   46 #include <synfig/vector.h> 
   47 #include <synfig/general.h> 
   48 #include <synfig/renddesc.h> 
   49 #include <synfig/canvas.h> 
   57 #include <jack/jack.h> 
   58 #include <jack/transport.h> 
   61 #include <synfig/soundprocessor.h> 
   72 class Preview : 
public sigc::trackable, 
public etl::shared_object
 
   79         Glib::RefPtr<Gdk::Pixbuf> 
buf; 
 
  106     float   begintime,endtime;
 
  108     bool    overbegin,overend;
 
  115     class Preview_Target;
 
  116     class Preview_Target_Cairo;
 
  117     void frame_finish(
const Preview_Target *);
 
  119     sigc::signal0<void> sig_changed;
 
  124                 float zoom = 0.5f, 
float fps = 15);
 
  144             return get_canvas()->rend_desc().get_time_start();
 
  153             return get_canvas()->rend_desc().get_time_end();
 
  182     FlipBook::iterator  
begin()     {
return frames.begin();}
 
  183     FlipBook::iterator  
end()       {
return frames.end();}
 
  185     FlipBook::const_iterator    
begin()
 const {
return frames.begin();}
 
  186     FlipBook::const_iterator    
end()
 const   {
return frames.end();}
 
  201     Gtk::DrawingArea    draw_area;
 
  202     Glib::RefPtr<Gtk::Adjustment> adj_time_scrub; 
 
  203     Gtk::HScale     scr_time_scrub;
 
  204     Gtk::ToggleButton   b_loop;
 
  205     Gtk::ScrolledWindow preview_window;
 
  207     Glib::RefPtr<Gdk::Pixbuf>   currentbuf;
 
  208     cairo_surface_t*    current_surface;
 
  215     etl::handle<Preview>    preview;
 
  216     sigc::connection    prevchanged;
 
  218     Gtk::ToggleButton *jackbutton;
 
  220     Glib::RefPtr<Gtk::Adjustment> adj_sound;
 
  222     Gtk::Label      l_lasttime;
 
  223     Gtk::Label      l_currenttime;
 
  234     sigc::connection    timecon;
 
  236     synfig::SoundProcessor soundProcessor;
 
  244     void scrub_updated(
double t);
 
  252     bool scroll_move_event(GdkEvent *);
 
  253     void disconnect_preview(
Preview *);
 
  255     bool redraw(
const Cairo::RefPtr<Cairo::Context> &cr);
 
  273     void seek(
const synfig::Time &t);
 
  316     Gtk::Button *play_button;
 
  317     Gtk::Button *pause_button;
 
  318     bool on_key_pressed(GdkEventKey*);
 
  319     void on_zoom_entry_activated();
 
  321     bool is_time_equal_to_current_frame(
const synfig::Time &time);
 
  325     bool jack_is_playing;
 
  326     synfig::Time jack_time;
 
  327     synfig::Time jack_offset;
 
  328     synfig::Time jack_initial_time;
 
  330     bool get_jack_enabled() { 
return jack_enabled; }
 
  331     void set_jack_enabled(
bool value);
 
  334     void toggle_jack_button();
 
  335     void on_jack_offset_changed();
 
  336     Glib::Dispatcher jack_dispatcher;
 
  337     jack_client_t *jack_client;
 
  338     bool jack_synchronizing;
 
  340     static int jack_sync_callback(jack_transport_state_t state, jack_position_t *pos, 
void *arg);