npapi-vlc | branch: master | Sergey Radionov <[email protected]> | Tue Jan 10 22:52:41 2012 +0700| [801fb91ff714b2611f155a2e0c8d75b6256ca9cb] | committer: Jean-Baptiste Kempf
Add a common helper class vlc_player_options Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=801fb91ff714b2611f155a2e0c8d75b6256ca9cb --- common/vlc_player_options.h | 92 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 92 insertions(+), 0 deletions(-) diff --git a/common/vlc_player_options.h b/common/vlc_player_options.h new file mode 100644 index 0000000..431e42f --- /dev/null +++ b/common/vlc_player_options.h @@ -0,0 +1,92 @@ +/***************************************************************************** + * Copyright � 2002-2011 VideoLAN and VLC authors + * $Id$ + * + * Authors: Sergey Radionov <[email protected]> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +#ifndef _VLC_PLAYER_OPTIONS_H_ +#define _VLC_PLAYER_OPTIONS_H_ + +#include <string> + +enum vlc_player_option_e +{ + po_autoplay, + po_show_toolbar, + po_enable_fullscreen, + po_bg_text, + po_bg_color +}; + +class vlc_player_options +{ +public: + vlc_player_options() + :_autoplay(true), _show_toolbar(true), _enable_fullscreen(true), + _bg_color(/*black*/"#000000") + {} + + void set_autoplay(bool ap){ + _autoplay = ap; + on_option_change(po_autoplay); + } + bool get_autoplay() const + {return _autoplay;} + + void set_show_toolbar(bool st){ + _show_toolbar = st; + on_option_change(po_show_toolbar); + } + bool get_show_toolbar() const + {return _show_toolbar;} + + void set_enable_fs(bool ef){ + _enable_fullscreen = ef; + on_option_change(po_enable_fullscreen); + } + bool get_enable_fs() const + {return _enable_fullscreen;} + + void set_bg_text(const std::string& bt){ + _bg_text = bt; + on_option_change(po_bg_text); + } + const std::string& get_bg_text() const { + return _bg_text; + } + + void set_bg_color(const std::string& bc){ + _bg_color = bc; + on_option_change(po_bg_color); + } + const std::string& get_bg_color() const { + return _bg_color; + } + + virtual void on_option_change(vlc_player_option_e o_ch){}; + +private: + bool _autoplay; + bool _show_toolbar; + bool _enable_fullscreen; + std::string _bg_text; + //background color format is "#rrggbb" + std::string _bg_color; +}; + +#endif //_VLC_PLAYER_OPTIONS_H_
_______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
