QTfrontend/util/LibavInteraction.h
author koda
Tue, 18 Jun 2013 22:10:06 +0200
branchwebgl
changeset 9254 d5f513019851
parent 9080 9b42757d7e71
child 9429 7a97a554ac80
permissions -rw-r--r--
rtl always static
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7897
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
     1
/*
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
     2
 * Hedgewars, a free turn based strategy game
9080
9b42757d7e71 bump copyright year for Andrey entries
unc0rr
parents: 7897
diff changeset
     3
 * Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com>
7897
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
     4
 *
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
     8
 *
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    12
 * GNU General Public License for more details.
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    13
 *
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    17
 */
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    18
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    19
#ifndef LIBAV_ITERACTION
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    20
#define LIBAV_ITERACTION
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    21
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    22
#include <QComboBox>
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    23
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    24
/**
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    25
 * @brief Class for interacting with ffmpeg/libav libraries
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    26
 *
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    27
 * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    28
 */
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    29
class LibavInteraction : public QObject
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    30
{
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    31
    Q_OBJECT;
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    32
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    33
    LibavInteraction();
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    34
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    35
public:
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    36
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    37
    static LibavInteraction & instance();
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    38
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    39
    // fill combo box with known file formats
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    40
    void fillFormats(QComboBox * pFormats);
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    41
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    42
    // fill combo boxes with known codecs for given formats
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    43
    void fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs);
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    44
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    45
    QString getExtension(const QString & format);
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    46
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    47
    // get information about file (duration, resolution etc) in multiline string
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    48
    QString getFileInfo(const QString & filepath);
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    49
};
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    50
5e7c0810f365 libav name refactor
koda
parents:
diff changeset
    51
#endif // LIBAV_ITERACTION