From 11f644afe434ce6b6d570c9da2a95590321871b3 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 31 Oct 2020 07:12:16 +0100 Subject: Make matrix posting, deleting, replying, edit async and video check if streamable async --- include/Program.hpp | 5 +++-- include/QuickMedia.hpp | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/Program.hpp b/include/Program.hpp index 8ac2d2d..82c912a 100644 --- a/include/Program.hpp +++ b/include/Program.hpp @@ -20,9 +20,10 @@ int exec_program_pipe(const char **args, ReadProgram *read_program); /* @args need to have at least 2 arguments. The first which is the program name - and the last which is NULL, which indicates end of args + and the last which is NULL, which indicates end of args. + |buffer_size| has to be between 1 and 65536. */ -int exec_program(const char **args, ProgramOutputCallback output_callback, void *userdata); +int exec_program(const char **args, ProgramOutputCallback output_callback, void *userdata, int buffer_size = 4096); // Return the exit status, or a negative value if waiting failed int wait_program(pid_t process_id); diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 6f8e3ff..b9ec2d9 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -36,6 +36,12 @@ namespace QuickMedia { Path source; Path destination; }; + + enum class TaskResult { + TRUE, + FALSE, + CANCEL + }; class Program { public: @@ -65,6 +71,8 @@ namespace QuickMedia { void chat_page(MatrixChatPage *chat_page, RoomData *current_room); void after_matrix_login_page(); + TaskResult run_task_with_loading_screen(std::function callback); + enum class LoadImageResult { OK, FAILED, -- cgit v1.2.3