Prepare screenshot of all mixer-strips

This will allow to create a PNG of all mixer-strips, even those currently
off-screen due to scrolling. It currently shows the main scroll-pane
page only (master-bus, VCAs are not included).

This method is not yet exposed.
This commit is contained in:
Robin Gareus 2019-07-17 22:57:30 +02:00
parent 90cf829f67
commit 9cd1fd9e4a
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 22 additions and 0 deletions

View File

@ -30,6 +30,7 @@
#include <glibmm/threads.h>
#include <gtkmm/accelmap.h>
#include <gtkmm/offscreenwindow.h>
#include <gtkmm/stock.h>
#include "pbd/convert.h"
@ -3501,3 +3502,22 @@ Mixer_UI::vca_unassign (boost::shared_ptr<VCA> vca)
}
}
}
void
Mixer_UI::screenshot (std::string const& filename)
{
Gtk::OffscreenWindow osw;
int height = strip_packer.get_height();
strip_group_box.remove (strip_packer);
osw.add (strip_packer);
add_button.hide ();
osw.set_size_request (-1, height);
osw.show();
osw.get_window()->process_updates (true);
Glib::RefPtr<Gdk::Pixbuf> pb = osw.get_pixbuf ();
pb->save (filename, "png");
osw.remove ();
pb.release ();
add_button.show ();
strip_group_box.pack_start (strip_packer);
}

View File

@ -147,6 +147,8 @@ public:
void showhide_mixbusses (bool on);
#endif
void screenshot (std::string const&);
protected:
void set_axis_targets_for_operation ();
ARDOUR::AutomationControlSet selected_gaincontrols ();