Dev:Adding a Render progress bar

From Synfig Studio :: Documentation
Revision as of 20:40, 3 January 2019 by BobSynfig (Talk | contribs) (Create + 1st part)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Now let's implement a Render Progress Bar!
It has been requested several time:
Indication needed that rendering is in progress. #383
Feature request: Give feedback when rendering is happening and complete #626
also in Default render parameter are bad #464

Things to take into account

  • Where to place the Progress Bar?
  • How does really a render work?
  • Where to do calls and implementation?

Where to place the Progress Bar?

I chose to implement it in the Dock_Info panel.
After all, this is a kind of information!


Implementation

synfig-studio/src/gui/docks/dock_info.h

  • Declare the components and members

In #include section

#include <gtkmm/progressbar.h>

In private section

Gtk::ProgressBar render_progress;

//! Number of passes request - 1 or 2 (if alpha)
int              n_passes_requested;
//! Number of passes pending - 2,1,0
int              n_passes_pending;

In public section

//! Current render progress - 0.0 to 1.0
//  depends on n_passes_requested and current_pass
void set_render_progress   (float value);
void set_n_passes_requested(int   value);
void set_n_passes_pending  (int   value);

synfig-studio/src/gui/docks/dock_info.cpp