Prepare screenshot of all mixer-strips
authorRobin Gareus <robin@gareus.org>
Wed, 17 Jul 2019 20:57:30 +0000 (22:57 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 17 Jul 2019 20:57:30 +0000 (22:57 +0200)
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.

gtk2_ardour/mixer_ui.cc
gtk2_ardour/mixer_ui.h

index 4bf6d60f7be15fa710d42c8debc6b95a95b2b517..1773c4497cce89e28ab22c1402cd51801ac948ee 100644 (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);
+}
index 5e0a25e9252f07ade0d3d7009ff01df16feee029..85197b991de08c15d5591acf9c1c20779b564b5f 100644 (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 ();