mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 15:29:37 -05:00
Consolidate bitmaps for reuse.
This commit is contained in:
parent
27a1423309
commit
f2453dd639
156
firmware/application/bitmap.hpp
Normal file
156
firmware/application/bitmap.hpp
Normal file
@ -0,0 +1,156 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __BITMAP_HPP__
|
||||
#define __BITMAP_HPP__
|
||||
|
||||
#include "ui.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
static constexpr uint8_t bitmap_record_data[] = {
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0xc0, 0x03,
|
||||
0xf0, 0x0f,
|
||||
0xf8, 0x1f,
|
||||
0xf8, 0x1f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xf8, 0x1f,
|
||||
0xf8, 0x1f,
|
||||
0xf0, 0x0f,
|
||||
0xc0, 0x03,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_record {
|
||||
{ 16, 16 }, bitmap_record_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_stop_data[] = {
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_stop {
|
||||
{ 16, 16 }, bitmap_stop_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_sleep_data[] = {
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0x00, 0x04,
|
||||
0x00, 0x08,
|
||||
0x00, 0x18,
|
||||
0x00, 0x18,
|
||||
0x00, 0x38,
|
||||
0x00, 0x3c,
|
||||
0x00, 0x3c,
|
||||
0x00, 0x3e,
|
||||
0x84, 0x1f,
|
||||
0xf8, 0x1f,
|
||||
0xf0, 0x0f,
|
||||
0xc0, 0x03,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_sleep {
|
||||
{ 16, 16 }, bitmap_sleep_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_camera_data[] = {
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0xcc, 0x03,
|
||||
0xe8, 0x07,
|
||||
0xfc, 0x3f,
|
||||
0x3c, 0x3c,
|
||||
0x9c, 0x39,
|
||||
0xdc, 0x3b,
|
||||
0xdc, 0x3b,
|
||||
0x9c, 0x39,
|
||||
0x3c, 0x3c,
|
||||
0xfc, 0x3f,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_camera {
|
||||
{ 16, 16 }, bitmap_camera_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_sd_card_ok_data[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0xf0, 0x1f,
|
||||
0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f,
|
||||
0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f,
|
||||
0xf8, 0x1f, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_sd_card_ok {
|
||||
{ 16, 16 }, bitmap_sd_card_ok_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_sd_card_unknown_data[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0xf0, 0x1f,
|
||||
0x38, 0x1c, 0x98, 0x19, 0xf8, 0x19, 0xf8, 0x1c,
|
||||
0x78, 0x1e, 0x78, 0x1e, 0xf8, 0x1f, 0x78, 0x1e,
|
||||
0xf8, 0x1f, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_sd_card_unknown {
|
||||
{ 16, 16 }, bitmap_sd_card_unknown_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_sd_card_error_data[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0xf0, 0x1f,
|
||||
0xf8, 0x1f, 0xd8, 0x1b, 0x98, 0x19, 0x38, 0x1c,
|
||||
0x78, 0x1e, 0x38, 0x1c, 0x98, 0x19, 0xd8, 0x1b,
|
||||
0xf8, 0x1f, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_sd_card_error {
|
||||
{ 16, 16 }, bitmap_sd_card_error_data
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
||||
|
||||
#endif/*__BITMAP_HPP__*/
|
@ -27,6 +27,8 @@
|
||||
#include "ui_receiver.hpp"
|
||||
#include "ui_spectrum.hpp"
|
||||
|
||||
#include "bitmap.hpp"
|
||||
|
||||
#include "audio_thread.hpp"
|
||||
|
||||
#include <string>
|
||||
@ -34,52 +36,6 @@
|
||||
|
||||
namespace ui {
|
||||
|
||||
static constexpr uint8_t bitmap_record_data[] = {
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0xc0, 0x03,
|
||||
0xf0, 0x0f,
|
||||
0xf8, 0x1f,
|
||||
0xf8, 0x1f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xf8, 0x1f,
|
||||
0xf8, 0x1f,
|
||||
0xf0, 0x0f,
|
||||
0xc0, 0x03,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_record {
|
||||
{ 16, 16 }, bitmap_record_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_stop_data[] = {
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0xfc, 0x3f,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_stop {
|
||||
{ 16, 16 }, bitmap_stop_data
|
||||
};
|
||||
|
||||
class CaptureAppView : public View {
|
||||
public:
|
||||
CaptureAppView(NavigationView& nav);
|
||||
|
@ -32,57 +32,13 @@
|
||||
#include "ui_audio.hpp"
|
||||
#include "ui_sd_card_status_view.hpp"
|
||||
|
||||
#include "bitmap.hpp"
|
||||
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
namespace ui {
|
||||
|
||||
static constexpr uint8_t bitmap_sleep_data[] = {
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0x00, 0x04,
|
||||
0x00, 0x08,
|
||||
0x00, 0x18,
|
||||
0x00, 0x18,
|
||||
0x00, 0x38,
|
||||
0x00, 0x3c,
|
||||
0x00, 0x3c,
|
||||
0x00, 0x3e,
|
||||
0x84, 0x1f,
|
||||
0xf8, 0x1f,
|
||||
0xf0, 0x0f,
|
||||
0xc0, 0x03,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_sleep {
|
||||
{ 16, 16 }, bitmap_sleep_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_camera_data[] = {
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0xcc, 0x03,
|
||||
0xe8, 0x07,
|
||||
0xfc, 0x3f,
|
||||
0x3c, 0x3c,
|
||||
0x9c, 0x39,
|
||||
0xdc, 0x3b,
|
||||
0xdc, 0x3b,
|
||||
0x9c, 0x39,
|
||||
0x3c, 0x3c,
|
||||
0xfc, 0x3f,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_camera {
|
||||
{ 16, 16 }, bitmap_camera_data
|
||||
};
|
||||
|
||||
class SystemStatusView : public View {
|
||||
public:
|
||||
std::function<void(void)> on_back;
|
||||
|
@ -24,45 +24,14 @@
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
#include "bitmap.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
/* SDCardStatusView *****************************************************/
|
||||
|
||||
namespace detail {
|
||||
|
||||
static constexpr uint8_t bitmap_sd_card_ok_data[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0xf0, 0x1f,
|
||||
0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f,
|
||||
0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f,
|
||||
0xf8, 0x1f, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_sd_card_ok {
|
||||
{ 16, 16 }, bitmap_sd_card_ok_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_sd_card_unknown_data[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0xf0, 0x1f,
|
||||
0x38, 0x1c, 0x98, 0x19, 0xf8, 0x19, 0xf8, 0x1c,
|
||||
0x78, 0x1e, 0x78, 0x1e, 0xf8, 0x1f, 0x78, 0x1e,
|
||||
0xf8, 0x1f, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_sd_card_unknown {
|
||||
{ 16, 16 }, bitmap_sd_card_unknown_data
|
||||
};
|
||||
|
||||
static constexpr uint8_t bitmap_sd_card_error_data[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0xf0, 0x1f,
|
||||
0xf8, 0x1f, 0xd8, 0x1b, 0x98, 0x19, 0x38, 0x1c,
|
||||
0x78, 0x1e, 0x38, 0x1c, 0x98, 0x19, 0xd8, 0x1b,
|
||||
0xf8, 0x1f, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
static constexpr Bitmap bitmap_sd_card_error {
|
||||
{ 16, 16 }, bitmap_sd_card_error_data
|
||||
};
|
||||
|
||||
const Bitmap& bitmap_sd_card(const sd_card::Status status) {
|
||||
switch(status) {
|
||||
case sd_card::Status::IOError:
|
||||
@ -113,7 +82,7 @@ const Color color_sd_card(const sd_card::Status status) {
|
||||
|
||||
SDCardStatusView::SDCardStatusView(
|
||||
const Rect parent_rect
|
||||
) : Image { parent_rect, &detail::bitmap_sd_card_unknown, detail::color_sd_card_unknown, Color::black() }
|
||||
) : Image { parent_rect, &bitmap_sd_card_unknown, detail::color_sd_card_unknown, Color::black() }
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user