]>
Commit | Line | Data |
---|---|---|
21ad818f JH |
1 | /* |
2 | * This file is part of the PulseView project. | |
3 | * | |
4 | * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk> | |
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 2 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 | ||
7a01bd36 JH |
21 | #ifndef PULSEVIEW_PV_BINDING_DECODER_HPP |
22 | #define PULSEVIEW_PV_BINDING_DECODER_HPP | |
21ad818f | 23 | |
2acdb232 | 24 | #include "binding.hpp" |
21ad818f | 25 | |
2acdb232 | 26 | #include <pv/prop/property.hpp> |
182d2f5d JH |
27 | |
28 | struct srd_decoder_option; | |
29 | ||
21ad818f | 30 | namespace pv { |
4e5a4405 JH |
31 | |
32 | namespace data { | |
6e89374a | 33 | class DecoderStack; |
7491a29f JH |
34 | namespace decode { |
35 | class Decoder; | |
36 | } | |
4e5a4405 JH |
37 | } |
38 | ||
21ad818f JH |
39 | namespace binding { |
40 | ||
3cc9ad7b | 41 | class Decoder : public Binding |
21ad818f JH |
42 | { |
43 | public: | |
3cc9ad7b | 44 | Decoder(std::shared_ptr<pv::data::DecoderStack> decoder_stack, |
f9abf97e | 45 | std::shared_ptr<pv::data::decode::Decoder> decoder); |
21ad818f | 46 | |
67fe5e9c | 47 | private: |
61703a01 | 48 | static std::shared_ptr<prop::Property> bind_enum(const QString &name, |
182d2f5d | 49 | const srd_decoder_option *option, |
61703a01 | 50 | prop::Property::Getter getter, prop::Property::Setter setter); |
182d2f5d | 51 | |
e8d00928 | 52 | Glib::VariantBase getter(const char *id); |
67fe5e9c | 53 | |
e8d00928 | 54 | void setter(const char *id, Glib::VariantBase value); |
67fe5e9c JH |
55 | |
56 | private: | |
8dbbc7f0 JH |
57 | std::shared_ptr<pv::data::DecoderStack> decoder_stack_; |
58 | std::shared_ptr<pv::data::decode::Decoder> decoder_; | |
21ad818f JH |
59 | }; |
60 | ||
61 | } // binding | |
21ad818f JH |
62 | } // pv |
63 | ||
7a01bd36 | 64 | #endif // PULSEVIEW_PV_BINDING_DECODER_HPP |