Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

MediaNode Class Reference
(Phonon::MediaNode)
[Phonon module]

The MediaNode class is the base class for all nodes in a media graph. More...

 #include <Phonon>

Inherited by Phonon::AudioOutput, Phonon::Effect, Phonon::MediaObject, and Phonon::VideoWidget.

This class was introduced in Qt 4.4.

Public Functions


Detailed Description

The MediaNode class is the base class for all nodes in a media graph.

In all phonon applications, one builds a media graph consisting of MediaNodes. The graph will take multimedia content, e.g., from a file, as input. After its nodes have processed the multimedia, the graph will output the media again, e.g., to a sound card.

The multimedia content is streamed over Paths between the nodes in the graph. You can query the paths that are connected to a media node with inputPaths() and outputPaths().

You can check whether the node is implemented by the current backend by calling isValid(). This does not guarantee that an instance of the class works as expected, but that the backend has implemented functionality for the class.

Currently, Phonon has three media nodes: MediaObject, AudioOutput, and VideoWidget. Please refer to their class descriptions for details about their usage, and to find out which nodes can be connected to each other. See also Building Graphs in Phonon's overview document.

Two nodes are connected to each other using the Phonon::createPath() function. We show a code example below, in which we build a media graph for video playback and then query its media nodes for their Paths:

     Phonon::MediaObject *mediaObject = new Phonon::MediaObject;
     Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput;
     Phonon::VideoWidget *videoWidget = new Phonon::VideoWidget;

     Phonon::createPath(mediaObject, audioOutput);
     Phonon::createPath(mediaObject, videoWidget);

     QList<Phonon::Path> inputPaths =
         audioOutput->inputPaths();   // inputPaths = [ mediaObject ]
     QList<Phonon::Path> outputPaths =
         mediaObject->outputPaths(); // outputPaths = [ audioOutput, videoWidget ]

When you create a Phonon application, you will likely build the graph yourself. This makes isValid() the most useful function of this class. The other two functions help navigate the graph, which you do not need to do as you created the nodes yourself.

See also Phonon Overview, Phonon::MediaObject, Phonon::AudioOutput, and Phonon::VideoWidget.


Member Function Documentation

MediaNode::~MediaNode ()   [virtual]

Destroys the media node and any paths connecting it to other nodes.

QList<Path> MediaNode::inputPaths () const

Returns the paths that inputs multimedia to this media node.

See also outputPaths().

bool MediaNode::isValid () const

Returns true if the backend provides an implementation of this class; otherwise returns false.

This does not guarantee that instances of the class works as expected, but that the backend has implemented the functionality for this class. For instance, Qt's GStreamer backend will return true for instances of the AudioOutput class, even if there is a problem with GStreamer and it could not play sound.

QList<Path> MediaNode::outputPaths () const

Returns the paths to which this media node output media.

See also inputPaths().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 48
  4. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  5. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 13
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
Page suivante

Le Qt Developer Network au hasard

Logo

Compiler l'add-in Qt de Visual Studio

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web