initial version
[synfig.git] / synfig-studio / trunk / src / gtkmm / widget_sound.h
1 /* === S I N F G =========================================================== */
2 /*!     \file widget_sound.h
3 **      \brief Widget Sound Header
4 **
5 **      $Id: widget_sound.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SINFG_WIDGET_SOUND_H
25 #define __SINFG_WIDGET_SOUND_H
26
27 /* === H E A D E R S ======================================================= */
28 #include <ETL/handle>
29
30 #include <gtkmm/drawingarea.h>
31
32 #include "widget_timeslider.h"
33
34 /* === M A C R O S ========================================================= */
35
36 /* === T Y P E D E F S ===================================================== */
37
38 /* === C L A S S E S & S T R U C T S ======================================= */
39
40 namespace studio {
41         
42 class AudioProfile;
43 class AudioContainer;
44
45 /*      What can widget sound do?
46         Options:
47         1. Just draw the sound
48         2. Scroll time and draw the sound
49         3. Play, stop, and scrub the sound... (full interaction...)
50         4. Provide hooks for scrubbing to work... (and possibly play and stop in the future)
51
52         Going with 4 for now...
53 */
54 class Widget_Sound : public Widget_Timeslider
55 {
56         etl::handle<AudioProfile>       audioprof;
57         
58         //event override interface
59         virtual bool on_expose_event(GdkEventExpose *heh = 0);
60         
61         //for scrubbing... (click is start, drag is scrub, and release is stop...)
62         virtual bool on_motion_notify_event(GdkEventMotion* event);
63         virtual bool on_button_press_event(GdkEventButton *event);
64         virtual bool on_button_release_event(GdkEventButton *event);
65         
66         //Might want a signal setup for scrubbing... and here it is
67         sigc::signal1<void,double>      signal_start_scrubbing_;
68         sigc::signal1<void,double>      signal_scrub_;
69         sigc::signal0<void>                     signal_stop_scrubbing_;
70         
71 public: //structors
72         Widget_Sound();
73         ~Widget_Sound();
74
75 public: //accessors
76         bool set_profile(etl::handle<AudioProfile>      p);
77         etl::handle<AudioProfile>       get_profile() const;
78
79         //for signal interface
80         sigc::signal1<void,double>      &       signal_start_scrubbing()        {return signal_start_scrubbing_;}
81         sigc::signal1<void,double>      &       signal_scrub()                          {return signal_scrub_;}
82         sigc::signal0<void>                     &       signal_stop_scrubbing()         {return signal_stop_scrubbing_;}
83
84 public: //get set interface
85         void set_position(double t);
86         double get_position() const;
87
88 public: //interface
89         void draw();
90         
91         void clear();
92 };
93
94 }; // END of namespace studio
95
96 /* === E N D =============================================================== */
97
98 #endif