mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-05 23:40:02 +01:00
Fixed Info panel Session File Source
and other UI minor details.
This commit is contained in:
@@ -637,19 +637,17 @@ void ImGuiVisitor::visit (MediaSource& s)
|
||||
UserInterface::manager().showSourceEditor(&s);
|
||||
top.x += ImGui::GetFrameHeight();
|
||||
}
|
||||
}
|
||||
else
|
||||
info.reset();
|
||||
|
||||
ImGui::SetCursorPos(top);
|
||||
if (ImGuiToolkit::IconButton(ICON_FA_FOLDER_OPEN, "Show in finder"))
|
||||
SystemToolkit::open(SystemToolkit::path_filename(s.path()));
|
||||
|
||||
if ( info.str().size() > 150 ) {
|
||||
top.y += 2.f * ImGui::GetFrameHeight();
|
||||
ImGui::SetCursorPos(top);
|
||||
if (ImGuiToolkit::IconButton(ICON_FA_COPY, "Copy"))
|
||||
if (ImGuiToolkit::IconButton(ICON_FA_FOLDER_OPEN, "Show in finder"))
|
||||
SystemToolkit::open(SystemToolkit::path_filename(s.path()));
|
||||
|
||||
}
|
||||
else {
|
||||
ImGui::SetCursorPos(top);
|
||||
if (ImGuiToolkit::IconButton(ICON_FA_COPY, "Copy message"))
|
||||
ImGui::SetClipboardText(info.str().c_str());
|
||||
info.reset();
|
||||
}
|
||||
|
||||
ImGui::SetCursorPos(botom);
|
||||
@@ -657,9 +655,6 @@ void ImGuiVisitor::visit (MediaSource& s)
|
||||
|
||||
void ImGuiVisitor::visit (SessionFileSource& s)
|
||||
{
|
||||
if (s.session() == nullptr)
|
||||
return;
|
||||
|
||||
ImVec2 top = ImGui::GetCursorPos();
|
||||
top.x = 0.5f * ImGui::GetFrameHeight() + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN;
|
||||
|
||||
@@ -674,13 +669,7 @@ void ImGuiVisitor::visit (SessionFileSource& s)
|
||||
|
||||
ImVec2 botom = ImGui::GetCursorPos();
|
||||
|
||||
if ( !s.failed() ) {
|
||||
|
||||
if ( ImGui::Button( ICON_FA_SIGN_OUT_ALT " Import", ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
|
||||
Mixer::manager().import( &s );
|
||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||
ImGui::Text("Sources");
|
||||
|
||||
if ( !s.failed() && s.session() != nullptr && s.session()->ready()) {
|
||||
// versions
|
||||
SessionSnapshots *versions = s.session()->snapshots();
|
||||
if (versions->keys_.size()>0) {
|
||||
@@ -701,23 +690,33 @@ void ImGuiVisitor::visit (SessionFileSource& s)
|
||||
}
|
||||
|
||||
// fading
|
||||
if (ImGuiToolkit::IconButton(2, 1)) s.session()->setFadingTarget(0.f);
|
||||
std::ostringstream oss;
|
||||
int f = 100 - int(s.session()->fading() * 100.f);
|
||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||
if (ImGui::SliderInt("Fading", &f, 0, 100, f > 99 ? "None" : "%d %%") )
|
||||
if (ImGui::SliderInt("##Fading", &f, 0, 100, f > 99 ? "None" : "%d %%") )
|
||||
s.session()->setFadingTarget( float(100 - f) * 0.01f );
|
||||
if (ImGui::IsItemDeactivatedAfterEdit()){
|
||||
std::ostringstream oss;
|
||||
oss << s.name() << ": Fading " << f << " %";
|
||||
Action::manager().store(oss.str());
|
||||
}
|
||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||
if (ImGuiToolkit::TextButton("Fading")) {
|
||||
s.session()->setFadingTarget(0.f);
|
||||
oss << s.name() << ": Fading 0 %";
|
||||
Action::manager().store(oss.str());
|
||||
}
|
||||
|
||||
// import
|
||||
if ( ImGui::Button( ICON_FA_FILE_EXPORT " Import all", ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
|
||||
Mixer::manager().import( &s );
|
||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||
ImGui::Text("Sources");
|
||||
|
||||
// file open
|
||||
if ( ImGui::Button( ICON_FA_FILE_UPLOAD " Open", ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
|
||||
Mixer::manager().set( s.detach() );
|
||||
ImGui::SameLine(0, IMGUI_SAME_LINE);
|
||||
ImGui::Text("File");
|
||||
ImGui::Text("Session");
|
||||
|
||||
botom = ImGui::GetCursorPos();
|
||||
|
||||
@@ -729,17 +728,14 @@ void ImGuiVisitor::visit (SessionFileSource& s)
|
||||
top.x += ImGui::GetFrameHeight();
|
||||
}
|
||||
|
||||
ImGui::SetCursorPos(top);
|
||||
if (ImGuiToolkit::IconButton(ICON_FA_FOLDER_OPEN, "Show in finder"))
|
||||
SystemToolkit::open(SystemToolkit::path_filename(s.path()));
|
||||
}
|
||||
else
|
||||
info.reset();
|
||||
|
||||
ImGui::SetCursorPos(top);
|
||||
|
||||
if (ImGuiToolkit::IconButton(ICON_FA_FOLDER_OPEN, "Show in finder"))
|
||||
SystemToolkit::open(SystemToolkit::path_filename(s.path()));
|
||||
|
||||
ImGui::SetCursorPos(botom);
|
||||
|
||||
}
|
||||
|
||||
void ImGuiVisitor::visit (SessionGroupSource& s)
|
||||
|
||||
@@ -91,7 +91,7 @@ void InfoVisitor::visit(MediaPlayer &mp)
|
||||
|
||||
std::ostringstream oss;
|
||||
if (mp.failed()) {
|
||||
oss << mp.filename() << std::endl << mp.log();
|
||||
oss << mp.filename() << std::endl << std::endl << mp.log();
|
||||
}
|
||||
else {
|
||||
if (brief_) {
|
||||
@@ -142,11 +142,12 @@ void InfoVisitor::visit (MediaSource& s)
|
||||
|
||||
void InfoVisitor::visit (SessionFileSource& s)
|
||||
{
|
||||
if (current_id_ == s.id() || s.session() == nullptr)
|
||||
if (current_id_ == s.id())
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
if (s.session()->frame()){
|
||||
|
||||
if (s.session() != nullptr && s.session()->frame() != nullptr){
|
||||
uint N = s.session()->size();
|
||||
std::string numsource = std::to_string(N) + " source" + (N>1 ? "s" : "");
|
||||
uint T = s.session()->numSources();
|
||||
@@ -163,6 +164,9 @@ void InfoVisitor::visit (SessionFileSource& s)
|
||||
oss << s.session()->frame()->width() << " x " << s.session()->frame()->height();
|
||||
}
|
||||
}
|
||||
else {
|
||||
oss << s.path() << std::endl << std::endl << "Failed to load.";
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
@@ -170,20 +174,21 @@ void InfoVisitor::visit (SessionFileSource& s)
|
||||
|
||||
void InfoVisitor::visit (SessionGroupSource& s)
|
||||
{
|
||||
if (current_id_ == s.id() || s.session() == nullptr)
|
||||
if (current_id_ == s.id())
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
|
||||
if (!brief_) oss << "Bundle of ";
|
||||
uint N = s.session()->size();
|
||||
oss << N << " source" << (N>1 ? "s" : "");
|
||||
uint T = s.session()->numSources();
|
||||
if (T>N)
|
||||
oss << " (" << std::to_string(T) << " total)";
|
||||
oss << std::endl;
|
||||
if (s.session() && s.session()->frame()){
|
||||
|
||||
if (!brief_) oss << "Bundle of ";
|
||||
uint N = s.session()->size();
|
||||
oss << N << " source" << (N>1 ? "s" : "");
|
||||
uint T = s.session()->numSources();
|
||||
if (T>N)
|
||||
oss << " (" << std::to_string(T) << " total)";
|
||||
oss << std::endl;
|
||||
|
||||
if (s.session()->frame()){
|
||||
if (brief_) {
|
||||
oss << (s.session()->frame()->flags() & FrameBuffer::FrameBuffer_alpha ? "RGBA, " : "RGB, ");
|
||||
oss << s.session()->frame()->width() << " x " << s.session()->frame()->height();
|
||||
@@ -193,6 +198,9 @@ void InfoVisitor::visit (SessionGroupSource& s)
|
||||
oss << s.session()->frame()->width() << " x " << s.session()->frame()->height();
|
||||
}
|
||||
}
|
||||
else {
|
||||
oss << "Empty bundle.";
|
||||
}
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
@@ -217,6 +225,8 @@ void InfoVisitor::visit (RenderSource& s)
|
||||
oss << s.frame()->width() << " x " << s.frame()->height();
|
||||
}
|
||||
}
|
||||
else
|
||||
oss << "Undefined";
|
||||
|
||||
information_ = oss.str();
|
||||
current_id_ = s.id();
|
||||
@@ -224,7 +234,7 @@ void InfoVisitor::visit (RenderSource& s)
|
||||
|
||||
void InfoVisitor::visit (CloneSource& s)
|
||||
{
|
||||
if (current_id_ == s.id() && !s.failed())
|
||||
if (current_id_ == s.id())
|
||||
return;
|
||||
|
||||
std::ostringstream oss;
|
||||
|
||||
@@ -136,22 +136,22 @@ MediaInfo MediaPlayer::UriDiscoverer(const std::string &uri)
|
||||
GstDiscovererResult result = gst_discoverer_info_get_result (info);
|
||||
switch (result) {
|
||||
case GST_DISCOVERER_URI_INVALID:
|
||||
video_stream_info.log = "\nInvalid URI";
|
||||
video_stream_info.log = "Invalid URI";
|
||||
break;
|
||||
case GST_DISCOVERER_ERROR:
|
||||
video_stream_info.log = std::string( "\nError; " ) + err->message;
|
||||
video_stream_info.log = std::string( "Error; " ) + err->message;
|
||||
break;
|
||||
case GST_DISCOVERER_TIMEOUT:
|
||||
video_stream_info.log = "\nTimeout loading";
|
||||
video_stream_info.log = "Timeout loading";
|
||||
break;
|
||||
case GST_DISCOVERER_BUSY:
|
||||
video_stream_info.log = "\nBusy";
|
||||
video_stream_info.log = "Busy";
|
||||
break;
|
||||
case GST_DISCOVERER_MISSING_PLUGINS:
|
||||
{
|
||||
const GstStructure *s = gst_discoverer_info_get_misc (info);
|
||||
gchar *str = gst_structure_to_string (s);
|
||||
video_stream_info.log = std::string( "\nUnknown format; " ) + std::string(str);
|
||||
video_stream_info.log = std::string( "Unknown format; " ) + std::string(str);
|
||||
g_free (str);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4336,7 +4336,7 @@ void OutputPreview::Render()
|
||||
// Display list of active stream
|
||||
if (ls.size()>0 || videoBroadcastEnabled() || sharedMemoryEnabled() || loopbackCameraEnabled()) {
|
||||
ImGui::Separator();
|
||||
ImGui::MenuItem("Active streams", nullptr, false, false);
|
||||
ImGui::MenuItem("Active streams:", nullptr, false, false);
|
||||
|
||||
// First the list of peer 2 peer
|
||||
for (auto it = ls.begin(); it != ls.end(); ++it)
|
||||
|
||||
Reference in New Issue
Block a user