Skip to content

Commit

Permalink
feat: 🎉 first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pcorbel committed Jul 15, 2024
1 parent 2913c5b commit a280e35
Show file tree
Hide file tree
Showing 154 changed files with 22,404 additions and 202 deletions.
Binary file added .github/docs/install.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/docs/menus/chapters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/docs/menus/konami.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/docs/menus/player.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/docs/menus/storiies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/docs/storii.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/docs/storii.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vscode
build
__pycache__
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Makefile

.PHONY: build

VERSION ?= v1.0.0

build:
@echo "Building release version $(VERSION)..."
rm -rf build app/__pycache__
mkdir -p build/App
cp -r app build/App/Storii
cd build && zip -r Storii-$(VERSION).zip App && cd ..
rm -rf build/App
@echo "Release build $(VERSION) done."
100 changes: 99 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,99 @@
# storii
# Storii

## Presentation

A children-friendly MP3 player for the Miyoo Mini (+).

![storii](.github/docs/storii.gif)

## Installation

### Requirements

You'll need to have [Onion OS](https://onionui.github.io/) installed on your SD Card.

### Setup

* Download the latest release of storii [here](https://github.com/pcorbel/storii/releases).
* Extract the archive and copy the `App` directory to the root of your SD card.
* Merge it if need be

![install](.github/docs/install.gif)

### Storiies

* On your SD card, in the `/Media` directory, create a `Storiies` directory.
* In `Storiies`, create a directory for each album you want to add.
* In each album directory, add the tracks.
* [Optional] You can add a cover image. The cover image must be named `cover.png`.

```bash
/Media/Storiies
├── Album A
│ ├── Track 1.mp3
│ ├── ...
│ ├── Track 3.mp3
│ └── cover.png
├── Album B
│ ├── Track 1.mp3
│ ├── ...
│ ├── Track 5.mp3
│ └── cover.png
└── Album C
│ ├── Track 1.mp3
│ ├── ...
│ ├── Track 8.mp3
└── cover.png
```

## Usage

### Storiies menu

![menu](.github/docs/menus/storiies.png)

| Buttons | Action |
|--------------|---------------------------|
| `←/→` | Paginate through storiies |
| `A` | Select current storii |

### Chapters menu

![menu](.github/docs/menus/chapters.png)

| Buttons | Action |
|--------------|---------------------------|
| `←/→` | Paginate through chapters |
| `A` | Select current chapter |
| `B` | Go back to Storiies menu |

### Player menu

![menu](.github/docs/menus/player.png)

| Buttons | Action |
|--------------|----------------------------------|
| `←/→` | Rewind / Fast-Forward 10 seconds |
| `A` | Play / Pause |
| `B` | Go back to Chapters menu |

## Advanced

### Konami Menu

An hidden, parent-oriented, menu can be accessed by entering the Konami code: `↑ ↑ ↓ ↓ ← → ← → B A`.

![konami menu](.github/docs/menus/konami.png)

| Buttons | Action |
|--------------|----------------------------------|
| `↑/↓` | Navigate through menu options |
| `←/→` | Adjust values for selected option|
| `A` | Select current option |
| `B` | Exit the Konami menu |

#### Konami Menu Options

1. **Set Timer**: Allows you to set a timer for how long the player will run.
2. **Launch at Startup**: Toggle whether Storii should launch automatically when the Miyoo Mini (+) starts up.
3. **Quit Storii**: Exits the Storii application and returns to the Onion OS menu.
6 changes: 6 additions & 0 deletions app/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"label": "Storii",
"icon": "/mnt/SDCARD/Icons/Default/app/music.png",
"launch": "launch.sh",
"description": "A Storii Teller"
}
53 changes: 53 additions & 0 deletions app/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import os

import pygame

# Initialize Pygame and Mixer
pygame.init()
pygame.mixer.init()

# Constants
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
FONT_SIZE = 30
CHEVRON_SIZE = (64, 64)
COVER_SIZE = (256, 256)
ICON_SIZE = (256, 256)
PADDING = 20
PROGRESS_BAR_HEIGHT = 10
PROGRESS_BAR_PADDING = 40
PROGRESS_BAR_Y = SCREEN_HEIGHT - 50
APP_BAR_HEIGHT = 24

# Colors
BLACK = pygame.Color(0, 0, 0)
WHITE = pygame.Color(255, 255, 255)

# Paths
SCRIPT_PATH = os.path.abspath(__file__)
SCRIPT_DIR = os.path.dirname(SCRIPT_PATH)
FONT_PATH = os.path.join(SCRIPT_DIR, "res", "roboto-bold.ttf")
CHEVRON_LEFT_PATH = os.path.join(SCRIPT_DIR, "res", "chevron-left.png")
CHEVRON_RIGHT_PATH = os.path.join(SCRIPT_DIR, "res", "chevron-right.png")
DEFAULT_IMG_PATH = os.path.join(SCRIPT_DIR, "res", "image.png")
PLAY_ICON_PATH = os.path.join(SCRIPT_DIR, "res", "play.png")
PAUSE_ICON_PATH = os.path.join(SCRIPT_DIR, "res", "pause.png")
BATTERY_ICON_PATH = os.path.join(SCRIPT_DIR, "res", "battery.png")
STORIIES_PATH = os.environ["STORIIES_PATH"]
PWM_PATH = "/sys/devices/soc0/soc/1f003400.pwm/pwm/pwmchip0/pwm0/duty_cycle"
BATTERY_PERC_PATH = "/tmp/percBat"
STARTUP_PATH = "/mnt/SDCARD/.tmp_update/startup/launch-storii-startup.sh"

# Konami Code
KONAMI_CODE = [
pygame.K_UP,
pygame.K_UP,
pygame.K_DOWN,
pygame.K_DOWN,
pygame.K_LEFT,
pygame.K_RIGHT,
pygame.K_LEFT,
pygame.K_RIGHT,
pygame.K_LCTRL,
pygame.K_SPACE,
]
Loading

0 comments on commit a280e35

Please sign in to comment.