Skip to content

Commit

Permalink
test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
milgra committed Sep 27, 2022
1 parent 1c2e6c1 commit c368fd8
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 101 deletions.
3 changes: 2 additions & 1 deletion doc/ROAD.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Zen Music development roadmap
# Visual Music Player development roadmap

Visual Music Player

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/TECH.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/TEST.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
16 changes: 8 additions & 8 deletions doc/USER.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 :
Expand All @@ -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

Expand Down
69 changes: 0 additions & 69 deletions doc/ZMDE.md

This file was deleted.

11 changes: 4 additions & 7 deletions src/media_coder/coder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/vmp/library.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions src/vmp/ui/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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"))
{
Expand All @@ -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);
Expand All @@ -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
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/vmp/vmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand All @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions tst/test_rec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions tst/test_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c368fd8

Please sign in to comment.