Send CaptureThread error into app-local message queue.

This commit is contained in:
Jared Boone
2016-06-21 11:04:10 -07:00
parent 76c5fe96af
commit cfaa44b02a
5 changed files with 42 additions and 17 deletions

View File

@@ -115,6 +115,18 @@ private:
};
std::unique_ptr<CaptureThread> capture_thread;
MessageHandlerRegistration message_handler_capture_thread_error {
Message::ID::CaptureThreadError,
[this](const Message* const p) {
const auto message = *reinterpret_cast<const CaptureThreadErrorMessage*>(p);
this->on_capture_thread_error(message.error);
}
};
void on_capture_thread_error(File::Error error) {
report_error(error.what());
}
};
} /* namespace ui */