node: merge tooltip into data function

This commit is contained in:
itsmattkc
2023-02-27 18:12:28 -08:00
parent 82454c09c9
commit ec2ff82229
4 changed files with 43 additions and 71 deletions
+40 -41
View File
@@ -397,6 +397,46 @@ QVariant Footage::data(const DataType &d) const
return icon::Error;
}
case TOOLTIP:
{
if (valid_) {
QString tip = tr("Filename: %1").arg(filename());
int vp_sz = GetVideoStreamCount();
for (int i=0; i<vp_sz; i++) {
VideoParams p = GetVideoParams(i);
if (p.enabled()) {
tip.append("\n");
tip.append(DescribeVideoStream(p));
}
}
int ap_sz = GetAudioStreamCount();
for (int i=0; i<ap_sz; i++) {
AudioParams p = GetAudioParams(i);
if (p.enabled()) {
tip.append("\n");
tip.append(DescribeAudioStream(p));
}
}
int sp_sz = GetSubtitleStreamCount();
for (int i=0; i<sp_sz; i++) {
SubtitleParams p = GetSubtitleParams(i);
if (p.enabled()) {
tip.append("\n");
tip.append(DescribeSubtitleStream(p));
}
}
return tip;
} else {
return tr("Invalid");
}
}
default:
break;
}
@@ -404,47 +444,6 @@ QVariant Footage::data(const DataType &d) const
return super::data(d);
}
void Footage::UpdateTooltip()
{
if (valid_) {
QString tip = tr("Filename: %1").arg(filename());
int vp_sz = GetVideoStreamCount();
for (int i=0; i<vp_sz; i++) {
VideoParams p = GetVideoParams(i);
if (p.enabled()) {
tip.append("\n");
tip.append(DescribeVideoStream(p));
}
}
int ap_sz = GetAudioStreamCount();
for (int i=0; i<ap_sz; i++) {
AudioParams p = GetAudioParams(i);
if (p.enabled()) {
tip.append("\n");
tip.append(DescribeAudioStream(p));
}
}
int sp_sz = GetSubtitleStreamCount();
for (int i=0; i<sp_sz; i++) {
SubtitleParams p = GetSubtitleParams(i);
if (p.enabled()) {
tip.append("\n");
tip.append(DescribeSubtitleStream(p));
}
}
SetToolTip(tip);
} else {
SetToolTip(tr("Invalid"));
}
}
void Footage::Reprobe()
{
// Determine if file still exists
-16
View File
@@ -183,22 +183,6 @@ protected:
private:
QString GetColorspaceToUse(const VideoParams& params) const;
/**
* @brief Update the icon based on the Footage status
*
* For kUnprobed and kError an appropriate icon will be shown. For kReady, this function will determine what the
* dominant type of media in this Footage is (video/audio/image) and set the icon accordingly based on that.
*/
void UpdateIcon();
/**
* @brief Update the tooltip based on the Footage status
*
* For kUnprobed and kError, this sets an appropriate generic message. For kReady, this function will set
* basic information about the Footage in the tooltip (based on the results of a previous probe).
*/
void UpdateTooltip();
void Reprobe();
VideoParams MergeVideoStream(const VideoParams &base, const VideoParams &over);