fix import/embed with "sequence files" option
[ardour2.git] / gtk2_ardour / crossfade_view.h
bloba1f6d56f8e5c888804c05310431ca7ed413b80d5
1 /*
2 Copyright (C) 2003 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __gtk_ardour_crossfade_view_h__
21 #define __gtk_ardour_crossfade_view_h__
23 #include <vector>
24 #include <libgnomecanvasmm.h>
25 #include <sigc++/signal.h>
26 #include <ardour/crossfade.h>
28 #include "time_axis_view_item.h"
30 class RouteTimeAxisView;
31 class AudioRegionView;
33 struct CrossfadeView : public TimeAxisViewItem
35 CrossfadeView (ArdourCanvas::Group*,
36 RouteTimeAxisView&,
37 boost::shared_ptr<ARDOUR::Crossfade>,
38 double initial_samples_per_unit,
39 Gdk::Color& basic_color,
40 AudioRegionView& leftview,
41 AudioRegionView& rightview);
42 ~CrossfadeView ();
44 boost::shared_ptr<ARDOUR::Crossfade> crossfade; // ok, let 'em have it
46 AudioRegionView& left_view; // and these too
47 AudioRegionView& right_view;
49 void set_height (double);
51 bool valid() const { return _valid; }
52 bool visible() const { return _visible; }
53 void set_valid (bool yn);
55 static sigc::signal<void,CrossfadeView*> GoingAway;
57 AudioRegionView& upper_regionview () const;
59 void fake_hide ();
60 void hide ();
61 void show ();
63 protected:
64 void reset_width_dependent_items (double pixel_width);
66 private:
67 bool _valid;
68 bool _visible;
70 double spu;
72 ArdourCanvas::Item *overlap_rect;
73 ArdourCanvas::Line *fade_in;
74 ArdourCanvas::Line *fade_out;
75 ArdourCanvas::Item *active_button;
77 void crossfade_changed (ARDOUR::Change);
78 void active_changed ();
79 void redraw_curves ();
80 void color_handler ();
83 #endif /* __gtk_ardour_crossfade_view_h__ */