CreateTrackSessionCommand

Stores tracksession creation parameters and information about the new tracksession.

Synopsis:

#include <qplayer/qplayer.h>

namespace QPlayer {

    class CreateTrackSessionCommand : public BaseCommand
    {
        Q_OBJECT

    public:

        explicit CreateTrackSessionCommand( 
                                    int mediaSourceId, 
                                    QString mediaNodeId, 
                                    int index = 0, 
                                    int limit = -1 );
    
        inline TrackSession result()
        {
            return m_result;
        }
    
        inline void setResult( TrackSession result )
        {
            m_result = result;
        }
    
        int mediaSourceId() const;

        QString mediaNodeId() const;

        int index() const;

        int limit() const;
    
    signals:

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

}

Library:

libqplayer

Description:

Stores tracksession creation parameters and information about the new tracksession. A tracksession is a sequence of playable tracks. When creating a CreateTrackSessionCommand object, you must provide the IDs of the "base" media node, which is used to populate the tracksession, and of the media source that the base node is located on. The exact behavior of tracksession creation depends on the type of the base node and the mm-player configuration. For more information, see the mm_player_create_trksession() method in the Multimedia Player Developer's Guide.

You can also specify the index of the track to be played first and provide a limit on how many items can be stored in the tracksession. These two settings apply only to folders.

When the underlying player has finished creating the tracksession, the CreateTrackSessionCommand object emits a complete signal to notify clients that the tracksession has been created. Clients can then call the result() method to retrieve information about the new tracksession. Note that the tracksession object doesn't contain the actual tracks, but rather an ID that you can pass into the QPlayer::getTrackSessionItems() function to retrieve the media nodes of the tracks.

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