1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006 - 2017 Andreas Persson |
* Copyright (C) 2006 - 2019 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 |
70 |
public PropEditor<DLS::Info> { |
public PropEditor<DLS::Info> { |
71 |
public: |
public: |
72 |
PropDialog(); |
PropDialog(); |
|
void set_info(DLS::Info* info); |
|
73 |
void set_file(gig::File* file); |
void set_file(gig::File* file); |
74 |
|
|
75 |
// implementation for abstract methods of interface class "ManagedWindow" |
// implementation for abstract methods of interface class "ManagedWindow" |
103 |
|
|
104 |
gig::File* m_file; |
gig::File* m_file; |
105 |
|
|
106 |
void onFileFormatChanged(); |
void set_FileFormat(int value); |
107 |
}; |
}; |
108 |
|
|
109 |
class InstrumentProps : public ManagedWindow, |
class InstrumentProps : public ManagedWindow, |
156 |
Gtk::ProgressBar progressBar; |
Gtk::ProgressBar progressBar; |
157 |
}; |
}; |
158 |
|
|
159 |
class Loader : public sigc::trackable { |
class LoaderSaverBase { |
160 |
public: |
public: |
|
Loader(const char* filename); |
|
161 |
void launch(); |
void launch(); |
162 |
Glib::Dispatcher& signal_progress(); |
Glib::Dispatcher& signal_progress(); |
163 |
Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error. |
Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error. |
168 |
Glib::ustring error_message; |
Glib::ustring error_message; |
169 |
gig::File* gig; |
gig::File* gig; |
170 |
|
|
171 |
|
protected: |
172 |
|
LoaderSaverBase(const Glib::ustring filename, gig::File* gig); |
173 |
|
|
174 |
private: |
private: |
175 |
Glib::Threads::Thread* thread; |
Glib::Threads::Thread* thread; |
176 |
void thread_function(); |
void thread_function(); |
177 |
|
virtual void thread_function_sub(gig::progress_t& progress) = 0; |
178 |
Glib::Dispatcher finished_dispatcher; |
Glib::Dispatcher finished_dispatcher; |
179 |
Glib::Dispatcher progress_dispatcher; |
Glib::Dispatcher progress_dispatcher; |
180 |
Glib::Dispatcher error_dispatcher; |
Glib::Dispatcher error_dispatcher; |
182 |
float progress; |
float progress; |
183 |
}; |
}; |
184 |
|
|
185 |
class Saver : public sigc::trackable { |
class Loader : public LoaderSaverBase { |
186 |
|
public: |
187 |
|
Loader(const char* filename); |
188 |
|
|
189 |
|
private: |
190 |
|
void thread_function_sub(gig::progress_t& progress); |
191 |
|
}; |
192 |
|
|
193 |
|
class Saver : public LoaderSaverBase { |
194 |
public: |
public: |
195 |
Saver(gig::File* file, Glib::ustring filename = ""); ///< one argument means "save", two arguments means "save as" |
Saver(gig::File* file, Glib::ustring filename = ""); ///< one argument means "save", two arguments means "save as" |
|
void launch(); |
|
|
Glib::Dispatcher& signal_progress(); |
|
|
Glib::Dispatcher& signal_finished(); ///< Finished successfully, without error. |
|
|
Glib::Dispatcher& signal_error(); |
|
|
void progress_callback(float fraction); |
|
|
float get_progress(); |
|
|
gig::File* gig; |
|
|
const Glib::ustring filename; |
|
|
Glib::ustring error_message; |
|
196 |
|
|
197 |
private: |
private: |
198 |
Glib::Threads::Thread* thread; |
void thread_function_sub(gig::progress_t& progress); |
|
void thread_function(); |
|
|
Glib::Dispatcher finished_dispatcher; |
|
|
Glib::Dispatcher progress_dispatcher; |
|
|
Glib::Dispatcher error_dispatcher; |
|
|
Glib::Threads::Mutex progressMutex; |
|
|
float progress; |
|
199 |
}; |
}; |
200 |
|
|
201 |
class MainWindow : public ManagedWindow { |
class MainWindow : public ManagedWindow { |
647 |
bool on_delete_event(GdkEventAny* event); |
bool on_delete_event(GdkEventAny* event); |
648 |
|
|
649 |
bool first_call_to_drag_data_get; |
bool first_call_to_drag_data_get; |
650 |
|
|
651 |
bool is_copy_samples_unity_note_enabled() const; |
bool is_copy_samples_unity_note_enabled() const; |
652 |
bool is_copy_samples_fine_tune_enabled() const; |
bool is_copy_samples_fine_tune_enabled() const; |
653 |
bool is_copy_samples_loop_enabled() const; |
bool is_copy_samples_loop_enabled() const; |