Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_07_rc2 / src / gtkmm / dialog_soundselect.cpp
1 /* === S Y N F I G ========================================================= */
2 /*!     \file dialog_soundselect.cpp
3 **      \brief Template File
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
10 **      This package is free software; you can redistribute it and/or
11 **      modify it under the terms of the GNU General Public License as
12 **      published by the Free Software Foundation; either version 2 of
13 **      the License, or (at your option) any later version.
14 **
15 **      This package is distributed in the hope that it will be useful,
16 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
17 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 **      General Public License for more details.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === H E A D E R S ======================================================= */
24
25 #ifdef USING_PCH
26 #       include "pch.h"
27 #else
28 #ifdef HAVE_CONFIG_H
29 #       include <config.h>
30 #endif
31
32 #include "dialog_soundselect.h"
33 #include <gtkmm/table.h>
34
35 #endif
36
37 /* === U S I N G =========================================================== */
38
39 using namespace std;
40 using namespace etl;
41 using namespace synfig;
42
43 /* === M A C R O S ========================================================= */
44
45 /* === G L O B A L S ======================================================= */
46
47 /* === P R O C E D U R E S ================================================= */
48
49 /* === M E T H O D S ======================================================= */
50
51 /* === E N T R Y P O I N T ================================================= */
52
53 studio::Dialog_SoundSelect::Dialog_SoundSelect(Gtk::Window &/*parent*/, etl::handle<synfigapp::CanvasInterface> ci)
54 :Dialog(_("Sound Select")),
55 okbutton(_("Ok")),
56 canvas_interface(ci)
57 {
58         Gtk::Table *table = manage(new Gtk::Table);
59
60         table->attach(soundfile,0,1,0,1);
61         table->attach(offset,1,2,0,1);
62         table->attach(okbutton,0,2,1,2);
63
64         table->show_all();
65         get_vbox()->pack_start(*table);
66
67         offset.set_value(0);
68
69         okbutton.signal_clicked().connect(sigc::mem_fun(*this,&Dialog_SoundSelect::on_ok));
70 }
71
72 studio::Dialog_SoundSelect::~Dialog_SoundSelect()
73 {
74 }
75
76 void studio::Dialog_SoundSelect::on_file()
77 {
78         signal_file_changed_(soundfile.get_value());
79 }
80
81 void studio::Dialog_SoundSelect::on_offset()
82 {
83         signal_offset_changed_(offset.get_value());
84 }
85
86 void studio::Dialog_SoundSelect::on_ok()
87 {
88         hide();
89
90         //signal_finish_(a);
91         signal_file_changed_(soundfile.get_value());
92         signal_offset_changed_(offset.get_value());
93 }
94
95 void studio::Dialog_SoundSelect::set_global_fps(float f)
96 {
97         offset.set_fps(f);
98 }