summaryrefslogtreecommitdiff
path: root/decoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'decoder.cpp')
-rw-r--r--decoder.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/decoder.cpp b/decoder.cpp
index c362745..9330c6e 100644
--- a/decoder.cpp
+++ b/decoder.cpp
@@ -6,19 +6,14 @@
#include <map>
-DecoderFilter::DecoderFilter(DecoderBase::p decoder_) {
- decoder = decoder_;
-}
-
-typedef boost::function<DecoderBase::p ()> DecoderFactory;
+typedef boost::function<Decoder::p (const std::string&)> DecoderFactory;
std::map<std::string, DecoderFactory> decoder_factories;
-void decoder::init() {
+void Decoder::init() {
mpg123_init(); // initialize the mpg123 library
decoder_factories["mpg123"] = boost::factory<boost::shared_ptr<DecoderMpg123> >();
}
-//! Construct a filter with the given decoder.
-DecoderFilter::p decoder::get_decoder(const std::string& name) {
- return DecoderFilter::p(new DecoderFilter(decoder_factories[name]()));
+Decoder::p Decoder::get(const std::string& name, const std::string& filename) {
+ return decoder_factories[name](filename);
}