~ubuntu-branches/ubuntu/precise/gigedit/precise

« back to all changes in this revision

Viewing changes to src/gigedit/mainwindow.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2011-02-08 23:43:24 UTC
  • mfrom: (3.1.2 natty)
  • Revision ID: james.westby@ubuntu.com-20110208234324-y4etux3ihk36apjf
Tags: 0.2.0-1
* Upload to unstable.
* debian/gbp.conf: Set sign-tags to True.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*                                                         -*- c++ -*-
2
 
 * Copyright (C) 2006, 2007 Andreas Persson
 
2
 * Copyright (C) 2006 - 2008 Andreas Persson
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or
5
5
 * modify it under the terms of the GNU General Public License as
43
43
 
44
44
class MainWindow;
45
45
 
 
46
class Table : public Gtk::Table
 
47
{
 
48
public:
 
49
    Table(int x, int y);
 
50
    void add(BoolEntry& boolentry);
 
51
    void add(BoolEntryPlus6& boolentry);
 
52
    void add(LabelWidget& labelwidget);
 
53
private:
 
54
    int rowno;
 
55
};
 
56
 
46
57
class PropDialog : public Gtk::Window {
47
58
public:
48
59
    PropDialog();
49
60
    void set_info(DLS::Info* info);
 
61
    sigc::signal<void>& signal_info_changed();
50
62
protected:
51
 
    Gtk::Table table;
52
 
    Gtk::Label label[16];
53
 
    Gtk::Entry entry[16];
 
63
    sigc::signal<void> info_changed;
 
64
    StringEntry eName;
 
65
    StringEntry eCreationDate;
 
66
    StringEntryMultiLine eComments;
 
67
    StringEntry eProduct;
 
68
    StringEntry eCopyright;
 
69
    StringEntry eArtists;
 
70
    StringEntry eGenre;
 
71
    StringEntry eKeywords;
 
72
    StringEntry eEngineer;
 
73
    StringEntry eTechnician;
 
74
    StringEntry eSoftware;
 
75
    StringEntry eMedium;
 
76
    StringEntry eSource;
 
77
    StringEntry eSourceForm;
 
78
    StringEntry eCommissioned;
 
79
    StringEntry eSubject;
 
80
    Gtk::VBox vbox;
 
81
    Gtk::HButtonBox buttonBox;
 
82
    Gtk::Button quitButton;
 
83
    Table table;
 
84
    int update_model;
 
85
    DLS::Info* info;
 
86
 
 
87
    template<typename T>
 
88
    void set_member(T value, T DLS::Info::* member) {
 
89
        if (update_model == 0) {
 
90
            info->*member = value;
 
91
            info_changed();
 
92
        }
 
93
    }
 
94
 
 
95
    template<typename C, typename T>
 
96
    void connect(C& widget, T DLS::Info::* member) {
 
97
        widget.signal_value_changed().connect(
 
98
            sigc::compose(
 
99
                sigc::bind(sigc::mem_fun(*this, &PropDialog::set_member<T>), member),
 
100
                sigc::mem_fun(widget, &C::get_value)));
 
101
    }
54
102
};
55
103
 
56
104
class InstrumentProps : public Gtk::Window {
102
150
    Gtk::VBox vbox;
103
151
    Gtk::HButtonBox buttonBox;
104
152
    Gtk::Button quitButton;
105
 
    Gtk::Table table;
 
153
    Table table;
106
154
    StringEntry eName;
107
155
    BoolEntry eIsDrum;
108
156
    NumEntryTemp<uint16_t> eMIDIBank;
115
163
    BoolEntry ePianoReleaseMode;
116
164
    NoteEntry eDimensionKeyRangeLow;
117
165
    NoteEntry eDimensionKeyRangeHigh;
118
 
    int rowno;
119
 
    void add_prop(BoolEntry& prop);
120
 
    void add_prop(BoolEntryPlus6& prop);
121
 
    void add_prop(LabelWidget& prop);
122
166
    sigc::signal<void> instrument_changed;
123
167
};
124
168
 
165
209
    sigc::signal<void, gig::Region*>& signal_region_changed();
166
210
    sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_to_be_changed();
167
211
    sigc::signal<void, gig::DimensionRegion*>& signal_dimreg_changed();
 
212
    sigc::signal<void, gig::Sample*>& signal_sample_changed();
168
213
    sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/>& signal_sample_ref_changed();
169
214
 
 
215
    sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_on();
 
216
    sigc::signal<void, int/*key*/, int/*velocity*/>& signal_note_off();
 
217
 
 
218
    sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_hit();
 
219
    sigc::signal<void, int/*key*/, int/*velocity*/>& signal_keyboard_key_released();
 
220
 
170
221
protected:
171
222
    Glib::RefPtr<Gtk::ActionGroup> actionGroup;
172
223
    Glib::RefPtr<Gtk::UIManager> uiManager;
189
240
    sigc::signal<void, gig::Region*> region_changed_signal;
190
241
    sigc::signal<void, gig::DimensionRegion*> dimreg_to_be_changed_signal;
191
242
    sigc::signal<void, gig::DimensionRegion*> dimreg_changed_signal;
 
243
    sigc::signal<void, gig::Sample*> sample_changed_signal;
192
244
    sigc::signal<void, gig::Sample*/*old*/, gig::Sample*/*new*/> sample_ref_changed_signal;
193
245
 
 
246
    sigc::signal<void, int/*key*/, int/*velocity*/> note_on_signal;
 
247
    sigc::signal<void, int/*key*/, int/*velocity*/> note_off_signal;
 
248
 
194
249
    void on_instrument_selection_change(int index);
195
250
    void on_sel_change();
196
251
    void region_changed();
283
338
    void on_action_sample_properties();
284
339
    void on_action_add_group();
285
340
    void on_action_add_sample();
 
341
    void on_action_replace_all_samples_in_all_groups();
286
342
    void on_action_remove_sample();
287
343
 
288
344
    void on_action_add_instrument();
297
353
    bool file_has_name;
298
354
    bool file_is_changed;
299
355
    std::string filename;
300
 
    std::string current_dir;
 
356
    std::string current_gig_dir;
 
357
    std::string current_sample_dir;
301
358
 
302
359
    void set_file_is_shared(bool);
303
360