diff --git a/.tar.gz b/.tar.gz new file mode 100644 index 0000000..df425a3 Binary files /dev/null and b/.tar.gz differ diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..1f427d1 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,17 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [], + "compilerPath": "/usr/bin/clang-9", + "cStandard": "c11", + "cppStandard": "c++14", + "intelliSenseMode": "linux-clang-x64", + "compileCommands": "${workspaceFolder}/build/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..21dc1c7 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "g++ - Build and debug active file", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/LIBREMM", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "Make", + "miDebuggerPath": "/usr/bin/gdb", + "visualizerFile": "/home/merdak/.config/Code/User/workspaceStorage/598ae159f6ad3f48c34c73a9f4284657/tonka3000.qtvsctools/qt.natvis.xml" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..36627b7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,80 @@ +{ + "files.associations": { + "iostream": "cpp", + "filesystem": "cpp", + "any": "cpp", + "array": "cpp", + "atomic": "cpp", + "bit": "cpp", + "*.tcc": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "cfenv": "cpp", + "charconv": "cpp", + "chrono": "cpp", + "cinttypes": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "complex": "cpp", + "condition_variable": "cpp", + "csetjmp": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cuchar": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "forward_list": "cpp", + "list": "cpp", + "map": "cpp", + "set": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "ratio": "cpp", + "regex": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "fstream": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "ostream": "cpp", + "scoped_allocator": "cpp", + "shared_mutex": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "valarray": "cpp", + "variant": "cpp" + }, + "C_Cpp.errorSquiggles": "Disabled" +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..336dc0f --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,48 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "CMake", // calistirilacak komut + "type": "shell", + "command": "cmake", + "options": { // cmake kodunun nerede calisirilacagi + "cwd": "${workspaceFolder}/build" + }, + "args": [ // cmake e verilen arguman (. ve ya ..) + "${workspaceFolder}", + ], + "group": { + "kind": "build", + "isDefault": true + }, + "dependsOn": [ // baska taska bagla + "createbuildFolder" + ] + }, + { + "label": "createbuildFolder", // build dosyasi olusturur + "type": "shell", + "command": "mkdir", + "options": { + "cwd": "${workspaceFolder}" + }, + "args": [ + "-p", // mkdir ayni dizin altina var olan dosyayi olusturamaz ama p arg verirsen bunu hata olarak dondurmez + "build" // olusturulucak klasor ismi + ] + }, + { + "label": "Make", + "type": "shell", + "command": "make", + "options": { + "cwd": "${workspaceFolder}/build" + }, + "args": [ + "-l" // kac core varsa ona gore paralelliyor + ] + } + + ] + +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b2cd3b2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,40 @@ +if(NOT DEFINED CMAKE_MINIMUM_REQUIRED_VERSION) + cmake_minimum_required(VERSION 3.16) +endif() + +project(LIBREMM LANGUAGES CXX) + +set(CMAKE_AUTOMOC ON) # auto generate qt moc rules + +set(CMAKE_CXX_STANDARD 11) + +set(PROJECT_DIR ${CMAKE_SOURCE_DIR}) + +set(PROJECT_SOURCE_DIR ${PROJECT_DIR}/src) +set(PROJECT_INCLUDE_DIR ${PROJECT_DIR}/inc) + +set(PROJECT_SOURCES + ${PROJECT_SOURCE_DIR}/main.cpp + ${PROJECT_SOURCE_DIR}/backoffice.cpp + ${PROJECT_SOURCE_DIR}/playlistmodal.cpp + ) +set(PROJECT_HEADERS + ${PROJECT_INCLUDE_DIR}/backoffice.h + ${PROJECT_INCLUDE_DIR}/srtparser.h + ${PROJECT_INCLUDE_DIR}/playlistmodal.h + ${PROJECT_INCLUDE_DIR}/iconv.hpp + ) + +find_package(Qt5 COMPONENTS Quick Qml QuickWidgets Multimedia REQUIRED) + +find_package(Iconv REQUIRED) + +qt5_add_resources(RSCS qml/qml.qrc icons/icons.qrc) + +include_directories(${PROJECT_INCLUDE_DIR}) + +add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${RSCS}) + +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Quick Qt5::Qml Qt5::QuickWidgets Qt5::Multimedia iconv) + +install(TARGETS LIBREMM DESTINATION bin) diff --git a/README.md b/README.md new file mode 100644 index 0000000..1ad5d85 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +## LIBREMM PLAYER +QML based lightweight media player. + +### How to build for Linux +`sudo ./install.sh` + +Call in cli with `LIBREMM` diff --git a/build/.cmake/api/v1/query/client-vscode/query.json b/build/.cmake/api/v1/query/client-vscode/query.json new file mode 100644 index 0000000..b9dc05e --- /dev/null +++ b/build/.cmake/api/v1/query/client-vscode/query.json @@ -0,0 +1 @@ +{"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2},{"kind":"toolchains","version":1}]} \ No newline at end of file diff --git a/build/.cmake/api/v1/reply/cache-v2-697e91098e51d52f3b0c.json b/build/.cmake/api/v1/reply/cache-v2-697e91098e51d52f3b0c.json new file mode 100644 index 0000000..44e7ce2 --- /dev/null +++ b/build/.cmake/api/v1/reply/cache-v2-697e91098e51d52f3b0c.json @@ -0,0 +1,1191 @@ +{ + "entries" : + [ + { + "name" : "CMAKE_ADDR2LINE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/addr2line" + }, + { + "name" : "CMAKE_AR", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/ar" + }, + { + "name" : "CMAKE_BUILD_TYPE", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ..." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_CACHEFILE_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "This is the directory where this CMakeCache.txt was created" + } + ], + "type" : "INTERNAL", + "value" : "/home/merdak/Desktop/LIBREMM/build" + }, + { + "name" : "CMAKE_CACHE_MAJOR_VERSION", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Major version of cmake used to create the current loaded cache" + } + ], + "type" : "INTERNAL", + "value" : "3" + }, + { + "name" : "CMAKE_CACHE_MINOR_VERSION", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Minor version of cmake used to create the current loaded cache" + } + ], + "type" : "INTERNAL", + "value" : "16" + }, + { + "name" : "CMAKE_CACHE_PATCH_VERSION", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Patch version of cmake used to create the current loaded cache" + } + ], + "type" : "INTERNAL", + "value" : "3" + }, + { + "name" : "CMAKE_COLOR_MAKEFILE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Enable/Disable color output during build." + } + ], + "type" : "BOOL", + "value" : "ON" + }, + { + "name" : "CMAKE_COMMAND", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Path to CMake executable." + } + ], + "type" : "INTERNAL", + "value" : "/usr/bin/cmake" + }, + { + "name" : "CMAKE_CPACK_COMMAND", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Path to cpack program executable." + } + ], + "type" : "INTERNAL", + "value" : "/usr/bin/cpack" + }, + { + "name" : "CMAKE_CTEST_COMMAND", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Path to ctest program executable." + } + ], + "type" : "INTERNAL", + "value" : "/usr/bin/ctest" + }, + { + "name" : "CMAKE_CXX_COMPILER", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "CXX compiler" + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/c++" + }, + { + "name" : "CMAKE_CXX_COMPILER_AR", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "A wrapper around 'ar' adding the appropriate '--plugin' option for the GCC compiler" + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/gcc-ar-9" + }, + { + "name" : "CMAKE_CXX_COMPILER_RANLIB", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "A wrapper around 'ranlib' adding the appropriate '--plugin' option for the GCC compiler" + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/gcc-ranlib-9" + }, + { + "name" : "CMAKE_CXX_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the CXX compiler during all build types." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_CXX_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the CXX compiler during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "-g" + }, + { + "name" : "CMAKE_CXX_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the CXX compiler during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "-Os -DNDEBUG" + }, + { + "name" : "CMAKE_CXX_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the CXX compiler during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "-O3 -DNDEBUG" + }, + { + "name" : "CMAKE_CXX_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the CXX compiler during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "-O2 -g -DNDEBUG" + }, + { + "name" : "CMAKE_DLLTOOL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "CMAKE_DLLTOOL-NOTFOUND" + }, + { + "name" : "CMAKE_EXECUTABLE_FORMAT", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Executable file format" + } + ], + "type" : "INTERNAL", + "value" : "ELF" + }, + { + "name" : "CMAKE_EXE_LINKER_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during all build types." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_EXE_LINKER_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_EXE_LINKER_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_EXE_LINKER_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_EXPORT_COMPILE_COMMANDS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Enable/Disable output of compile commands during generation." + } + ], + "type" : "BOOL", + "value" : "OFF" + }, + { + "name" : "CMAKE_EXTRA_GENERATOR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Name of external makefile project generator." + } + ], + "type" : "INTERNAL", + "value" : "" + }, + { + "name" : "CMAKE_GENERATOR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Name of generator." + } + ], + "type" : "INTERNAL", + "value" : "Unix Makefiles" + }, + { + "name" : "CMAKE_GENERATOR_INSTANCE", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Generator instance identifier." + } + ], + "type" : "INTERNAL", + "value" : "" + }, + { + "name" : "CMAKE_GENERATOR_PLATFORM", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Name of generator platform." + } + ], + "type" : "INTERNAL", + "value" : "" + }, + { + "name" : "CMAKE_GENERATOR_TOOLSET", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Name of generator toolset." + } + ], + "type" : "INTERNAL", + "value" : "" + }, + { + "name" : "CMAKE_HOME_DIRECTORY", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Source directory with the top level CMakeLists.txt file for this project" + } + ], + "type" : "INTERNAL", + "value" : "/home/merdak/Desktop/LIBREMM" + }, + { + "name" : "CMAKE_INSTALL_PREFIX", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Install path prefix, prepended onto install directories." + } + ], + "type" : "PATH", + "value" : "/usr/local" + }, + { + "name" : "CMAKE_INSTALL_SO_NO_EXE", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Install .so files without execute permission." + } + ], + "type" : "INTERNAL", + "value" : "1" + }, + { + "name" : "CMAKE_LINKER", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/ld" + }, + { + "name" : "CMAKE_MAKE_PROGRAM", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/make" + }, + { + "name" : "CMAKE_MODULE_LINKER_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of modules during all build types." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_MODULE_LINKER_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of modules during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of modules during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_MODULE_LINKER_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of modules during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of modules during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_NM", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/nm" + }, + { + "name" : "CMAKE_NUMBER_OF_MAKEFILES", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "number of local generators" + } + ], + "type" : "INTERNAL", + "value" : "1" + }, + { + "name" : "CMAKE_OBJCOPY", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/objcopy" + }, + { + "name" : "CMAKE_OBJDUMP", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/objdump" + }, + { + "name" : "CMAKE_PLATFORM_INFO_INITIALIZED", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Platform information initialized" + } + ], + "type" : "INTERNAL", + "value" : "1" + }, + { + "name" : "CMAKE_PROJECT_DESCRIPTION", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Value Computed by CMake" + } + ], + "type" : "STATIC", + "value" : "" + }, + { + "name" : "CMAKE_PROJECT_HOMEPAGE_URL", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Value Computed by CMake" + } + ], + "type" : "STATIC", + "value" : "" + }, + { + "name" : "CMAKE_PROJECT_NAME", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Value Computed by CMake" + } + ], + "type" : "STATIC", + "value" : "LIBREMM" + }, + { + "name" : "CMAKE_RANLIB", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/ranlib" + }, + { + "name" : "CMAKE_READELF", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/readelf" + }, + { + "name" : "CMAKE_ROOT", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Path to CMake installation." + } + ], + "type" : "INTERNAL", + "value" : "/usr/share/cmake-3.16" + }, + { + "name" : "CMAKE_SHARED_LINKER_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of shared libraries during all build types." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_SHARED_LINKER_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of shared libraries during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of shared libraries during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_SHARED_LINKER_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of shared libraries during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of shared libraries during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_SKIP_INSTALL_RPATH", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "If set, runtime paths are not added when installing shared libraries, but are added when building." + } + ], + "type" : "BOOL", + "value" : "NO" + }, + { + "name" : "CMAKE_SKIP_RPATH", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "If set, runtime paths are not added when using shared libraries." + } + ], + "type" : "BOOL", + "value" : "NO" + }, + { + "name" : "CMAKE_STATIC_LINKER_FLAGS", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of static libraries during all build types." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_STATIC_LINKER_FLAGS_DEBUG", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of static libraries during DEBUG builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of static libraries during MINSIZEREL builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_STATIC_LINKER_FLAGS_RELEASE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of static libraries during RELEASE builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Flags used by the linker during the creation of static libraries during RELWITHDEBINFO builds." + } + ], + "type" : "STRING", + "value" : "" + }, + { + "name" : "CMAKE_STRIP", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "Path to a program." + } + ], + "type" : "FILEPATH", + "value" : "/usr/bin/strip" + }, + { + "name" : "CMAKE_UNAME", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "uname command" + } + ], + "type" : "INTERNAL", + "value" : "/usr/bin/uname" + }, + { + "name" : "CMAKE_VERBOSE_MAKEFILE", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo." + } + ], + "type" : "BOOL", + "value" : "FALSE" + }, + { + "name" : "FIND_PACKAGE_MESSAGE_DETAILS_Iconv", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Details about finding Iconv" + } + ], + "type" : "INTERNAL", + "value" : "[/usr/local/lib/libiconv.so][/usr/local/include][v()]" + }, + { + "name" : "Iconv_INCLUDE_DIR", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "iconv include directory" + } + ], + "type" : "PATH", + "value" : "/usr/local/include" + }, + { + "name" : "Iconv_IS_BUILT_IN", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Test Iconv_IS_BUILT_IN" + } + ], + "type" : "INTERNAL", + "value" : "" + }, + { + "name" : "Iconv_LIBRARY", + "properties" : + [ + { + "name" : "ADVANCED", + "value" : "1" + }, + { + "name" : "HELPSTRING", + "value" : "iconv library (potentially the C library)" + } + ], + "type" : "FILEPATH", + "value" : "/usr/local/lib/libiconv.so" + }, + { + "name" : "LIBREMM_BINARY_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Value Computed by CMake" + } + ], + "type" : "STATIC", + "value" : "/home/merdak/Desktop/LIBREMM/build" + }, + { + "name" : "LIBREMM_SOURCE_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "Value Computed by CMake" + } + ], + "type" : "STATIC", + "value" : "/home/merdak/Desktop/LIBREMM" + }, + { + "name" : "Qt5Core_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "The directory containing a CMake configuration file for Qt5Core." + } + ], + "type" : "PATH", + "value" : "/usr/lib/x86_64-linux-gnu/cmake/Qt5Core" + }, + { + "name" : "Qt5Gui_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "The directory containing a CMake configuration file for Qt5Gui." + } + ], + "type" : "PATH", + "value" : "/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui" + }, + { + "name" : "Qt5Multimedia_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "The directory containing a CMake configuration file for Qt5Multimedia." + } + ], + "type" : "PATH", + "value" : "/usr/lib/x86_64-linux-gnu/cmake/Qt5Multimedia" + }, + { + "name" : "Qt5Network_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "The directory containing a CMake configuration file for Qt5Network." + } + ], + "type" : "PATH", + "value" : "/usr/lib/x86_64-linux-gnu/cmake/Qt5Network" + }, + { + "name" : "Qt5Qml_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "The directory containing a CMake configuration file for Qt5Qml." + } + ], + "type" : "PATH", + "value" : "/usr/lib/x86_64-linux-gnu/cmake/Qt5Qml" + }, + { + "name" : "Qt5QuickWidgets_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "The directory containing a CMake configuration file for Qt5QuickWidgets." + } + ], + "type" : "PATH", + "value" : "/usr/lib/x86_64-linux-gnu/cmake/Qt5QuickWidgets" + }, + { + "name" : "Qt5Quick_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "The directory containing a CMake configuration file for Qt5Quick." + } + ], + "type" : "PATH", + "value" : "/usr/lib/x86_64-linux-gnu/cmake/Qt5Quick" + }, + { + "name" : "Qt5Widgets_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "The directory containing a CMake configuration file for Qt5Widgets." + } + ], + "type" : "PATH", + "value" : "/usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets" + }, + { + "name" : "Qt5_DIR", + "properties" : + [ + { + "name" : "HELPSTRING", + "value" : "The directory containing a CMake configuration file for Qt5." + } + ], + "type" : "PATH", + "value" : "/usr/lib/x86_64-linux-gnu/cmake/Qt5" + } + ], + "kind" : "cache", + "version" : + { + "major" : 2, + "minor" : 0 + } +} diff --git a/build/.cmake/api/v1/reply/codemodel-v2-562810f5f13a7cbcaf3a.json b/build/.cmake/api/v1/reply/codemodel-v2-562810f5f13a7cbcaf3a.json new file mode 100644 index 0000000..45650de --- /dev/null +++ b/build/.cmake/api/v1/reply/codemodel-v2-562810f5f13a7cbcaf3a.json @@ -0,0 +1,69 @@ +{ + "configurations" : + [ + { + "directories" : + [ + { + "build" : ".", + "hasInstallRule" : true, + "minimumCMakeVersion" : + { + "string" : "3.16" + }, + "projectIndex" : 0, + "source" : ".", + "targetIndexes" : + [ + 0, + 1 + ] + } + ], + "name" : "", + "projects" : + [ + { + "directoryIndexes" : + [ + 0 + ], + "name" : "LIBREMM", + "targetIndexes" : + [ + 0, + 1 + ] + } + ], + "targets" : + [ + { + "directoryIndex" : 0, + "id" : "LIBREMM::@6890427a1f51a3e7e1df", + "jsonFile" : "target-LIBREMM-7817c836e4d1d5ad8e84.json", + "name" : "LIBREMM", + "projectIndex" : 0 + }, + { + "directoryIndex" : 0, + "id" : "LIBREMM_autogen::@6890427a1f51a3e7e1df", + "jsonFile" : "target-LIBREMM_autogen-361df8def5a0aa85d306.json", + "name" : "LIBREMM_autogen", + "projectIndex" : 0 + } + ] + } + ], + "kind" : "codemodel", + "paths" : + { + "build" : "/home/merdak/Desktop/LIBREMM/build", + "source" : "/home/merdak/Desktop/LIBREMM" + }, + "version" : + { + "major" : 2, + "minor" : 0 + } +} diff --git a/build/.cmake/api/v1/reply/index-2022-02-07T18-33-27-0019.json b/build/.cmake/api/v1/reply/index-2022-02-07T18-33-27-0019.json new file mode 100644 index 0000000..a9d34e0 --- /dev/null +++ b/build/.cmake/api/v1/reply/index-2022-02-07T18-33-27-0019.json @@ -0,0 +1,94 @@ +{ + "cmake" : + { + "generator" : + { + "name" : "Unix Makefiles" + }, + "paths" : + { + "cmake" : "/usr/bin/cmake", + "cpack" : "/usr/bin/cpack", + "ctest" : "/usr/bin/ctest", + "root" : "/usr/share/cmake-3.16" + }, + "version" : + { + "isDirty" : false, + "major" : 3, + "minor" : 16, + "patch" : 3, + "string" : "3.16.3", + "suffix" : "" + } + }, + "objects" : + [ + { + "jsonFile" : "codemodel-v2-562810f5f13a7cbcaf3a.json", + "kind" : "codemodel", + "version" : + { + "major" : 2, + "minor" : 0 + } + }, + { + "jsonFile" : "cache-v2-697e91098e51d52f3b0c.json", + "kind" : "cache", + "version" : + { + "major" : 2, + "minor" : 0 + } + } + ], + "reply" : + { + "client-vscode" : + { + "query.json" : + { + "requests" : + [ + { + "kind" : "cache", + "version" : 2 + }, + { + "kind" : "codemodel", + "version" : 2 + }, + { + "kind" : "toolchains", + "version" : 1 + } + ], + "responses" : + [ + { + "jsonFile" : "cache-v2-697e91098e51d52f3b0c.json", + "kind" : "cache", + "version" : + { + "major" : 2, + "minor" : 0 + } + }, + { + "jsonFile" : "codemodel-v2-562810f5f13a7cbcaf3a.json", + "kind" : "codemodel", + "version" : + { + "major" : 2, + "minor" : 0 + } + }, + { + "error" : "unknown request kind 'toolchains'" + } + ] + } + } + } +} diff --git a/build/.cmake/api/v1/reply/target-LIBREMM-7817c836e4d1d5ad8e84.json b/build/.cmake/api/v1/reply/target-LIBREMM-7817c836e4d1d5ad8e84.json new file mode 100644 index 0000000..2a57298 --- /dev/null +++ b/build/.cmake/api/v1/reply/target-LIBREMM-7817c836e4d1d5ad8e84.json @@ -0,0 +1,367 @@ +{ + "artifacts" : + [ + { + "path" : "LIBREMM" + } + ], + "backtrace" : 1, + "backtraceGraph" : + { + "commands" : + [ + "add_executable", + "install", + "target_link_libraries", + "include_directories" + ], + "files" : + [ + "CMakeLists.txt" + ], + "nodes" : + [ + { + "file" : 0 + }, + { + "command" : 0, + "file" : 0, + "line" : 36, + "parent" : 0 + }, + { + "command" : 1, + "file" : 0, + "line" : 40, + "parent" : 0 + }, + { + "command" : 2, + "file" : 0, + "line" : 38, + "parent" : 0 + }, + { + "command" : 3, + "file" : 0, + "line" : 34, + "parent" : 0 + } + ] + }, + "compileGroups" : + [ + { + "compileCommandFragments" : + [ + { + "fragment" : " " + }, + { + "backtrace" : 3, + "fragment" : "-fPIC" + }, + { + "fragment" : "-std=gnu++11" + } + ], + "defines" : + [ + { + "backtrace" : 3, + "define" : "QT_CORE_LIB" + }, + { + "backtrace" : 3, + "define" : "QT_GUI_LIB" + }, + { + "backtrace" : 3, + "define" : "QT_MULTIMEDIA_LIB" + }, + { + "backtrace" : 3, + "define" : "QT_NETWORK_LIB" + }, + { + "backtrace" : 3, + "define" : "QT_NO_DEBUG" + }, + { + "backtrace" : 3, + "define" : "QT_QML_LIB" + }, + { + "backtrace" : 3, + "define" : "QT_QUICKWIDGETS_LIB" + }, + { + "backtrace" : 3, + "define" : "QT_QUICK_LIB" + }, + { + "backtrace" : 3, + "define" : "QT_WIDGETS_LIB" + } + ], + "includes" : + [ + { + "backtrace" : 0, + "path" : "/home/merdak/Desktop/LIBREMM/build/LIBREMM_autogen/include" + }, + { + "backtrace" : 4, + "path" : "/home/merdak/Desktop/LIBREMM/inc" + }, + { + "backtrace" : 3, + "isSystem" : true, + "path" : "/usr/include/x86_64-linux-gnu/qt5" + }, + { + "backtrace" : 3, + "isSystem" : true, + "path" : "/usr/include/x86_64-linux-gnu/qt5/QtQuick" + }, + { + "backtrace" : 3, + "isSystem" : true, + "path" : "/usr/include/x86_64-linux-gnu/qt5/QtQml" + }, + { + "backtrace" : 3, + "isSystem" : true, + "path" : "/usr/include/x86_64-linux-gnu/qt5/QtNetwork" + }, + { + "backtrace" : 3, + "isSystem" : true, + "path" : "/usr/include/x86_64-linux-gnu/qt5/QtCore" + }, + { + "backtrace" : 3, + "isSystem" : true, + "path" : "/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++" + }, + { + "backtrace" : 3, + "isSystem" : true, + "path" : "/usr/include/x86_64-linux-gnu/qt5/QtGui" + }, + { + "backtrace" : 3, + "isSystem" : true, + "path" : "/usr/include/x86_64-linux-gnu/qt5/QtQuickWidgets" + }, + { + "backtrace" : 3, + "isSystem" : true, + "path" : "/usr/include/x86_64-linux-gnu/qt5/QtWidgets" + }, + { + "backtrace" : 3, + "isSystem" : true, + "path" : "/usr/include/x86_64-linux-gnu/qt5/QtMultimedia" + } + ], + "language" : "CXX", + "sourceIndexes" : + [ + 0, + 1, + 2, + 3, + 8, + 9 + ] + } + ], + "dependencies" : + [ + { + "backtrace" : 0, + "id" : "LIBREMM_autogen::@6890427a1f51a3e7e1df" + } + ], + "id" : "LIBREMM::@6890427a1f51a3e7e1df", + "install" : + { + "destinations" : + [ + { + "backtrace" : 2, + "path" : "bin" + } + ], + "prefix" : + { + "path" : "/usr/local" + } + }, + "link" : + { + "commandFragments" : + [ + { + "fragment" : "", + "role" : "flags" + }, + { + "backtrace" : 3, + "fragment" : "/usr/lib/x86_64-linux-gnu/libQt5QuickWidgets.so.5.12.8", + "role" : "libraries" + }, + { + "backtrace" : 3, + "fragment" : "/usr/lib/x86_64-linux-gnu/libQt5Multimedia.so.5.12.8", + "role" : "libraries" + }, + { + "fragment" : "-liconv", + "role" : "libraries" + }, + { + "backtrace" : 3, + "fragment" : "/usr/lib/x86_64-linux-gnu/libQt5Quick.so.5.12.8", + "role" : "libraries" + }, + { + "backtrace" : 3, + "fragment" : "/usr/lib/x86_64-linux-gnu/libQt5Qml.so.5.12.8", + "role" : "libraries" + }, + { + "fragment" : "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.12.8", + "role" : "libraries" + }, + { + "fragment" : "/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.12.8", + "role" : "libraries" + }, + { + "fragment" : "/usr/lib/x86_64-linux-gnu/libQt5Network.so.5.12.8", + "role" : "libraries" + }, + { + "fragment" : "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.12.8", + "role" : "libraries" + } + ], + "language" : "CXX" + }, + "name" : "LIBREMM", + "nameOnDisk" : "LIBREMM", + "paths" : + { + "build" : ".", + "source" : "." + }, + "sourceGroups" : + [ + { + "name" : "Source Files", + "sourceIndexes" : + [ + 0, + 1, + 2, + 3, + 8, + 9 + ] + }, + { + "name" : "Header Files", + "sourceIndexes" : + [ + 4, + 5, + 6, + 7 + ] + }, + { + "name" : "", + "sourceIndexes" : + [ + 10, + 11 + ] + } + ], + "sources" : + [ + { + "backtrace" : 0, + "compileGroupIndex" : 0, + "isGenerated" : true, + "path" : "build/LIBREMM_autogen/mocs_compilation.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "src/main.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "src/backoffice.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "path" : "src/playlistmodal.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "path" : "inc/backoffice.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "inc/srtparser.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "inc/playlistmodal.h", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "path" : "inc/iconv.hpp", + "sourceGroupIndex" : 1 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "isGenerated" : true, + "path" : "build/qrc_qml.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 1, + "compileGroupIndex" : 0, + "isGenerated" : true, + "path" : "build/qrc_icons.cpp", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 0, + "path" : "qml/qml.qrc", + "sourceGroupIndex" : 2 + }, + { + "backtrace" : 0, + "path" : "icons/icons.qrc", + "sourceGroupIndex" : 2 + } + ], + "type" : "EXECUTABLE" +} diff --git a/build/.cmake/api/v1/reply/target-LIBREMM_autogen-361df8def5a0aa85d306.json b/build/.cmake/api/v1/reply/target-LIBREMM_autogen-361df8def5a0aa85d306.json new file mode 100644 index 0000000..34e7a1c --- /dev/null +++ b/build/.cmake/api/v1/reply/target-LIBREMM_autogen-361df8def5a0aa85d306.json @@ -0,0 +1,58 @@ +{ + "backtrace" : 0, + "backtraceGraph" : + { + "commands" : [], + "files" : + [ + "CMakeLists.txt" + ], + "nodes" : + [ + { + "file" : 0 + } + ] + }, + "id" : "LIBREMM_autogen::@6890427a1f51a3e7e1df", + "isGeneratorProvided" : true, + "name" : "LIBREMM_autogen", + "paths" : + { + "build" : ".", + "source" : "." + }, + "sourceGroups" : + [ + { + "name" : "", + "sourceIndexes" : + [ + 0 + ] + }, + { + "name" : "CMake Rules", + "sourceIndexes" : + [ + 1 + ] + } + ], + "sources" : + [ + { + "backtrace" : 0, + "isGenerated" : true, + "path" : "build/CMakeFiles/LIBREMM_autogen", + "sourceGroupIndex" : 0 + }, + { + "backtrace" : 0, + "isGenerated" : true, + "path" : "build/CMakeFiles/LIBREMM_autogen.rule", + "sourceGroupIndex" : 1 + } + ], + "type" : "UTILITY" +} diff --git a/changelog b/changelog new file mode 100644 index 0000000..ba4f762 --- /dev/null +++ b/changelog @@ -0,0 +1,8 @@ +--------------------------------------------------------------------------- +# V0.01 +--------------------------------------------------------------------------- +- Media dropping +- Charset conversation +- Playlist +- Subtitle settings(active when subtitle dropped) +- Shortcuts(all of them same with VLC player) diff --git a/icons/+10.png b/icons/+10.png new file mode 100644 index 0000000..5acdc24 Binary files /dev/null and b/icons/+10.png differ diff --git a/icons/-10.png b/icons/-10.png new file mode 100644 index 0000000..df6635c Binary files /dev/null and b/icons/-10.png differ diff --git a/icons/arrowdw.png b/icons/arrowdw.png new file mode 100644 index 0000000..fb8f276 Binary files /dev/null and b/icons/arrowdw.png differ diff --git a/icons/backward.png b/icons/backward.png new file mode 100644 index 0000000..fdbd3c4 Binary files /dev/null and b/icons/backward.png differ diff --git a/icons/close.png b/icons/close.png new file mode 100644 index 0000000..f953176 Binary files /dev/null and b/icons/close.png differ diff --git a/icons/forward.png b/icons/forward.png new file mode 100644 index 0000000..917759a Binary files /dev/null and b/icons/forward.png differ diff --git a/icons/fscreen.png b/icons/fscreen.png new file mode 100644 index 0000000..1bd859a Binary files /dev/null and b/icons/fscreen.png differ diff --git a/icons/icons.qrc b/icons/icons.qrc new file mode 100644 index 0000000..2efb742 --- /dev/null +++ b/icons/icons.qrc @@ -0,0 +1,19 @@ + + + pause.png + play.png + backward.png + forward.png + close.png + openfile.png + volume.png + arrowdw.png + suboff.png + subon.png + -10.png + +10.png + fscreen.png + nscreen.png + minimize.png + + diff --git a/icons/minimize.png b/icons/minimize.png new file mode 100644 index 0000000..e4febde Binary files /dev/null and b/icons/minimize.png differ diff --git a/icons/nscreen.png b/icons/nscreen.png new file mode 100644 index 0000000..5343ce7 Binary files /dev/null and b/icons/nscreen.png differ diff --git a/icons/openfile.png b/icons/openfile.png new file mode 100644 index 0000000..d64d990 Binary files /dev/null and b/icons/openfile.png differ diff --git a/icons/pause.png b/icons/pause.png new file mode 100644 index 0000000..730f3d6 Binary files /dev/null and b/icons/pause.png differ diff --git a/icons/play.png b/icons/play.png new file mode 100644 index 0000000..7ed1ad9 Binary files /dev/null and b/icons/play.png differ diff --git a/icons/suboff.png b/icons/suboff.png new file mode 100644 index 0000000..2b148d8 Binary files /dev/null and b/icons/suboff.png differ diff --git a/icons/subon.png b/icons/subon.png new file mode 100644 index 0000000..9df6ad4 Binary files /dev/null and b/icons/subon.png differ diff --git a/icons/volume.png b/icons/volume.png new file mode 100644 index 0000000..7b3664b Binary files /dev/null and b/icons/volume.png differ diff --git a/inc/backoffice.h b/inc/backoffice.h new file mode 100644 index 0000000..1605493 --- /dev/null +++ b/inc/backoffice.h @@ -0,0 +1,36 @@ +#include + +#include +#include +#include + +#include "srtparser.h" +#include "iconv.hpp" +#include "playlistmodal.h" + +#define VERSION 0.01 + +class BackOffice : public QObject +{ + Q_OBJECT +private: + + QMediaPlayer *player; + + PlaylistModal *m_playlist; + +public: + explicit BackOffice(QObject *parent = nullptr/*, QMediaPlayer* qmlplayer = nullptr*/); + ~BackOffice(); + + inline PlaylistModal *getPlaylist() { return m_playlist; } + +public slots: + Q_INVOKABLE void readSub(QString); + Q_INVOKABLE void convCode(QString, QString, QString); + + QString getSubText(double); + +private slots: + +}; diff --git a/inc/iconv.hpp b/inc/iconv.hpp new file mode 100644 index 0000000..32e0362 --- /dev/null +++ b/inc/iconv.hpp @@ -0,0 +1,116 @@ +#ifndef ICONV_HPP +#define ICONV_HPP +/* +Copyright (c) 2011, Yuya Unno +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Yuya Unno nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#pragma once + +#include +#include + +#include +#include +#include + +namespace iconvpp { + +class converter { + public: + converter(const std::string& out_encode, + const std::string& in_encode, + bool ignore_error = false, + size_t buf_size = 1024) + : ignore_error_(ignore_error), + buf_size_(buf_size) { + if (buf_size == 0) { + throw std::runtime_error("buffer size must be greater than zero"); + } + + iconv_t conv = ::iconv_open(out_encode.c_str(), in_encode.c_str()); + if (conv == (iconv_t)-1) { + if (errno == EINVAL) + throw std::runtime_error( + "not supported from " + in_encode + " to " + out_encode); + else + throw std::runtime_error("unknown error"); + } + iconv_ = conv; + } + + ~converter() { + iconv_close(iconv_); + } + + void convert(const std::string& input, std::string& output) const { + // copy the string to a buffer as iconv function requires a non-const char + // pointer. + std::vector in_buf(input.begin(), input.end()); + char* src_ptr = &in_buf[0]; + size_t src_size = input.size(); + + std::vector buf(buf_size_); + std::string dst; + while (0 < src_size) { + char* dst_ptr = &buf[0]; + size_t dst_size = buf.size(); + size_t res = ::iconv(iconv_, &src_ptr, &src_size, &dst_ptr, &dst_size); + if (res == (size_t)-1) { + if (errno == E2BIG) { + // ignore this error + } else if (ignore_error_) { + // skip character + ++src_ptr; + --src_size; + } else { + check_convert_error(); + } + } + dst.append(&buf[0], buf.size() - dst_size); + } + dst.swap(output); + } + + private: + void check_convert_error() const { + switch (errno) { + case EILSEQ: + case EINVAL: + throw std::runtime_error("invalid multibyte chars"); + default: + throw std::runtime_error("unknown error"); + } + } + + iconv_t iconv_; + bool ignore_error_; + const size_t buf_size_; +}; + +} // namespace iconvpp + +#endif // ICONV_HPP diff --git a/inc/playlistmodal.h b/inc/playlistmodal.h new file mode 100644 index 0000000..8887cc2 --- /dev/null +++ b/inc/playlistmodal.h @@ -0,0 +1,52 @@ +#ifndef PLAYLISTMODAL_H +#define PLAYLISTMODAL_H + +#include +#include + +struct TrackInfo +{ + QString name; + bool playing; +}; + + +class PlaylistModal : public QAbstractListModel +{ + Q_OBJECT + +public: + explicit PlaylistModal(QObject *parent = nullptr); + + // Basic functionality: + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + + QHash roleNames() const override; + + Q_INVOKABLE void append(QString name, bool playing); + + Q_INVOKABLE void remove(int i); + + Q_INVOKABLE void clear(); + + Q_INVOKABLE QString getMediaUrl(int i); + + + + + + QList m_list; + + enum TrackRoles { + NameRole = Qt::UserRole + 1, + PlayingRole + }; + + Q_ENUM(TrackRoles) + +private: +}; + +#endif // PLAYLISTMODAL_H diff --git a/inc/srtparser.h b/inc/srtparser.h new file mode 100644 index 0000000..0b5e32f --- /dev/null +++ b/inc/srtparser.h @@ -0,0 +1,657 @@ +/* + * Author : Saurabh Shrivastava + * Email : saurabh.shrivastava54@gmail.com + * Link : https://github.com/saurabhshri + * + * Based on subtitle-parser by Oleksii Maryshchenko. + * Email : young_developer@mail.ru + * Link : https://github.com/young-developer/subtitle-parser + */ + +#ifndef SRTPARSER_H +#define SRTPARSER_H + +#include +#include +#include +#include +#include +#include + +//function for splitting sentences based on supplied delimiter +inline std::vector &split(const std::string &s, char delim, std::vector &elems) { + std::stringstream ss(s); + std::string item; + + while (getline(ss, item, delim)) { + elems.push_back(item); + } + return elems; +} + +/**** Class definitions ****/ + + +class SubtitleWord +{ +private: + std::string _text; +public: + SubtitleWord(void); + SubtitleWord(std::string text); + virtual std::string getText() const; + ~SubtitleWord(void); +}; + +class SubtitleItem +{ +private: + long int _startTime; //in milliseconds + long int _endTime; + std::string _text; //actual line, as present in subtitle file + long int timeMSec(std::string value); //converts time string into ms + + int _subNo; //subtitle number + std::string _startTimeString; //time as in srt format + std::string _endTimeString; + bool _ignore; //should subtitle be ignore; used when the subtitle is empty after processing + std::string _justDialogue; //contains processed subtitle - stripped style, non dialogue text removal etc. + int _speakerCount; //count of number of speakers + std::vector _speaker; //list of speakers in a single subtitle + int _nonDialogueCount; //count of non spoken words in a subtitle + std::vector _nonDialogue; //list of non dialogue words, e.g. (applause) + int _wordCount; //number of words in _justDialogue + std::vector _word; //list of words in dialogue + std::vector _wordStartTime; //start time of each word in dialogue + std::vector _wordEndTime; //end time of each word in dialogue + std::vector _wordDuration; //actual duration of each word without silence + int _styleTagCount; //count of style tags in a single subtitle + std::vector _styleTag; //list of style tags in that subtitle + void extractInfo(bool keepHTML = 0, bool doNotIgnoreNonDialogues = 0, bool doNotRemoveSpeakerNames = 0); //process subtitle +public: + long int getStartTime() const; //returns starting time in ms + long int getEndTime() const; //returns ending time in ms + std::string getText() const; //returns subtitle text as present in .srt file + + int getSubNo() const; //returns subtitle number + std::string getStartTimeString() const; //returns sarting time as present in .srt file + std::string getEndTimeString() const; //returns ending time as present in .srt file + bool getIgnoreStatus() const; //returns status, whether the subtitle is ignorable or not after processing + std::string getDialogue(bool keepHTML = 0, bool doNotIgnoreNonDialogues = 0, bool doNotRemoveSpeakerNames = 0); //returns processed subtitle + int getSpeakerCount() const; //return speaker count + int getNonDialogueCount() const; //return non dialogue words count + int getStyleTagCount() const; //return style tags count + int getWordCount() const; //return words count + std::vector getIndividualWords(); //return string vector of individual words + std::string getWordByIndex(int index); //return word stored at 'index' + std::vector getWordStartTimes(); //return long int vector of start time of individual words + std::vector getWordEndTimes(); //return long int vector of end time of individual words + long int getWordStartTimeByIndex(int index); //return the start time of a word based on index + long int getWordEndTimeByIndex (int index); //return the end time of a word based on index + std::vector getSpeakerNames(); //return string vector of speaker names + std::vector getNonDialogueWords(); //return string vector of non dialogue words + std::vector getStyleTags(); //return string vector of style tags + + + void setStartTime(long int startTime); //set starting time + void setEndTime(long int endTime); //set ending time + void setText(std::string text); //set subtitle text + void setWordTimes(std::vector wordStartTime, std::vector wordEndTime, std::vector wordDuration); //assign time to individual words + + SubtitleItem(void); + SubtitleItem(int subNo, std::string startTime,std::string endTime, std::string text, bool ignore = false, + std::string justDialogue = "" , int speakerCount = 0, int nonDialogueCount = 0, + int styleTagCount = 0, int wordCount = 0, std::vector speaker = std::vector(), + std::vector nonDialogue = std::vector(), + std::vector styleTags = std::vector(), + std::vector word = std::vector()); //default constructor + ~SubtitleItem(void); +}; + +class SubtitleParser +{ +protected: + std::vector _subtitles; //stores subtitles + std::string _fileName; //supplied filename + virtual void parse(std::string fileName) = 0; +public: + virtual std::vector getSubtitles(); //returns subtitles + std::string getFileData(); + SubtitleParser(void); + virtual ~SubtitleParser(void); +}; + +class SubtitleParserFactory +{ +private: + std::string _fileName; +public: + SubtitleParser* getParser(); + SubtitleParserFactory(std::string fileName); + ~SubtitleParserFactory(void); +}; + +class SubRipParser : public SubtitleParser +{ + void parse(std::string fileName); +public: + SubRipParser(void); + SubRipParser(std::string fileName); + ~SubRipParser(void); +}; + + +/**** Function definitions ****/ + +//1. SubtitleParserFactory class + +inline SubtitleParserFactory::SubtitleParserFactory(std::string fileName) +{ + _fileName = fileName; +} + +inline SubtitleParser* SubtitleParserFactory::getParser() +{ + return new SubRipParser(_fileName); //creates and returns SubRipParser obj +} + +inline SubtitleParserFactory::~SubtitleParserFactory(void) +{ +} + +//2. SubtitleParser class + +inline std::vector SubtitleParser::getSubtitles() +{ + return _subtitles; +} + +inline std::string SubtitleParser::getFileData() //returns whole read file i.e. contents of input.srt +{ + std::ifstream infile(_fileName); + std::string allData = ""; + std::string line; + while (std::getline(infile, line)) + { + std::istringstream iss(line); + allData += line + "\n"; + } + return allData; + +} + +inline SubtitleParser::SubtitleParser(void) +{ + +} + +inline SubtitleParser::~SubtitleParser(void) +{ +} + +//3. SubRipParser class + +inline SubRipParser::SubRipParser(void) +{ +} + +inline void SubRipParser::parse(std::string fileName) //srt parser +{ + + std::ifstream infile(fileName); + std::string line, start, end, completeLine = "", timeLine = ""; + int subNo, turn = 0; + + /* + * turn = 0 -> Add subtitle number + * turn = 1 -> Add string to timeLine + * turn > 1 -> Add string to completeLine + */ + + while (std::getline(infile, line)) + { + line.erase(remove(line.begin(), line.end(), '\r'), line.end()); + + if (line.compare("")) + { + if(!turn) + { + subNo=atoi(line.c_str()); + turn++; + continue; + } + + if (line.find("-->") != std::string::npos) + { + timeLine += line; + + std::vector srtTime; + srtTime = split(timeLine, ' ', srtTime); + start = srtTime[0]; + end = srtTime[2]; + + } + else + { + if (completeLine != "") + completeLine += " "; + + completeLine += line; + } + + turn++; + } + + else + { + turn = 0; + _subtitles.push_back(new SubtitleItem(subNo,start,end,completeLine)); + completeLine = timeLine = ""; + } + + if(infile.eof()) //insert last remaining subtitle + { + _subtitles.push_back(new SubtitleItem(subNo,start,end,completeLine)); + } + } +} + +inline SubRipParser::SubRipParser(std::string fileName) +{ + _fileName = fileName; + parse(fileName); +} + +inline SubRipParser::~SubRipParser(void) +{ + for(int i=0;i != _subtitles.size();++i) + { + if(_subtitles[i]) + delete _subtitles[i]; + } +} + +//4. SubtitleItem class + +inline SubtitleItem::SubtitleItem(void) +{ +} + +inline SubtitleItem::SubtitleItem(int subNo, std::string startTime,std::string endTime, std::string text, bool ignore, + std::string justDialogue, int speakerCount, int nonDialogueCount, + int styleTagCount, int wordCount, std::vector speaker, std::vector nonDialogue, + std::vector styleTags, std::vector word) +{ + _startTime = timeMSec(startTime); + _endTime = timeMSec(endTime); + _text = text; + + _subNo = subNo; + _startTimeString = startTime; + _endTimeString = endTime; + _ignore = ignore; + _justDialogue = justDialogue; + _speakerCount = speakerCount; + _nonDialogueCount = nonDialogueCount; + _wordCount = wordCount; + _speaker = speaker; + _styleTagCount = styleTagCount; + _styleTag = styleTags; + _nonDialogue = nonDialogue; + _word = word; + + extractInfo(); +} + +inline long int SubtitleItem::timeMSec(std::string value) +{ + std::vector t, secs; + int hours, mins, seconds, milliseconds; + + t = split(value, ':', t); + hours = atoi(t[0].c_str()); + mins = atoi(t[1].c_str()); + + secs = split(t[2], ',', secs); + seconds = atoi(secs[0].c_str()); + milliseconds = atoi(secs[1].c_str()); + + return hours * 3600000 + mins * 60000 + seconds * 1000 + milliseconds; +} + +inline long int SubtitleItem::getStartTime() const +{ + return _startTime; +} +inline long int SubtitleItem::getEndTime() const +{ + return _endTime; +} + +inline std::string SubtitleItem::getText() const +{ + return _text; +} + +inline void SubtitleItem::setStartTime(long int startTime) +{ + _startTime = startTime; +} +inline void SubtitleItem::setEndTime(long int endTime) +{ + _endTime = endTime; +} +inline void SubtitleItem::setText(std::string text) +{ + _text = text; +} +inline void SubtitleItem::setWordTimes(std::vector wordStartTime, std::vector wordEndTime, std::vector wordDuration) +{ + _wordStartTime = wordStartTime; + _wordEndTime = wordEndTime; + _wordDuration = wordDuration; +} +inline int SubtitleItem::getSubNo() const +{ + return _subNo; +} +inline std::string SubtitleItem::getStartTimeString() const +{ + return _startTimeString; +} + +inline std::string SubtitleItem::getEndTimeString() const +{ + return _endTimeString; +} + +inline bool SubtitleItem::getIgnoreStatus() const +{ + if(_ignore) + return true; + + else + return false; + +} + +inline void SubtitleItem::extractInfo(bool keepHTML, bool doNotIgnoreNonDialogues, bool doNotRemoveSpeakerNames) //process subtitle +{ + std::string output = _text; + + //stripping HTML tags + if(!keepHTML) + { + /* + * TODO : Before erasing, extract the words. + * std::vector getStyleTags(); + * int getStyleTagCount() const; + * std::vector _styleTag; + * int _styleTagCount; + */ + + int countP = 0; + for(char& c : output) // replacing <...> with ~~~~ + { + if(c=='<') + { + countP++; + c = '~'; + } + + else + { + if(countP!=0) + { + if(c != '>') + c = '~'; + + else if(c == '>') + { + c = '~'; + countP--; + } + } + } + } + } + + //stripping non dialogue data e.g. (applause) + + if(!doNotIgnoreNonDialogues) + { + /* + * TODO : Before erasing, extract the words. + * std::vector getNonDialogueWords(); + * int getNonDialogueCount() const; + * std::vector _nonDialogue; + * int _nonDialogueCount; + */ + + int countP = 0; + for(char& c : output) // replacing (...) with ~~~~ + { + if(c=='(') + { + countP++; + c = '~'; + } + + else + { + if(countP!=0) + { + if(c != ')') + c = '~'; + + else if(c == ')') + { + c = '~'; + countP--; + } + } + } + } + } + + output.erase(std::remove(output.begin(), output.end(), '~'), output.end()); // deleting all ~ + + //Extracting speaker names + if(!doNotRemoveSpeakerNames) + { + for(int i=0; output[i]!='\0';i++) + { + int colonIndex = 0, nameBeginIndex = 0; + if(output[i]==':') //speaker found; travel back + { + _speakerCount++; + colonIndex = i; + + int tempIndex = 0, foundEvilColon = 0, continueFlag = 0, spaceBeforeColon = 0; + + if(output[i-1] == ' ') + spaceBeforeColon = 2; + + /* + Possible Cases : + + Elon Musk: Hey Saurabh, you are pretty smart. // First and Last Name + Saurabh: *_* What? Elon Musk: Yes! // Two names in single line + Saurabh : OMG OMG! // Space before colon + Elon: LOL World: LAMAO + Saurabh: ._. // normal + + */ + + for(int j=i - spaceBeforeColon; j>=0;j--) + { + if(output[j] == '.' || output[j] == '!' || output[j] == ',' || output[j] == '?' || output[j] == '\n' + || output[j] == ' ' || j== 0) + { + + if(output[j] == '.' || output[j] == '!' || output[j] == ',' || output[j] == '?' || j == 0) + { + if((continueFlag && j == 0)) + { + if(!isupper(output[j])) + { + nameBeginIndex = tempIndex; + break; + } + + else + tempIndex = j; + + } + + else if(j!=0) + tempIndex = j + 1; + } + + else if(output[j] == ' ' && isupper(output[j+1])) + { + tempIndex = j; + continueFlag = 1; + + continue; + } + + else if(output[j] == ' ' && !isupper(output[j+1] && tempIndex == 0)) + { + _speakerCount--; + foundEvilColon = 1; + break; + } + + nameBeginIndex = tempIndex; + break; + } + } + + if(foundEvilColon) + continue; + + i = nameBeginIndex; //compensating the removal and changes in index + + //check if there's a space after colon i.e. A: Hello vs A:Hello + int removeSpace = 0; + if(output[colonIndex + 1]==' ') + removeSpace = 1; + + _speaker.push_back(output.substr(nameBeginIndex, colonIndex - nameBeginIndex)); + output.erase(nameBeginIndex, colonIndex - nameBeginIndex + removeSpace); + } + + } + + } + + // removing more than one whitespaces with one space + unique_copy (output.begin(), output.end(), std::back_insert_iterator(_justDialogue), + [](char a,char b) + { + return isspace(a) && isspace(b); + }); + + // trimming whitespaces + const char* whiteSpaces = " \t\n\r\f\v"; + _justDialogue.erase(0, _justDialogue.find_first_not_of(whiteSpaces)); + _justDialogue.erase(_justDialogue.find_last_not_of(whiteSpaces) + 1); + + if(_justDialogue.empty() || _justDialogue == " ") + _ignore = true; + + else + { + _word = split(_justDialogue, ' ', _word); //extracting individual words + _wordCount = _word.size(); + } +} + +inline std::string SubtitleItem::getDialogue(bool keepHTML, bool doNotIgnoreNonDialogues, bool doNotRemoveSpeakerNames) +{ + if(_justDialogue.empty()) + extractInfo(keepHTML, doNotIgnoreNonDialogues, doNotRemoveSpeakerNames); + + return _justDialogue; +} +inline int SubtitleItem::getSpeakerCount() const +{ + return _speakerCount; +} +inline int SubtitleItem::getNonDialogueCount() const +{ + return _nonDialogueCount; +} +inline int SubtitleItem::getStyleTagCount() const +{ + return _styleTagCount; +} +inline int SubtitleItem::getWordCount() const +{ + return _wordCount; +} +inline std::vector SubtitleItem::getSpeakerNames() +{ + return _speaker; +} +inline std::vector SubtitleItem::getNonDialogueWords() +{ + return _nonDialogue; +} +inline std::vector SubtitleItem::getIndividualWords() +{ + return _word; +} +inline std::string SubtitleItem::getWordByIndex(int index) +{ + return _word[index]; +} +inline std::vector SubtitleItem::getWordStartTimes() +{ + return _wordStartTime; +} +inline std::vector SubtitleItem::getWordEndTimes() +{ + return _wordEndTime; +} +inline long int SubtitleItem::getWordStartTimeByIndex(int index) +{ + return _wordStartTime[index]; +} +inline long int SubtitleItem::getWordEndTimeByIndex(int index) +{ + return _wordEndTime[index]; +} +inline std::vector SubtitleItem::getStyleTags() +{ + return _styleTag; +} +inline SubtitleItem::~SubtitleItem(void) +{ + +} + +//5. SubtitleWordclass + +inline SubtitleWord::SubtitleWord(void) +{ + _text = ""; +} + +inline SubtitleWord::SubtitleWord(std::string text) +{ + _text = text; +} + +inline std::string SubtitleWord::getText() const +{ + return _text; +} + +inline SubtitleWord::~SubtitleWord(void) +{ +} + + +#endif //SRTPARSER_H diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..ac1b9ec --- /dev/null +++ b/install.sh @@ -0,0 +1,17 @@ +#[Install dependencieces] +sudo apt install qtbase5-dev qtdeclarative5-dev \ + libqt5multimedia5-plugins \ + qml-module-qtmultimedia \ + qml-module-qtquick-dialogs \ + qml-module-qtquick-controls \ + qml-module-qtquick-controls2 \ + qml-module-qt-labs-settings \ + qml-module-qtquick-window2 \ + qml-module-qt-labs-folderlistmodel \ + qml-module-qt-labs-folderlistmodel + +#[Build and install] +cd build +cmake .. +make +sudo make install diff --git a/qml/contents/BottomTools.qml b/qml/contents/BottomTools.qml new file mode 100644 index 0000000..be5b013 --- /dev/null +++ b/qml/contents/BottomTools.qml @@ -0,0 +1,138 @@ +import QtQuick 2.12 +import QtMultimedia 5.12 + +Rectangle { + + width: parent.width; height: 75 + color: "transparent" + anchors { + left: parent.left; right: parent.right; bottom: parent.bottom + leftMargin: 10; rightMargin: 10; bottomMargin: 10 + } + + property Image playimage: playimage // expose op, for image swapping + property Rectangle volumepercent: volumepercent + + +// Rectangle { +// id: volume +// y:backward.y +// width: 40; height: 40 +// color: "gray"; radius: 10 +// //scale: 4/5 +// anchors { left: parent.left; top: parent.top; topMargin: 15; leftMargin: 5 } + +// Rectangle { +// id: volumepercent +// height: parent.height; width: 0 +// color: "yellow"; radius: 10 +// NumberAnimation on width { id: volumeper_up; from: 0; to: mmplayer.player.volume * 200; duration: 500; running: false } +// NumberAnimation on width { id: volumeper_dw; from: mmplayer.player.volume * 200; to: 0; duration: 500; running: false } + +// } +// MouseArea { +// anchors.fill: parent +// hoverEnabled: true +// onEntered: { +// volumeext_up.start(); +// volumeper_up.start(); +// } +// onExited: { +// volumeext_dw.start() +// volumeper_dw.start() +// } +// onClicked: { +// var mouseP = Qt.point(mouse.x, mouse.y); +// var posnInVol = volumepercent.mapToItem(volume, mouseP) +// volumepercent.width = posnInVol.x +// mmplayer.player.volume = posnInVol.x / 200 +// } +// } +// NumberAnimation on width { id: volumeext_up; from: 40; to: 200; duration: 500; running: false } +// NumberAnimation on width { id: volumeext_dw; from: 200; to: 40; duration: 500; running: false } +// Image { +// width: 40; height: 40 +// source: "qrc:/volume.png" +// scale: 2/3 +// } +// } + + Rectangle { + id: backward + width: 75; height: parent.height + color: "transparent" + anchors { right: play.left } + Image { + anchors.fill: parent + source: "qrc:/backward.png" + scale: 2/3 + } + MouseArea { + anchors.fill: parent + onClicked: { + mmplayer.player.seek(mmplayer.player.position - 10000) + // -10 veya << işareti ekrana yansıtılsın + } + } + } + + Rectangle { + id: play + width: 75; height: parent.height + color: "transparent"; radius: 37.5 + anchors { horizontalCenter: parent.horizontalCenter } + Image { + id: playimage + anchors.fill: parent + source: "qrc:/play.png" + scale: 2/3 + } + MouseArea { + anchors.fill: parent + onClicked: { + mmplayer.player.playbackState === MediaPlayer.PlayingState ? mmplayer.player.pause() : mmplayer.player.play() + } + } + } + + Rectangle { + id: forward + width: 75; height: parent.height + color: "transparent" + anchors { left: play.right } + Image { + anchors.fill: parent + source: "qrc:/forward.png" + scale: 2/3 + } + MouseArea { + anchors.fill: parent + onClicked: { + mmplayer.player.seek(mmplayer.player.position + 10000) + // +10 veya >> işareti ekrana yansıtılsın + } + } + } + +// Rectangle { +// id: subtitle +// width: 40; height: 40 +// color: "white"; radius: 5 +// anchors { right: parent.right; top: parent.top; topMargin: 15; rightMargin: 5 } +// Image { +// anchors.fill: parent +// source: "qrc:/subon.png" +// //scale: 2/3 +// } +// MouseArea { +// anchors.fill: parent +// onClicked: { +// subpopup.open() +// //subpopup.open() +// } +// } +// } + +} + + diff --git a/qml/contents/MMPlayer.qml b/qml/contents/MMPlayer.qml new file mode 100644 index 0000000..0e5b153 --- /dev/null +++ b/qml/contents/MMPlayer.qml @@ -0,0 +1,112 @@ +import QtQuick 2.12 +import QtMultimedia 5.12 +import QtQuick.Controls 2.12 + + +Item { + id: mmitem + + property MediaPlayer player: player + property Label subtitle: subtitle + property Label playingtrack: playingtrack + property NumberAnimation playingtrackanm: playingtrackanm + + + MediaPlayer { + id: player + autoPlay: true + volume: 0.5 + + objectName: "qmlplayer" // expose to C++ + + onPlaying: { + bottomtools.playimage.source = "qrc:/pause.png" + } + + onPaused: { + bottomtools.playimage.source = "qrc:/play.png" + } + + onPositionChanged: { + slider.value = position + } + + + } + + VideoOutput { + anchors.fill: parent + source: player + visible: player.hasVideo + + + + Label { + id: subtitle + text: "" + width: parent.width + color: "yellow" + font { family: "Bahnschrift"; pointSize: 60 } + renderType: Text.NativeRendering + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + anchors.bottom: parent.bottom + anchors.bottomMargin: 150 + + background: Rectangle { + color: "transparent" + anchors.left: parent.left + anchors.right: parent.right + } + Timer { + id: refreshTimer + interval: 32 // 30Hz + running: player.hasVideo + repeat: true + onTriggered: { + subtitle.text = BackOffice.getSubText(player.position) + } + } + } + + Label { + id: playingtrack + width: parent.width + color: "yellow" + font { family: "Bahnschrift"; pointSize: 25 } + horizontalAlignment: Text.AlignRight + anchors.top: parent.top + anchors.topMargin: 100; + NumberAnimation { id: playingtrackanm; target: playingtrack; running: false; property: "opacity"; from: 1.0; to: 0.0; duration: 1500 } + + Timer { + id: posMstoS + interval: 750 + running: player.hasVideo + repeat: true + onTriggered: { + //playingtrack.text = Qt.formatTime(new Date(mmplayer.player.position), "hh:mm:ss") // timezone? + playingtrack.text = mstoSec(mmplayer.player.position) + '/' + mstoSec(mmplayer.player.duration) + " " + } + + function mstoSec(msec){ + function pad(n, z) { z = z || 2; return ('00' + n).slice(-z); } + var s = msec + var ms = s % 1000; + s = (s - ms) / 1000; + var secs = s % 60; + s = (s - secs) / 60; + var mins = s % 60; + var hrs = (s - mins) / 60; + return pad(hrs) + ':' + pad(mins) + ':' + pad(secs); + } + } + + } + + + + } + +} + diff --git a/qml/contents/MediaDropArea.qml b/qml/contents/MediaDropArea.qml new file mode 100644 index 0000000..24d4e34 --- /dev/null +++ b/qml/contents/MediaDropArea.qml @@ -0,0 +1,31 @@ +import QtQuick 2.12 + +DropArea { + enabled: true + + onDropped: { + + drop.acceptProposedAction() + if (drop.hasUrls) + { + if(drop.text.split('.').pop() === "srt") { // get file extension + toptools.settings.visible = true + mmplayer.playingtrack.text = "Subtitle added " + subpath = drop.urls[0] + BackOffice.readSub(drop.urls[0]) + } + else { + // append to listview + for (let j=0; j < drop.urls.length; j++) { + j == 0 ? PlaylistModal.append(drop.urls[j], 1) : PlaylistModal.append(drop.urls[j], 0) + } + + mmplayer.player.source = drop.urls[0] + + } + mmplayer.playingtrackanm.running = true + } + } + +} + diff --git a/qml/contents/Playlist.qml b/qml/contents/Playlist.qml new file mode 100644 index 0000000..13dfd81 --- /dev/null +++ b/qml/contents/Playlist.qml @@ -0,0 +1,107 @@ +import QtQuick 2.0 +import QtQml.Models 2.12 + +Item { + y: parent.height/7 + width:frame.width/4; height: frame.height/1.5 + anchors.right: parent.right; anchors.rightMargin: 5 + + property ListView listview: listview + + ListView { + id: listview; + anchors.fill: parent + opacity: 0 + model: PlaylistModal + delegate: delegatecom + + Rectangle { + anchors.fill: parent + color: "transparent"; + border { width: 1; color: "white" } radius: 10 + } + + SequentialAnimation { + id: show; running: false + NumberAnimation { target: listview; property: "opacity"; from:0; to: 0.75; duration: 500; } + } + + SequentialAnimation { + id: hide; running: false + NumberAnimation { target: listview; property: "opacity"; from:0.75; to: 0; duration: 500 } + } + + // delegate part + Component { + id: delegatecom + + Rectangle { + id: delegatename + implicitWidth: parent.width; implicitHeight: product_name.implicitHeight*3; + color: "white"; radius: 10 + Text { + id: product_name; width: parent.width - parent.height + elide: Text.ElideLeft + text: model.name; color: "black"; font.pixelSize: 16; + anchors { verticalCenter: parent.verticalCenter; } + } + Image { + id: playingimg + width: parent.height; height: parent.height + anchors.right: parent.right + source: model.playing ? "qrc:/pause.png" : "qrc:/play.png" + scale: 2/3 + } + MouseArea { + anchors.fill: parent + hoverEnabled: true + onClicked: { + mmplayer.player.source = PlaylistModal.getMediaUrl(index) + // accessing grandchild of listitem (which is playingimg) + for(let i=0; i= parent.height) { height = parent.height } + } + } + +// WheelHandler { +// target: volumepercent +// acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad +// property: "height" +// } + + Image { + width: 40; height: 40 + source: "qrc:/volume.png" + anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter; bottomMargin: 10 } + scale: 2/3 + } + + MouseArea { + anchors.fill: parent + + onClicked: { + var mouseP = Qt.point(mouse.x, mouse.y); + var posnInVol = volumepercent.mapToItem(volumePopup, mouseP) + volumepercent.height = volumePopup.height - mouse.y + mmplayer.player.volume = volumepercent.height / volumePopup.height + } + } + + } +} + diff --git a/qml/mainpage.qml b/qml/mainpage.qml new file mode 100644 index 0000000..5cfce7d --- /dev/null +++ b/qml/mainpage.qml @@ -0,0 +1,153 @@ +import QtQuick 2.12 +import QtQuick.Window 2.12 +import QtQuick.Controls 2.12 +import QtMultimedia 5.12 + +import "contents" + + +ApplicationWindow { + id: frame; + flags: Qt.FramelessWindowHint + x: Screen.width/2 - width/2; + y: Screen.height/2 - height/2 + width: 1280; height: 800; + color: "transparent" + visible: true; + + property int fs: 0 + property string subpath + + background: Rectangle { + anchors.fill: parent + color: "black"; radius: 25 + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton// | Qt.RightButton + property int prevX: 0 + property int prevY: 0 + onDoubleClicked: { + if(!fs) { showFullScreen(); toptools.visible = false; fs = 1; opatmr.restart(); } + else { showNormal(); toptools.visible = true ; fs = 0; } + } + + onPressed: { + prevX = mouse.x; prevY = mouse.y + toptools.opacity = 1 + slider.opacity = 1 + bottomtools.opacity = 1 + mmplayer.player.playbackState === MediaPlayer.PlayingState ? opatmr.restart() : opatmr.stop() + } + + onPositionChanged:{ + var deltaX = mouse.x - prevX; + frame.x += deltaX; + prevX = mouse.x - deltaX; + var deltaY = mouse.y - prevY + frame.y += deltaY; + prevY = mouse.y - deltaY; + } + + + } + + Timer { + id: opatmr; running: false; interval: 3000; //repeat: true + onTriggered: { + topopa_dw.restart(); + sldopa_dw.restart(); + botopa_dw.restart(); + } + } + + + MMPlayer { + id: mmplayer + anchors.fill: parent + + } + + VolumePanel { + id: volume + + } + + TopTools { + id: toptools + + OpacityAnimator { id: topopa_up; target: toptools; from: 0; to: 1; duration: 500; running: true } + OpacityAnimator { id: topopa_dw; target: toptools; from: 1; to: 0; duration: 3000; running: false } + } + + Playlist { + id:playlist + + } + + + MediaDropArea { + id: trackdrop + anchors.fill: parent + } + + +// Rectangle { +// y: parent.height/10 +// width: parent.width/30; height: parent.height/1.30 +// anchors { right: parent.right; } +// color: "green"; + +// MouseArea { +// anchors.fill: parent +// hoverEnabled: true + +// onEntered: { +// //show.running = true +// playlist.show.running = true +// console.log("entered") +// } + +// onExited: { +// //hide.running =true +// playlist.hide.running = true +// console.log("exited") +// } +// } +// } + + + + Slider { + id: slider + width: frame.width + anchors { bottom: bottomtools.top } + from: 0; to: mmplayer.player.duration + onMoved: { + mmplayer.player.seek(slider.value) + } + + OpacityAnimator { id: sldopa_up; target: slider; from: 0; to: 1; duration: 500; running: true } + OpacityAnimator { id: sldopa_dw; target: slider; from: 1; to: 0; duration: 3000; running: false } + + } + + BottomTools { + id: bottomtools + + OpacityAnimator { id: botopa_up; target: bottomtools; from: 0; to: 1; duration: 500; running: true } + OpacityAnimator { id: botopa_dw; target: bottomtools; from: 1; to: 0; duration: 3000; running: false } + } + + Shortcuts { + id: shortcuts + } + + SubSettings { + id: settingspopup + } + + + +} diff --git a/qml/qml.qrc b/qml/qml.qrc new file mode 100644 index 0000000..76693a1 --- /dev/null +++ b/qml/qml.qrc @@ -0,0 +1,13 @@ + + + mainpage.qml + contents/MMPlayer.qml + contents/MediaDropArea.qml + contents/Shortcuts.qml + contents/TopTools.qml + contents/BottomTools.qml + contents/SubSettings.qml + contents/VolumePanel.qml + contents/Playlist.qml + + diff --git a/src/backoffice.cpp b/src/backoffice.cpp new file mode 100644 index 0000000..2e330b8 --- /dev/null +++ b/src/backoffice.cpp @@ -0,0 +1,77 @@ +#include +#include +#include +#include + +#include "backoffice.h" + +using namespace std; + +std::vector sub; + +BackOffice::BackOffice(QObject *parent/*, QMediaPlayer *qmlplayer*/) +{ + //player = qmlplayer; + qDebug() << "LIBREMM Ver." << VERSION << "running"; + + m_playlist = new PlaylistModal(this); // no need to delete + +} + +BackOffice::~BackOffice() +{ + +} + +void BackOffice::readSub(QString url) +{ + QString abs = url.mid(7); qDebug() << abs; + SubtitleParserFactory *subParserFactory = new SubtitleParserFactory(abs.toStdString()); + SubtitleParser *parser = subParserFactory->getParser(); + sub = parser->getSubtitles(); +} + +auto BackOffice::getSubText(double pos_ms) -> QString +{ + QStringList textandtime; + for(SubtitleItem *element : sub) + { + double T_START = element->getStartTime(); + double T_STOP = element->getEndTime(); + + if( (T_START <= pos_ms) && (pos_ms <= T_STOP)) + { + return QString::fromStdString(element->getText()); + } + } + return ""; +} + +void BackOffice::convCode(QString path, QString TOCODE, QString FROMCODE) +{ + iconvpp::converter conv(TOCODE.toStdString(), FROMCODE.toStdString(), true, 1024); + QFile file(path); + if(!file.open(QIODevice::ReadOnly)) { qDebug() << "Could not opened!"; return; } + + QByteArray ba; + while (!file.atEnd()) + { + ba += file.readLine(); + } + file.close(); + + std::string input = ba.toStdString(); + std::string output; + + conv.convert(input, output); + QFile out(path); + if(!out.open(QIODevice::Append)) { qDebug() << "Could not opened!"; return; } + out.resize(0); + out.write(output.c_str()); + out.close(); +} + + + + + diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..7003e27 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,32 @@ +#include +#include +#include + +#include + +#include "backoffice.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + //QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + //qmlRegisterType("io.qt.metadata", 1, 0, "MetaData"); + + QQmlApplicationEngine engine; + + + + //auto qmlPlayer = engine.rootObjects()[0]->findChild("qmlplayer"); + //QMediaPlayer* qmlplayer = qvariant_cast(qmlPlayer->property("mediaObject")); // expose to C++ + + BackOffice* boff = new BackOffice(nullptr); + engine.rootContext()->setContextProperty("BackOffice", boff); + engine.rootContext()->setContextProperty("PlaylistModal", boff->getPlaylist()); // expose to QML + //std::unique_ptr str= std::make_unique(); + + engine.load(QUrl(QStringLiteral("qrc:/mainpage.qml"))); + if (engine.rootObjects().isEmpty()) { return -1; } + + return app.exec(); +} diff --git a/src/playlistmodal.cpp b/src/playlistmodal.cpp new file mode 100644 index 0000000..07ee65b --- /dev/null +++ b/src/playlistmodal.cpp @@ -0,0 +1,59 @@ + +#include "playlistmodal.h" + +PlaylistModal::PlaylistModal(QObject *parent) : QAbstractListModel(parent) +{ +} + +int PlaylistModal::rowCount(const QModelIndex &parent) const +{ + if (parent.isValid()) + return 0; + return m_list.size(); +} + +QHash PlaylistModal::roleNames() const { + return { { NameRole, "name" }, + { PlayingRole, "playing" }, + }; +} + +void PlaylistModal::append(QString name, bool playing) +{ + int rowIndex = rowCount(); + beginInsertRows(QModelIndex(), rowIndex, rowIndex); + TrackInfo track; + track.name = name; track.playing = playing; + m_list.append(track); + endInsertRows(); +} + +void PlaylistModal::remove(int i) +{ + beginRemoveRows(QModelIndex(), i, i); + m_list.removeAt(i); + endRemoveRows(); +} + +void PlaylistModal::clear() +{ + +} + +QString PlaylistModal::getMediaUrl(int i) +{ + m_list[i].playing = true; + return m_list[i].name; +} + +QVariant PlaylistModal::data(const QModelIndex &index, int role) const +{ + if (!index.isValid()) + return QVariant(); + if (!hasIndex(index.row(), index.column(), index.parent())) return QVariant(); + const TrackInfo &track = m_list.at(index.row()); + if (role == NameRole) return track.name; + if (role == PlayingRole) return track.playing; + return QVariant(); +} +