1
0

window-main-basic.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /******************************************************************************
  2. Copyright (C) 2013 by Hugh Bailey <[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 "obs-app.hpp"
  15. #include "window-main-basic.hpp"
  16. void OBSBasic::OnClose(wxCloseEvent& event)
  17. {
  18. wxGetApp().ExitMainLoop();
  19. event.Skip();
  20. }
  21. void OBSBasic::OnMinimize(wxIconizeEvent& event)
  22. {
  23. event.Skip();
  24. }
  25. void OBSBasic::OnSize(wxSizeEvent& event)
  26. {
  27. struct obs_video_info ovi;
  28. event.Skip();
  29. if (!obs_get_video_info(&ovi))
  30. return;
  31. /* resize preview panel to fix to the top section of the window */
  32. wxSize targetSize = GetPreviewContainer()->GetSize();
  33. double targetAspect = double(targetSize.x) / double(targetSize.y);
  34. double baseAspect = double(ovi.base_width) / double(ovi.base_height);
  35. if (targetAspect > baseAspect)
  36. GetPreviewPanel()->SetMinSize(wxSize(targetSize.y * baseAspect,
  37. targetSize.y));
  38. else
  39. GetPreviewPanel()->SetMinSize(wxSize(targetSize.x,
  40. targetSize.x / baseAspect));
  41. }
  42. void OBSBasic::file_newOnMenuSelection(wxCommandEvent& event)
  43. {
  44. }
  45. void OBSBasic::file_openOnMenuSelection(wxCommandEvent& event)
  46. {
  47. }
  48. void OBSBasic::file_saveOnMenuSelection(wxCommandEvent& event)
  49. {
  50. }
  51. void OBSBasic::file_exitOnMenuSelection(wxCommandEvent& event)
  52. {
  53. wxGetApp().ExitMainLoop();
  54. }
  55. void OBSBasic::scenesOnRightDown(wxMouseEvent& event)
  56. {
  57. }
  58. void OBSBasic::sceneAddOnToolClicked(wxCommandEvent& event)
  59. {
  60. }
  61. void OBSBasic::sceneRemoveOnToolClicked(wxCommandEvent& event)
  62. {
  63. }
  64. void OBSBasic::scenePropertiesOnToolClicked(wxCommandEvent& event)
  65. {
  66. }
  67. void OBSBasic::sceneUpOnToolClicked(wxCommandEvent& event)
  68. {
  69. }
  70. void OBSBasic::sceneDownOnToolClicked(wxCommandEvent& event)
  71. {
  72. }
  73. void OBSBasic::sourcesOnRightDown(wxMouseEvent& event)
  74. {
  75. }
  76. void OBSBasic::sourceAddOnToolClicked(wxCommandEvent& event)
  77. {
  78. }
  79. void OBSBasic::sourceRemoveOnToolClicked(wxCommandEvent& event)
  80. {
  81. }
  82. void OBSBasic::sourcePropertiesOnToolClicked(wxCommandEvent& event)
  83. {
  84. }
  85. void OBSBasic::sourceUpOnToolClicked(wxCommandEvent& event)
  86. {
  87. }
  88. void OBSBasic::sourceDownOnToolClicked(wxCommandEvent& event)
  89. {
  90. }
  91. void OBSBasic::exitButtonOnButtonClick(wxCommandEvent& event)
  92. {
  93. wxGetApp().ExitMainLoop();
  94. }