Gnash  0.8.11dev
RunResources.h
Go to the documentation of this file.
1 // RunResources.h Hold external and per-run resources for Gnash core.
2 //
3 // Copyright (C) 2007, 2008, 2009, 2010, 2011. 2012
4 // Free Software Foundation, Inc.
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 
20 
21 #ifndef GNASH_RUN_INFO_H
22 #define GNASH_RUN_INFO_H
23 
24 #include <string>
25 #include <boost/shared_ptr.hpp>
26 #include "StreamProvider.h"
27 #include "Renderer.h"
28 #include "sound_handler.h"
29 #include "MediaHandler.h"
30 #include "TagLoadersTable.h"
31 
32 namespace gnash {
33 
35 //
44 {
45 public:
46 
48  //
52 
54  //
56  void setStreamProvider(boost::shared_ptr<StreamProvider> sp) {
57  _streamProvider = sp;
58  }
59 
61  //
64  //
66  const StreamProvider& streamProvider() const {
67  assert (_streamProvider.get());
68  return *_streamProvider;
69  }
70 
72  //
75  //
78  void setSoundHandler(boost::shared_ptr<sound::sound_handler> s) {
79  _soundHandler = s;
80  }
81 
83  //
87  return _soundHandler.get();
88  }
89 
90  void setMediaHandler(boost::shared_ptr<media::MediaHandler> s) {
91  _mediaHandler = s;
92  }
93 
95  return _mediaHandler.get();
96  }
97 
98  void setRenderer(boost::shared_ptr<Renderer> r) {
99  _renderer = r;
100  }
101 
102  Renderer* renderer() const {
103  return _renderer.get();
104  }
105 
107  //
111  void setTagLoaders(boost::shared_ptr<const SWF::TagLoadersTable> loaders) {
112  _tagLoaders = loaders;
113  }
114 
117  assert(_tagLoaders.get());
118  return *_tagLoaders;
119  }
120 
121 #if 1
122  void setRenderBackend(const std::string& x) { _renderer_backend = x; }
126  std::string& getRenderBackend() { return _renderer_backend; }
127 
131  std::string& getHWAccelBackend() { return _hwaccel_backend; }
132  void setHWAccelBackend(const std::string& x) { _hwaccel_backend = x; }
133 #endif
134 
135 private:
136 
137  boost::shared_ptr<StreamProvider> _streamProvider;
138 
139  boost::shared_ptr<sound::sound_handler> _soundHandler;
140 
141  boost::shared_ptr<media::MediaHandler> _mediaHandler;
142 
143  boost::shared_ptr<Renderer> _renderer;
144 
145  boost::shared_ptr<const SWF::TagLoadersTable> _tagLoaders;
146 
150  std::string _hwaccel_backend;
151 
155  std::string _renderer_backend;
156 };
157 
158 } // end of gnash namespace
159 
160 #endif
161 
162 // local Variables:
163 // mode: C++
164 // indent-tabs-mode: t
165 // End:
166