node: merge tooltip into data function
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user