void
TextContent::add_font (shared_ptr<Font> font)
{
- DCPOMATIC_ASSERT(!get_font(font->id()));
+ boost::mutex::scoped_lock lm(_mutex);
+
+ DCPOMATIC_ASSERT(!get_font_unlocked(font->id()));
_fonts.push_back (font);
connect_to_fonts ();
}
shared_ptr<dcpomatic::Font>
TextContent::get_font(string id) const
+{
+ boost::mutex::scoped_lock lm(_mutex);
+ return get_font_unlocked(id);
+}
+
+
+shared_ptr<dcpomatic::Font>
+TextContent::get_font_unlocked(string id) const
{
auto iter = std::find_if(_fonts.begin(), _fonts.end(), [&id](shared_ptr<dcpomatic::Font> font) {
return font->id() == id;
void
TextContent::clear_fonts()
{
+ boost::mutex::scoped_lock lm(_mutex);
+
_fonts.clear();
}
void font_changed ();
void connect_to_fonts ();
+ std::shared_ptr<dcpomatic::Font> get_font_unlocked(std::string id) const;
std::list<boost::signals2::connection> _font_connections;