mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Can't use context() in ui::Widget constructor, move use elsewhere.
TODO: Seems like a design flaw to me... Either eliminate need for context(), or pass into constructors.
This commit is contained in:
parent
a7226820d0
commit
32312a6cfb
@ -480,7 +480,18 @@ ReceiverView::ReceiverView(
|
||||
};
|
||||
|
||||
receiver_model.enable();
|
||||
}
|
||||
|
||||
ReceiverView::~ReceiverView() {
|
||||
|
||||
// TODO: Manipulating audio codec here, and in ui_receiver.cpp. Good to do
|
||||
// both?
|
||||
audio_codec.headphone_mute();
|
||||
|
||||
receiver_model.disable();
|
||||
}
|
||||
|
||||
void ReceiverView::on_show() {
|
||||
context().message_map.register_handler(Message::ID::FSKPacket,
|
||||
[](const Message* const p) {
|
||||
const auto message = static_cast<const FSKPacketMessage*>(p);
|
||||
@ -489,14 +500,8 @@ ReceiverView::ReceiverView(
|
||||
);
|
||||
}
|
||||
|
||||
ReceiverView::~ReceiverView() {
|
||||
void ReceiverView::on_hide() {
|
||||
context().message_map.unregister_handler(Message::ID::FSKPacket);
|
||||
|
||||
// TODO: Manipulating audio codec here, and in ui_receiver.cpp. Good to do
|
||||
// both?
|
||||
audio_codec.headphone_mute();
|
||||
|
||||
receiver_model.disable();
|
||||
}
|
||||
|
||||
void ReceiverView::set_parent_rect(const Rect new_parent_rect) {
|
||||
|
@ -367,6 +367,9 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
void on_show() override;
|
||||
void on_hide() override;
|
||||
|
||||
private:
|
||||
ReceiverModel& receiver_model;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user