Skip to content
Snippets Groups Projects
vlm.hpp 5.59 KiB
Newer Older
/*****************************************************************************
 ****************************************************************************
 * Copyright ( C ) 2006 the VideoLAN team
 *
 * Authors: Jean-François Massol <jf.massol@gmail.com>
 *          Jean-Baptiste Kempf <jb@videolan.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * ( at your option ) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef QVLC_VLM_DIALOG_H_
#define QVLC_VLM_DIALOG_H_ 1
Christophe Mutricy's avatar
Christophe Mutricy committed
# include "config.h"
/* Auto-generated from .ui files */
#include "ui_vlm.h"

#include "widgets/native/qvlcframe.hpp"
#include "util/singleton.hpp"
enum{
    QVLM_Broadcast,
enum{
    ControlBroadcastPlay,
    ControlBroadcastPause,
    ControlBroadcastStop,
    ControlBroadcastSeek
};

class QComboBox;
class QVBoxLayout;
class QLabel;
class QGridLayout;
class QToolButton;
class QGroupBox;
class VLMDialog : public QVLCFrame, public Singleton<VLMDialog>
    Q_OBJECT
    VLMDialog( intf_thread_t * );
    virtual ~VLMDialog();

ivoire's avatar
ivoire committed
    QString inputOptions;

    int currentIndex;

    QVBoxLayout *vlmItemLayout;
    QWidget *vlmItemWidget;
    QComboBox *mediatype;
    QDateTimeEdit *time, *date, *repeatTime;
    QSpinBox *scherepeatnumber, *repeatDays;
    bool isNameGenuine( const QString& );
    void removeVLMItem( VLMAWidget * );
    void startModifyVLMItem( VLMAWidget * );
private slots:
    void addVLMItem();
    void clearWidgets();
    void saveModifications();
    void showScheduleWidget( int );
    void selectVLMItem( int );

    friend class    Singleton<VLMDialog>;
    VLMWrapper( vlm_t * );
    int GetMedias( vlm_media_t **& );

    void AddBroadcast( const QString&, const QString&,
                       const QString&, const QString&,
                       bool b_enabled = true, bool b_loop = false );
    void EditBroadcast( const QString&, const QString&,
ivoire's avatar
ivoire committed
                        const QString&, const QString&,
                        bool b_enabled = true, bool b_loop = false );
    void EditSchedule( const QString&, const QString&,
                       const QString&, const QString&,
                       QDateTime _schetime, QDateTime _schedate,
                       int _scherepeatnumber, int _repeatDays,
                       bool b_enabled = true, const QString& mux = "" );
    void AddSchedule( const QString&, const QString&,
                      const QString&, const QString&,
                      QDateTime _schetime, QDateTime _schedate,
                      int _scherepeatnumber, int _repeatDays,
                      bool b_enabled = true, const QString& mux = "" );

    void ControlBroadcast( const QString&, int, unsigned int seek = 0 );
    void EnableItem( const QString&, bool );

    void SaveConfig( const QString& );
    bool LoadConfig( const QString& );
    VLMAWidget( VLMWrapper *, const QString& name, const QString& input,
ivoire's avatar
ivoire committed
                const QString& inputOptions, const QString& output,
                bool _enable, VLMDialog *parent, int _type = QVLM_Broadcast );
ivoire's avatar
ivoire committed
    QString inputOptions;
    VLMWrapper *vlm;
    QGridLayout *objLayout;
private slots:
    virtual void modify();
    virtual void del();
    VLMBroadcast( VLMWrapper *, const QString& name, const QString& input,
ivoire's avatar
ivoire committed
                  const QString& inputOptions, const QString& output,
                  bool _enable, bool _loop, VLMDialog *parent );
    void update() Q_DECL_OVERRIDE;
private slots:
    void stop();
    void togglePlayPause();
    void toggleLoop();
    VLMSchedule( VLMWrapper *, const QString& name, const QString& input,
ivoire's avatar
ivoire committed
                 const QString& inputOptions, const QString& output,
                 QDateTime schetime, QDateTime schedate, int repeatnumber,
                 int repeatdays, bool enabled, VLMDialog *parent );
    QDateTime schetime;
    QDateTime schedate;
    int rNumber;
    int rDays;