- Main Page
- Related Pages
- Namespaces
- Classes
- Files

# widget_sound.h

Go to the documentation of this file.

    00001 /* === S Y N F I G ========================================================= */
    00021 /* ========================================================================= */
    00022
    00023 /* === S T A R T =========================================================== */
    00024
    00025 #ifndef __SYNFIG_WIDGET_SOUND_H
    00026 #define __SYNFIG_WIDGET_SOUND_H
    00027
    00028 /* === H E A D E R S ======================================================= */
    00029 #include <ETL/handle>
    00030
    00031 #include <gtkmm/drawingarea.h>
    00032
    00033 #include "widget_timeslider.h"
    00034
    00035 /* === M A C R O S ========================================================= */
    00036
    00037 /* === T Y P E D E F S ===================================================== */
    00038
    00039 /* === C L A S S E S & S T R U C T S ======================================= */
    00040
    00041 namespace studio {
    00042
    00043 class AudioProfile;
    00044 class AudioContainer;
    00045
    00046 /*  What can widget sound do?
    00047     Options:
    00048     1. Just draw the sound
    00049     2. Scroll time and draw the sound
    00050     3. Play, stop, and scrub the sound... (full interaction...)
    00051     4. Provide hooks for scrubbing to work... (and possibly play and stop in the future)
    00052
    00053     Going with 4 for now...
    00054 */
    00055 class Widget_Sound : public Widget_Timeslider
    00056 {
    00057     etl::handle<AudioProfile>   audioprof;
    00058
    00059     //event override interface
    00060     virtual bool on_expose_event(GdkEventExpose *heh = 0);
    00061
    00062     //for scrubbing... (click is start, drag is scrub, and release is stop...)
    00063     virtual bool on_motion_notify_event(GdkEventMotion* event);
    00064     virtual bool on_button_press_event(GdkEventButton *event);
    00065     virtual bool on_button_release_event(GdkEventButton *event);
    00066
    00067     //Might want a signal setup for scrubbing... and here it is
    00068     sigc::signal1<void,double>  signal_start_scrubbing_;
    00069     sigc::signal1<void,double>  signal_scrub_;
    00070     sigc::signal0<void>         signal_stop_scrubbing_;
    00071
    00072 public: //structors
    00073     Widget_Sound();
    00074     ~Widget_Sound();
    00075
    00076 public: //accessors
    00077     bool set_profile(etl::handle<AudioProfile>  p);
    00078     etl::handle<AudioProfile>   get_profile() const;
    00079
    00080     //for signal interface
    00081     sigc::signal1<void,double>  &   signal_start_scrubbing()    {return signal_start_scrubbing_;}
    00082     sigc::signal1<void,double>  &   signal_scrub()              {return signal_scrub_;}
    00083     sigc::signal0<void>         &   signal_stop_scrubbing()     {return signal_stop_scrubbing_;}
    00084
    00085 public: //get set interface
    00086     void set_position(double t);
    00087     double get_position() const;
    00088
    00089 public: //interface
    00090     void draw();
    00091
    00092     void clear();
    00093 };
    00094
    00095 }; // END of namespace studio
    00096
    00097 /* === E N D =============================================================== */
    00098
    00099 #endif