MetadataCommand

Stores metadata retrieval parameters and metadata read from a media node.

Synopsis:

#include <qplayer/qplayer.h>

namespace QPlayer {

    class MetadataCommand : public BaseCommand
    {
        Q_OBJECT

    public:

        explicit MetadataCommand( int mediaSourceId, 
                                  QString mediaNodeId );

        ~MetadataCommand();
    
        inline QPlayer::Metadata result()
        {
            return m_result;
        }
    
        inline void setResult( QPlayer::Metadata result )
        {
            m_result = result;
        }
    
        int mediaSourceId() const;

        QString mediaNodeId() const;
    
    signals:

        void complete( MetadataCommand *command );
    
        void error( MetadataCommand *command );
    
    };

}

Library:

libqplayer

Description:

Stores metadata retrieval parameters and metadata read from a media node. Metadata includes a media node's creation details (e.g., artist name, genre, year of release), runtime information (e.g., track length), or display parameters (e.g., width, height). The exact metadata fields defined for a given media node depend on its type—audio, video, or photo. When creating a MetadataCommand object, you must specify the IDs of the media node from which you're reading metadata and of the media source on which the node is located.

When the underlying player has finished retrieving the metadata from a media node, the object emits a complete signal to notify clients that the metadata can now be read. Clients can then call the result() method to retrieve the metadata. Obtaining up-to-date metadata is useful for refreshing the HMI display when the user browses to or starts playing a new media file.

If the getMetadata() command fails, the object emits an error signal. You can then call errorMessage() to retrieve a QString describing the error.