config.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #define WM_DEFINE_CONFIG 1
  2. #include "config.h"
  3. #include "loadini.h"
  4. #include "main.h"
  5. #include "../nu/Config.h"
  6. bool config_no_video = false;
  7. extern Nullsoft::Utility::Config wmConfig;
  8. #pragma warning(disable:4800)
  9. #define READ(type, name) config_##name = (type)wmConfig.cfg_int(TEXT("config_") TEXT(#name), default_##name)
  10. #define WRITE(type, name) wmConfig.cfg_int(TEXT("config_") TEXT(#name), default_##name) = (int)config_##name
  11. #define DEFAULT(name) config_##name = default_##name
  12. void ReadConfig()
  13. {
  14. READ(bool, lowmemory);
  15. READ(bool, clock);
  16. READ(bool, video_dedicated_thread);
  17. READ(bool, video_early);
  18. READ(int, video_early_pad);
  19. READ(bool, video_outoforder);
  20. READ(bool, video_catchup);
  21. READ(int, video_jitter);
  22. READ(int, video_drop_threshold);
  23. READ(size_t, video_cache_frames);
  24. READ(bool, video_notifylate);
  25. READ(bool, video_framedropoffset);
  26. READ(bool, audio_outoforder);
  27. READ(bool, audio_dedicated_thread);
  28. READ(int, audio_early_pad);
  29. READ(bool, audio_early);
  30. READ(size_t, audio_cache_frames);
  31. READ(size_t, audio_num_channels);
  32. // READ(bool, no_silent);
  33. // READ(bool, untrusted_ok);
  34. READ(bool, http_metadata);
  35. READ(size_t, buffer_time);
  36. READ(bool, extra_asx_extensions);
  37. READ(int, col1);
  38. READ(int, col2);
  39. }
  40. void WriteConfig()
  41. {
  42. WRITE(bool, lowmemory);
  43. WRITE(bool, clock);
  44. WRITE(bool, video_dedicated_thread);
  45. WRITE(bool, video_early);
  46. WRITE(int, video_early_pad);
  47. WRITE(bool, video_outoforder);
  48. WRITE(bool, video_catchup);
  49. WRITE(int, video_jitter);
  50. WRITE(int, video_drop_threshold);
  51. WRITE(size_t, video_cache_frames);
  52. WRITE(bool, video_notifylate);
  53. WRITE(bool, video_framedropoffset);
  54. WRITE(bool, audio_outoforder);
  55. WRITE(bool, audio_dedicated_thread);
  56. WRITE(int, audio_early_pad);
  57. WRITE(bool, audio_early);
  58. WRITE(size_t, audio_cache_frames);
  59. WRITE(size_t, audio_num_channels);
  60. // WRITE(bool, no_silent);
  61. // WRITE(bool, untrusted_ok);
  62. WRITE(bool, http_metadata);
  63. WRITE(size_t, buffer_time);
  64. WRITE(bool, extra_asx_extensions);
  65. WRITE(int, col1);
  66. WRITE(int, col2);
  67. }
  68. void DefaultConfig()
  69. {
  70. DEFAULT(http_metadata);
  71. // DEFAULT(no_silent);
  72. // DEFAULT(untrusted_ok);
  73. DEFAULT(buffer_time);
  74. DEFAULT(audio_num_channels);
  75. DEFAULT(audio_outoforder);
  76. DEFAULT(audio_dedicated_thread);
  77. DEFAULT(audio_early_pad);
  78. DEFAULT(audio_early);
  79. DEFAULT(audio_cache_frames);
  80. DEFAULT(lowmemory);
  81. DEFAULT(clock);
  82. DEFAULT(video_dedicated_thread);
  83. DEFAULT(video_early);
  84. DEFAULT(video_early_pad);
  85. DEFAULT(video_outoforder);
  86. DEFAULT(video_catchup);
  87. DEFAULT(video_jitter);
  88. DEFAULT(video_drop_threshold);
  89. DEFAULT(video_cache_frames);
  90. DEFAULT(video_notifylate);
  91. DEFAULT(video_framedropoffset);
  92. DEFAULT(extra_asx_extensions);
  93. DEFAULT(col1);
  94. DEFAULT(col2);
  95. }