DSDisplayOverlay.cxx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
  2. *
  3. * This file is part of Open Source Doubango Framework.
  4. *
  5. * DOUBANGO is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * DOUBANGO is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with DOUBANGO.
  17. */
  18. #if !defined(VMR) && !defined(VMR9) && !defined(VMR9_WINDOWLESS)
  19. #include "internals/DSDisplayOverlay.h"
  20. #include "internals/DSDisplayGraph.h"
  21. #include <iostream>
  22. using namespace std;
  23. DSDisplayOverlay::DSDisplayOverlay()
  24. {
  25. }
  26. DSDisplayOverlay::~DSDisplayOverlay()
  27. {
  28. }
  29. void DSDisplayOverlay::attach(HWND parent, DSDisplayGraph *graph)
  30. {
  31. this->displayGraph = graph;
  32. }
  33. void DSDisplayOverlay::detach()
  34. {
  35. this->displayGraph = NULL;
  36. }
  37. void DSDisplayOverlay::show(int value)
  38. {
  39. // Store the ticks to count down
  40. this->ticks = value;
  41. this->internalUpdate();
  42. }
  43. void DSDisplayOverlay::update()
  44. {
  45. if (this->displayGraph && (this->ticks > 0)) {
  46. this->ticks--;
  47. this->internalUpdate();
  48. }
  49. }
  50. void DSDisplayOverlay::internalUpdate()
  51. {
  52. this->displayGraph->getSourceFilter()->showOverlay(this->ticks);
  53. }
  54. #endif