ACMX 2.139.0
Dual-Backend Real-Time GPU Video Synthesis
Loading...
Searching...
No Matches
MetadataViewer Class Reference

#include <metadata-viewer.hpp>

Inheritance diagram for MetadataViewer:

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

Detailed Description

Definition at line 24 of file metadata-viewer.hpp.

Constructor & Destructor Documentation

◆ MetadataViewer()

Member Function Documentation

◆ addJsonValue()

void MetadataViewer::addJsonValue ( QTreeWidgetItem * parent,
const QString & key,
const QJsonValue & value )
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().

◆ analyzeFile

void MetadataViewer::analyzeFile ( )
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().

◆ browseFile

void MetadataViewer::browseFile ( )
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().

◆ buildHtml()

QString MetadataViewer::buildHtml ( const QJsonObject & root) const
private

Render an HTML-formatted summary of the metadata.

Definition at line 429 of file metadata-viewer.cpp.

Referenced by analyzeFile().

◆ buildMarkdown()

QString MetadataViewer::buildMarkdown ( const QJsonObject & root) const
private

Render a Markdown-formatted summary of the metadata.

Definition at line 375 of file metadata-viewer.cpp.

Referenced by analyzeFile().

◆ buildPlainText()

QString MetadataViewer::buildPlainText ( const QJsonObject & root) const
private

Render a plain-text summary of the metadata.

Definition at line 496 of file metadata-viewer.cpp.

Referenced by analyzeFile().

◆ copyCurrentTab

void MetadataViewer::copyCurrentTab ( )
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().

◆ populateTree()

void MetadataViewer::populateTree ( const QJsonObject & root)
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().

◆ updateCopyButtonLabel()

void MetadataViewer::updateCopyButtonLabel ( )
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().

Member Data Documentation

◆ analyzeButton

QPushButton* MetadataViewer::analyzeButton = nullptr
private

Definition at line 54 of file metadata-viewer.hpp.

Referenced by MetadataViewer().

◆ browseButton

QPushButton* MetadataViewer::browseButton = nullptr
private

Definition at line 53 of file metadata-viewer.hpp.

Referenced by MetadataViewer().

◆ closeButton

QPushButton* MetadataViewer::closeButton = nullptr
private

Definition at line 56 of file metadata-viewer.hpp.

Referenced by MetadataViewer().

◆ copyButton

QPushButton* MetadataViewer::copyButton = nullptr
private

Definition at line 55 of file metadata-viewer.hpp.

Referenced by analyzeFile(), MetadataViewer(), and updateCopyButtonLabel().

◆ htmlPreview

QPlainTextEdit* MetadataViewer::htmlPreview = nullptr
private

Definition at line 60 of file metadata-viewer.hpp.

Referenced by analyzeFile(), copyCurrentTab(), and MetadataViewer().

◆ htmlTabIndex

int MetadataViewer::htmlTabIndex = -1
private

Definition at line 63 of file metadata-viewer.hpp.

Referenced by copyCurrentTab(), MetadataViewer(), and updateCopyButtonLabel().

◆ markdownPreview

QPlainTextEdit* MetadataViewer::markdownPreview = nullptr
private

Definition at line 59 of file metadata-viewer.hpp.

Referenced by analyzeFile(), copyCurrentTab(), and MetadataViewer().

◆ markdownTabIndex

int MetadataViewer::markdownTabIndex = -1
private

Definition at line 62 of file metadata-viewer.hpp.

Referenced by copyCurrentTab(), MetadataViewer(), and updateCopyButtonLabel().

◆ pathEdit

QLineEdit* MetadataViewer::pathEdit = nullptr
private

Definition at line 52 of file metadata-viewer.hpp.

Referenced by analyzeFile(), browseFile(), and MetadataViewer().

◆ tabs

QTabWidget* MetadataViewer::tabs = nullptr
private

Definition at line 58 of file metadata-viewer.hpp.

Referenced by copyCurrentTab(), MetadataViewer(), and updateCopyButtonLabel().

◆ textPreview

QPlainTextEdit* MetadataViewer::textPreview = nullptr
private

Definition at line 61 of file metadata-viewer.hpp.

Referenced by analyzeFile(), copyCurrentTab(), and MetadataViewer().

◆ textTabIndex

int MetadataViewer::textTabIndex = -1
private

Definition at line 64 of file metadata-viewer.hpp.

Referenced by copyCurrentTab(), MetadataViewer(), and updateCopyButtonLabel().

◆ tree

QTreeWidget* MetadataViewer::tree = nullptr
private

Definition at line 57 of file metadata-viewer.hpp.

Referenced by MetadataViewer(), and populateTree().


The documentation for this class was generated from the following files: