2 Copyright (C) 2014 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <gtkmm/stock.h>
23 #include "ruler_dialog.h"
27 RulerDialog::RulerDialog ()
28 : ArdourDialog (_("Rulers"))
30 add_button (Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT);
32 get_vbox()->pack_start (samples_button);
33 get_vbox()->pack_start (timecode_button);
34 get_vbox()->pack_start (minsec_button);
35 get_vbox()->pack_start (bbt_button);
36 get_vbox()->pack_start (tempo_button);
37 get_vbox()->pack_start (meter_button);
38 get_vbox()->pack_start (loop_punch_button);
39 get_vbox()->pack_start (range_button);
40 get_vbox()->pack_start (mark_button);
41 get_vbox()->pack_start (cdmark_button);
42 get_vbox()->pack_start (video_button);
44 get_vbox()->show_all ();
46 connect_action (samples_button, "samples-ruler");
47 connect_action (timecode_button, "timecode-ruler");
48 connect_action (minsec_button, "minsec-ruler");
49 connect_action (bbt_button, "bbt-ruler");
50 connect_action (tempo_button, "tempo-ruler");
51 connect_action (meter_button, "meter-ruler");
52 connect_action (loop_punch_button, "loop-punch-ruler");
53 connect_action (range_button, "range-ruler");
54 connect_action (mark_button, "marker-ruler");
55 connect_action (cdmark_button, "cd-marker-ruler");
56 connect_action (video_button, "video-ruler");
59 RulerDialog::~RulerDialog ()
64 RulerDialog::on_response (int)
70 RulerDialog::connect_action (Gtk::CheckButton& button, std::string const &action_name_part)
72 std::string action_name = "toggle-";
73 action_name += action_name_part;
75 Glib::RefPtr<Gtk::Action> act = ActionManager::get_action ("Rulers", action_name.c_str());
80 Glib::RefPtr<Gtk::ToggleAction> tact = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic (act);
85 tact->connect_proxy (button);