X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Finput_manager.hpp;h=1e62627851496053ea195e439f05b8993a562db8;hb=88b4c402e279e9999c845cf69cab2665c2d31fda;hp=2560045f6bb09e52b33dffe38870a49f4cd4ea2b;hpb=e876396adcc8151303d3cf3e199922f1aaf4b380;p=vlc diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp index 2560045f6b..1e62627851 100644 --- a/modules/gui/qt4/input_manager.hpp +++ b/modules/gui/qt4/input_manager.hpp @@ -22,16 +22,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#ifndef _INPUT_MANAGER_H_ -#define _INPUT_MANAGER_H_ +#ifndef QVLC_INPUT_MANAGER_H_ +#define QVLC_INPUT_MANAGER_H_ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include -#include -#include #include "qt4.hpp" @@ -46,6 +44,7 @@ enum { ItemTitleChanged_Type, ItemRateChanged_Type, VolumeChanged_Type, + SoundMuteChanged_Type, ItemEsChanged_Type, ItemTeletextChanged_Type, InterfaceVoutUpdate_Type, @@ -58,8 +57,11 @@ enum { CachingEvent_Type, BookmarksChanged_Type, RecordingEvent_Type, -/* ProgramChanged_Type, - SignalChanged_Type, */ + ProgramChanged_Type, + RandomChanged_Type, + LoopChanged_Type, + RepeatChanged_Type, +/* SignalChanged_Type, */ FullscreenControlToggle_Type = QEvent::User + IMEventType + 20, FullscreenControlShow_Type, @@ -67,16 +69,44 @@ enum { FullscreenControlPlanHide_Type, }; +enum { NORMAL, /* loop: 0, repeat: 0 */ + REPEAT_ONE,/* loop: 1, repeat: 0 */ + REPEAT_ALL,/* loop: 0, repeat: 1 */ +}; + class IMEvent : public QEvent { friend class InputManager; public: - IMEvent( int type, int id ) : QEvent( (QEvent::Type)(type) ) - { i_id = id ; } ; - virtual ~IMEvent() {}; + IMEvent( int type, input_item_t *p_input = NULL ) + : QEvent( (QEvent::Type)(type) ) + { + if( (p_item = p_input) != NULL ) + vlc_gc_incref( p_item ); + } + virtual ~IMEvent() + { + if( p_item ) + vlc_gc_decref( p_item ); + } private: - int i_id; + input_item_t *p_item; +}; + +enum PLEventTypes +{ + PLItemAppended_Type = QEvent::User + PLEventType + 1, + PLItemRemoved_Type +}; + +class PLEvent : public QEvent +{ +public: + PLEvent( PLEventTypes t, int i, int p ) + : QEvent( (QEvent::Type)t ), i_item(i), i_parent(p) {} + int i_item; + int i_parent; }; class InputManager : public QObject @@ -102,11 +132,13 @@ public: void requestArtUpdate(); QString getName() { return oldName; } + static const QString decodeArtURL( input_item_t *p_item ); private: intf_thread_t *p_intf; input_thread_t *p_input; - int i_input_id; + vlc_object_t *p_input_vbi; + input_item_t *p_item; int i_old_playing_status; QString oldName; QString artUrl; @@ -129,14 +161,13 @@ private: void UpdateArt(); void UpdateInfo(); void UpdateMeta(); - void UpdateMeta(int); + void UpdateMeta(input_item_t *); void UpdateVout(); void UpdateAout(); void UpdateStats(); void UpdateCaching(); void UpdateRecord(); - - void AtoBLoop( int ); + void UpdateProgramEvent(); public slots: void setInput( input_thread_t * ); ///< Our controlled input changed @@ -145,8 +176,13 @@ public slots: void reverse(); void slower(); void faster(); + void littlefaster(); + void littleslower(); void normalRate(); void setRate( int ); + /* Jumping */ + void jumpFwd(); + void jumpBwd(); /* Menus */ void sectionNext(); void sectionPrev(); @@ -160,20 +196,21 @@ public slots: private slots: void togglePlayPause(); + void AtoBLoop( float, int64_t, int ); signals: /// Send new position, new time and new length - void positionUpdated( float , int, int ); + void positionUpdated( float , int64_t, int ); void rateChanged( int ); - void nameChanged( QString ); + void nameChanged( const QString& ); /// Used to signal whether we should show navigation buttons void titleChanged( bool ); void chapterChanged( bool ); /// Statistics are updated void statisticsUpdated( input_item_t* ); void infoChanged( input_item_t* ); - void metaChanged( input_item_t* ); - void metaChanged( int ); + void currentMetaChanged( input_item_t* ); + void metaChanged( input_item_t *); void artChanged( QString ); /// Play/pause status void statusChanged( int ); @@ -192,9 +229,8 @@ signals: void synchroChanged(); void bookmarksChanged(); void cachingChanged( float ); -#if 0 + /// Program Event changes void encryptionChanged( bool ); -#endif }; class MainInputManager : public QObject @@ -209,18 +245,20 @@ public: } static void killInstance() { - if( instance ) delete instance; + delete instance; + instance = NULL; } - virtual ~MainInputManager(); - input_thread_t *getInput() { return p_input; }; - InputManager *getIM() { return im; }; + input_thread_t *getInput() { return p_input; } + InputManager *getIM() { return im; } vout_thread_t* getVout(); aout_instance_t *getAout(); private: MainInputManager( intf_thread_t * ); + virtual ~MainInputManager(); + static MainInputManager *instance; void customEvent( QEvent * ); @@ -229,15 +267,27 @@ private: input_thread_t *p_input; intf_thread_t *p_intf; + void notifyRepeatLoop(); public slots: void togglePlayPause(); + void play(); + void pause(); + void toggleRandom(); void stop(); void next(); void prev(); + void activatePlayQuit( bool ); + + void loopRepeatLoopStatus(); signals: void inputChanged( input_thread_t * ); void volumeChanged(); + void soundMuteChanged(); + void playlistItemAppended( int itemId, int parentId ); + void playlistItemRemoved( int itemId ); + void randomChanged( bool ); + void repeatLoopChanged( int ); }; #endif