Merge remote-tracking branch 'origin/master'

This commit is contained in:
Bruno
2021-07-27 09:15:47 +02:00
5 changed files with 119 additions and 74 deletions

View File

@@ -115,7 +115,7 @@ std::string DialogToolkit::saveSessionFileDialog(const std::string &path)
#endif #endif
std::string extension = filename.substr(filename.find_last_of(".") + 1); std::string extension = filename.substr(filename.find_last_of(".") + 1);
if (extension != "mix") if (!filename.empty() && extension != "mix")
filename += ".mix"; filename += ".mix";
return filename; return filename;

View File

@@ -316,6 +316,7 @@ void UserInterface::handleKeyboard()
// No CTRL modifier // No CTRL modifier
else { else {
ctrl_modifier_active = false; ctrl_modifier_active = false;
Source *_cs = Mixer::manager().currentSource();
// Application F-Keys // Application F-Keys
if (ImGui::IsKeyPressed( GLFW_KEY_F1 )) if (ImGui::IsKeyPressed( GLFW_KEY_F1 ))
@@ -328,6 +329,12 @@ void UserInterface::handleKeyboard()
Mixer::manager().setView(View::TEXTURE); Mixer::manager().setView(View::TEXTURE);
else if (ImGui::IsKeyPressed( GLFW_KEY_F12 )) else if (ImGui::IsKeyPressed( GLFW_KEY_F12 ))
StartScreenshot(); StartScreenshot();
// button home to toggle menu
else if (ImGui::IsKeyPressed( GLFW_KEY_HOME ))
navigator.togglePannelMenu();
// button home to toggle menu
else if (ImGui::IsKeyPressed( GLFW_KEY_INSERT ))
navigator.togglePannelNew();
// button esc // button esc
else if (ImGui::IsKeyPressed( GLFW_KEY_ESCAPE )) { else if (ImGui::IsKeyPressed( GLFW_KEY_ESCAPE )) {
// 1. escape fullscreen // 1. escape fullscreen
@@ -348,14 +355,33 @@ void UserInterface::handleKeyboard()
Mixer::selection().clear(); Mixer::selection().clear();
} }
} }
// button home to toggle menu
else if (ImGui::IsKeyPressed( GLFW_KEY_HOME )) // keys to control the current source if media player is not focused
navigator.togglePannelMenu(); if (_cs != nullptr && _cs->active() && (!ImGui::IsAnyWindowFocused() || sourcecontrol.Active()) )
// button home to toggle menu {
else if (ImGui::IsKeyPressed( GLFW_KEY_INSERT )) // Space bar to toggle play / pause
navigator.togglePannelNew(); if (ImGui::IsKeyPressed( GLFW_KEY_SPACE )) {
_cs->play( !_cs->playing() );
}
// B to rewind to Beginning
else if (ImGui::IsKeyPressed( GLFW_KEY_B )) {
_cs->replay();
}
// N for Next frame or fast forward
else if (ImGui::IsKeyPressed( GLFW_KEY_N )) {
MediaSource *ms = dynamic_cast<MediaSource *>(_cs);
if ( ms != nullptr ) {
if (ms->playing())
ms->mediaplayer()->jump();
else
ms->mediaplayer()->step();
}
}
}
// normal keys in workspace // make sure no entry / window box is active // normal keys in workspace // make sure no entry / window box is active
else if ( !ImGui::IsAnyWindowFocused() ){ if ( !ImGui::IsAnyWindowFocused() )
{
// Backspace to delete source // Backspace to delete source
if (ImGui::IsKeyPressed( GLFW_KEY_BACKSPACE ) || ImGui::IsKeyPressed( GLFW_KEY_DELETE )) if (ImGui::IsKeyPressed( GLFW_KEY_BACKSPACE ) || ImGui::IsKeyPressed( GLFW_KEY_DELETE ))
Mixer::manager().deleteSelection(); Mixer::manager().deleteSelection();
@@ -1986,7 +2012,7 @@ void ToolBox::Render()
/// ///
/// SOURCE CONTROLLER /// SOURCE CONTROLLER
/// ///
SourceController::SourceController() : min_width_(0.f), h_space_(0.f), v_space_(0.f), buttons_height_(0.f), SourceController::SourceController() : focused_(false), min_width_(0.f), h_space_(0.f), v_space_(0.f), buttons_height_(0.f),
timeline_height_(0.f), scrollbar_(0.f), mediaplayer_height_(0.f), buttons_width_(0.f), timeline_height_(0.f), scrollbar_(0.f), mediaplayer_height_(0.f), buttons_width_(0.f),
active_label_(LABEL_AUTO_MEDIA_PLAYER), active_selection_(-1), active_label_(LABEL_AUTO_MEDIA_PLAYER), active_selection_(-1),
selection_context_menu_(false), selection_mediaplayer_(nullptr), selection_target_slower_(0), selection_target_faster_(0), selection_context_menu_(false), selection_mediaplayer_(nullptr), selection_target_slower_(0), selection_target_faster_(0),
@@ -2003,6 +2029,14 @@ void SourceController::resetActiveSelection()
active_label_ = LABEL_AUTO_MEDIA_PLAYER; active_label_ = LABEL_AUTO_MEDIA_PLAYER;
} }
bool SourceController::Active()
{
return ( Settings::application.widget.media_player
&& (Settings::application.widget.media_player_view < 0 || Settings::application.widget.media_player_view == Settings::application.current_view )
&& focused_);
}
void SourceController::Render() void SourceController::Render()
{ {
// reset on session change // reset on session change
@@ -2041,6 +2075,7 @@ void SourceController::Render()
} }
source_window_pos = ImGui::GetWindowPos(); source_window_pos = ImGui::GetWindowPos();
source_window_size = ImGui::GetWindowSize(); source_window_size = ImGui::GetWindowSize();
focused_ = ImGui::IsWindowFocused();
// menu (no title bar) // menu (no title bar)
if (ImGui::BeginMenuBar()) if (ImGui::BeginMenuBar())

View File

@@ -106,6 +106,7 @@ public:
class SourceController class SourceController
{ {
bool focused_;
float min_width_; float min_width_;
float h_space_; float h_space_;
float v_space_; float v_space_;
@@ -152,6 +153,7 @@ public:
void resetActiveSelection(); void resetActiveSelection();
void Render(); void Render();
bool Active();
}; };

View File

@@ -4,38 +4,17 @@
<dict> <dict>
<key>Apl</key> <key>Apl</key>
<string></string> <string></string>
<key>LSAppNapIsDisabled</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>vimix needs to access the camera to enable camera sources.</string>
<key>LSMinimumSystemVersion</key>
<string>10.14.0</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDocumentTypes</key> <key>CFBundleDocumentTypes</key>
<array> <array>
<dict> <dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mix</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>vimix.icns</string>
<key>CFBundleTypeName</key> <key>CFBundleTypeName</key>
<string>vimix session</string> <string>vimix session</string>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>Editor</string> <string>Editor</string>
<key>LSIsAppleDefaultForType</key>
<true/>
<key>LSHandlerRank</key> <key>LSHandlerRank</key>
<string>Owner</string> <string>Owner</string>
<key>LSIsAppleDefaultForType</key>
<true/>
<key>LSItemContentTypes</key> <key>LSItemContentTypes</key>
<array> <array>
<string>com.bhbn.mix</string> <string>com.bhbn.mix</string>
@@ -64,7 +43,24 @@
<string>0.6</string> <string>0.6</string>
<key>CSResourcesFileMapped</key> <key>CSResourcesFileMapped</key>
<true/> <true/>
<key>LSAppNapIsDisabled</key>
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.video</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>vimix needs to access the camera to enable camera sources.</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string>Bruno Herbelin</string> <string>Copyright © 2021 Bruno Herbelin. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict> </dict>
</plist> </plist>

12
vimix.entitlements Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.personal-information.photos-library</key>
<true/>
</dict>
</plist>