mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Check if format is valid before starting export
This can happen if e.g. mp3 export is n/a, but a mp3 preset is present.
This commit is contained in:
parent
15e1b8f675
commit
f807ea6ea2
2 changed files with 28 additions and 0 deletions
|
|
@ -125,6 +125,7 @@ SimpleExportDialog::set_session (ARDOUR::Session* s)
|
||||||
ArdourDialog::set_session (s);
|
ArdourDialog::set_session (s);
|
||||||
|
|
||||||
_range_combo.remove_all ();
|
_range_combo.remove_all ();
|
||||||
|
_preset_cfg_connection.disconnect ();
|
||||||
|
|
||||||
if (!s) {
|
if (!s) {
|
||||||
_export_button->set_sensitive (false);
|
_export_button->set_sensitive (false);
|
||||||
|
|
@ -166,6 +167,31 @@ SimpleExportDialog::set_session (ARDOUR::Session* s)
|
||||||
_range_combo.set_active (0);
|
_range_combo.set_active (0);
|
||||||
_range_combo.set_sensitive (true);
|
_range_combo.set_sensitive (true);
|
||||||
_export_button->set_sensitive (true);
|
_export_button->set_sensitive (true);
|
||||||
|
|
||||||
|
_preset_cfg_connection = _eps.CriticalSelectionChanged.connect (sigc::mem_fun (*this, &SimpleExportDialog::check_manager));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SimpleExportDialog::check_manager ()
|
||||||
|
{
|
||||||
|
bool ok = _manager && _manager->preset ();
|
||||||
|
|
||||||
|
if (ok && _manager->get_formats ().empty ()) {
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ok) {
|
||||||
|
/* check for NULL ExportFormatSpecPtr */
|
||||||
|
auto fms = _manager->get_formats ();
|
||||||
|
for (auto const& fm : fms) {
|
||||||
|
if (!fm->format) {
|
||||||
|
ok = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_export_button->set_sensitive (ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ private:
|
||||||
void start_export ();
|
void start_export ();
|
||||||
void close_dialog ();
|
void close_dialog ();
|
||||||
void show_progress ();
|
void show_progress ();
|
||||||
|
void check_manager ();
|
||||||
void set_error (std::string const&);
|
void set_error (std::string const&);
|
||||||
bool progress_timeout ();
|
bool progress_timeout ();
|
||||||
|
|
||||||
|
|
@ -69,6 +70,7 @@ private:
|
||||||
Gtk::ProgressBar _progress_bar;
|
Gtk::ProgressBar _progress_bar;
|
||||||
|
|
||||||
sigc::connection _progress_connection;
|
sigc::connection _progress_connection;
|
||||||
|
sigc::connection _preset_cfg_connection;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue