2007-04-26 16:54:31 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2000-2007 Paul Davis
|
|
|
|
|
|
|
|
This program 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 program 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.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
#ifndef __ardour_gtk_automation_time_axis_h__
|
|
|
|
#define __ardour_gtk_automation_time_axis_h__
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <list>
|
|
|
|
#include <string>
|
2007-06-29 00:02:58 -04:00
|
|
|
#include <utility>
|
2006-07-27 12:52:14 -04:00
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/types.h"
|
|
|
|
#include "ardour/automatable.h"
|
|
|
|
#include "ardour/automation_list.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-15 21:57:22 -05:00
|
|
|
#include "canvas.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "time_axis_view.h"
|
2005-11-12 22:53:51 -05:00
|
|
|
#include "simplerect.h"
|
2007-06-29 00:02:58 -04:00
|
|
|
#include "automation_controller.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
using std::vector;
|
|
|
|
using std::list;
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
class Route;
|
2007-09-05 22:30:39 -04:00
|
|
|
class AutomationControl;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
class PublicEditor;
|
|
|
|
class TimeSelection;
|
2006-07-31 23:23:35 -04:00
|
|
|
class RegionSelection;
|
2005-09-25 14:42:24 -04:00
|
|
|
class PointSelection;
|
|
|
|
class AutomationLine;
|
|
|
|
class Selection;
|
|
|
|
class Selectable;
|
2007-09-05 22:30:39 -04:00
|
|
|
class AutomationStreamView;
|
|
|
|
class AutomationController;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-06-30 14:41:50 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
class AutomationTimeAxisView : public TimeAxisView {
|
|
|
|
public:
|
|
|
|
AutomationTimeAxisView (ARDOUR::Session&,
|
2006-07-27 12:52:14 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Route>,
|
2007-06-30 14:41:50 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Automatable>,
|
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl>,
|
2005-09-25 14:42:24 -04:00
|
|
|
PublicEditor&,
|
|
|
|
TimeAxisView& parent,
|
2007-09-05 22:30:39 -04:00
|
|
|
bool show_regions,
|
2005-11-15 21:57:22 -05:00
|
|
|
ArdourCanvas::Canvas& canvas,
|
2005-12-22 07:23:54 -05:00
|
|
|
const string & name, /* translatable */
|
|
|
|
const string & plug_name = "");
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
~AutomationTimeAxisView();
|
|
|
|
|
2008-09-12 05:01:52 -04:00
|
|
|
virtual void set_height (uint32_t);
|
2005-09-25 14:42:24 -04:00
|
|
|
void set_samples_per_unit (double);
|
|
|
|
std::string name() const { return _name; }
|
|
|
|
|
2007-06-30 14:41:50 -04:00
|
|
|
void add_automation_event (ArdourCanvas::Item *item, GdkEvent *event, nframes_t, double);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-06-30 14:41:50 -04:00
|
|
|
void clear_lines ();
|
|
|
|
boost::shared_ptr<AutomationLine> line() { return _line; }
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void set_selected_points (PointSelection&);
|
2006-09-28 13:23:52 -04:00
|
|
|
void get_selectables (nframes_t start, nframes_t end, double top, double bot, list<Selectable *>&);
|
2005-09-25 14:42:24 -04:00
|
|
|
void get_inverted_selectables (Selection&, list<Selectable*>& results);
|
|
|
|
|
2006-09-28 13:23:52 -04:00
|
|
|
void show_timestretch (nframes_t start, nframes_t end) {}
|
2005-09-25 14:42:24 -04:00
|
|
|
void hide_timestretch () {}
|
|
|
|
|
|
|
|
/* editing operations */
|
|
|
|
|
|
|
|
bool cut_copy_clear (Selection&, Editing::CutCopyOp);
|
|
|
|
bool cut_copy_clear_objects (PointSelection&, Editing::CutCopyOp);
|
2006-09-28 13:23:52 -04:00
|
|
|
bool paste (nframes_t, float times, Selection&, size_t nth);
|
2006-05-19 16:10:35 -04:00
|
|
|
void reset_objects (PointSelection&);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-09-10 11:03:30 -04:00
|
|
|
int set_state (const XMLNode&);
|
2007-06-30 14:41:50 -04:00
|
|
|
|
|
|
|
guint32 show_at (double y, int& nth, Gtk::VBox *parent);
|
|
|
|
void hide ();
|
2007-07-03 20:39:00 -04:00
|
|
|
|
|
|
|
static const string state_node_name;
|
|
|
|
XMLNode* get_state_node();
|
2007-09-05 22:30:39 -04:00
|
|
|
|
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> control() { return _control; }
|
|
|
|
boost::shared_ptr<AutomationController> controller() { return _controller; }
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
protected:
|
2007-06-30 14:41:50 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Route> _route; ///< Parent route
|
|
|
|
boost::shared_ptr<ARDOUR::AutomationControl> _control; ///< Control
|
|
|
|
boost::shared_ptr<ARDOUR::Automatable> _automatable; ///< Control owner, maybe = _route
|
|
|
|
|
|
|
|
boost::shared_ptr<AutomationController> _controller;
|
|
|
|
|
|
|
|
ArdourCanvas::SimpleRect* _base_rect;
|
|
|
|
boost::shared_ptr<AutomationLine> _line;
|
2007-09-05 22:30:39 -04:00
|
|
|
AutomationStreamView* _view;
|
2007-06-30 14:41:50 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
string _name;
|
2007-06-29 00:02:58 -04:00
|
|
|
bool ignore_toggle;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-03 07:54:06 -04:00
|
|
|
bool first_call_to_set_height;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::Button hide_button;
|
|
|
|
Gtk::Button auto_button;
|
|
|
|
Gtk::Menu* automation_menu;
|
|
|
|
Gtk::Label* plugname;
|
|
|
|
bool plugname_packed;
|
|
|
|
|
|
|
|
Gtk::CheckMenuItem* auto_off_item;
|
|
|
|
Gtk::CheckMenuItem* auto_play_item;
|
|
|
|
Gtk::CheckMenuItem* auto_touch_item;
|
|
|
|
Gtk::CheckMenuItem* auto_write_item;
|
|
|
|
|
2007-07-06 23:19:04 -04:00
|
|
|
Gtk::CheckMenuItem* mode_discrete_item;
|
|
|
|
Gtk::CheckMenuItem* mode_line_item;
|
|
|
|
|
2007-06-30 14:41:50 -04:00
|
|
|
void add_line (boost::shared_ptr<AutomationLine>);
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void clear_clicked ();
|
|
|
|
void hide_clicked ();
|
|
|
|
void auto_clicked ();
|
|
|
|
|
2007-06-30 14:41:50 -04:00
|
|
|
void build_display_menu ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
bool cut_copy_clear_one (AutomationLine&, Selection&, Editing::CutCopyOp);
|
|
|
|
bool cut_copy_clear_objects_one (AutomationLine&, PointSelection&, Editing::CutCopyOp);
|
2006-09-28 13:23:52 -04:00
|
|
|
bool paste_one (AutomationLine&, nframes_t, float times, Selection&, size_t nth);
|
2006-05-19 16:10:35 -04:00
|
|
|
void reset_objects_one (AutomationLine&, PointSelection&);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-06-29 00:02:58 -04:00
|
|
|
void set_automation_state (ARDOUR::AutoState);
|
2005-09-25 14:42:24 -04:00
|
|
|
bool ignore_state_request;
|
|
|
|
|
|
|
|
void automation_state_changed ();
|
2007-07-06 23:19:04 -04:00
|
|
|
|
|
|
|
void set_interpolation (ARDOUR::AutomationList::InterpolationStyle);
|
|
|
|
void interpolation_changed ();
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
sigc::connection automation_connection;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-06-30 14:41:50 -04:00
|
|
|
void update_extra_xml_shown (bool editor_shown);
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void entered ();
|
|
|
|
void exited ();
|
2006-12-14 11:21:43 -05:00
|
|
|
|
2008-02-10 13:16:25 -05:00
|
|
|
//void set_colors ();
|
2007-06-15 18:08:27 -04:00
|
|
|
void color_handler ();
|
2007-04-11 09:07:51 -04:00
|
|
|
|
2007-07-03 17:02:29 -04:00
|
|
|
static Pango::FontDescription* name_font;
|
2006-12-14 11:21:43 -05:00
|
|
|
static bool have_name_font;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_gtk_automation_time_axis_h__ */
|