Add Auditioned to Export Report Dialog.
[ardour.git] / gtk2_ardour / export_report.h
1 /*
2  * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18
19 #include <cairo/cairo.h>
20 #include <gtkmm/notebook.h>
21
22 #include "gtkmm2ext/cairo_widget.h"
23 #include "gtkmm2ext/gui_thread.h"
24
25 #include "ardour/export_status.h"
26
27 #include "ardour_dialog.h"
28
29 class CimgArea : public CairoWidget
30 {
31 public:
32         CimgArea (Cairo::RefPtr<Cairo::ImageSurface> sf)
33                 : CairoWidget()
34                 , _surface(sf)
35         {
36                 set_size_request (sf->get_width (), sf->get_height ());
37         }
38
39         virtual void render (cairo_t* cr, cairo_rectangle_t* r)
40         {
41                 cairo_rectangle (cr, r->x, r->y, r->width, r->height);
42                 cairo_clip (cr);
43                 cairo_set_source_surface (cr, _surface->cobj(), 0, 0);
44                 cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
45                 cairo_paint (cr);
46         }
47
48 private:
49         Cairo::RefPtr<Cairo::ImageSurface> _surface;
50 };
51
52 class ExportReport : public ArdourDialog
53 {
54 public:
55         typedef boost::shared_ptr<ARDOUR::ExportStatus> StatusPtr;
56         ExportReport (ARDOUR::Session*, StatusPtr);
57         int run ();
58
59 private:
60         void open_folder (std::string);
61         void audition (std::string, unsigned int);
62         void stop_audition ();
63         void audition_active (bool);
64
65         StatusPtr        status;
66         Gtk::Notebook    pages;
67         ARDOUR::Session* _session;
68         Gtk::Button*     stop_btn;
69         PBD::ScopedConnectionList auditioner_connections;
70 };