1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006 - 2019 Andreas Persson |
* Copyright (C) 2006 - 2020 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
59 |
#include "dimregionchooser.h" |
#include "dimregionchooser.h" |
60 |
#include "dimregionedit.h" |
#include "dimregionedit.h" |
61 |
#include "midirules.h" |
#include "midirules.h" |
62 |
|
#ifdef GLIB_THREADS |
63 |
#ifndef OLD_THREADS |
#ifndef OLD_THREADS |
64 |
#include <glibmm/threads.h> |
#include <glibmm/threads.h> |
65 |
#endif |
#endif |
66 |
|
#else |
67 |
|
#include <thread> |
68 |
|
#include <mutex> |
69 |
|
#endif |
70 |
#include "ManagedWindow.h" |
#include "ManagedWindow.h" |
71 |
|
|
72 |
class MainWindow; |
class MainWindow; |
73 |
|
|
74 |
class PropDialog : public ManagedWindow, |
class FilePropDialog : public ManagedWindow, |
75 |
public PropEditor<DLS::Info> { |
public PropEditor<DLS::Info> { |
76 |
public: |
public: |
77 |
PropDialog(); |
FilePropDialog(); |
78 |
void set_file(gig::File* file); |
void set_file(gig::File* file); |
79 |
|
|
80 |
// implementation for abstract methods of interface class "ManagedWindow" |
// implementation for abstract methods of interface class "ManagedWindow" |
135 |
void set_MIDIProgram(uint32_t value); |
void set_MIDIProgram(uint32_t value); |
136 |
|
|
137 |
sigc::signal<void> sig_name_changed; |
sigc::signal<void> sig_name_changed; |
138 |
VBox vbox; |
Gtk::Notebook tabs; |
139 |
|
VBox vbox[3]; |
140 |
HButtonBox buttonBox; |
HButtonBox buttonBox; |
141 |
Gtk::Button quitButton; |
Gtk::Button quitButton; |
142 |
|
|
143 |
|
// tab 1 |
144 |
Table table; |
Table table; |
145 |
StringEntry eName; |
StringEntry eName; |
146 |
BoolEntry eIsDrum; |
BoolEntry eIsDrum; |
147 |
NumEntryTemp<uint16_t> eMIDIBank; |
NumEntryTemp<uint16_t> eMIDIBank; |
148 |
NumEntryTemp<uint32_t> eMIDIProgram; |
NumEntryTemp<uint32_t> eMIDIProgram; |
149 |
NumEntryGain eAttenuation; |
NumEntryGain eAttenuation; |
|
BoolEntryPlus6 eGainPlus6; |
|
150 |
NumEntryTemp<uint16_t> eEffectSend; |
NumEntryTemp<uint16_t> eEffectSend; |
151 |
NumEntryTemp<int16_t> eFineTune; |
NumEntryTemp<int16_t> eFineTune; |
152 |
NumEntryTemp<uint16_t> ePitchbendRange; |
NumEntryTemp<uint16_t> ePitchbendRange; |
153 |
BoolEntry ePianoReleaseMode; |
BoolEntry ePianoReleaseMode; |
154 |
NoteEntry eDimensionKeyRangeLow; |
NoteEntry eDimensionKeyRangeLow; |
155 |
NoteEntry eDimensionKeyRangeHigh; |
NoteEntry eDimensionKeyRangeHigh; |
156 |
|
|
157 |
|
// tab 2 |
158 |
|
Table table2; |
159 |
|
StringEntry eName2; |
160 |
|
StringEntry eCreationDate; |
161 |
|
StringEntryMultiLine eComments; |
162 |
|
StringEntry eProduct; |
163 |
|
StringEntry eCopyright; |
164 |
|
StringEntry eArtists; |
165 |
|
StringEntry eGenre; |
166 |
|
StringEntry eKeywords; |
167 |
|
StringEntry eEngineer; |
168 |
|
StringEntry eTechnician; |
169 |
|
StringEntry eSoftware; |
170 |
|
StringEntry eMedium; |
171 |
|
StringEntry eSource; |
172 |
|
StringEntry eSourceForm; |
173 |
|
StringEntry eCommissioned; |
174 |
|
StringEntry eSubject; |
175 |
|
}; |
176 |
|
|
177 |
|
class SampleProps : public ManagedWindow, |
178 |
|
public PropEditor<gig::Sample> { |
179 |
|
public: |
180 |
|
SampleProps(); |
181 |
|
void set_sample(gig::Sample* sample); |
182 |
|
gig::Sample* get_sample() { return m; } |
183 |
|
void update_name(); |
184 |
|
sigc::signal<void>& signal_name_changed() { |
185 |
|
return sig_name_changed; |
186 |
|
} |
187 |
|
|
188 |
|
// implementation for abstract methods of interface class "ManagedWindow" |
189 |
|
virtual Settings::Property<int>* windowSettingX() { return &Settings::singleton()->samplePropsWindowX; } |
190 |
|
virtual Settings::Property<int>* windowSettingY() { return &Settings::singleton()->samplePropsWindowY; } |
191 |
|
virtual Settings::Property<int>* windowSettingWidth() { return &Settings::singleton()->samplePropsWindowW; } |
192 |
|
virtual Settings::Property<int>* windowSettingHeight() { return &Settings::singleton()->samplePropsWindowH; } |
193 |
|
|
194 |
|
protected: |
195 |
|
void set_Name(const gig::String& name); |
196 |
|
|
197 |
|
sigc::signal<void> sig_name_changed; |
198 |
|
Gtk::Notebook tabs; |
199 |
|
VBox vbox[3]; |
200 |
|
HButtonBox buttonBox; |
201 |
|
Gtk::Button quitButton; |
202 |
|
|
203 |
|
// tab 1 |
204 |
|
Table table; |
205 |
|
StringEntry eName; |
206 |
|
NoteEntry eUnityNote; |
207 |
|
ReadOnlyLabelWidget eSampleGroup; |
208 |
|
ReadOnlyLabelWidget eSampleFormatInfo; |
209 |
|
ReadOnlyLabelWidget eSampleID; |
210 |
|
ReadOnlyLabelWidget eChecksum; |
211 |
|
NumEntryTemp<uint32_t> eLoopsCount; |
212 |
|
NumEntryTemp<uint32_t> eLoopStart; |
213 |
|
NumEntryTemp<uint32_t> eLoopLength; |
214 |
|
ChoiceEntry<gig::loop_type_t> eLoopType; |
215 |
|
NumEntryTemp<uint32_t> eLoopPlayCount; |
216 |
|
// tab 2 |
217 |
|
Table table2; |
218 |
|
StringEntry eName2; |
219 |
|
StringEntry eCreationDate; |
220 |
|
StringEntryMultiLine eComments; |
221 |
|
StringEntry eProduct; |
222 |
|
StringEntry eCopyright; |
223 |
|
StringEntry eArtists; |
224 |
|
StringEntry eGenre; |
225 |
|
StringEntry eKeywords; |
226 |
|
StringEntry eEngineer; |
227 |
|
StringEntry eTechnician; |
228 |
|
StringEntry eSoftware; |
229 |
|
StringEntry eMedium; |
230 |
|
StringEntry eSource; |
231 |
|
StringEntry eSourceForm; |
232 |
|
StringEntry eCommissioned; |
233 |
|
StringEntry eSubject; |
234 |
}; |
}; |
235 |
|
|
236 |
class ProgressDialog : public Gtk::Dialog { |
class ProgressDialog : public Gtk::Dialog { |
258 |
LoaderSaverBase(const Glib::ustring filename, gig::File* gig); |
LoaderSaverBase(const Glib::ustring filename, gig::File* gig); |
259 |
|
|
260 |
private: |
private: |
261 |
|
#ifdef GLIB_THREADS |
262 |
Glib::Threads::Thread* thread; |
Glib::Threads::Thread* thread; |
263 |
|
Glib::Threads::Mutex progressMutex; |
264 |
|
#else |
265 |
|
std::thread thread; |
266 |
|
std::mutex progressMutex; |
267 |
|
#endif |
268 |
void thread_function(); |
void thread_function(); |
269 |
virtual void thread_function_sub(gig::progress_t& progress) = 0; |
virtual void thread_function_sub(gig::progress_t& progress) = 0; |
270 |
Glib::Dispatcher finished_dispatcher; |
Glib::Dispatcher finished_dispatcher; |
271 |
Glib::Dispatcher progress_dispatcher; |
Glib::Dispatcher progress_dispatcher; |
272 |
Glib::Dispatcher error_dispatcher; |
Glib::Dispatcher error_dispatcher; |
|
Glib::Threads::Mutex progressMutex; |
|
273 |
float progress; |
float progress; |
274 |
}; |
}; |
275 |
|
|
352 |
Glib::RefPtr<Gio::SimpleAction> m_actionEditScript; |
Glib::RefPtr<Gio::SimpleAction> m_actionEditScript; |
353 |
Glib::RefPtr<Gio::SimpleAction> m_actionRemoveScript; |
Glib::RefPtr<Gio::SimpleAction> m_actionRemoveScript; |
354 |
|
|
355 |
|
Glib::RefPtr<Gio::SimpleAction> m_actionInstrDoubleClickOpensProps; |
356 |
|
|
357 |
Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleUnity; |
Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleUnity; |
358 |
Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleTune; |
Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleTune; |
359 |
Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleLoop; |
Glib::RefPtr<Gio::SimpleAction> m_actionToggleCopySampleLoop; |
373 |
RegionChooser m_RegionChooser; |
RegionChooser m_RegionChooser; |
374 |
DimRegionChooser m_DimRegionChooser; |
DimRegionChooser m_DimRegionChooser; |
375 |
|
|
376 |
PropDialog propDialog; |
FilePropDialog fileProps; |
377 |
InstrumentProps instrumentProps; |
InstrumentProps instrumentProps; |
378 |
|
SampleProps sampleProps; |
379 |
MidiRules midiRules; |
MidiRules midiRules; |
380 |
|
|
381 |
/** |
/** |
410 |
#if !USE_GTKMM_BUILDER |
#if !USE_GTKMM_BUILDER |
411 |
void on_instrument_selection_change(Gtk::RadioMenuItem* item); |
void on_instrument_selection_change(Gtk::RadioMenuItem* item); |
412 |
#endif |
#endif |
413 |
|
void on_action_move_instr(); |
414 |
void on_sel_change(); |
void on_sel_change(); |
415 |
void region_changed(); |
void region_changed(); |
416 |
void dimreg_changed(); |
void dimreg_changed(); |
570 |
void on_action_quit(); |
void on_action_quit(); |
571 |
void show_instr_props(); |
void show_instr_props(); |
572 |
bool instr_props_set_instrument(); |
bool instr_props_set_instrument(); |
573 |
|
void show_sample_props(); |
574 |
|
bool sample_props_set_sample(); |
575 |
|
void sample_name_changed_by_sample_props(Gtk::TreeModel::iterator& it); |
576 |
void show_midi_rules(); |
void show_midi_rules(); |
577 |
void show_script_slots(); |
void show_script_slots(); |
578 |
void on_action_view_status_bar(); |
void on_action_view_status_bar(); |
579 |
void on_auto_restore_win_dim(); |
void on_auto_restore_win_dim(); |
580 |
|
void on_instr_double_click_opens_props(); |
581 |
void on_save_with_temporary_file(); |
void on_save_with_temporary_file(); |
582 |
void on_action_refresh_all(); |
void on_action_refresh_all(); |
583 |
void on_action_warn_user_on_extensions(); |
void on_action_warn_user_on_extensions(); |