]> git.sesse.net Git - casparcg/blobdiff - modules/bluefish/consumer/bluefish_consumer.cpp
Created a consumer that provides sync to a channel based on the pace of another chann...
[casparcg] / modules / bluefish / consumer / bluefish_consumer.cpp
index 77cc4d852ac251a9f79aa98cc544066b401126ee..a51b9dc80bcd5f39b49fb472fa523bdda3633069 100644 (file)
@@ -460,7 +460,7 @@ void describe_consumer(core::help_sink& sink, const core::help_repository& repo)
 }
 
 spl::shared_ptr<core::frame_consumer> create_consumer(
-               const std::vector<std::wstring>& params, core::interaction_sink*)
+               const std::vector<std::wstring>& params, core::interaction_sink*, std::vector<spl::shared_ptr<core::video_channel>> channels)
 {
        if(params.size() < 1 || !boost::iequals(params.at(0), L"BLUEFISH"))
                return core::frame_consumer::empty();
@@ -478,7 +478,7 @@ spl::shared_ptr<core::frame_consumer> create_consumer(
                auto found_layout = core::audio_channel_layout_repository::get_default()->get_layout(channel_layout);
 
                if (!found_layout)
-                       CASPAR_THROW_EXCEPTION(file_not_found() << msg_info(L"Channel layout " + channel_layout + L" not found"));
+                       CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Channel layout " + channel_layout + L" not found"));
 
                layout = *found_layout;
        }
@@ -487,8 +487,8 @@ spl::shared_ptr<core::frame_consumer> create_consumer(
 }
 
 spl::shared_ptr<core::frame_consumer> create_preconfigured_consumer(
-               const boost::property_tree::wptree& ptree, core::interaction_sink*)
-{      
+               const boost::property_tree::wptree& ptree, core::interaction_sink*, std::vector<spl::shared_ptr<core::video_channel>> channels)
+{
        const auto device_index         = ptree.get(                                            L"device",                      1);
        const auto embedded_audio       = ptree.get(                                            L"embedded-audio",      false);
        const auto key_only                     = ptree.get(                                            L"key-only",            false);
@@ -498,10 +498,12 @@ spl::shared_ptr<core::frame_consumer> create_preconfigured_consumer(
 
        if (channel_layout)
        {
+               CASPAR_SCOPED_CONTEXT_MSG("/channel-layout")
+
                auto found_layout = core::audio_channel_layout_repository::get_default()->get_layout(*channel_layout);
 
                if (!found_layout)
-                       CASPAR_THROW_EXCEPTION(file_not_found() << msg_info(L"Channel layout " + *channel_layout + L" not found"));
+                       CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Channel layout " + *channel_layout + L" not found"));
 
                layout = *found_layout;
        }