a few more header files fixes, plus cleanup from nick_m, and the start of Action...
[ardour.git] / gtk2_ardour / crossfade_view.h
1 /*
2     Copyright (C) 2003 Paul Davis 
3
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18     $Id$
19 */
20
21 #ifndef __gtk_ardour_crossfade_view_h__
22 #define __gtk_ardour_crossfade_view_h__
23
24 #include <vector>
25 #include <gtkmm.h>
26 #include <libgnomecanvas/libgnomecanvas.h>
27 #include <sigc++/signal.h>
28 #include <ardour/crossfade.h>
29
30 #include "time_axis_view_item.h"
31
32 class AudioTimeAxisView;
33 class AudioRegionView;
34
35 struct CrossfadeView : public TimeAxisViewItem
36 {
37     CrossfadeView (GnomeCanvasGroup*, 
38                    AudioTimeAxisView&,
39                    ARDOUR::Crossfade&,
40                    double initial_samples_per_unit, 
41                    Gdk::Color& basic_color,
42                    AudioRegionView& leftview,
43                    AudioRegionView& rightview);
44     ~CrossfadeView ();
45
46     ARDOUR::Crossfade& crossfade;  // ok, let 'em have it
47     AudioRegionView& left_view;    // and these too
48     AudioRegionView& right_view;
49
50     std::string get_item_name();
51     void set_height (double);
52
53     bool valid() const { return _valid; }
54     bool visible() const { return _visible; }
55     void set_valid (bool yn);
56
57     static sigc::signal<void,CrossfadeView*> GoingAway;
58
59     AudioRegionView& upper_regionview () const;
60
61     void fake_hide ();
62     void hide ();
63     void show ();
64     
65   protected:
66     void reset_width_dependent_items (double pixel_width);
67
68   private:
69     bool _valid;
70     bool _visible;
71
72     double spu;
73
74     GnomeCanvasItem *overlap_rect;
75     GnomeCanvasItem *fade_in;
76     GnomeCanvasItem *fade_out;
77     GnomeCanvasItem *active_button;
78
79     void crossfade_changed (ARDOUR::Change);
80     void active_changed ();
81     void redraw_curves ();
82 };
83
84 #endif /* __gtk_ardour_crossfade_view_h__ */