Subversion Repositories Kolibri OS

Rev

Rev 8389 | Rev 9434 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #define MEMSIZE 4096 * 50
  2.  
  3. //===================================================//
  4. //                                                   //
  5. //                       LIB                         //
  6. //                                                   //
  7. //===================================================//
  8.  
  9. #include "../lib/fs.h"
  10. #include "../lib/list_box.h"
  11. #include "../lib/gui.h"
  12. #include "../lib/random.h"
  13. #include "../lib/kfont.h"
  14.  
  15. #include "../lib/obj/libimg.h"
  16. #include "../lib/obj/libini.h"
  17. #include "../lib/obj/proc_lib.h"
  18. #include "../lib/obj/box_lib.h"
  19.  
  20. #include "../lib/patterns/simple_open_dialog.h"
  21.  
  22. //===================================================//
  23. //                                                   //
  24. //                       DATA                        //
  25. //                                                   //
  26. //===================================================//
  27.  
  28. //simple open dialog data
  29. char default_dir[] = "/rd/1";
  30. od_filter filter2 = { 15, "MP3\0WAV\0XM\0\0" };
  31.  
  32. #define ABOUT_MESSAGE "                   v2.94 Final
  33.  
  34.           A tiny music folder player.
  35.     Supports MP3, WAV, XM audio file formats.
  36.  
  37. Hot keys:
  38.   Open file: O key
  39.   Play/Stop: Space or P key
  40.   Start playing selected file: Enter
  41.   Goto next/previous track: Ctrl + Left/Right
  42.   Change sound volume: Left/Right key
  43.   Remove from the list: Delete
  44.   Permanently delete file: Shift + Delete
  45.   Show file info: I
  46.   Repeat: R
  47.   Shuffle: S
  48.   Mute: M
  49.  
  50. kolibri-n.org & aspero.pro"
  51.  
  52. scroll_bar scroll1 = { 5,200,398,44,0,2,115,15,0,0xeeeeee,0xBBBbbb,0xeeeeee,
  53.         0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
  54.  
  55. proc_info Form;
  56. llist list;
  57.  
  58. char pixie_ini_path[4096];
  59. char work_folder[4096];
  60. char current_filename[256];
  61.  
  62. enum {
  63.         BUTTON_WINDOW_CLOSE = 1,
  64.         BUTTON_WINDOW_MINIMIZE,
  65.         BUTTON_WINDOW_REDUCE,
  66.         BUTTON_PLAYBACK_PLAY_PAUSE = 10,
  67.         BUTTON_PLAYBACK_PREV,
  68.         BUTTON_PLAYBACK_NEXT,
  69.         BUTTON_REPEAT,
  70.         BUTTON_SHUFFLE,
  71.         BUTTON_OPEN_DIALOG,
  72.         BUTTON_SHOW_VOLUME
  73. };
  74.  
  75. int player_run_id;
  76. int notify_run_id;
  77.  
  78. bool repeat=false;
  79. bool shuffle=false;
  80.  
  81. int current_playing_file_n=0;
  82.  
  83. word win_x_normal, win_y_normal;
  84. word win_x_small, win_y_small;
  85.  
  86. byte window_mode;
  87. enum {
  88.         WINDOW_MODE_NORMAL,
  89.         WINDOW_MODE_SMALL
  90. };
  91.  
  92. byte playback_mode;
  93. enum {
  94.         PLAYBACK_MODE_STOPED,
  95.         PLAYBACK_MODE_PLAYING
  96. };
  97.  
  98. libimg_image skin;
  99.  
  100. #define LAST_FOLDER_EXISTS 1
  101.  
  102. //===================================================//
  103. //                                                   //
  104. //                       CODE                        //
  105. //                                                   //
  106. //===================================================//
  107.  
  108. #include "get_files_list.h"
  109. #include "settings.h"
  110.  
  111. void LoadLibraries()
  112. {
  113.         load_dll(boxlib, #box_lib_init,0);
  114.         load_dll(libimg, #libimg_init,1);
  115.         load_dll(libini, #lib_init,1);
  116.         load_dll(Proc_lib, #OpenDialog_init,0);
  117.         OpenDialog_init stdcall (#o_dialog);
  118. }
  119.  
  120. void main()
  121. {
  122.         list.SetFont(8, 16, 13);
  123.         LoadLibraries();
  124.         LoadIniConfig();
  125.         if (!param) {
  126.                 notify("'Pixie Player\nPress O key to open MP3/WAV/XM file' -St");
  127.                 if (work_folder) param=LAST_FOLDER_EXISTS;
  128.         }
  129.         kfont.init(DEFAULT_FONT);      
  130.         @SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
  131.         loop() switch(@WaitEventTimeout(10))
  132.         {
  133.                 case evMouse:
  134.                         mouse.get();
  135.                         scrollbar_v_mouse (#scroll1);
  136.                         if (list.first != scroll1.position)
  137.                         {
  138.                                 list.first = scroll1.position;
  139.                                 DrawPlayList();
  140.                                 break;
  141.                         }
  142.                         if (list.MouseOver(mouse.x, mouse.y))
  143.                         {
  144.                                 if (mouse.vert) && (list.MouseScroll(mouse.vert)) DrawPlayList();
  145.                                 if (mouse.dblclick) EventStartPlayingSelectedItem();
  146.                                 if (mouse.down) && (mouse.key&MOUSE_LEFT)
  147.                                         && (list.ProcessMouse(mouse.x, mouse.y)) DrawPlayList();
  148.                         }
  149.                         if(mouse.key&MOUSE_LEFT) && (mouse.x<14)
  150.                                 && (window_mode == WINDOW_MODE_SMALL) EventDragWindow();
  151.                         if (mouse.down) && (mouse.y>skin_height) && (mouse.key&MOUSE_RIGHT) EventShowAbout();
  152.                         break;
  153.                 case evButton:
  154.                         switch(@GetButtonID()) {
  155.                                 case BUTTON_WINDOW_CLOSE: EventExitApp(); break;
  156.                                 case BUTTON_WINDOW_MINIMIZE: MinimizeWindow(); break;
  157.                                 case BUTTON_WINDOW_REDUCE: EventChangeWindowMode(); break;
  158.                                 case BUTTON_PLAYBACK_PREV: EventPlaybackPrevious();     break;
  159.                                 case BUTTON_PLAYBACK_NEXT: EventPlaybackNext(); break;
  160.                                 case BUTTON_PLAYBACK_PLAY_PAUSE: EventPlayAndPause(); break;
  161.                                 case BUTTON_REPEAT: EventRepeatClick(); break;
  162.                                 case BUTTON_SHUFFLE: EventShuffleClick(); break;
  163.                                 case BUTTON_OPEN_DIALOG: EventFileDialogOpen(); break;
  164.                                 case BUTTON_SHOW_VOLUME: RunProgram("/sys/@VOLUME", NULL); break;
  165.                         }
  166.                         break;   
  167.                 case evKey:
  168.                         GetKeys();
  169.                         if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) {
  170.                                 if (key_scancode==SCAN_CODE_LEFT) EventPlaybackPrevious();
  171.                                 if (key_scancode==SCAN_CODE_RIGHT) EventPlaybackNext();
  172.                                 break;
  173.                         }
  174.                         if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
  175.                                 if (key_scancode==SCAN_CODE_DEL) EventPermanentlyDeleteFile();
  176.                                 break;
  177.                         }
  178.                         if (key_scancode==SCAN_CODE_KEY_O) EventFileDialogOpen();
  179.                         if (key_scancode==SCAN_CODE_KEY_M) RunProgram("/sys/@VOLUME", "m");
  180.                         if (key_scancode==SCAN_CODE_KEY_R) EventRepeatClick();
  181.                         if (key_scancode==SCAN_CODE_KEY_S) EventShuffleClick();
  182.                         if (key_scancode==SCAN_CODE_KEY_I) EventShowTagInfo();
  183.                         if (key_scancode==SCAN_CODE_RIGHT) RunProgram("/sys/@VOLUME", "+");
  184.                         if (key_scancode==SCAN_CODE_LEFT)  RunProgram("/sys/@VOLUME", "-");
  185.                         if (key_scancode==SCAN_CODE_ENTER) EventStartPlayingSelectedItem();
  186.                         if (key_scancode==SCAN_CODE_DEL) EventRemoveItemFromList();
  187.                         if (key_scancode==SCAN_CODE_KEY_P)||(key_scancode==SCAN_CODE_SPACE) EventPlayAndPause();
  188.                         if (key_scancode==SCAN_CODE_F1) EventShowAbout();
  189.                         if (list.ProcessKey(key_scancode)) DrawPlayList();
  190.                         break;
  191.                 case evReDraw:
  192.                         if (window_mode == WINDOW_MODE_NORMAL)
  193.                                 DefineDragableWindow(win_x_normal, win_y_normal, skin.w - 1, skin.h + list.h-1);
  194.                         if (window_mode == WINDOW_MODE_SMALL)
  195.                                 DefineDragableWindow(win_x_small, win_y_small, WIN_W_SMALL, WIN_H_SMALL);
  196.                         draw_window();
  197.                         if (param[0]) {
  198.                                 if (param==LAST_FOLDER_EXISTS) EventOpenFolder(NULL);
  199.                                 else EventOpenFolder(#param);
  200.                                 param[0] = NULL;
  201.                         }
  202.                         break;
  203.                 default:
  204.                         EventCheckSongFinished();
  205.         }
  206. }
  207.  
  208.  
  209. void DrawPlayList()
  210. {
  211.         int i;
  212.         int yyy;
  213.         int kfont_width;
  214.         char temp_filename[4096];
  215.         dword text_color, bg_color;
  216.         for (i=0; i<list.visible; i++;)
  217.         {
  218.                 strcpy(#temp_filename, files_mas[i + list.first] * 304 + buf + 72);
  219.                 temp_filename[strrchr(#temp_filename, '.')-1] = '\0';
  220.                
  221.                 yyy = i*list.item_h+list.y;
  222.                
  223.                 //this is selected file
  224.                 if (list.cur_y - list.first == i)
  225.                 {
  226.                         if (i>=list.count) continue;
  227.                         bg_color = theme.color_list_active_bg;
  228.                         text_color = theme.color_list_text;
  229.                 }
  230.                 //this is not selected file
  231.                 else
  232.                 {
  233.                         if (i>=list.count) continue;
  234.                         bg_color = theme.color_list_bg;
  235.                         text_color = theme.color_list_text;
  236.                 }
  237.                 //this is cur_y playing file
  238.                 if (i + list.first == current_playing_file_n)
  239.                 && (playback_mode == PLAYBACK_MODE_PLAYING)
  240.                 {
  241.                         text_color = theme.color_list_active_text;
  242.                 }
  243.                 DrawBar(list.x, yyy, list.w, list.item_h, bg_color);
  244.                 kfont_width = kfont.WriteIntoWindow(6, yyy+list.text_y, bg_color,
  245.                         text_color, list.font_type, #temp_filename);
  246.                 if (kfont_width>skin.w-15) DrawBar(skin.w-1, yyy, 1, list.item_h, theme.color_list_border);
  247.         }
  248.         DrawBar(list.x,list.visible * list.item_h + list.y, list.w,
  249.                 -list.visible * list.item_h + list.h, theme.color_list_bg);
  250.         DrawScroller();
  251. }
  252.  
  253.  
  254. void draw_window() {
  255.         GetProcessInfo(#Form, SelfInfo);
  256.         DrawTopPanel();
  257.         IF (Form.status_window&ROLLED_UP) return;
  258.         if (window_mode == WINDOW_MODE_NORMAL)
  259.         {
  260.                 DrawPlayList();
  261.                 DrawRectangle(0, skin.h-1, skin.w-1, list.h+1, theme.color_list_border);
  262.         }
  263. }
  264.  
  265. void DrawTopPanel()
  266. {
  267.         int kfont_width;
  268.         int button_y;
  269.         //Mode depended
  270.         if (window_mode == WINDOW_MODE_NORMAL)
  271.         {
  272.                 button_y = 46;
  273.                 img_draw stdcall(skin.image, 0, 0, skin.w, skin.h, 0, 0);
  274.                 if (playback_mode != PLAYBACK_MODE_STOPED)
  275.                         img_draw stdcall(skin.image, 47, button_y, 41, 21, skin.w+1, WIN_H_SMALL+1);
  276.                 if (repeat)
  277.                         img_draw stdcall(skin.image, 217, button_y+2, 17,17,skin.w+43, WIN_H_SMALL+1);
  278.                 if (shuffle)
  279.                         img_draw stdcall(skin.image, 236, button_y+2, 17,17, skin.w+62, WIN_H_SMALL+1);
  280.  
  281.                 if (!work_folder) DrawPixieTitle("Pixie");
  282.                 else DrawPixieTitle(#work_folder + strrchr(#work_folder, '/'));
  283.                 kfont_width = kfont.WriteIntoWindow(8, 24, theme.color_top_panel_bg,
  284.                         theme.color_top_panel_song_name, list.font_type, #current_filename);
  285.                 if (kfont_width>skin.w-15) DrawBar(skin.w-1, 24, 1, list.item_h, theme.color_list_border);
  286.                 //Playing control buttons
  287.                 DefineHiddenButton(7, button_y, 38, 20, BUTTON_PLAYBACK_PREV);
  288.                 DefineHiddenButton(48, button_y, 38, 20, BUTTON_PLAYBACK_PLAY_PAUSE);
  289.                 DefineHiddenButton(87, button_y, 38, 20, BUTTON_PLAYBACK_NEXT);
  290.                 //Window control buttons
  291.                 DefineHiddenButton(Form.width - 27, 1, 26, 15, BUTTON_WINDOW_CLOSE);
  292.                 DefineHiddenButton(Form.width - 55, 1, 26, 15, BUTTON_WINDOW_MINIMIZE);
  293.                 DefineHiddenButton(Form.width - 83, 1, 26, 15, BUTTON_WINDOW_REDUCE);
  294.                 //Other buttons
  295.                 DefineHiddenButton(218, button_y+3, 17, 16, BUTTON_REPEAT);
  296.                 DefineHiddenButton(237, button_y+3, 17, 16, BUTTON_SHUFFLE);
  297.                 DefineHiddenButton(270, button_y+3, 17, 16, BUTTON_OPEN_DIALOG);
  298.                 DefineHiddenButton(289, button_y+3, 17, 16, BUTTON_SHOW_VOLUME);
  299.         }
  300.         else if (window_mode == WINDOW_MODE_SMALL)
  301.         {
  302.                 button_y = 7;
  303.                 img_draw stdcall(skin.image, 0, 0, WIN_W_SMALL, WIN_H_SMALL, skin.w-1, 0);
  304.                 if (playback_mode != PLAYBACK_MODE_STOPED)
  305.                         img_draw stdcall(skin.image, 46, button_y-1, 27, 19, skin.w+83, WIN_H_SMALL+1);
  306.                 DefineHiddenButton(0, 0, WIN_W_SMALL, WIN_H_SMALL, 99 + BT_NOFRAME);
  307.                 //Playing control buttons
  308.                 DefineHiddenButton(20, button_y, 24, 16, BUTTON_PLAYBACK_PREV);
  309.                 DefineHiddenButton(46, button_y, 24, 16, BUTTON_PLAYBACK_PLAY_PAUSE);
  310.                 DefineHiddenButton(72, button_y, 24, 16, BUTTON_PLAYBACK_NEXT);
  311.                 //Window control buttons
  312.                 DefineHiddenButton(Form.width - 20, 1, 19, 13, BUTTON_WINDOW_CLOSE);
  313.                 DefineHiddenButton(Form.width - 20, 16, 19, 13, BUTTON_WINDOW_REDUCE);
  314.         }
  315. }
  316.  
  317.  
  318. void DrawScroller()
  319. {
  320.         scroll1.max_area = list.count;
  321.         scroll1.cur_area = list.visible;
  322.         scroll1.position = list.first;
  323.         scroll1.all_redraw = 0;
  324.         scroll1.start_x = skin.w - scroll1.size_x-1;
  325.         scroll1.start_y = list.y-1;
  326.         scroll1.size_y = list.h+2;
  327.         if (list.count > list.visible) scrollbar_v_draw(#scroll1);
  328. }
  329.  
  330. void DrawPixieTitle(dword _t)
  331. {
  332.         char title[35];
  333.         strlcpy(#title, _t, sizeof(title));
  334.         if (strlen(#title)>30) strcpy(#title+30, "...");
  335.         kfont.WriteIntoWindow(8, 5, theme.color_top_panel_bg,
  336.         theme.color_top_panel_folder_name, list.font_type, #title);
  337. }
  338.  
  339. void DrawAboutWindow()
  340. {
  341.         #define ABOUT_W 400
  342.         #define ABOUT_H 410
  343.         loop() switch(@WaitEvent())
  344.         {
  345.                 case evButton: ExitProcess(); break;
  346.                 case evKey: if (GetKeyScancode() == SCAN_CODE_ESC) ExitProcess(); break;
  347.                 case evReDraw:
  348.                         DefineDragableWindow(150, 200, ABOUT_W, ABOUT_H);
  349.  
  350.                         DrawBar(0, 0, ABOUT_W, ABOUT_H, theme.color_top_panel_bg);
  351.                         DrawRectangle(0, 0, ABOUT_W, ABOUT_H, theme.color_list_border);
  352.  
  353.                         //DefineHiddenButton(ABOUT_W - 27, 1, 26, 15, BUTTON_WINDOW_CLOSE);
  354.                         //skin.draw(ABOUT_W-28, 0, 28, 18, skin.w - 29, 0);
  355.                         DrawCaptButton(ABOUT_W-10-80, ABOUT_H - 34, 80, 24, 2,
  356.                           theme.color_top_panel_bg, 0xF5EFB3, "Cool");
  357.                        
  358.                         WriteText(131,16, 0x81, 0x8E7C61, "Pixie Player");
  359.                         WriteText(130,15, 0x81, 0xF5EFB3, "Pixie Player");
  360.  
  361.                         WriteTextLines(10, 40, 0x90, theme.color_top_panel_song_name, ABOUT_MESSAGE, 19);
  362.                         DrawIcon32(45, 15, theme.color_top_panel_bg, 65);
  363.                         DrawIcon32(ABOUT_W-32-45, 15, theme.color_top_panel_bg, 65);
  364.         }
  365. }
  366.  
  367. //===================================================//
  368. //                                                   //
  369. //                     EVENTS                        //
  370. //                                                   //
  371. //===================================================//
  372.  
  373.  
  374. void EventOpenFolder(dword _open_path)
  375. {
  376.         if (!_open_path)
  377.         {
  378.                 OpenDirectory(#work_folder);
  379.         }
  380.         else
  381.         {
  382.                 strcpy(#work_folder, _open_path);
  383.                 work_folder[strrchr(#work_folder, '/')-1]='\0';
  384.                 OpenDirectory(#work_folder);
  385.                 SetOpenedFileFirst(_open_path);
  386.         }
  387.         list.SetSizes(1, skin.h, skin.w-1, 22*15, 22);
  388.         if (list.count <= list.visible)
  389.         {
  390.                 list.h = list.count * list.item_h;
  391.                 list.visible = list.count;
  392.                 list.w -= 1;
  393.         }
  394.         else
  395.         {
  396.                 list.w -= scroll1.size_x;
  397.         }
  398.         if (window_mode==WINDOW_MODE_NORMAL) MoveSize(OLD, OLD, OLD, skin.h + list.h);
  399.         list.KeyHome();
  400.         current_playing_file_n=0;
  401.         EventStopPlaying();
  402.         if (_open_path) EventStartPlaying();   
  403. }
  404.  
  405.  
  406. void EventStopPlaying()
  407. {
  408.         if (player_run_id) player_run_id = KillProcess(player_run_id);
  409.         if (notify_run_id) notify_run_id = KillProcess(notify_run_id);
  410.         playback_mode = PLAYBACK_MODE_STOPED;
  411.         DrawTopPanel();
  412.         DrawPlayList();
  413. }
  414.  
  415.  
  416. void EventStartPlaying()
  417. {
  418.         word i;
  419.         char item_path[4096];
  420.         char notify_message[512];
  421.         EventStopPlaying();
  422.         if (current_playing_file_n >= list.count) {
  423.                 current_playing_file_n = list.count-1;
  424.                 return;
  425.         }
  426.         if (current_playing_file_n < 0) {
  427.                 current_playing_file_n = 0;
  428.                 return;
  429.         }
  430.         playback_mode = PLAYBACK_MODE_PLAYING;
  431.         strlcpy(#current_filename, GetPlayingItemName(), sizeof(current_filename));
  432.         sprintf(#item_path,"-h %s/%s",#work_folder,#current_filename);
  433.         current_filename[strrchr(#current_filename, '.')-1] = '\0';
  434.         DrawPlayList();
  435.         DrawTopPanel();
  436.         //start_playing_time =
  437.         player_run_id = RunProgram("/sys/media/ac97snd", #item_path);  
  438.         //player_run_id = RunProgram("/kolibrios/media/minimp3", #item_path);  
  439.         sprintf(#notify_message,"'Now playing:\n%s' -St",#current_filename);
  440.         if (!repeat) && (window_mode==WINDOW_MODE_SMALL)
  441.         {
  442.                 for (i=2; i<strlen(#notify_message)-6; i++)
  443.                 {
  444.                         //replace ' char to avoid @notify misunderstood
  445.                         if (notify_message[i]=='\'') notify_message[i]=96;
  446.                 }
  447.                 notify_run_id = notify(#notify_message);
  448.         }
  449. }
  450.  
  451.  
  452. void EventPlayAndPause()
  453. {
  454.         if (playback_mode == PLAYBACK_MODE_PLAYING)
  455.         {
  456.                 playback_mode = PLAYBACK_MODE_STOPED;
  457.                 EventStopPlaying();
  458.         }
  459.         else
  460.         {
  461.                 playback_mode = PLAYBACK_MODE_PLAYING;
  462.                 EventStartPlaying();
  463.         }
  464. }
  465.  
  466.  
  467. void EventChangeWindowMode()
  468. {
  469.         if (window_mode == WINDOW_MODE_NORMAL)
  470.         {
  471.                 window_mode = WINDOW_MODE_SMALL;
  472.                 win_x_normal = Form.left;
  473.                 win_y_normal = Form.top;
  474.                 MoveSize(OLD, OLD, WIN_W_SMALL-1, WIN_H_SMALL-1);
  475.                 MoveSize(OLD, win_y_small, OLD, OLD);
  476.                 MoveSize(win_x_small, OLD, OLD, OLD);
  477.         }
  478.         else
  479.         {
  480.                 window_mode = WINDOW_MODE_NORMAL;
  481.                 win_x_small = Form.left;
  482.                 win_y_small = Form.top;
  483.                 MoveSize(win_x_normal, win_y_normal, skin.w -1 ,skin.h + list.h);
  484.         }
  485. }
  486.  
  487. void EventExitApp()
  488. {
  489.         EventStopPlaying();
  490.         SaveIniConfig();
  491.         ExitProcess();
  492. }
  493.  
  494. void EventPlaybackPrevious()
  495. {
  496.         if (shuffle) current_playing_file_n = random(list.count);
  497.         else current_playing_file_n--;
  498.         EventStartPlaying();
  499. }
  500.  
  501. void EventPlaybackNext()
  502. {
  503.         if (shuffle) current_playing_file_n = random(list.count);
  504.         else current_playing_file_n++;
  505.         EventStartPlaying();
  506. }
  507.  
  508. void EventStartPlayingSelectedItem()
  509. {
  510.         current_playing_file_n=list.cur_y;
  511.         EventStartPlaying();
  512. }
  513.  
  514. void EventFileDialogOpen()
  515. {
  516.         OpenDialog_start stdcall (#o_dialog);
  517.         if (o_dialog.status==1) EventOpenFolder(#openfile_path);
  518. }
  519.  
  520. void EventCheckSongFinished()
  521. {
  522.         if (playback_mode == PLAYBACK_MODE_PLAYING)
  523.         && (!GetProcessSlot(player_run_id)) {
  524.                 if (repeat) EventStartPlaying();
  525.                 else EventPlaybackNext();
  526.         }
  527. }
  528.  
  529. void EventRepeatClick()
  530. {
  531.         repeat ^= 1;
  532.         DrawTopPanel();
  533. }
  534.  
  535. void EventShuffleClick()
  536. {
  537.         shuffle ^= 1;
  538.         DrawTopPanel();
  539. }
  540.  
  541. void EventRemoveItemFromList()
  542. {
  543.         int i;
  544.         if (list.cur_y == current_playing_file_n) EventStopPlaying();
  545.         for (i=list.cur_y; i<list.count; i++) files_mas[i] = files_mas[i+1];
  546.         list.count--;
  547.         if (list.cur_y <= current_playing_file_n) current_playing_file_n--;
  548.         list.CheckDoesValuesOkey();
  549.         if (list.count <= list.visible)
  550.         {
  551.                 list.h = list.count * list.item_h;
  552.                 list.visible = list.count;
  553.                 if (window_mode==WINDOW_MODE_NORMAL) MoveSize(OLD, OLD, OLD, skin.h + list.h);
  554.         }
  555.         else DrawPlayList();
  556. }
  557.  
  558. void EventPermanentlyDeleteFile()
  559. {
  560.         char item_path[4096];
  561.         sprintf(#item_path,"%s/%s",#work_folder,GetSelectedItemName());
  562.         DeleteFile(#item_path);
  563.         EventRemoveItemFromList();
  564. }
  565.  
  566. void EventShowAbout()
  567. {
  568.         CreateThread(#DrawAboutWindow,#menu_stak+4092);
  569. }
  570.  
  571. /*
  572. struct {
  573.         char tag[4];
  574.         char title[60];
  575.         char artist[60];
  576.         char album[60];
  577.         char speed;
  578.         char genre[30];
  579.         char start_time[6];
  580.         char end_time[6];
  581. } tag11;
  582.  
  583. struct {
  584.         char tag[3];
  585.         char title[30];
  586.         char artist[30];
  587.         char album[30];
  588.         char year[4];
  589.         char comment[30];
  590.         unsigned char genre; //https://www.w3.org/People/Bos/MP3tag/mp3tag.c
  591. } tag10;
  592. */
  593.  
  594. void EventShowTagInfo()
  595. {
  596.         char item_path[4096];
  597.         sprintf(#item_path,"%s/%s",#work_folder,GetSelectedItemName());
  598.         RunProgram("/sys/media/mp3info", #item_path);
  599. }
  600.  
  601.  
  602. stop:
  603.  
  604. char menu_stak[4096];