From c368fd859f4943f3cbf2046d39d5abc7f1a1bc6a Mon Sep 17 00:00:00 2001 From: Milan Toth Date: Tue, 27 Sep 2022 19:44:27 +0000 Subject: [PATCH] test updates --- doc/ROAD.md | 3 +- doc/TECH.md | 6 ++-- doc/TEST.md | 2 +- doc/USER.md | 16 +++++----- doc/ZMDE.md | 69 ----------------------------------------- src/media_coder/coder.c | 11 +++---- src/vmp/library.c | 4 +-- src/vmp/ui/ui.c | 8 ++--- src/vmp/vmp.c | 4 +-- tst/test_rec.sh | 4 +-- tst/test_run.sh | 4 +-- 11 files changed, 30 insertions(+), 101 deletions(-) delete mode 100644 doc/ZMDE.md diff --git a/doc/ROAD.md b/doc/ROAD.md index 7fb7c41..765c15a 100644 --- a/doc/ROAD.md +++ b/doc/ROAD.md @@ -1,4 +1,4 @@ -# Zen Music development roadmap +# Visual Music Player development roadmap Visual Music Player @@ -19,6 +19,7 @@ genre list should filter artist list also str to cstr mindenhol text style kulon view-bol jojjon, ne interferaljon table css-sel clean info log level +don't render if no change happened in the ui - metadata editor problems, doesn't jump to beginning after long edit - jump to current song misbehaves when column sort is set differently diff --git a/doc/TECH.md b/doc/TECH.md index f1b4752..ee2ffd9 100644 --- a/doc/TECH.md +++ b/doc/TECH.md @@ -1,9 +1,9 @@ -# Zen Music technical information +# Visual Music Player technical information for contributors and developers ## 1. Overview ## -Zen Music is a pure C project written in [headerless C](https://github.com/milgra/headerlessc). +Visual Music Player is a pure C project written in [headerless C](https://github.com/milgra/headerlessc). It uses the ffmpeg library for media decoding/encoding/transcoding, SDL2 library for window and audio handling and OpenGL context creation. It uses a custom UI renderer called Zen UI, it is backed by OpenGL at the moment, Vulkan backend is on the roadmap. It uses the Zen Core library for memory management, map/vector/bitmap container implementations, utf8 string and math functions. @@ -45,7 +45,7 @@ svg - media source files tst - recorded test sessions and test working directory ``` -## 4. Zen Music Logic ## +## 4. Visual Music Player Logic ## ``` callbacks.c - callback collector & invocator diff --git a/doc/TEST.md b/doc/TEST.md index c84d889..9cb67a0 100644 --- a/doc/TEST.md +++ b/doc/TEST.md @@ -1,4 +1,4 @@ -# Zen Music test protocol +# Visual Music Player test protocol Before creating a pull request first check for leaks around your modification first with the built-in leak checker ( automatically executed on exit in dev mode ) and with valgrind(freebsd) or valgrind/address sanitizer(linux) Then create a release build with gmake/make rel. diff --git a/doc/USER.md b/doc/USER.md index beec573..a0c744a 100644 --- a/doc/USER.md +++ b/doc/USER.md @@ -1,6 +1,6 @@ -# Zen Music User Guide +# Visual Music Player User Guide -Welcome to Zen Music player, visualizer and organizer! I put a lot of effort in the making of this application and I hope that using this application fills your heart with warmth, pride and childlike joy! +Welcome to Visual Music Player player, visualizer and organizer! I put a lot of effort in the making of this application and I hope that using this application fills your heart with warmth, pride and childlike joy! ## Table of contents @@ -36,11 +36,11 @@ The application will show you the library selector popup page. Click on the red button if you want to quit the application. If you want to continue, enter the path to the folder on your machine where you store your music/music videos and click on the green button. [note: in the near future a file browser popup will be added to this part] -Zen Music will parse your library and create a database from your songs. During parsing the parsed songs will be shown in the library browser. +Visual Music Player will parse your library and create a database from your songs. During parsing the parsed songs will be shown in the library browser. ## 2. The Main Interface -Zen Music's main user interface has four main parts : +Visual Music Player's main user interface has four main parts : - The toolbar - The library browser @@ -176,7 +176,7 @@ click on the clean search/filter field button ## 11. Supporting user interfaces -Zen Music's supporting user interface are the following : +Visual Music Player's supporting user interface are the following : - The metadata/tag editor - The settings viewer/editor @@ -227,13 +227,13 @@ click on the main info display in the toolbar ## 16. Remote control -It is possible to remote control Zen Music. +It is possible to remote control Visual Music Player. **How to enable the feature** In settings popup, click on Remote Control, click on accept. **How to use the feature** -Zen Music opens up an UDP port on 23723. ( The port is configurable in the config file ) +Visual Music Player opens up an UDP port on 23723. ( The port is configurable in the config file ) Send 1 byte packets to this port, 0x00 to play/pause 0x01 to play previous song, 0x02 to play next song For example, my i3 config for remote control looks like this : @@ -247,7 +247,7 @@ In KDE/GNOME you can also bind keys to commands. ## 17. Creating song collections -Zen Music doesn't have playlists but you can do something similar. You can add tags to songs in the metadata editor, so if you want for example a playlist for monday, select all the songs you want to include at once or one-by-one and add "monday" to the tags field. Then if you search for "monday" in the search field it will show all songs with "monday" tag. Feel free to add more values to tags field using comma as separator. +Visual Music Player doesn't have playlists but you can do something similar. You can add tags to songs in the metadata editor, so if you want for example a playlist for monday, select all the songs you want to include at once or one-by-one and add "monday" to the tags field. Then if you search for "monday" in the search field it will show all songs with "monday" tag. Feel free to add more values to tags field using comma as separator. ## 18. Command line arguments diff --git a/doc/ZMDE.md b/doc/ZMDE.md deleted file mode 100644 index c827956..0000000 --- a/doc/ZMDE.md +++ /dev/null @@ -1,69 +0,0 @@ -********************************** -ZEN MULTIMEDIA DESKTOP ENVIRONMENT -********************************** - -Productivity centered distraction free environment - -- no notifications -- no unused ( distracting ) ui elements -- minimalistic and beautiful design -- zen key = meta key = WIN/MAC/custom key - -Zen desktop - -- tiling window manager -- workspace oriented -- shortcut oriented -- zen key brings up workspaces and shortcuts ( wifi, drives, kbd ) -- zen + space brings up launcher ( dmenu ) -- clipboard widget - -Zen Music Player, Visualizer And Organizer - -- zen + m? - -Zen Media File Manager - -- copy/move basket, preview works on them -- file viewer and manager -- preview area, info area, binary area? -- spaces toggles autostart -- zen + f? -- flat tree listing ( like programming packages ) -- shows zen music/image/video libs -- info/hex tab -- binary files shows up immediately as hex in media viewer - -Zen Image Library - -- image/video viewer and organizer -- zen + i? - -Zen Control Center - -- html based layout -- wifi, sound, display, etc controls can be added by html - -Zen Wifi - -- floating wifi manager -- zen + w? - -Zen Words - -- markdown based word processor -- zen + w? - -Zen Video - -- image/video editor -- replacement for kdenlive/gimp -- replacement for adobe premier with wine -- replacement for photoshop with wine -- new ui around shotcut? - -Zen Paint - -ZenSwarm -Zenflow -ZenBrawl \ No newline at end of file diff --git a/src/media_coder/coder.c b/src/media_coder/coder.c index eeee3d6..2edf34c 100644 --- a/src/media_coder/coder.c +++ b/src/media_coder/coder.c @@ -736,19 +736,16 @@ int coder_write_png(char* path, bm_rgba_t* bm) av_image_fill_arrays(frame_in->data, frame_in->linesize, bm->data, AV_PIX_FMT_RGBA, bm->w, bm->h, 1); - AVPacket pkt; - pkt.data = NULL; - pkt.size = 0; - // av_init_packet(&pkt); + AVPacket* pkt = av_packet_alloc(); if (avcodec_send_frame(enc_ctx, frame_in) >= 0) { - if (avcodec_receive_packet(enc_ctx, &pkt) >= 0) + if (avcodec_receive_packet(enc_ctx, pkt) >= 0) { FILE* file = fopen(path, "wb"); - fwrite(pkt.data, 1, pkt.size, file); + fwrite(pkt->data, 1, pkt->size, file); fclose(file); - av_packet_unref(&pkt); + av_packet_free(&pkt); } else printf("Error during encoding\n"); diff --git a/src/vmp/library.c b/src/vmp/library.c index 7ddc4bc..c5a481f 100644 --- a/src/vmp/library.c +++ b/src/vmp/library.c @@ -56,7 +56,7 @@ void lib_read(char* libpath) { assert(libpath != NULL); - char* dbpath = path_new_append(libpath, "zenmusic.kvl"); // REL 0 + char* dbpath = path_new_append(libpath, "vmp.kvl"); // REL 0 zc_log_info("READING DB %s", dbpath); @@ -71,7 +71,7 @@ void lib_write(char* libpath) { assert(libpath != NULL); - char* dbpath = cstr_new_format(PATH_MAX + NAME_MAX, "/%s/zenmusic.kvl", libpath); // REL 0 + char* dbpath = cstr_new_format(PATH_MAX + NAME_MAX, "/%s/vmp.kvl", libpath); // REL 0 int res = kvlist_write(dbpath, db); diff --git a/src/vmp/ui/ui.c b/src/vmp/ui/ui.c index 391a1aa..a801842 100644 --- a/src/vmp/ui/ui.c +++ b/src/vmp/ui/ui.c @@ -12,7 +12,7 @@ void ui_toggle_pause(); void ui_add_cursor(); void ui_update_cursor(r2_t frame); -void ui_screenshot(uint32_t time, char hide_cursor); +void ui_screenshot(uint32_t time); void ui_update_player(); void ui_update_songlist(); @@ -876,7 +876,7 @@ void ui_update_cursor(r2_t frame) view_set_frame(ui.cursor, frame); } -void ui_screenshot(uint32_t time, char hide_cursor) +void ui_screenshot(uint32_t time) { if (config_get("lib_path")) { @@ -887,7 +887,7 @@ void ui_screenshot(uint32_t time, char hide_cursor) // remove cursor for screenshot to remain identical - if (hide_cursor) + if (ui.cursor) { ui_manager_remove(ui.cursor); ui_manager_render(time); @@ -907,7 +907,7 @@ void ui_screenshot(uint32_t time, char hide_cursor) REL(path); // REL 1 REL(screen); // REL 0 - if (hide_cursor) ui_update_cursor(frame); // full screen cursor to indicate screenshot, next step will reset it + if (ui.cursor) ui_update_cursor(frame); // full screen cursor to indicate screenshot, next step will reset it } } diff --git a/src/vmp/vmp.c b/src/vmp/vmp.c index eb8d4ac..ec03cf0 100644 --- a/src/vmp/vmp.c +++ b/src/vmp/vmp.c @@ -185,7 +185,7 @@ void update(ev_t ev) ui_manager_event(*recev); ui_update_cursor((r2_t){recev->x, recev->y, 10, 10}); - if (recev->type == EV_KDOWN && recev->keycode == SDLK_PRINTSCREEN) ui_screenshot(ev.time, mmfm.replay); + if (recev->type == EV_KDOWN && recev->keycode == SDLK_PRINTSCREEN) ui_screenshot(ev.time); } } } @@ -194,7 +194,7 @@ void update(ev_t ev) if (mmfm.record) { evrec_record(ev); - if (ev.type == EV_KDOWN && ev.keycode == SDLK_PRINTSCREEN) ui_screenshot(ev.time, mmfm.replay); + if (ev.type == EV_KDOWN && ev.keycode == SDLK_PRINTSCREEN) ui_screenshot(ev.time); } } diff --git a/tst/test_rec.sh b/tst/test_rec.sh index b8d47f6..f9af9dd 100755 --- a/tst/test_rec.sh +++ b/tst/test_rec.sh @@ -20,13 +20,13 @@ res="y" while [ $res = "y" ]; do res_path="../res" - cfg_path="../tst/test/cfg" ses_path="../tst/session$cnt.rec" + lib_path="../tst/test" frm_size="1000x900" ((cnt+=1)) - bin/zenmusic -r $res_path -c $cfg_path -s $ses_path -f $frm_size + build/vmp -r $res_path -s $ses_path -f $frm_size -l $lib_path echo "Record another session? y/n" diff --git a/tst/test_run.sh b/tst/test_run.sh index 50bcb4f..34faef7 100755 --- a/tst/test_run.sh +++ b/tst/test_run.sh @@ -16,15 +16,15 @@ cnt=0 while true; do res_path="../res" - cfg_path="../tst/test/cfg" ses_path="../tst/session$cnt.rec" + lib_path="../tst/test" abs_path="tst/session$cnt.rec" frm_size="1000x900" ((cnt+=1)) if test -f $abs_path; then - bin/zenmusic -r $res_path -c $cfg_path -p $ses_path -f $frm_size + build/vmp -r $res_path -p $ses_path -f $frm_size -l $lib_path else break fi