creating them on-the-fly in config as well.
void edit_preferences ()
{
if (!_config_dialog) {
- _config_dialog = create_full_config_dialog ();
+ _config_dialog = create_full_config_dialog(&_film_viewer);
}
_config_dialog->Show (this);
}
}
if (!_config_dialog) {
- _config_dialog = create_player_config_dialog ();
+ _config_dialog = create_player_config_dialog(&_viewer);
}
_config_dialog->Show (this);
}
#include "check_box.h"
#include "config_dialog.h"
#include "dcpomatic_button.h"
+#include "film_viewer.h"
#include "nag_dialog.h"
#include "static_text.h"
#include <dcp/file.h>
font.SetPointSize (font.GetPointSize() - 1);
_sound_output_details->SetFont (font);
- RtAudio audio (DCPOMATIC_RTAUDIO_API);
+ auto& audio = _viewer->audio_backend();
for (unsigned int i = 0; i < audio.getDeviceCount(); ++i) {
try {
auto dev = audio.getDeviceInfo (i);
void
SoundPage::sound_output_changed ()
{
- RtAudio audio (DCPOMATIC_RTAUDIO_API);
+ auto& audio = _viewer->audio_backend();
auto const so = get_sound_output();
string default_device;
try {
auto const current_so = get_sound_output ();
optional<string> configured_so;
+ auto& audio = _viewer->audio_backend();
+
if (config->sound_output()) {
configured_so = config->sound_output().get();
} else {
/* No configured output means we should use the default */
- RtAudio audio (DCPOMATIC_RTAUDIO_API);
try {
configured_so = audio.getDeviceInfo(audio.getDefaultOutputDevice()).name;
} catch (RtAudioError&) {
}
}
- RtAudio audio (DCPOMATIC_RTAUDIO_API);
-
map<int, wxString> apis;
apis[RtAudio::MACOSX_CORE] = _("CoreAudio");
apis[RtAudio::WINDOWS_ASIO] = _("ASIO");
class AudioMappingView;
class CheckBox;
+class FilmViewer;
class Page : public wxPreferencesPage
class SoundPage : public Page
{
public:
- SoundPage (wxSize panel_size, int border)
+ SoundPage(wxSize panel_size, int border, FilmViewer* viewer)
: Page (panel_size, border)
+ , _viewer(viewer)
{}
wxString GetName() const override;
wxStaticText* _sound_output_details;
AudioMappingView* _map;
Button* _reset_to_default;
+ FilmViewer* _viewer;
};
int errored () const;
int gets () const;
+ RtAudio& audio_backend() {
+ return _audio;
+ }
+
int audio_callback (void* out, unsigned int frames);
StateTimer const & state_timer () const {
wxPreferencesEditor*
-create_full_config_dialog ()
+create_full_config_dialog(FilmViewer* viewer)
{
auto e = new wxPreferencesEditor ();
#endif
e->AddPage (new FullGeneralPage (ps, border));
- e->AddPage (new SoundPage (ps, border));
+ if (viewer) {
+ e->AddPage(new SoundPage(ps, border, viewer));
+ }
e->AddPage (new DefaultsPage (ps, border));
e->AddPage (new EncodingServersPage(ps, border));
e->AddPage (new KeysPage (ps, border));
class wxPreferencesEditor;
+class FilmViewer;
-wxPreferencesEditor* create_full_config_dialog ();
+wxPreferencesEditor* create_full_config_dialog(FilmViewer* viewer = nullptr);
wxPreferencesEditor*
-create_player_config_dialog ()
+create_player_config_dialog(FilmViewer* viewer)
{
auto e = new wxPreferencesEditor (_("DCP-o-matic Player Preferences"));
#endif
e->AddPage (new PlayerGeneralPage(wxSize(-1, 500), border));
- e->AddPage (new SoundPage(ps, border));
+ e->AddPage(new SoundPage(ps, border, viewer));
e->AddPage (new LocationsPage(ps, border));
e->AddPage (new KeysPage(ps, border));
e->AddPage (new PlayerAdvancedPage(ps, border));
*/
+
/** @file src/player_config_dialog.h
* @brief A dialogue to edit DCP-o-matic Player configuration.
*/
+
class wxPreferencesEditor;
+class FilmViewer;
+
-wxPreferencesEditor* create_player_config_dialog ();
+wxPreferencesEditor* create_player_config_dialog(FilmViewer* viewer);