Ardour  8.12
crossfade_view.h
Go to the documentation of this file.
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 
40 {
41 public:
44  std::shared_ptr<ARDOUR::Crossfade>,
45  double initial_samples_per_pixel,
46  Gdk::Color& basic_color,
47  AudioRegionView& leftview,
48  AudioRegionView& rightview);
49 
51 
52  std::shared_ptr<ARDOUR::Crossfade> crossfade; // ok, let 'em have it
53 
54  AudioRegionView& left_view; // and these too
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 ();
69 
70 protected:
72 
73 private:
74  bool _valid;
75  bool _visible;
77  double _child_height;
78 
81 
84  void active_changed ();
85  void redraw_curves ();
86  void color_handler ();
87 };
88 
89 #endif /* __gtk_ardour_crossfade_view_h__ */
bool valid() const
void horizontal_position_changed()
bool visible() const
void crossfade_changed(const PBD::PropertyChange &)
ArdourCanvas::PolyLine * fade_out
double _child_height
ArdourCanvas::PolyLine * fade_in
void active_changed()
AudioRegionView & right_view
void crossfade_fades_changed()
void set_valid(bool yn)
AudioRegionView & left_view
static PBD::Signal1< void, CrossfadeView * > CatchDeletion
void color_handler()
CrossfadeView(ArdourCanvas::Container *, RouteTimeAxisView &, std::shared_ptr< ARDOUR::Crossfade >, double initial_samples_per_pixel, Gdk::Color &basic_color, AudioRegionView &leftview, AudioRegionView &rightview)
void redraw_curves()
void set_heights(double, double)
void reset_width_dependent_items(double pixel_width)
std::shared_ptr< ARDOUR::Crossfade > crossfade
void fake_hide()
int pixel_width(const std::string &str, const Pango::FontDescription &font)