#define DCPOMATIC_WX_UTIL_H
+#include "lib/config.h"
#include "lib/dcpomatic_time.h"
-#include "lib/warnings.h"
-DCPOMATIC_DISABLE_WARNINGS
-#include <wx/wx.h>
-DCPOMATIC_ENABLE_WARNINGS
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
#include <wx/gbsizer.h>
-#include <boost/function.hpp>
-#include <boost/thread.hpp>
+#include <wx/wx.h>
+#include <RtAudio.h>
+LIBDCP_ENABLE_WARNINGS
#include <boost/signals2.hpp>
+#include <boost/thread.hpp>
class FilePickerCtrl;
#define DCPOMATIC_SIZER_Y_GAP 8
#define DCPOMATIC_SIZER_GAP 8
#define DCPOMATIC_DIALOG_BORDER 12
+#ifdef __WXGTK3__
+#define DCPOMATIC_SPIN_CTRL_WIDTH 118
+#else
+#define DCPOMATIC_SPIN_CTRL_WIDTH 56
+#endif
+
+/** Amount by which you need to bottom-pad text next to a checkbox in order
+ * for the text baselines to be aligned.
+ */
+#ifdef DCPOMATIC_OSX
+#define DCPOMATIC_CHECKBOX_BOTTOM_PAD 2
+#else
+#define DCPOMATIC_CHECKBOX_BOTTOM_PAD 0
+#endif
+
+/** Amount by which you need to top-pad a choice to make it line up, in some cases */
+#ifdef DCPOMATIC_OSX
+#define DCPOMATIC_CHOICE_TOP_PAD 1
+#else
+#define DCPOMATIC_CHOICE_TOP_PAD 0
+#endif
/** Spacing to use between buttons in a vertical/horizontal line */
#if defined(DCPOMATIC_OSX) || defined(__WXGTK3__)
#define DCPOMATIC_BUTTON_STACK_GAP 0
#endif
-#ifdef DCPOMATIC_LINUX
-#define DCPOMATIC_RTAUDIO_API RtAudio::LINUX_PULSE
-#endif
-#ifdef DCPOMATIC_WINDOWS
-#define DCPOMATIC_RTAUDIO_API RtAudio::UNSPECIFIED
-#endif
-#ifdef DCPOMATIC_OSX
-#define DCPOMATIC_RTAUDIO_API RtAudio::MACOSX_CORE
-#endif
-
/** i18n macro to support strings like Context|String
* so that `String' can be translated to different things
extern void dcpomatic_setup_i18n ();
extern wxString context_translation (wxString);
extern std::string string_client_data (wxClientData* o);
+extern std::string selection_string_client_data(wxChoice* choice);
extern wxString time_to_timecode (dcpomatic::DCPTime t, double fps);
extern void setup_audio_channels_choice (wxChoice* choice, int minimum);
extern wxSplashScreen* maybe_show_splash ();
extern bool display_progress (wxString title, wxString task);
extern bool report_errors_from_last_job (wxWindow* parent);
extern wxString bitmap_path (std::string name);
+extern wxString icon_path(std::string name);
extern wxSize small_button_size (wxWindow* parent, wxString text);
-
+extern bool gui_is_dark ();
+extern double dpi_scale_factor (wxWindow* window);
+extern int search_ctrl_height ();
+extern void report_config_load_failure(wxWindow* parent, Config::LoadFailure what);
struct Offset
{
extern int get_offsets (std::vector<Offset>& offsets);
+class AudioAPI
+{
+public:
+ AudioAPI(wxString name, std::string id, RtAudio::Api rtaudio_id)
+ : _name(name)
+ , _id(id)
+ , _rtaudio_id(rtaudio_id)
+ {}
+
+ wxString name() const {
+ return _name;
+ }
+
+ std::string id() const {
+ return _id;
+ }
+
+ RtAudio::Api rtaudio_id() const {
+ return _rtaudio_id;
+ }
+
+private:
+ wxString _name;
+ std::string _id;
+ RtAudio::Api _rtaudio_id;
+};
+
+
+std::vector<AudioAPI> audio_apis();
+AudioAPI id_to_audio_api(std::string id);
+AudioAPI id_to_audio_api(boost::optional<std::string> id);
+AudioAPI index_to_audio_api(int index);
+
+
extern void checked_set (FilePickerCtrl* widget, boost::filesystem::path value);
extern void checked_set (wxDirPickerCtrl* widget, boost::filesystem::path value);
extern void checked_set (wxSpinCtrl* widget, int value);
extern int wx_get (wxSpinCtrl* widget);
extern double wx_get (wxSpinCtrlDouble* widget);
-#if defined(__WXMSW__)
+#ifdef DCPOMATIC_WINDOWS
#define DCPOMATIC_USE_OWN_PICKER
#endif