#include <metadata-viewer.hpp>
Public Member Functions | |
| MetadataViewer (QWidget *parent=nullptr) | |
Private Slots | |
| void | analyzeFile () |
| Launch ffprobe against the current file and refresh the tree. | |
| void | browseFile () |
| Open a file picker and store the chosen path in the path field. | |
| void | copyCurrentTab () |
| Copy the currently selected tab's text (Markdown/HTML/Text) to the system clipboard. | |
Private Member Functions | |
| void | addJsonValue (QTreeWidgetItem *parent, const QString &key, const QJsonValue &value) |
| Recursively add a JSON value as a tree item. | |
| QString | buildHtml (const QJsonObject &root) const |
| Render an HTML-formatted summary of the metadata. | |
| QString | buildMarkdown (const QJsonObject &root) const |
| Render a Markdown-formatted summary of the metadata. | |
| QString | buildPlainText (const QJsonObject &root) const |
| Render a plain-text summary of the metadata. | |
| void | populateTree (const QJsonObject &root) |
| Populate the tree widget from a parsed ffprobe JSON object. | |
| void | updateCopyButtonLabel () |
| Refresh the copy button label based on the active tab. | |
Private Attributes | |
| QPushButton * | analyzeButton = nullptr |
| QPushButton * | browseButton = nullptr |
| QPushButton * | closeButton = nullptr |
| QPushButton * | copyButton = nullptr |
| QPlainTextEdit * | htmlPreview = nullptr |
| int | htmlTabIndex = -1 |
| QPlainTextEdit * | markdownPreview = nullptr |
| int | markdownTabIndex = -1 |
| QLineEdit * | pathEdit = nullptr |
| QTabWidget * | tabs = nullptr |
| QPlainTextEdit * | textPreview = nullptr |
| int | textTabIndex = -1 |
| QTreeWidget * | tree = nullptr |
Definition at line 24 of file metadata-viewer.hpp.
|
explicit |
Definition at line 172 of file metadata-viewer.cpp.
References analyzeButton, analyzeFile(), acmx2::applyCustomStyleIfEnabled(), browseButton, browseFile(), closeButton, copyButton, copyCurrentTab(), htmlPreview, htmlTabIndex, markdownPreview, markdownTabIndex, pathEdit, tabs, textPreview, textTabIndex, tree, and updateCopyButtonLabel().
|
private |
Recursively add a JSON value as a tree item.
Definition at line 313 of file metadata-viewer.cpp.
References addJsonValue().
Referenced by addJsonValue(), and populateTree().
|
privateslot |
Launch ffprobe against the current file and refresh the tree.
Definition at line 264 of file metadata-viewer.cpp.
References buildHtml(), buildMarkdown(), buildPlainText(), copyButton, htmlPreview, markdownPreview, pathEdit, populateTree(), and textPreview.
Referenced by MetadataViewer().
|
privateslot |
Open a file picker and store the chosen path in the path field.
Definition at line 256 of file metadata-viewer.cpp.
References pathEdit.
Referenced by MetadataViewer().
|
private |
Render an HTML-formatted summary of the metadata.
Definition at line 429 of file metadata-viewer.cpp.
Referenced by analyzeFile().
|
private |
Render a Markdown-formatted summary of the metadata.
Definition at line 375 of file metadata-viewer.cpp.
Referenced by analyzeFile().
|
private |
Render a plain-text summary of the metadata.
Definition at line 496 of file metadata-viewer.cpp.
Referenced by analyzeFile().
|
privateslot |
Copy the currently selected tab's text (Markdown/HTML/Text) to the system clipboard.
Definition at line 566 of file metadata-viewer.cpp.
References htmlPreview, htmlTabIndex, markdownPreview, markdownTabIndex, tabs, textPreview, and textTabIndex.
Referenced by MetadataViewer().
|
private |
Populate the tree widget from a parsed ffprobe JSON object.
Definition at line 333 of file metadata-viewer.cpp.
References addJsonValue(), and tree.
Referenced by analyzeFile().
|
private |
Refresh the copy button label based on the active tab.
Definition at line 242 of file metadata-viewer.cpp.
References copyButton, htmlTabIndex, markdownTabIndex, tabs, and textTabIndex.
Referenced by MetadataViewer().
|
private |
Definition at line 54 of file metadata-viewer.hpp.
Referenced by MetadataViewer().
|
private |
Definition at line 53 of file metadata-viewer.hpp.
Referenced by MetadataViewer().
|
private |
Definition at line 56 of file metadata-viewer.hpp.
Referenced by MetadataViewer().
|
private |
Definition at line 55 of file metadata-viewer.hpp.
Referenced by analyzeFile(), MetadataViewer(), and updateCopyButtonLabel().
|
private |
Definition at line 60 of file metadata-viewer.hpp.
Referenced by analyzeFile(), copyCurrentTab(), and MetadataViewer().
|
private |
Definition at line 63 of file metadata-viewer.hpp.
Referenced by copyCurrentTab(), MetadataViewer(), and updateCopyButtonLabel().
|
private |
Definition at line 59 of file metadata-viewer.hpp.
Referenced by analyzeFile(), copyCurrentTab(), and MetadataViewer().
|
private |
Definition at line 62 of file metadata-viewer.hpp.
Referenced by copyCurrentTab(), MetadataViewer(), and updateCopyButtonLabel().
|
private |
Definition at line 52 of file metadata-viewer.hpp.
Referenced by analyzeFile(), browseFile(), and MetadataViewer().
|
private |
Definition at line 58 of file metadata-viewer.hpp.
Referenced by copyCurrentTab(), MetadataViewer(), and updateCopyButtonLabel().
|
private |
Definition at line 61 of file metadata-viewer.hpp.
Referenced by analyzeFile(), copyCurrentTab(), and MetadataViewer().
|
private |
Definition at line 64 of file metadata-viewer.hpp.
Referenced by copyCurrentTab(), MetadataViewer(), and updateCopyButtonLabel().
|
private |
Definition at line 57 of file metadata-viewer.hpp.
Referenced by MetadataViewer(), and populateTree().