/* * mp3plot - Bitrate analysis tool * * Copyright (C) 2007 Toni Corvera * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // $Id: mp3_bitrate_plotter.h 753 2007-05-26 00:04:38Z $ #ifndef ONET_BITRATE_PLOTTER_H #define ONET_BITRATE_PLOTTER_H #include // FIXME: Add to configure.in // TODO: auto_ptr isn't compatible with STL containers, what other smart pointer is preferable? #include #include "mp3_common.h" namespace net_outlyer { namespace mp3 { // Prototype class mp3file; /*! * \brief Creates a bitrate plot based on a bitrate distribution * \see bitrate_distribution */ class bitrate_plotter { public: enum plotter_type_t { TEXT = 0x01, IMAGE = 0x02, EXTERNAL = 0x03 // Unused currently }; private: typedef std::map > reg_plotters_map_t; static reg_plotters_map_t registered_plotters; protected: bitrate_plotter() {} public: virtual ~bitrate_plotter() {}; struct e_unregistered_plotter_type : e_error { public: e_unregistered_plotter_type() // FIXME: Error type : e_error("Unregistered plotter type", EX_SOFTWARE) {} }; /*! * \brief Creates the plot * \param file The MP3 file, with data already red */ virtual void plot(const mp3file & file) const {}; static void register_plotter(plotter_type_t, boost::shared_ptr); static bitrate_plotter & choose(plotter_type_t) throw (e_unregistered_plotter_type); }; } // namespace mp3 } // namespace net_outlyer #endif // ONET_BITRATE_PLOTTER_H /* vim:set ts=4 et ai: */