Config.hpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #pragma once
  2. #include <string>
  3. #include <vector>
  4. namespace QuickMedia {
  5. struct SearchConfig {
  6. int font_size = 16;
  7. };
  8. struct TabConfig {
  9. int font_size = 16;
  10. };
  11. struct BodyConfig {
  12. int title_font_size = 16;
  13. int author_font_size = 14;
  14. int description_font_size = 14;
  15. int timestamp_font_size = 10;
  16. int reaction_font_size = 14;
  17. int progress_font_size = 14;
  18. int replies_font_size = 14;
  19. int embedded_load_font_size = 14;
  20. int loading_text_font_size = 30;
  21. };
  22. struct InputConfig {
  23. int font_size = 16;
  24. };
  25. struct AnimationConfig {
  26. float move_speed = 30.0f;
  27. float loading_icon_speed = 400.0;
  28. };
  29. struct VideoConfig {
  30. int max_height = 0;
  31. };
  32. struct LocalMangaConfig {
  33. std::string directory;
  34. bool sort_by_name = false;
  35. bool sort_chapters_by_name = false;
  36. };
  37. struct LocalAnimeConfig {
  38. std::string directory;
  39. bool sort_by_name = false; // Series
  40. bool sort_episodes_by_name = true;
  41. bool auto_group_episodes = true;
  42. bool recursive = true;
  43. };
  44. struct YoutubeSponsorblock {
  45. bool enable = false;
  46. std::string api_endpoint = "https://sponsor.ajay.app";
  47. int min_votes = 0;
  48. };
  49. struct YoutubeConfig {
  50. bool load_progress = true;
  51. std::string invidious_instance;
  52. YoutubeSponsorblock sponsorblock;
  53. };
  54. struct MatrixConfig {
  55. std::vector<std::string> known_homeservers;
  56. std::string gpg_user_id;
  57. int room_name_font_size = 18;
  58. int room_description_font_size = 12;
  59. bool send_read_receipts = true;
  60. bool send_typing_notifications = true;
  61. bool appear_online = true;
  62. bool clear_message_on_escape = true;
  63. };
  64. struct PeertubeConfig {
  65. std::vector<std::string> known_instances;
  66. };
  67. struct DownloadConfig {
  68. std::string video_directory;
  69. std::string image_directory;
  70. std::string music_directory;
  71. std::string file_directory;
  72. };
  73. struct FontScaleConfig {
  74. float latin = 1.0f;
  75. float latin_bold = 1.0f;
  76. float latin_monospace = 1.0f;
  77. float cjk = 1.0f;
  78. float symbols = 1.0f;
  79. };
  80. struct FontConfig {
  81. std::string latin;
  82. std::string latin_bold;
  83. std::string latin_monospace;
  84. std::string cjk;
  85. std::string symbols;
  86. FontScaleConfig scale;
  87. };
  88. struct MangadexConfig {
  89. bool allow_hentai = false;
  90. };
  91. struct FileManagerConfig {
  92. bool grid_view = true;
  93. };
  94. struct Config {
  95. Config() = default;
  96. Config(const Config&) = delete;
  97. Config&operator=(const Config&) = delete;
  98. SearchConfig search;
  99. TabConfig tab;
  100. BodyConfig body;
  101. InputConfig input;
  102. AnimationConfig animation;
  103. VideoConfig video;
  104. LocalMangaConfig local_manga;
  105. LocalAnimeConfig local_anime;
  106. YoutubeConfig youtube;
  107. MatrixConfig matrix;
  108. PeertubeConfig peertube;
  109. DownloadConfig download;
  110. FontConfig font;
  111. MangadexConfig mangadex;
  112. FileManagerConfig file_manager;
  113. bool use_system_fonts = false;
  114. bool use_system_mpv_config = false;
  115. std::string system_mpv_profile;
  116. bool enable_shaders = true;
  117. std::string theme = "default";
  118. float scale = 1.0f;
  119. float font_scale = 1.0f;
  120. float spacing_scale = 1.0f;
  121. bool low_latency_mode = false;
  122. };
  123. Config& get_config();
  124. }