]> git.sesse.net Git - casparcg/blobdiff - core/mixer/mixer.h
[CEF] excluded libcef.pdb from Windows build to be able to change back to .zip format...
[casparcg] / core / mixer / mixer.h
index 4416e28110cc444371f1f19af5d7abb3b6a7f796..4d51a69e9fde371f0d4e9366e0b911ea75814d40 100644 (file)
@@ -1,75 +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 "image/blend_modes.h"\r
-\r
-#include "../producer/frame/frame_factory.h"\r
-\r
-#include <common/concurrency/governor.h>\r
-#include <common/memory/safe_ptr.h>\r
-\r
-#include <agents.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
-struct frame_transform;\r
-struct frame_transform;\r
-class video_channel_context;;\r
-struct pixel_format;\r
-class ogl_device;\r
-\r
-class mixer : public core::frame_factory\r
-{\r
-public:        \r
-       \r
-       typedef std::pair<std::map<int, safe_ptr<basic_frame>>, ticket_t>       source_element_t;\r
-       typedef std::pair<safe_ptr<core::read_frame>, ticket_t>                         target_element_t;\r
-\r
-       typedef Concurrency::ISource<source_element_t>                                                          source_t;\r
-       typedef Concurrency::ITarget<target_element_t>                                                          target_t;\r
-\r
-       explicit mixer(source_t& source, target_t& target, const video_format_desc& format_desc, ogl_device& ogl);\r
-                                               \r
-       boost::unique_future<safe_ptr<write_frame>> async_create_frame(const void* video_stream_tag, const pixel_format_desc& desc);\r
-\r
-       core::video_format_desc get_video_format_desc() const; // nothrow\r
-       \r
-       void set_frame_transform(int index, const core::frame_transform& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void apply_frame_transform(int index, const std::function<core::frame_transform(core::frame_transform)>& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear");\r
-       void clear_transforms();\r
-\r
-       void set_blend_mode(int index, blend_mode::type value);\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