Compare commits

..

2 Commits

Author SHA1 Message Date
81f34cd28c apps/piano: refactoring, part 2
- Fixed bugs in keys and buttons reading and audio play
- Refactored data tables and removed loops
- Used more constants for everything
- Changes Spanish encoding to CP850
- Shifted notes on keys by -0x10 to match buttons
- Configured events mask for help thread
- Shift now works for buttons also
- Help window have relative coordinates from main window
- Maybe something else that I already forgot

Co-authored-by: Doczom <mixa.frolov2003@gmail.com>
2025-12-26 20:58:46 +02:00
5049d6b0b4 Piano refacoring, part 1 2025-12-24 19:10:11 +02:00
8 changed files with 440 additions and 873 deletions

View File

@@ -31,8 +31,8 @@ import lib_libini, \
LIBINI_enum_keys , 'ini_enum_keys' , \
LIBINI_get_str , 'ini_get_str' , \
LIBINI_get_int , 'ini_get_int' , \
LIBINI_get_color , 'ini_get_color' , \
LIBINI_get_shortcut , 'ini_get_shortcut' , \
LIBINI_get_color , 'int_get_color' , \
LIBINI_get_shortcut , 'int_get_shortcut' , \
LIBINI_set_str , 'ini_set_str' , \
LIBINI_set_int , 'ini_set_int' , \
LIBINI_set_color , 'ini_set_color'

View File

@@ -864,7 +864,7 @@ void ff_set_mpeg4_time(MpegEncContext * s){
}
static void mpeg4_encode_gop_header(MpegEncContext * s){
int64_t hours, minutes, seconds;
int hours, minutes, seconds;
int64_t time;
put_bits(&s->pb, 16, 0);

View File

@@ -2035,13 +2035,8 @@ static int vp3_decode_frame(AVCodecContext *avctx,
if (ff_thread_get_buffer(avctx, &s->current_frame, AV_GET_BUFFER_FLAG_REF) < 0)
goto error;
if (!s->edge_emu_buffer) {
if (!s->edge_emu_buffer)
s->edge_emu_buffer = av_malloc(9*FFABS(s->current_frame.f->linesize[0]));
if (!s->edge_emu_buffer) {
ret = AVERROR(ENOMEM);
goto error;
}
}
if (s->keyframe) {
if (!s->theora)

View File

@@ -2580,10 +2580,8 @@ static int http_receive_data(HTTPContext *c)
} else if (c->buffer_ptr - c->buffer >= 2 &&
!memcmp(c->buffer_ptr - 1, "\r\n", 2)) {
c->chunk_size = strtol(c->buffer, 0, 16);
if (c->chunk_size <= 0) { // end of stream or invalid chunk size
c->chunk_size = 0;
if (c->chunk_size == 0) // end of stream
goto fail;
}
c->buffer_ptr = c->buffer;
break;
} else if (++loop_run > 10)
@@ -2605,7 +2603,6 @@ static int http_receive_data(HTTPContext *c)
/* end of connection : close it */
goto fail;
else {
av_assert0(len <= c->chunk_size);
c->chunk_size -= len;
c->buffer_ptr += len;
c->data_count += len;

View File

@@ -267,12 +267,8 @@ static int cine_read_header(AVFormatContext *avctx)
/* parse image offsets */
avio_seek(pb, offImageOffsets, SEEK_SET);
for (i = 0; i < st->duration; i++) {
if (avio_feof(pb))
return AVERROR_INVALIDDATA;
for (i = 0; i < st->duration; i++)
av_add_index_entry(st, avio_rl64(pb), i, 0, 0, AVINDEX_KEYFRAME);
}
return 0;
}

View File

@@ -1,7 +1,4 @@
if tup.getconfig("NO_FASM") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_fasm.lua")
add_include(tup.getvariantdir())
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
tup.rule({"piano.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "piano")
tup.rule("piano.asm", FASM .. " -dlang=" .. tup.getconfig("LANG") .. " %f %o" .. tup.getconfig("KPACK_CMD"), "%B")

View File

@@ -1,4 +0,0 @@
@echo lang fix en_US >lang.inc
@fasm piano.asm piano
@erase lang.inc
@pause

File diff suppressed because it is too large Load Diff