~rabbits/orca-toy

015451c77cfd5cf5c91c7a2dacb228f0188bee2a — neauoire 2 years ago 87bcca6
Added block comments
2 files changed, 32 insertions(+), 6 deletions(-)

M README.md
M orca.c
M README.md => README.md +14 -4
@@ 45,6 45,19 @@ To display the list of operators inside of Orca, use `CmdOrCtrl+G`.
- `*` **bang**: Bangs neighboring operands.
- `#` **comment**: Halts a line.

## Controls

- `PAGEUP`, incr. bpm.
- `PAGEDOWN`, decr. bpm.
- `+` zoom in.
- `-` zoom out.
- `SHIFT+ARROW` scale selection.
- `CTRL+ARROW` drag selection.
- `ARROW` move selection.
- `SPACE` toggle play.
- `BACKSPACE` erase.
- `CTRL+/` comment block.

## Syntax Highlight

- `1` locked


@@ 56,9 69,6 @@ To display the list of operators inside of Orca, use `CmdOrCtrl+G`.
## TODOs

- True clock
	- Display BMP in interface.
	- Add clock controls.
	- Makeup for render time.
- Trigger release behaviour.
- Reflect outgoing midi notes.
- Selection right-to-left drag.
- Random

M orca.c => orca.c +18 -2
@@ 461,8 461,20 @@ select(int x, int y, int w, int h)
{
	cursor.x = clamp(x, 0, HOR - 1);
	cursor.y = clamp(y, 0, VER - 1);
	cursor.w = clamp(w, 1, 36);
	cursor.h = clamp(h, 1, 36);
	cursor.w = clamp(w, 1, HOR - x + 1);
	cursor.h = clamp(h, 1, VER - y + 1);
	redraw(pixels);
}

void
comment(Rect2d *r)
{
	int y;
	char c = get(&g, r->x, r->y) == '#' ? '.' : '#';
	for(y = 0; y < r->h; ++y) {
		set(&g, r->x, r->y + y, c);
		set(&g, r->x + r->w - 1, r->y + y, c);
	}
	redraw(pixels);
}



@@ 631,6 643,10 @@ dokey(SDL_Event *event)
	case SDLK_PLUS: modzoom(1); break;
	case SDLK_UNDERSCORE:
	case SDLK_MINUS: modzoom(-1); break;
	case SDLK_SLASH:
		if(ctrl)
			comment(&cursor);
		break;
	case SDLK_UP:
		if(ctrl)
			moveclip(&cursor, clip, 0, -1);