]> git.sesse.net Git - casparcg/blobdiff - core/mixer/mixer.h
Added support for setting a mastervolume for a channel. Examples:
[casparcg] / core / mixer / mixer.h
index 3958a36bae6f5894f34b73e3a68940562f88d771..2ee82411c10451ea7ed5a814799a91a257de983f 100644 (file)
@@ -1,27 +1,36 @@
 /*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
 *\r
-*  This file is part of CasparCG.\r
+* This file is part of CasparCG (www.casparcg.com).\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
+* 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
+* 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
+* Author: Robert Nagy, ronag89@gmail.com\r
 */\r
+\r
 #pragma once\r
 \r
+#include "image/blend_modes.h"\r
+\r
 #include "../producer/frame/frame_factory.h"\r
 \r
 #include <common/memory/safe_ptr.h>\r
+#include <common/concurrency/target.h>\r
+#include <common/diagnostics/graph.h>\r
+\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
+#include <boost/thread/future.hpp>\r
 \r
 #include <map>\r
 \r
@@ -34,37 +43,37 @@ namespace core {
 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
+class ogl_device;\r
+struct frame_transform;\r
 struct pixel_format;\r
 \r
-class mixer : public core::frame_factory\r
+class mixer : public target<std::pair<std::map<int, safe_ptr<core::basic_frame>>, std::shared_ptr<void>>>\r
+                       , public core::frame_factory\r
 {\r
 public:        \r
-       explicit mixer(video_channel_context& video_channel);\r
+       typedef target<std::pair<safe_ptr<read_frame>, std::shared_ptr<void>>> target_t;\r
+\r
+       explicit mixer(const safe_ptr<diagnostics::graph>& graph, const safe_ptr<target_t>& target, const video_format_desc& format_desc, const safe_ptr<ogl_device>& ogl);\r
                \r
-       safe_ptr<core::read_frame> execute(const std::map<int, safe_ptr<core::basic_frame>>& frames); // nothrow\r
+       // target\r
+\r
+       virtual void send(const std::pair<std::map<int, safe_ptr<basic_frame>>, std::shared_ptr<void>>& frames) override; \r
                \r
+       // mixer\r
+\r
        safe_ptr<core::write_frame> create_frame(const void* tag, const core::pixel_format_desc& desc);         \r
-       safe_ptr<core::write_frame> create_frame(const 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 reset_transforms();\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
+       void set_video_format_desc(const video_format_desc& format_desc);\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
+       void set_blend_mode(int index, blend_mode::type value);\r
+       void clear_blend_mode(int index);\r
+       void clear_blend_modes();\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
+       void set_master_volume(float volume);\r
 \r
+       boost::unique_future<boost::property_tree::wptree> info() const;\r
+       \r
 private:\r
        struct implementation;\r
        safe_ptr<implementation> impl_;\r