OBSSourceLabel.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /******************************************************************************
  2. Copyright (C) 2015 by Ruwen Hahn <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #include "OBSSourceLabel.hpp"
  15. #include "moc_OBSSourceLabel.cpp"
  16. void OBSSourceLabel::SourceRenamed(void *data, calldata_t *params)
  17. {
  18. auto &label = *static_cast<OBSSourceLabel *>(data);
  19. const char *name = calldata_string(params, "new_name");
  20. label.setText(name);
  21. emit label.Renamed(name);
  22. }
  23. void OBSSourceLabel::SourceRemoved(void *data, calldata_t *)
  24. {
  25. auto &label = *static_cast<OBSSourceLabel *>(data);
  26. emit label.Removed();
  27. }
  28. void OBSSourceLabel::SourceDestroyed(void *data, calldata_t *)
  29. {
  30. auto &label = *static_cast<OBSSourceLabel *>(data);
  31. emit label.Destroyed();
  32. label.destroyedSignal.Disconnect();
  33. label.removedSignal.Disconnect();
  34. label.renamedSignal.Disconnect();
  35. }