WMHandler.cpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. #include "main.h"
  2. #include <assert.h>
  3. void WMHandler::OpenFailed()
  4. {
  5. if (next)
  6. next->OpenFailed();
  7. }
  8. void WMHandler::ReOpen()
  9. {
  10. if (next)
  11. next->ReOpen();
  12. }
  13. void WMHandler::Started()
  14. {
  15. if (next)
  16. next->Started();
  17. }
  18. void WMHandler::Stopped()
  19. {
  20. if (next)
  21. next->Stopped();
  22. }
  23. void WMHandler::PreRollComplete()
  24. {
  25. if (next)
  26. next->PreRollComplete();
  27. }
  28. void WMHandler::EndOfFile()
  29. {
  30. if (next)
  31. next->EndOfFile();
  32. }
  33. void WMHandler::Closed()
  34. {
  35. if (next)
  36. next->Closed();
  37. }
  38. void WMHandler::BufferingStarted()
  39. {
  40. if (next)
  41. next->BufferingStarted();
  42. }
  43. void WMHandler::BufferingStopped()
  44. {
  45. if (next)
  46. next->BufferingStopped();
  47. }
  48. void WMHandler::NewMetadata()
  49. {
  50. if (next)
  51. next->NewMetadata();
  52. }
  53. void WMHandler::Individualize()
  54. {
  55. if (next)
  56. next->Individualize();
  57. }
  58. void WMHandler::SignatureState(WMT_DRMLA_TRUST *&state)
  59. {
  60. if (next)
  61. next->SignatureState(state);
  62. }
  63. void WMHandler::NoRightsEx(WM_GET_LICENSE_DATA *&licenseData)
  64. {
  65. if (next)
  66. next->NoRightsEx(licenseData);
  67. }
  68. void WMHandler::AcquireLicense(WM_GET_LICENSE_DATA *&licenseData)
  69. {
  70. if (next)
  71. next->AcquireLicense(licenseData);
  72. }
  73. void WMHandler::AllocateOutput(long outputNum, long bufferSize, INSSBuffer *&buffer)
  74. {
  75. if (next)
  76. next->AllocateOutput(outputNum, bufferSize, buffer);
  77. }
  78. void WMHandler::VideoCatchup(QWORD time)
  79. {
  80. if (next)
  81. next->VideoCatchup(time);
  82. }
  83. void WMHandler::TimeToSync(QWORD timeStamp,__int64 &diff)
  84. {
  85. if (next)
  86. next->TimeToSync(timeStamp, diff);
  87. }
  88. void WMHandler::Error()
  89. {
  90. if (next)
  91. next->Error();
  92. }
  93. void WMHandler::LicenseRequired()
  94. {
  95. if (next)
  96. next->LicenseRequired();
  97. }
  98. void WMHandler::NoRights(wchar_t *licenseData)
  99. {
  100. if (next)
  101. next->NoRights(licenseData);
  102. }
  103. WMHandler::WMHandler() : next(0), prev(0)
  104. {}
  105. WMHandler::~WMHandler()
  106. {
  107. if (next)
  108. next->prev = prev;
  109. if (prev)
  110. prev->next = next;
  111. }
  112. WMHandler &WMHandler::operator << (WMHandler &chain)
  113. {
  114. assert(chain.next == 0);
  115. assert(prev == 0);
  116. prev = &chain;
  117. chain.next = this;
  118. return chain;
  119. }
  120. WMHandler &WMHandler::operator >> (WMHandler &chain)
  121. {
  122. if (chain.prev)
  123. {
  124. operator >>(chain.prev);
  125. return chain;
  126. }
  127. assert (next == 0);
  128. assert (chain.prev == 0);
  129. next = &chain;
  130. chain.prev = this;
  131. return chain;
  132. }
  133. WMHandler&WMHandler::operator << (WMHandler *chain)
  134. {
  135. return operator <<(*chain);
  136. }
  137. WMHandler &WMHandler::operator >> (WMHandler *chain)
  138. {
  139. return operator >>(*chain);
  140. }
  141. WMHandler &WMHandler::First()
  142. {
  143. if (prev)
  144. return prev->First();
  145. else
  146. return *this;
  147. }