1 | //============================================================================ |
2 | // |
3 | // SSSS tt lll lll |
4 | // SS SS tt ll ll |
5 | // SS tttttt eeee ll ll aaaa |
6 | // SSSS tt ee ee ll ll aa |
7 | // SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" |
8 | // SS SS tt ee ll ll aa aa |
9 | // SSSS ttt eeeee llll llll aaaaa |
10 | // |
11 | // Copyright (c) 1995-2019 by Bradford W. Mott, Stephen Anthony |
12 | // and the Stella Team |
13 | // |
14 | // See the file "License.txt" for information on usage and redistribution of |
15 | // this file, and for a DISCLAIMER OF ALL WARRANTIES. |
16 | //============================================================================ |
17 | |
18 | #ifndef AUDIO_WIDGET_HXX |
19 | #define AUDIO_WIDGET_HXX |
20 | |
21 | class GuiObject; |
22 | class DataGridWidget; |
23 | |
24 | #include "Widget.hxx" |
25 | #include "Command.hxx" |
26 | |
27 | class AudioWidget : public Widget, public CommandSender |
28 | { |
29 | public: |
30 | AudioWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, |
31 | int x, int y, int w, int h); |
32 | virtual ~AudioWidget() = default; |
33 | |
34 | private: |
35 | // ID's for the various widgets |
36 | // We need ID's, since there are more than one of several types of widgets |
37 | enum { |
38 | kAUDFID, |
39 | kAUDCID, |
40 | kAUDVID |
41 | }; |
42 | |
43 | DataGridWidget* myAudF; |
44 | DataGridWidget* myAudC; |
45 | DataGridWidget* myAudV; |
46 | StaticTextWidget* myAudEffV; |
47 | |
48 | // Audio channels |
49 | enum |
50 | { |
51 | kAud0Addr, |
52 | kAud1Addr |
53 | }; |
54 | |
55 | private: |
56 | void changeFrequencyRegs(); |
57 | void changeControlRegs(); |
58 | void changeVolumeRegs(); |
59 | void handleCommand(CommandSender* sender, int cmd, int data, int id) override; |
60 | void loadConfig() override; |
61 | |
62 | void handleVolume(); |
63 | uInt32 getEffectiveVolume(); |
64 | |
65 | // Following constructors and assignment operators not supported |
66 | AudioWidget() = delete; |
67 | AudioWidget(const AudioWidget&) = delete; |
68 | AudioWidget(AudioWidget&&) = delete; |
69 | AudioWidget& operator=(const AudioWidget&) = delete; |
70 | AudioWidget& operator=(AudioWidget&&) = delete; |
71 | }; |
72 | |
73 | #endif |
74 | |