]>
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 | |
efdec55a | 17 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
21ad818f JH |
18 | */ |
19 | ||
7a01bd36 JH |
20 | #ifndef PULSEVIEW_PV_BINDING_DECODER_HPP |
21 | #define PULSEVIEW_PV_BINDING_DECODER_HPP | |
21ad818f | 22 | |
2acdb232 | 23 | #include "binding.hpp" |
21ad818f | 24 | |
2acdb232 | 25 | #include <pv/prop/property.hpp> |
182d2f5d | 26 | |
6f925ba9 UH |
27 | using std::shared_ptr; |
28 | ||
182d2f5d JH |
29 | struct srd_decoder_option; |
30 | ||
21ad818f | 31 | namespace pv { |
4e5a4405 JH |
32 | |
33 | namespace data { | |
6e89374a | 34 | class DecoderStack; |
7491a29f JH |
35 | namespace decode { |
36 | class Decoder; | |
37 | } | |
4e5a4405 JH |
38 | } |
39 | ||
21ad818f JH |
40 | namespace binding { |
41 | ||
3cc9ad7b | 42 | class Decoder : public Binding |
21ad818f JH |
43 | { |
44 | public: | |
6f925ba9 UH |
45 | Decoder(shared_ptr<pv::data::DecoderStack> decoder_stack, |
46 | shared_ptr<pv::data::decode::Decoder> decoder); | |
21ad818f | 47 | |
67fe5e9c | 48 | private: |
6f925ba9 | 49 | static shared_ptr<prop::Property> bind_enum(const QString &name, |
9a267f8d | 50 | const QString &desc, const srd_decoder_option *option, |
61703a01 | 51 | prop::Property::Getter getter, prop::Property::Setter setter); |
182d2f5d | 52 | |
e8d00928 | 53 | Glib::VariantBase getter(const char *id); |
67fe5e9c | 54 | |
e8d00928 | 55 | void setter(const char *id, Glib::VariantBase value); |
67fe5e9c JH |
56 | |
57 | private: | |
6f925ba9 UH |
58 | shared_ptr<pv::data::DecoderStack> decoder_stack_; |
59 | shared_ptr<pv::data::decode::Decoder> decoder_; | |
21ad818f JH |
60 | }; |
61 | ||
870ea3db UH |
62 | } // namespace binding |
63 | } // namespace pv | |
21ad818f | 64 | |
7a01bd36 | 65 | #endif // PULSEVIEW_PV_BINDING_DECODER_HPP |