Fix thinkos in cubasish theme
[ardour.git] / gtk2_ardour / crossfade_view.h
1 /*
2  * Copyright (C) 2005-2014 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2005 Nick Mainsbridge <mainsbridge@gmail.com>
4  * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
5  * Copyright (C) 2006-2011 David Robillard <d@drobilla.net>
6  * Copyright (C) 2007-2011 Carl Hetherington <carl@carlh.net>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 #ifndef __gtk_ardour_crossfade_view_h__
24 #define __gtk_ardour_crossfade_view_h__
25
26 #include <vector>
27 #include "pbd/signals.h"
28 #include "ardour/crossfade.h"
29
30 #include "time_axis_view_item.h"
31
32 class RouteTimeAxisView;
33 class AudioRegionView;
34
35 namespace ArdourCanvas {
36         class PolyLine;
37 }
38
39 class CrossfadeView : public TimeAxisViewItem
40 {
41 public:
42         CrossfadeView (ArdourCanvas::Container*,
43                        RouteTimeAxisView&,
44                        boost::shared_ptr<ARDOUR::Crossfade>,
45                        double initial_samples_per_pixel,
46                        Gdk::Color& basic_color,
47                        AudioRegionView& leftview,
48                        AudioRegionView& rightview);
49
50         ~CrossfadeView ();
51
52         boost::shared_ptr<ARDOUR::Crossfade> crossfade;  // ok, let 'em have it
53
54         AudioRegionView& left_view;    // and these too
55         AudioRegionView& right_view;
56
57         void set_heights (double, double);
58
59         bool valid() const { return _valid; }
60         bool visible() const { return _visible; }
61         void set_valid (bool yn);
62
63         static PBD::Signal1<void,CrossfadeView*> CatchDeletion;
64
65         void fake_hide ();
66         void hide ();
67         void show ();
68         void horizontal_position_changed ();
69
70 protected:
71         void reset_width_dependent_items (double pixel_width);
72
73 private:
74         bool _valid;
75         bool _visible;
76         bool _all_in_view;
77         double _child_height;
78
79         ArdourCanvas::PolyLine *fade_in;
80         ArdourCanvas::PolyLine *fade_out;
81
82         void crossfade_changed (const PBD::PropertyChange&);
83         void crossfade_fades_changed ();
84         void active_changed ();
85         void redraw_curves ();
86         void color_handler ();
87 };
88
89 #endif /* __gtk_ardour_crossfade_view_h__ */