#include "static_text.h"
#include "lib/constants.h"
#include <dcp/file.h>
+#include <dcp/filesystem.h>
#include <dcp/raw_convert.h>
languages.push_back (make_pair("Deutsch", "de_DE"));
languages.push_back (make_pair("English", "en_GB"));
languages.push_back (make_pair("Español", "es_ES"));
+ languages.push_back (make_pair("فارسی", "fa_IR"));
languages.push_back (make_pair("Français", "fr_FR"));
languages.push_back (make_pair("Italiano", "it_IT"));
+ languages.push_back (make_pair("ქართული", "ka_KA"));
languages.push_back (make_pair("Nederlands", "nl_NL"));
languages.push_back (make_pair("Русский", "ru_RU"));
languages.push_back (make_pair("Polski", "pl_PL"));
void
CertificateChainEditor::add_certificate ()
{
- auto d = new wxFileDialog (this, _("Select Certificate File"));
- ScopeGuard sg = [d]() { d->Destroy(); };
+ auto d = make_wx<wxFileDialog>(this, _("Select Certificate File"));
if (d->ShowModal() == wxID_OK) {
try {
default_name = "intermediate.pem";
}
- auto d = new wxFileDialog(
+ auto d = make_wx<wxFileDialog>(
this, _("Select Certificate File"), wxEmptyString, default_name, wxT ("PEM files (*.pem)|*.pem"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT
);
- ScopeGuard sg = [d]() { d->Destroy(); };
auto j = all.begin ();
for (int k = 0; k < i; ++k) {
void
CertificateChainEditor::export_chain ()
{
- auto d = new wxFileDialog (
+ auto d = make_wx<wxFileDialog>(
this, _("Select Chain File"), wxEmptyString, wxT("certificate_chain.pem"), wxT("PEM files (*.pem)|*.pem"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT
);
- ScopeGuard sg = [d]() { d->Destroy(); };
if (d->ShowModal() != wxID_OK) {
return;
return;
}
- auto d = new MakeChainDialog (this, _get());
- ScopeGuard sg = [d]() { d->Destroy(); };
+ auto d = make_wx<MakeChainDialog>(this, _get());
if (d->ShowModal () == wxID_OK) {
_set (d->get());
void
CertificateChainEditor::import_private_key ()
{
- auto d = new wxFileDialog (this, _("Select Key File"));
- ScopeGuard sg = [d]() { d->Destroy(); };
+ auto d = make_wx<wxFileDialog>(this, _("Select Key File"));
if (d->ShowModal() == wxID_OK) {
try {
boost::filesystem::path p (wx_to_std (d->GetPath ()));
- if (boost::filesystem::file_size (p) > 8192) {
+ if (dcp::filesystem::file_size(p) > 8192) {
error_dialog (
this,
wxString::Format (_("Could not read key file; file is too long (%s)"), std_to_wx (p.string ()))
return;
}
- auto d = new wxFileDialog (
+ auto d = make_wx<wxFileDialog>(
this, _("Select Key File"), wxEmptyString, wxT("private_key.pem"), wxT("PEM files (*.pem)|*.pem"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT
);
- ScopeGuard sg = [d]() { d->Destroy(); };
if (d->ShowModal () == wxID_OK) {
boost::filesystem::path path (wx_to_std(d->GetPath()));
void
KeysPage::export_decryption_chain_and_key ()
{
- auto d = new wxFileDialog (
+ auto d = make_wx<wxFileDialog>(
_panel, _("Select Export File"), wxEmptyString, wxEmptyString, wxT ("DOM files (*.dom)|*.dom"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT
);
- ScopeGuard sg = [d]() { d->Destroy(); };
if (d->ShowModal() != wxID_OK) {
return;
return;
}
- auto d = new wxFileDialog (
+ auto d = make_wx<wxFileDialog>(
_panel, _("Select File To Import"), wxEmptyString, wxEmptyString, wxT ("DOM files (*.dom)|*.dom")
);
- ScopeGuard sg = [d]() { d->Destroy(); };
if (d->ShowModal() != wxID_OK) {
return;
}
default_name += wxT("_kdm_decryption_cert.pem");
- auto d = new wxFileDialog (
+ auto d = make_wx<wxFileDialog>(
_panel, _("Select Certificate File"), wxEmptyString, default_name, wxT("PEM files (*.pem)|*.pem"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT
);
- ScopeGuard sg = [d]() { d->Destroy(); };
if (d->ShowModal() != wxID_OK) {
return;
add_label_to_sizer (table, _panel, _("Mapping"), true, wxGBPosition(r, 0));
_map = new AudioMappingView (_panel, _("DCP"), _("DCP"), _("Output"), _("output"));
- _map->SetSize (-1, 400);
table->Add (_map, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND);
++r;
_sound_output_details->SetFont (font);
RtAudio audio (DCPOMATIC_RTAUDIO_API);
+#if (RTAUDIO_VERSION_MAJOR >= 6)
+ for (auto device_id: audio.getDeviceIds()) {
+ auto dev = audio.getDeviceInfo(device_id);
+ if (dev.outputChannels > 0) {
+ _sound_output->Append(std_to_wx(dev.name));
+ }
+ }
+#else
for (unsigned int i = 0; i < audio.getDeviceCount(); ++i) {
try {
auto dev = audio.getDeviceInfo (i);
/* Something went wrong so let's just ignore that device */
}
}
+#endif
_sound->bind(&SoundPage::sound_changed, this);
_sound_output->Bind (wxEVT_CHOICE, bind(&SoundPage::sound_output_changed, this));
RtAudio audio (DCPOMATIC_RTAUDIO_API);
auto const so = get_sound_output();
string default_device;
+#if (RTAUDIO_VERSION_MAJOR >= 6)
+ default_device = audio.getDeviceInfo(audio.getDefaultOutputDevice()).name;
+#else
try {
default_device = audio.getDeviceInfo(audio.getDefaultOutputDevice()).name;
} catch (RtAudioError&) {
/* Never mind */
}
+#endif
if (!so || *so == default_device) {
Config::instance()->unset_sound_output ();
} else {
} else {
/* No configured output means we should use the default */
RtAudio audio (DCPOMATIC_RTAUDIO_API);
+#if (RTAUDIO_VERSION_MAJOR >= 6)
+ configured_so = audio.getDeviceInfo(audio.getDefaultOutputDevice()).name;
+#else
try {
configured_so = audio.getDeviceInfo(audio.getDefaultOutputDevice()).name;
} catch (RtAudioError&) {
/* Probably no audio devices at all */
}
+#endif
}
if (configured_so && current_so != configured_so) {
int channels = 0;
if (configured_so) {
+#if (RTAUDIO_VERSION_MAJOR >= 6)
+ for (auto device_id: audio.getDeviceIds()) {
+ auto info = audio.getDeviceInfo(device_id);
+ if (info.name == *configured_so && info.outputChannels > 0) {
+ channels = info.outputChannels;
+ }
+ }
+#else
for (unsigned int i = 0; i < audio.getDeviceCount(); ++i) {
try {
auto info = audio.getDeviceInfo(i);
/* Never mind */
}
}
+#endif
}
_sound_output_details->SetLabel (