File indexing completed on 2024-05-05 04:44:40

0001 /*  This file is part of the KDE project
0002     Copyright (C) 2006 Matthias Kretz <kretz@kde.org>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Lesser General Public
0006     License as published by the Free Software Foundation; either
0007     version 2.1 of the License, or (at your option) version 3, or any
0008     later version accepted by the membership of KDE e.V. (or its
0009     successor approved by the membership of KDE e.V.), Nokia Corporation 
0010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
0011     act as a proxy defined in Section 6 of version 3 of the license.
0012 
0013     This library is distributed in the hope that it will be useful,
0014     but WITHOUT ANY WARRANTY; without even the implied warranty of
0015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016     Lesser General Public License for more details.
0017 
0018     You should have received a copy of the GNU Lesser General Public 
0019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0020 
0021 */
0022 
0023 #ifndef PHONON_AVWRITER_H
0024 #define PHONON_AVWRITER_H
0025 
0026 #include "export.h"
0027 #include "../phonondefs.h"
0028 #include "../abstractaudiooutput.h"
0029 #include "../abstractvideooutput.h"
0030 
0031 namespace Phonon
0032 {
0033 namespace Experimental
0034 {
0035 
0036 class AvWriterPrivate;
0037 
0038 //TODO:
0039 // Container formats can support multiple audio, video and subtitle streams, a
0040 // control track (menus) and chapters. Anything else?
0041 // How should those features be mapped to this API? Multiple audio and video
0042 // streams should be covered already. Are the subtitle streams implicit
0043 // depending on the source material?
0044 // Chapters: call a method when to add a chapter? How does that map to a
0045 // specific frame/sample? Chapter support is probably overkill for Phonon.
0046 class PHONONEXPERIMENTAL_EXPORT AvWriter : public QObject
0047 {
0048     Q_OBJECT
0049     K_DECLARE_PRIVATE(AvWriter)
0050     Q_PROPERTY(ContainerFormat containerFormat READ containerFormat WRITE setContainerFormat)
0051     Q_PROPERTY(KUrl url READ url WRITE setUrl)
0052     public:
0053         /**
0054          * Standard QObject constructor.
0055          *
0056          * \param parent QObject parent
0057          */
0058         AvWriter(QObject *parent);
0059         
0060         KUrl url() const;
0061         setUrl(const KUrl &url);
0062 
0063         /**
0064          * Creates a new AudioWriter object to be used for sending the audio
0065          * data to this file
0066          *
0067          * \param streamName A name identifying the stream. Often this name is
0068          * used for the language identifier.
0069          *
0070          * \return Returns the new AudioWriter object or 0 if the container
0071          * format does not support multiple audio streams.
0072          */
0073         AudioWriter *addAudioStream(const QString &streamName);
0074         VideoWriter *addVideoStream(const QString &streamName);
0075 
0076         ContainerFormat containerFormat() const;
0077 
0078     public Q_SLOTS:
0079         void setContainerFormat(ContainerFormat format);
0080 };
0081 
0082 } // namespace Experimental
0083 } // namespace Phonon
0084 
0085 #endif // PHONON_AVWRITER_H
0086 // vim: sw=4 ts=4 tw=80