actions_manager.hpp 3.24 KB
Newer Older
1
/*****************************************************************************
Pere Orga's avatar
Pere Orga committed
2
 * actions_manager.hpp : Controller for the main interface
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 ****************************************************************************
 * Copyright (C) 2006-2008 the VideoLAN team
 * $Id$
 *
 * Authors: 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.
 *****************************************************************************/

24 25
#ifndef QVLC_ACTIONS_MANAGER_H_
#define QVLC_ACTIONS_MANAGER_H_ 1
26 27 28 29 30

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

31
#include "qt.hpp"
32
#include "util/singleton.hpp"
33
#include <QVector>
34 35

#include <QObject>
36
#include <QTimer>
37 38
class QAction;

39 40 41 42 43 44 45 46 47 48
typedef enum actionType_e
{
    PLAY_ACTION,
    STOP_ACTION,
    OPEN_ACTION,
    PREVIOUS_ACTION,
    NEXT_ACTION,
    SLOWER_ACTION,
    FASTER_ACTION,
    FULLSCREEN_ACTION,
49
    FULLWIDTH_ACTION,
50 51 52 53 54 55 56 57 58
    EXTENDED_ACTION,
    PLAYLIST_ACTION,
    SNAPSHOT_ACTION,
    RECORD_ACTION,
    FRAME_ACTION,
    ATOB_ACTION,
    REVERSE_ACTION,
    SKIP_BACK_ACTION,
    SKIP_FW_ACTION,
59
    QUIT_ACTION,
60
    RANDOM_ACTION,
61
    LOOP_ACTION,
62
    INFO_ACTION,
63
    OPEN_SUB_ACTION,
64 65
} actionType_e;

66
class ActionsManager : public QObject, public Singleton<ActionsManager>
67 68 69
{

    Q_OBJECT
70 71
    friend class Singleton<ActionsManager>;

72 73 74
public:

private:
75
    ActionsManager( intf_thread_t  *_p_i );
76
    virtual ~ActionsManager();
77

78
    intf_thread_t* const p_intf;
79
    QVector<vlc_renderer_discovery_t*> m_rds;
80 81
    QTimer m_stop_scan_timer;
    bool m_scanning;
82

83 84 85 86
    static void renderer_event_item_added( vlc_renderer_discovery_t *,
                                           vlc_renderer_item_t * );
    static void renderer_event_item_removed( vlc_renderer_discovery_t *,
                                             vlc_renderer_item_t * );
87 88
    static vlc_renderer_item_t* compareRenderers( const QVariant &m_obj,
                                                  vlc_renderer_item_t* p_item );
89

90 91 92 93
public slots:
    void toggleMuteAudio();
    void AudioUp();
    void AudioDown();
94
    void play();
95
    void record();
96 97
    void skipForward();
    void skipBackward();
98 99 100
    void StartRendererScan();
    void RendererMenuCountdown();
    void StopRendererScan();
101
    void RendererSelected( QAction * );
102

103
protected slots:
104 105
    void onRendererItemAdded( vlc_renderer_item_t* );
    void onRendererItemRemoved( vlc_renderer_item_t* );
106 107
    void fullscreen();
    void snapshot();
108
    void playlist();
109 110
    void frame();

111
    virtual void doAction( int );
112 113 114 115

signals:
    void rendererItemAdded( vlc_renderer_item_t* );
    void rendererItemRemoved( vlc_renderer_item_t* );
116 117 118 119
};

#endif