summaryrefslogtreecommitdiff
path: root/gtk2_ardour/control_point_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2008-12-18 17:57:37 +0000
committerCarl Hetherington <carl@carlh.net>2008-12-18 17:57:37 +0000
commite8ab0cb95a445ba4a49ae6fb541554bc3172fc8d (patch)
tree9faeed609eb9a329004ffd691cc02287df394fa0 /gtk2_ardour/control_point_dialog.cc
parent883eeb8cf2c717bc0fd121882b484897742f7f28 (diff)
Oops. Missing files from previous commit.
git-svn-id: svn://localhost/ardour2/branches/3.0@4330 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/control_point_dialog.cc')
-rw-r--r--gtk2_ardour/control_point_dialog.cc63
1 files changed, 63 insertions, 0 deletions
diff --git a/gtk2_ardour/control_point_dialog.cc b/gtk2_ardour/control_point_dialog.cc
new file mode 100644
index 0000000000..e61be312a3
--- /dev/null
+++ b/gtk2_ardour/control_point_dialog.cc
@@ -0,0 +1,63 @@
+/*
+ Copyright (C) 2000-2008 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.
+
+*/
+
+#include "control_point_dialog.h"
+#include "control_point.h"
+#include "automation_line.h"
+#include "i18n.h"
+#include <gtkmm/stock.h>
+
+/**
+ * ControlPointDialog constructor.
+ *
+ * @param p ControlPoint to edit.
+ */
+
+ControlPointDialog::ControlPointDialog (ControlPoint* p)
+ : ArdourDialog (_("Control point")),
+ point_ (p)
+{
+ assert (point_);
+
+ double const y_fraction = 1.0 - (p->get_y () / p->line().height ());
+
+ value_.set_text (p->line().fraction_to_string (y_fraction));
+
+ Gtk::HBox* b = Gtk::manage (new Gtk::HBox ());
+
+ b->pack_start (*Gtk::manage (new Gtk::Label (_("Value"))));
+ b->pack_start (value_);
+
+ if (p->line ().get_uses_gain_mapping ()) {
+ b->pack_start (*Gtk::manage (new Gtk::Label (_("dB"))));
+ }
+
+ get_vbox ()->pack_end (*b);
+ b->show_all ();
+
+ add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+ add_button (Gtk::Stock::APPLY, Gtk::RESPONSE_ACCEPT);
+ set_default_response (Gtk::RESPONSE_ACCEPT);
+}
+
+double
+ControlPointDialog::get_y_fraction () const
+{
+ return point_->line().string_to_fraction (value_.get_text ());
+}