]> git.sesse.net Git - casparcg/blobdiff - core/mixer/mixer.h
Created a consumer that provides sync to a channel based on the pace of another chann...
[casparcg] / core / mixer / mixer.h
index b03fa89356c458526378be6901bc375dbb5a86ea..4d51a69e9fde371f0d4e9366e0b911ea75814d40 100644 (file)
@@ -1,76 +1,76 @@
-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-*  This file is part of CasparCG.\r
-*\r
-*    CasparCG is free software: you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation, either version 3 of the License, or\r
-*    (at your option) any later version.\r
-*\r
-*    CasparCG is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-*/\r
-#pragma once\r
-\r
-#include "../producer/frame/pixel_format.h"\r
-#include "../producer/frame/frame_factory.h"\r
-\r
-#include <common/memory/safe_ptr.h>\r
-\r
-#include <map>\r
-\r
-namespace caspar { \r
-\r
-class executor;\r
-       \r
-namespace core {\r
-\r
-class read_frame;\r
-class write_frame;\r
-class basic_frame;\r
-class audio_transform;\r
-class image_transform;\r
-class video_channel_context;;\r
-\r
-class mixer : public core::frame_factory\r
-{\r
-public:        \r
-       explicit mixer(video_channel_context& video_channel);\r
-               \r
-       safe_ptr<core::read_frame> execute(const std::map<int, safe_ptr<core::basic_frame>>& frames); // nothrow\r
-               \r
-       safe_ptr<core::write_frame> create_frame(void* tag, const core::pixel_format_desc& desc);               \r
-       safe_ptr<core::write_frame> create_frame(void* tag, size_t width, size_t height, core::pixel_format::type pix_fmt = core::pixel_format::bgra);          \r
-       \r
-       core::video_format_desc get_video_format_desc() const; // nothrow\r
-\r
-       void set_image_transform(const core::image_transform& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void set_image_transform(int index, const core::image_transform& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-\r
-       void set_audio_transform(const core::audio_transform& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void set_audio_transform(int index, const core::audio_transform& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       \r
-       void apply_image_transform(const std::function<core::image_transform(core::image_transform)>& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void apply_image_transform(int index, const std::function<core::image_transform(core::image_transform)>& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-\r
-       void apply_audio_transform(const std::function<core::audio_transform(core::audio_transform)>& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void apply_audio_transform(int index, const std::function<core::audio_transform(core::audio_transform)>& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-\r
-       void reset_image_transform(unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void reset_image_transform(int index, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void reset_audio_transform(unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void reset_audio_transform(int index, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-\r
-private:\r
-       struct implementation;\r
-       safe_ptr<implementation> impl_;\r
-};\r
-\r
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Robert Nagy, ronag89@gmail.com
+*/
+
+#pragma once
+
+#include "image/blend_modes.h"
+
+#include <common/forward.h>
+#include <common/future_fwd.h>
+#include <common/memory.h>
+
+#include <core/fwd.h>
+#include <core/monitor/monitor.h>
+
+#include <boost/property_tree/ptree_fwd.hpp>
+
+#include <map>
+
+FORWARD2(caspar, diagnostics, class graph);
+
+namespace caspar { namespace core {
+       
+class mixer final
+{
+       mixer(const mixer&);
+       mixer& operator=(const mixer&);
+public:
+       
+       // Static Members
+                                       
+       // Constructors
+       
+       explicit mixer(int channel_index, spl::shared_ptr<caspar::diagnostics::graph> graph, spl::shared_ptr<image_mixer> image_mixer);
+
+       // Methods
+               
+       const_frame operator()(std::map<int, draw_frame> frames, const video_format_desc& format_desc, const core::audio_channel_layout& channel_layout);
+
+       void set_master_volume(float volume);
+       float get_master_volume();
+       void set_straight_alpha_output(bool value);
+       bool get_straight_alpha_output();
+
+       mutable_frame create_frame(const void* tag, const pixel_format_desc& desc, const core::audio_channel_layout& channel_layout);
+
+       // Properties
+
+       std::future<boost::property_tree::wptree> info() const;
+       std::future<boost::property_tree::wptree> delay_info() const;
+
+       monitor::subject& monitor_output();
+
+private:
+       struct impl;
+       spl::shared_ptr<impl> impl_;
+};
+
 }}
\ No newline at end of file