node: merge tooltip into data function
This commit is contained in:
+2
-13
@@ -175,11 +175,6 @@ public:
|
||||
*/
|
||||
virtual QString Description() const;
|
||||
|
||||
const QString& ToolTip() const
|
||||
{
|
||||
return tooltip_;
|
||||
}
|
||||
|
||||
Folder* folder() const
|
||||
{
|
||||
return folder_;
|
||||
@@ -198,7 +193,8 @@ public:
|
||||
DURATION,
|
||||
CREATED_TIME,
|
||||
MODIFIED_TIME,
|
||||
FREQUENCY_RATE
|
||||
FREQUENCY_RATE,
|
||||
TOOLTIP
|
||||
};
|
||||
|
||||
virtual QVariant data(const DataType &d) const;
|
||||
@@ -1026,11 +1022,6 @@ protected:
|
||||
effect_input_ = input;
|
||||
}
|
||||
|
||||
void SetToolTip(const QString& s)
|
||||
{
|
||||
tooltip_ = s;
|
||||
}
|
||||
|
||||
void SetFlag(Flag f, bool on = true)
|
||||
{
|
||||
if (on) {
|
||||
@@ -1229,8 +1220,6 @@ private:
|
||||
|
||||
OutputConnections output_connections_;
|
||||
|
||||
QString tooltip_;
|
||||
|
||||
Folder* folder_;
|
||||
|
||||
QMap<InputElementPair, ValueHint> value_hints_;
|
||||
|
||||
@@ -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