Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / 0.61.08 / 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 #include "general.h"
36
37 #endif
38
39 /* === U S I N G =========================================================== */
40
41 using namespace std;
42 using namespace etl;
43 using namespace synfig;
44
45 /* === M A C R O S ========================================================= */
46
47 /* === G L O B A L S ======================================================= */
48
49 /* === P R O C E D U R E S ================================================= */
50
51 /* === M E T H O D S ======================================================= */
52
53 /* === E N T R Y P O I N T ================================================= */
54
55 studio::Dialog_SoundSelect::Dialog_SoundSelect(Gtk::Window &/*parent*/, etl::handle<synfigapp::CanvasInterface> ci)
56 :Dialog(_("Sound Select")),
57 okbutton(_("Ok")),
58 canvas_interface(ci)
59 {
60         Gtk::Table *table = manage(new Gtk::Table);
61
62         table->attach(soundfile,0,1,0,1);
63         table->attach(offset,1,2,0,1);
64         table->attach(okbutton,0,2,1,2);
65
66         table->show_all();
67         get_vbox()->pack_start(*table);
68
69         offset.set_value(0);
70
71         okbutton.signal_clicked().connect(sigc::mem_fun(*this,&Dialog_SoundSelect::on_ok));
72 }
73
74 studio::Dialog_SoundSelect::~Dialog_SoundSelect()
75 {
76 }
77
78 void studio::Dialog_SoundSelect::on_file()
79 {
80         signal_file_changed_(soundfile.get_value());
81 }
82
83 void studio::Dialog_SoundSelect::on_offset()
84 {
85         signal_offset_changed_(offset.get_value());
86 }
87
88 void studio::Dialog_SoundSelect::on_ok()
89 {
90         hide();
91
92         //signal_finish_(a);
93         signal_file_changed_(soundfile.get_value());
94         signal_offset_changed_(offset.get_value());
95 }
96
97 void studio::Dialog_SoundSelect::set_global_fps(float f)
98 {
99         offset.set_fps(f);
100 }