+ output_channel[output].set_name_updated_callback(callback);
+ }
+
+ typedef std::function<void(const std::string &)> color_updated_callback_t;
+ void set_color_updated_callback(Output output, color_updated_callback_t callback)
+ {
+ output_channel[output].set_color_updated_callback(callback);
+ }
+
+ std::vector<std::string> get_transition_names()
+ {
+ return theme->get_transition_names(pts());
+ }
+
+ unsigned get_num_channels() const
+ {
+ return theme->get_num_channels();
+ }
+
+ std::string get_channel_name(unsigned channel) const
+ {
+ return theme->get_channel_name(channel);
+ }
+
+ std::string get_channel_color(unsigned channel) const
+ {
+ return theme->get_channel_color(channel);
+ }
+
+ int get_channel_signal(unsigned channel) const
+ {
+ return theme->get_channel_signal(channel);
+ }
+
+ int map_signal(unsigned channel)
+ {
+ return theme->map_signal(channel);
+ }
+
+ unsigned get_master_clock() const
+ {
+ return master_clock_channel;
+ }
+
+ void set_master_clock(unsigned channel)
+ {
+ master_clock_channel = channel;
+ }
+
+ void set_signal_mapping(int signal, int card)
+ {
+ return theme->set_signal_mapping(signal, card);
+ }
+
+ YCbCrInterpretation get_input_ycbcr_interpretation(unsigned card_index) const;
+ void set_input_ycbcr_interpretation(unsigned card_index, const YCbCrInterpretation &interpretation);
+
+ bool get_supports_set_wb(unsigned channel) const
+ {
+ return theme->get_supports_set_wb(channel);
+ }
+
+ void set_wb(unsigned channel, double r, double g, double b) const
+ {
+ theme->set_wb(channel, r, g, b);
+ }
+
+ // Note: You can also get this through the global variable global_audio_mixer.
+ AudioMixer *get_audio_mixer() { return &audio_mixer; }
+ const AudioMixer *get_audio_mixer() const { return &audio_mixer; }
+
+ void schedule_cut()
+ {
+ should_cut = true;
+ }
+
+ unsigned get_num_cards() const { return num_cards; }
+
+ std::string get_card_description(unsigned card_index) const {
+ assert(card_index < num_cards);
+ return cards[card_index].capture->get_description();
+ }
+
+ // The difference between this and the previous function is that if a card
+ // is used as the current output, get_card_description() will return the
+ // fake card that's replacing it for input, whereas this function will return
+ // the card's actual name.
+ std::string get_output_card_description(unsigned card_index) const {
+ assert(card_can_be_used_as_output(card_index));
+ assert(card_index < num_cards);
+ if (cards[card_index].parked_capture) {
+ return cards[card_index].parked_capture->get_description();
+ } else {
+ return cards[card_index].capture->get_description();
+ }
+ }
+
+ bool card_can_be_used_as_output(unsigned card_index) const {
+ assert(card_index < num_cards);
+ return cards[card_index].output != nullptr;
+ }
+
+ std::map<uint32_t, bmusb::VideoMode> get_available_video_modes(unsigned card_index) const {
+ assert(card_index < num_cards);
+ return cards[card_index].capture->get_available_video_modes();
+ }
+
+ uint32_t get_current_video_mode(unsigned card_index) const {
+ assert(card_index < num_cards);
+ return cards[card_index].capture->get_current_video_mode();
+ }
+
+ void set_video_mode(unsigned card_index, uint32_t mode) {
+ assert(card_index < num_cards);
+ cards[card_index].capture->set_video_mode(mode);
+ }
+
+ void start_mode_scanning(unsigned card_index);
+
+ std::map<uint32_t, std::string> get_available_video_inputs(unsigned card_index) const {
+ assert(card_index < num_cards);
+ return cards[card_index].capture->get_available_video_inputs();
+ }
+
+ uint32_t get_current_video_input(unsigned card_index) const {
+ assert(card_index < num_cards);
+ return cards[card_index].capture->get_current_video_input();
+ }
+
+ void set_video_input(unsigned card_index, uint32_t input) {
+ assert(card_index < num_cards);
+ cards[card_index].capture->set_video_input(input);
+ }
+
+ std::map<uint32_t, std::string> get_available_audio_inputs(unsigned card_index) const {
+ assert(card_index < num_cards);
+ return cards[card_index].capture->get_available_audio_inputs();
+ }
+
+ uint32_t get_current_audio_input(unsigned card_index) const {
+ assert(card_index < num_cards);
+ return cards[card_index].capture->get_current_audio_input();
+ }
+
+ void set_audio_input(unsigned card_index, uint32_t input) {
+ assert(card_index < num_cards);
+ cards[card_index].capture->set_audio_input(input);
+ }
+
+ void change_x264_bitrate(unsigned rate_kbit) {
+ video_encoder->change_x264_bitrate(rate_kbit);
+ }
+
+ int get_output_card_index() const { // -1 = no output, just stream.
+ return desired_output_card_index;
+ }
+
+ void set_output_card(int card_index) { // -1 = no output, just stream.
+ desired_output_card_index = card_index;
+ }
+
+ std::map<uint32_t, bmusb::VideoMode> get_available_output_video_modes() const;
+
+ uint32_t get_output_video_mode() const {
+ return desired_output_video_mode;
+ }
+
+ void set_output_video_mode(uint32_t mode) {
+ desired_output_video_mode = mode;
+ }
+
+ void set_display_timecode_in_stream(bool enable) {
+ display_timecode_in_stream = enable;
+ }
+
+ void set_display_timecode_on_stdout(bool enable) {
+ display_timecode_on_stdout = enable;
+ }
+
+ int64_t get_num_connected_clients() const {
+ return httpd.get_num_connected_clients();