Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: m-labs/flickernoise
base: 007009f
...
head fork: m-labs/flickernoise
compare: b4b36d0
  • 3 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
View
2  src/Makefile
@@ -13,7 +13,7 @@ OBJDIR=obj
BINDIR=bin
# base
-OBJS=version.o shellext.o sysconfig.o config.o fb.o input.o keymap.o fbgrab.o shortcuts.o osc.o pngload.o flashvalid.o main.o
+OBJS=version.o shellext.o sysconfig.o config.o fb.o input.o keymap.o fbgrab.o shortcuts.o osc.o png.o flashvalid.o main.o
# GUI
OBJS+=messagebox.o filedialog.o resmgr.o guirender.o performance.o cp.o keyboard.o ir.o audio.o midi.o oscsettings.o dmxspy.o dmxdesk.o dmx.o videoin.o rsswall.o patcheditor.o monitor.o firstpatch.o filemanager.o sysettings.o about.o flash.o shutdown.o
View
19 src/cp.c
@@ -116,7 +116,6 @@ enum {
CP_ITEM_SAVE,
CP_ITEM_FIRSTPATCH,
CP_ITEM_START,
- CP_ITEM_STARTSIMPLE,
CP_ITEM_FILEMANAGER,
CP_ITEM_PDFREADER,
@@ -180,10 +179,7 @@ static void cp_callback(mtk_event *e, void *arg)
open_firstpatch_window();
break;
case CP_ITEM_START:
- start_performance(false);
- break;
- case CP_ITEM_STARTSIMPLE:
- start_performance(true);
+ open_performance_window();
break;
case CP_ITEM_FILEMANAGER:
@@ -286,18 +282,14 @@ void init_cp()
"b_load = new Button(-text \"Load\")",
"b_save = new Button(-text \"Save\")",
"b_firstpatch = new Button(-text \"First patch\")",
- "g_start = new Grid()",
"b_start = new Button(-text \"Start!\")",
- "b_startsimple = new Button(-text \"Simple mode\")",
- "g_start.place(b_start, -column 1 -row 1)",
- "g_start.place(b_startsimple, -column 2 -row 1)",
"g_performance.place(b_new, -column 1 -row 1)",
"g_performance.place(b_load, -column 2 -row 1)",
"g_performance.place(b_save, -column 3 -row 1)",
"g.place(g_performance0, -column 1 -row 8)",
"g.place(g_performance, -column 1 -row 9)",
"g.place(b_firstpatch, -column 1 -row 10)",
- "g.place(g_start, -column 1 -row 11)",
+ "g.place(b_start, -column 1 -row 11)",
"g_tools0 = new Grid()",
"l_tools = new Label(-text \"Tools\" -font \"title\")",
@@ -356,7 +348,6 @@ void init_cp()
mtk_bind(appid, "b_save", "commit", cp_callback, (void *)CP_ITEM_SAVE);
mtk_bind(appid, "b_firstpatch", "commit", cp_callback, (void *)CP_ITEM_FIRSTPATCH);
mtk_bind(appid, "b_start", "commit", cp_callback, (void *)CP_ITEM_START);
- mtk_bind(appid, "b_startsimple", "commit", cp_callback, (void *)CP_ITEM_STARTSIMPLE);
mtk_bind(appid, "b_filemanager", "commit", cp_callback, (void *)CP_ITEM_FILEMANAGER);
#ifdef WITH_PDF
mtk_bind(appid, "b_pdfreader", "commit", cp_callback, (void *)CP_ITEM_PDFREADER);
@@ -374,12 +365,14 @@ void init_cp()
void cp_autostart()
{
char autostart[256];
+ int dt, as;
switch(sysconfig_get_autostart_mode()) {
case SC_AUTOSTART_NONE:
break;
case SC_AUTOSTART_SIMPLE:
- start_performance(true);
+ sysconfig_get_autostart_mode_simple(&dt, &as);
+ start_performance(1, dt, as);
break;
case SC_AUTOSTART_FILE:
sysconfig_get_autostart(autostart);
@@ -394,7 +387,7 @@ void cp_autostart()
return;
}
on_config_change();
- start_performance(false);
+ start_performance(0, 0, 0);
break;
}
}
View
2  src/fbgrab.c
@@ -28,7 +28,7 @@
#include <stdlib.h>
#include <png.h>
-#include "pngload.h"
+#include "png.h"
#include "fbgrab.h"
static char *filename = "/ssd/Screenshot-00.png";
View
40 src/performance.c
@@ -47,6 +47,8 @@ static int npatches;
static int current_patch;
static struct patch_info patches[MAX_PATCHES];
static bool simple_mode;
+static int dt_mode;
+static int as_mode;
static int add_patch(const char *filename)
{
@@ -283,21 +285,37 @@ static int keycode_to_index(int keycode)
}
}
+static rtems_interval next_as_time;
+
static void event_callback(mtk_event *e, int count)
{
int i;
int index;
+ int next;
+ rtems_interval t;
index = -1;
if(simple_mode) {
+ next = 0;
for(i=0;i<count;i++) {
- if((e[i].type == EVENT_TYPE_PRESS) && (e[i].press.code == MTK_KEY_F11)) {
- current_patch++;
- if(current_patch == npatches)
- current_patch = 0;
- index = current_patch;
+ if((e[i].type == EVENT_TYPE_PRESS) && (e[i].press.code == MTK_KEY_F11))
+ next = 1;
+ }
+ if(as_mode) {
+ t = rtems_clock_get_ticks_since_boot();
+ if(t >= next_as_time) {
+ next = 1;
+ next_as_time = t + 3000;
}
}
+ if(next) {
+ current_patch++;
+ if(current_patch == npatches)
+ current_patch = 0;
+ index = current_patch;
+ }
+ if(dt_mode && (index != -1))
+ osd_event(patches[index].filename);
} else {
for(i=0;i<count;i++) {
if(e[i].type == EVENT_TYPE_PRESS) {
@@ -368,17 +386,25 @@ static void refresh_callback(mtk_event *e, int count)
}
}
+void open_performance_window()
+{
+ mtk_cmd(appid, "w.open()");
+}
+
static rtems_id comp_task_id;
-void start_performance(bool simple)
+void start_performance(int simple, int dt, int as)
{
rtems_status_code sc;
if(started) return;
started = 1;
- /* build patch list */
simple_mode = simple;
+ dt_mode = dt;
+ as_mode = as;
+
+ /* build patch list */
npatches = 0;
current_patch = 0;
if(simple) {
View
3  src/performance.h
@@ -21,6 +21,7 @@
#define SIMPLE_PATCHES_FOLDER "/ssd/patchpool/"
void init_performance();
-void start_performance(bool simple);
+void open_performance_window();
+void start_performance(int simple, int dt, int as);
#endif /* __PERFORMANCE_H */
View
17 src/pngload.c → src/png.c
@@ -19,9 +19,14 @@
#include <stdlib.h>
#include <setjmp.h>
#include <png.h>
+#include <zlib.h>
#include "color.h"
-#include "pngload.h"
+#include "png.h"
+
+#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
+#warning Floating point PNG is slow
+#endif
static void floyd_steinberg(int *pic, int width, int height)
{
@@ -206,28 +211,28 @@ int png_write(unsigned char *outbuffer, const char *filename,
png_infop info_ptr;
FILE *outfile;
- for (i=0; i<height; i++)
+ for(i=0; i<height; i++)
row_pointers[i] = outbuffer + i * width * 3;
outfile = fopen(filename, "w");
- if (outfile == NULL) {
+ if(outfile == NULL) {
perror("Error: Couldn't fopen");
return -1;
}
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
- if (!png_ptr) {
+ if(!png_ptr) {
fprintf(stderr, "Error: Couldn't create PNG write struct\n");
goto free0;
}
info_ptr = png_create_info_struct(png_ptr);
- if (!info_ptr) {
+ if(!info_ptr) {
fprintf(stderr, "Error: Couldn't create PNG info struct\n");
goto free1;
}
- if (setjmp(png_jmpbuf(png_ptr))) goto free1;
+ if(setjmp(png_jmpbuf(png_ptr))) goto free1;
png_init_io(png_ptr, outfile);
View
0  src/pngload.h → src/png.h
File renamed without changes
View
2  src/sysconfig.c
@@ -34,7 +34,7 @@
#include <mtklib.h>
#include "version.h"
-#include "pngload.h"
+#include "png.h"
#include "fb.h"
#include "sysconfig.h"

No commit comments for this range

Something went wrong with that request. Please try again.