1 /* === S Y N F I G ========================================================= */
2 /*! \file dialog_soundselect.cpp
3 ** \brief Template File
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2008 David Roden
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === H E A D E R S ======================================================= */
33 #include "dialog_soundselect.h"
34 #include <gtkmm/alignment.h>
35 #include <gtkmm/frame.h>
36 #include <gtkmm/label.h>
37 #include <gtkmm/table.h>
43 /* === U S I N G =========================================================== */
47 using namespace synfig;
49 /* === M A C R O S ========================================================= */
51 /* === G L O B A L S ======================================================= */
53 /* === P R O C E D U R E S ================================================= */
55 /* === M E T H O D S ======================================================= */
57 /* === E N T R Y P O I N T ================================================= */
59 studio::Dialog_SoundSelect::Dialog_SoundSelect(Gtk::Window &parent, etl::handle<synfigapp::CanvasInterface> ci)
60 :Dialog(_("Sound Select"), parent, false, true),
63 Gtk::Alignment *dialogPadding = manage(new Gtk::Alignment(0, 0, 1, 1));
64 dialogPadding->set_padding(12, 12, 12, 12);
65 get_vbox()->pack_start(*dialogPadding, false, false, 0);
67 Gtk::Frame *soundFrame = manage(new Gtk::Frame(_("Sound Parameters")));
68 ((Gtk::Label *) soundFrame->get_label_widget())->set_markup(_("<b>Sound Parameters</b>"));
69 soundFrame->set_shadow_type(Gtk::SHADOW_NONE);
70 dialogPadding->add(*soundFrame);
72 Gtk::Alignment *framePadding = manage(new Gtk::Alignment(0, 0, 1, 1));
73 framePadding->set_padding(6, 0, 24, 0);
74 soundFrame->add(*framePadding);
76 Gtk::Label *fileLabel = manage(new Gtk::Label(_("_Sound File"), true));
77 fileLabel->set_alignment(0, 0.5);
78 fileLabel->set_mnemonic_widget(soundfile);
79 Gtk::Label *offsetLabel = manage(new Gtk::Label(_("Time _Offset"), true));
80 offsetLabel->set_alignment(0, 0.5);
81 offsetLabel->set_mnemonic_widget(offset);
83 Gtk::Table *table = manage(new Gtk::Table(2, 2, false));
84 table->set_row_spacings(6);
85 table->set_col_spacings(12);
86 framePadding->add(*table);
88 table->attach(*fileLabel, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
89 table->attach(soundfile, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
90 table->attach(*offsetLabel, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
91 table->attach(offset, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::SHRINK | Gtk::FILL, 0, 0);
93 okbutton = manage(new Gtk::Button(Gtk::StockID("gtk-ok")));
94 add_action_widget(*okbutton, 0);
96 get_vbox()->show_all();
100 okbutton->signal_clicked().connect(sigc::mem_fun(*this,&Dialog_SoundSelect::on_ok));
103 studio::Dialog_SoundSelect::~Dialog_SoundSelect()
107 void studio::Dialog_SoundSelect::on_file()
109 signal_file_changed_(soundfile.get_value());
112 void studio::Dialog_SoundSelect::on_offset()
114 signal_offset_changed_(offset.get_value());
117 void studio::Dialog_SoundSelect::on_ok()
122 signal_file_changed_(soundfile.get_value());
123 signal_offset_changed_(offset.get_value());
126 void studio::Dialog_SoundSelect::set_global_fps(float f)