wip midi
This commit is contained in:
@@ -14,9 +14,9 @@ jobs:
|
||||
with:
|
||||
submodules: 'true'
|
||||
- name: install libs
|
||||
run: sudo apt install -y libglfw3-dev libgl-dev
|
||||
run: sudo apt install -y libglfw3-dev libgl-dev libv4l-dev libasound2
|
||||
- name: gcc
|
||||
run: mkdir -p build && gcc -v -Wall -Wextra -Werror src/*.c src/*.h -lglfw -lGL -lm -Iinclude hashmap.c/hashmap.c log.c/src/log.c -DGLFW_INCLUDE_NONE -DGLFW_EXPOSE_NATIVE_EGL -DGLFW_NATIVE_INCLUDE_NONE
|
||||
run: mkdir -p build && gcc -v -Wall -Wextra -Werror src/*.c src/*.h -lglfw -lGL -lm -lasound -Iinclude hashmap.c/hashmap.c log.c/src/log.c -DGLFW_INCLUDE_NONE -DGLFW_EXPOSE_NATIVE_EGL -DGLFW_NATIVE_INCLUDE_NONE
|
||||
|
||||
build-release:
|
||||
needs: lint
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
with:
|
||||
submodules: 'true'
|
||||
- name: install libs
|
||||
run: sudo apt install -y libglfw3-dev libgl-dev
|
||||
run: sudo apt install -y libglfw3-dev libgl-dev libv4l-dev libasound2
|
||||
- name: aclocal
|
||||
run: aclocal
|
||||
- name: autoconf
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
AUTOMAKE_OPTIONS = foreign subdir-objects -Wall
|
||||
bin_PROGRAMS = forge
|
||||
forge_SOURCES = src/main.c src/args.c src/forge.c src/file.c src/window.c src/shaders.c src/timer.c src/string.c src/config_file.c src/rand.c src/video.c src/shared.c $(top_srcdir)/include/glad/gl.h $(top_srcdir)/include/glad/egl.h $(top_srcdir)/hashmap.c/hashmap.c $(top_srcdir)/log.c/src/log.c
|
||||
forge_SOURCES = src/main.c src/args.c src/forge.c src/file.c src/window.c src/shaders.c src/timer.c src/string.c src/config_file.c src/rand.c src/video.c src/shared.c src/midi.c $(top_srcdir)/include/glad/gl.h $(top_srcdir)/include/glad/egl.h $(top_srcdir)/hashmap.c/hashmap.c $(top_srcdir)/log.c/src/log.c
|
||||
forge_CFLAGS = -Ofast -march=native -flto -funroll-loops -fprefetch-loop-arrays -fno-exceptions -fopenmp -I$(top_srcdir)/include -DGLFW_INCLUDE_NONE -DGLFW_EXPOSE_NATIVE_EGL -DGLFW_NATIVE_INCLUDE_NONE -DLOG_USE_COLOR
|
||||
forge_LDADD = -lm -lGL -lglfw
|
||||
include_HEADERS = src/main.h src/args.h src/config.h src/types.h src/forge.h src/file.h src/constants.h src/window.h src/shaders.h src/timer.h src/string.h src/config_file.h src/rand.h src/video.h src/shared.h $(top_srcdir)/include/glad/gl.h $(top_srcdir)/include/glad/egl.h $(top_srcdir)/include/linmath.h $(top_srcdir)/include/hashmap.h $(top_srcdir)/include/log.h
|
||||
include_HEADERS = src/main.h src/args.h src/config.h src/types.h src/forge.h src/file.h src/constants.h src/window.h src/shaders.h src/timer.h src/string.h src/config_file.h src/rand.h src/video.h src/shared.h src/midi.h $(top_srcdir)/include/glad/gl.h $(top_srcdir)/include/glad/egl.h $(top_srcdir)/include/linmath.h $(top_srcdir)/include/hashmap.h $(top_srcdir)/include/log.h
|
||||
+1
-1
@@ -14,7 +14,7 @@ build:
|
||||
-Iinclude \
|
||||
hashmap.c/hashmap.c \
|
||||
log.c/src/log.c \
|
||||
-lm -lGL -lglfw -ldrm \
|
||||
-lm -lGL -lglfw -lasound \
|
||||
-Wall -Wextra \
|
||||
-DGLFW_INCLUDE_NONE \
|
||||
-DGLFW_EXPOSE_NATIVE_EGL \
|
||||
|
||||
@@ -3,7 +3,7 @@ pkgver=0.0.0
|
||||
pkgrel=1
|
||||
pkgdesc="Fusion Of Real Time Generative Effects"
|
||||
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64' 'riscv64')
|
||||
depends=('glfw>=1:3.0')
|
||||
depends=('glfw>=1:3.0', 'v4l-utils>=1.30', 'alsa-lib>=1.2.14')
|
||||
url="https://github.com/klemek/forge"
|
||||
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/klemek/forge/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
|
||||
sha256sums=('TODO')
|
||||
|
||||
@@ -132,7 +132,7 @@ make -f Makefile.dev release-arch
|
||||
- [ ] State machine with A/B switch
|
||||
- [ ] Tap-tempo feature
|
||||
- [ ] Clean code and fix things
|
||||
- [ ] Video input
|
||||
- [x] Video input
|
||||
- [x] Fixed camera video
|
||||
- [x] Pass video info to shaders
|
||||
- [x] Sub process video reading
|
||||
@@ -141,7 +141,7 @@ make -f Makefile.dev release-arch
|
||||
- [x] Get first video size matching internal size
|
||||
- [x] Other internal size for video
|
||||
- [x] Pass input fps into shaders for debug
|
||||
- [ ] Clean code and fix things
|
||||
- [x] Clean code and fix things
|
||||
- [x] Monitor screen
|
||||
- [x] 2nd window
|
||||
- [x] Use buffers as panels (INA A FXA / DEBUG A+B FXA+B / INB B FXB)
|
||||
|
||||
+16
-8
@@ -1,26 +1,34 @@
|
||||
AC_INIT([forge], [0.0.0], [klemek.dev@proton.me])
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_PROG_CC
|
||||
AC_CHECK_HEADERS([errno.h])
|
||||
AC_CHECK_HEADERS([fcntl.h])
|
||||
AC_CHECK_HEADERS([GLFW/glfw3.h])
|
||||
AC_CHECK_HEADERS([GLFW/glfw3native.h])
|
||||
AC_CHECK_HEADERS([limits.h])
|
||||
AC_CHECK_HEADERS([linux/videodev2.h])
|
||||
AC_CHECK_HEADERS([math.h])
|
||||
|
||||
AC_CHECK_HEADERS([stdbool.h])
|
||||
AC_CHECK_HEADERS([stddef.h])
|
||||
AC_CHECK_HEADERS([stdint.h])
|
||||
AC_CHECK_HEADERS([stdio.h])
|
||||
AC_CHECK_HEADERS([stdlib.h])
|
||||
AC_CHECK_HEADERS([string.h])
|
||||
|
||||
AC_CHECK_HEADERS([sys/ioctl.h])
|
||||
AC_CHECK_HEADERS([sys/mman.h])
|
||||
AC_CHECK_HEADERS([sys/stat.h])
|
||||
AC_CHECK_HEADERS([sys/time.h])
|
||||
AC_CHECK_HEADERS([sys/types.h])
|
||||
AC_CHECK_HEADERS([sys/wait.h])
|
||||
|
||||
AC_CHECK_HEADERS([errno.h])
|
||||
AC_CHECK_HEADERS([fcntl.h])
|
||||
AC_CHECK_HEADERS([limits.h])
|
||||
AC_CHECK_HEADERS([math.h])
|
||||
AC_CHECK_HEADERS([string.h])
|
||||
AC_CHECK_HEADERS([time.h])
|
||||
AC_CHECK_HEADERS([unistd.h])
|
||||
|
||||
AC_CHECK_HEADERS([linux/videodev2.h])
|
||||
|
||||
AC_CHECK_HEADERS([alsa/rawmidi.h])
|
||||
|
||||
AC_CHECK_HEADERS([GLFW/glfw3.h])
|
||||
AC_CHECK_HEADERS([GLFW/glfw3native.h])
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "types.h"
|
||||
|
||||
void midi_close(MidiDevice device) {
|
||||
if (device.input != NULL) {
|
||||
snd_rawmidi_close(device.input);
|
||||
}
|
||||
if (device.output != NULL) {
|
||||
snd_rawmidi_close(device.input);
|
||||
}
|
||||
}
|
||||
|
||||
MidiDevice midi_open(char *name) {
|
||||
MidiDevice device;
|
||||
|
||||
device.input = NULL;
|
||||
device.output = NULL;
|
||||
|
||||
snd_rawmidi_open(&device.input, &device.output, name, 0);
|
||||
|
||||
device.error = device.input == NULL || device.output == NULL;
|
||||
|
||||
if (device.error) {
|
||||
midi_close(device);
|
||||
}
|
||||
|
||||
log_debug("(%s) MIDI open", name);
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
// int bytes_read = snd_rawmidi_read(input, input_buffer, sizeof(input_buffer));
|
||||
// snd_rawmidi_write(output, buffer, 3);
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "types.h"
|
||||
|
||||
#ifndef MIDI_H
|
||||
#define MIDI_H
|
||||
|
||||
MidiDevice midi_open(char *name);
|
||||
void midi_close(MidiDevice device);
|
||||
|
||||
#endif /* MIDI_H */
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <alsa/asoundlib.h>
|
||||
#include <glad/egl.h>
|
||||
#include <glad/gl.h>
|
||||
#include <hashmap.h>
|
||||
@@ -148,4 +149,10 @@ typedef struct ConfigFileItem {
|
||||
char value[2048];
|
||||
} ConfigFileItem;
|
||||
|
||||
typedef struct MidiDevice {
|
||||
bool error;
|
||||
snd_rawmidi_t *input;
|
||||
snd_rawmidi_t *output;
|
||||
} MidiDevice;
|
||||
|
||||
#endif /* TYPES_H */
|
||||
Reference in New Issue
Block a user