summaryrefslogtreecommitdiff
path: root/gtk2_ardour/mixer_ui.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-07-17 22:57:30 +0200
committerRobin Gareus <robin@gareus.org>2019-07-17 22:57:30 +0200
commit9cd1fd9e4aba0aeebb2271156be36890b4274eaf (patch)
tree281bb54318a79c631aa63dc53fdd5e3464b246b4 /gtk2_ardour/mixer_ui.cc
parent90cf829f67e954548957aca54102619c66890050 (diff)
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.
Diffstat (limited to 'gtk2_ardour/mixer_ui.cc')
-rw-r--r--gtk2_ardour/mixer_ui.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc
index 4bf6d60f7b..1773c4497c 100644
--- a/gtk2_ardour/mixer_ui.cc
+++ b/gtk2_ardour/mixer_ui.cc
@@ -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);
+}