Gnash  0.8.10
RunResources.h
Go to the documentation of this file.
00001 // RunResources.h    Hold external and per-run resources for Gnash core.
00002 // 
00003 //   Copyright (C) 2007, 2008, 2009, 2010, 2011. 2012
00004 //   Free Software Foundation, Inc.
00005 // 
00006 // This program is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License as published by
00008 // the Free Software Foundation; either version 3 of the License, or
00009 // (at your option) any later version.
00010 // 
00011 // This program is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 // 
00016 // You should have received a copy of the GNU General Public License
00017 // along with this program; if not, write to the Free Software
00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019 
00020 
00021 #ifndef GNASH_RUN_INFO_H
00022 #define GNASH_RUN_INFO_H
00023 
00024 #include <string>
00025 #include <boost/shared_ptr.hpp>
00026 #include "StreamProvider.h"
00027 #include "Renderer.h"
00028 #include "sound_handler.h"
00029 #include "MediaHandler.h"
00030 #include "TagLoadersTable.h"
00031 
00032 namespace gnash {
00033 
00035 //
00043 class RunResources
00044 {
00045 public:
00046 
00048     //
00051     RunResources() {}
00052 
00054     //
00056     void setStreamProvider(boost::shared_ptr<StreamProvider> sp) {
00057         _streamProvider = sp;
00058     }
00059 
00061     //
00064     //
00066     const StreamProvider& streamProvider() const {
00067         assert (_streamProvider.get());
00068         return *_streamProvider;
00069     }
00070 
00072     //
00075     //
00078     void setSoundHandler(boost::shared_ptr<sound::sound_handler> s) {
00079         _soundHandler = s;
00080     } 
00081 
00083     //
00086     sound::sound_handler* soundHandler() const {
00087         return _soundHandler.get();
00088     }
00089 
00090     void setMediaHandler(boost::shared_ptr<media::MediaHandler> s) {
00091         _mediaHandler = s;
00092     }
00093 
00094     media::MediaHandler* mediaHandler() const {
00095         return _mediaHandler.get();
00096     }
00097 
00098     void setRenderer(boost::shared_ptr<Renderer> r) {
00099         _renderer = r;
00100     }
00101 
00102     Renderer* renderer() const {
00103         return _renderer.get();
00104     }
00105 
00107     //
00111     void setTagLoaders(boost::shared_ptr<const SWF::TagLoadersTable> loaders) {
00112         _tagLoaders = loaders;
00113     }
00114 
00116     const SWF::TagLoadersTable& tagLoaders() const {
00117         assert(_tagLoaders.get());
00118         return *_tagLoaders;
00119     }
00120 
00121 #if 1
00122 
00123 
00124 
00125     void setRenderBackend(const std::string& x) { _renderer_backend = x; }
00126     std::string& getRenderBackend() { return _renderer_backend; }
00127 
00131     std::string& getHWAccelBackend() { return _hwaccel_backend; }
00132     void setHWAccelBackend(const std::string& x) { _hwaccel_backend = x; }
00133 #endif
00134 
00135 private:
00136 
00137     boost::shared_ptr<StreamProvider> _streamProvider;
00138 
00139     boost::shared_ptr<sound::sound_handler> _soundHandler;
00140     
00141     boost::shared_ptr<media::MediaHandler> _mediaHandler;
00142 
00143     boost::shared_ptr<Renderer> _renderer;
00144 
00145     boost::shared_ptr<const SWF::TagLoadersTable> _tagLoaders;
00146 
00147 #if 1
00148 
00149 
00150 
00151     std::string _hwaccel_backend;
00152 
00156     std::string _renderer_backend;
00157 #endif    
00158 };
00159 
00160 } // end of gnash namespace
00161 
00162 #endif
00163 
00164 // local Variables:
00165 // mode: C++
00166 // indent-tabs-mode: t
00167 // End:
00168