SceneCollection.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /******************************************************************************
  2. Copyright (C) 2025 by Patrick Heyer <[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 "SceneCollection.hpp"
  15. static constexpr std::string_view invalidCoordinateMode = "Invalid coordinate mode provided";
  16. namespace OBS {
  17. std::string SceneCollection::getName() const
  18. {
  19. return name_;
  20. }
  21. std::string SceneCollection::getFileName() const
  22. {
  23. return filePath_.filename().u8string();
  24. }
  25. std::string SceneCollection::getFileStem() const
  26. {
  27. return filePath_.stem().u8string();
  28. }
  29. std::filesystem::path SceneCollection::getFilePath() const
  30. {
  31. return filePath_;
  32. }
  33. std::string SceneCollection::getFilePathString() const
  34. {
  35. return filePath_.u8string();
  36. }
  37. SceneCoordinateMode SceneCollection::getCoordinateMode() const
  38. {
  39. return coordinateMode_;
  40. }
  41. void SceneCollection::setCoordinateMode(SceneCoordinateMode newMode)
  42. {
  43. if (newMode != SceneCoordinateMode::Invalid) {
  44. coordinateMode_ = newMode;
  45. } else {
  46. throw std::invalid_argument(invalidCoordinateMode.data());
  47. }
  48. }
  49. Rect SceneCollection::getMigrationResolution() const
  50. {
  51. return migrationResolution_;
  52. }
  53. void SceneCollection::setMigrationResolution(Rect newResolution)
  54. {
  55. migrationResolution_ = newResolution;
  56. }
  57. } // namespace OBS