X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftags%2F0.61.08%2Fsrc%2Fgtkmm%2Fwidget_sound.h;fp=synfig-studio%2Ftags%2F0.61.08%2Fsrc%2Fgtkmm%2Fwidget_sound.h;h=0db129d8954e867f904f799d1b094e97e46125d8;hb=79fcd5b32f0accf9f1d13f9b6ded0d628e6f4b33;hp=0000000000000000000000000000000000000000;hpb=c1f365570ac471ede0668ad976fad345747aa8de;p=synfig.git diff --git a/synfig-studio/tags/0.61.08/src/gtkmm/widget_sound.h b/synfig-studio/tags/0.61.08/src/gtkmm/widget_sound.h new file mode 100644 index 0000000..0db129d --- /dev/null +++ b/synfig-studio/tags/0.61.08/src/gtkmm/widget_sound.h @@ -0,0 +1,99 @@ +/* === S Y N F I G ========================================================= */ +/*! \file widget_sound.h +** \brief Widget Sound Header +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. +** +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. +** \endlegal +*/ +/* ========================================================================= */ + +/* === S T A R T =========================================================== */ + +#ifndef __SYNFIG_WIDGET_SOUND_H +#define __SYNFIG_WIDGET_SOUND_H + +/* === H E A D E R S ======================================================= */ +#include + +#include + +#include "widget_timeslider.h" + +/* === M A C R O S ========================================================= */ + +/* === T Y P E D E F S ===================================================== */ + +/* === C L A S S E S & S T R U C T S ======================================= */ + +namespace studio { + +class AudioProfile; +class AudioContainer; + +/* What can widget sound do? + Options: + 1. Just draw the sound + 2. Scroll time and draw the sound + 3. Play, stop, and scrub the sound... (full interaction...) + 4. Provide hooks for scrubbing to work... (and possibly play and stop in the future) + + Going with 4 for now... +*/ +class Widget_Sound : public Widget_Timeslider +{ + etl::handle audioprof; + + //event override interface + virtual bool on_expose_event(GdkEventExpose *heh = 0); + + //for scrubbing... (click is start, drag is scrub, and release is stop...) + virtual bool on_motion_notify_event(GdkEventMotion* event); + virtual bool on_button_press_event(GdkEventButton *event); + virtual bool on_button_release_event(GdkEventButton *event); + + //Might want a signal setup for scrubbing... and here it is + sigc::signal1 signal_start_scrubbing_; + sigc::signal1 signal_scrub_; + sigc::signal0 signal_stop_scrubbing_; + +public: //structors + Widget_Sound(); + ~Widget_Sound(); + +public: //accessors + bool set_profile(etl::handle p); + etl::handle get_profile() const; + + //for signal interface + sigc::signal1 & signal_start_scrubbing() {return signal_start_scrubbing_;} + sigc::signal1 & signal_scrub() {return signal_scrub_;} + sigc::signal0 & signal_stop_scrubbing() {return signal_stop_scrubbing_;} + +public: //get set interface + void set_position(double t); + double get_position() const; + +public: //interface + void draw(); + + void clear(); +}; + +}; // END of namespace studio + +/* === E N D =============================================================== */ + +#endif