Commit 1fa283fd authored by Clément Stenac's avatar Clément Stenac

Some progress

parent 79854934
...@@ -16,7 +16,8 @@ TOMOC = main_interface \ ...@@ -16,7 +16,8 @@ TOMOC = main_interface \
input_manager \ input_manager \
dialogs/playlist \ dialogs/playlist \
dialogs/streaminfo \ dialogs/streaminfo \
components/infopanels components/infopanels \
util/input_slider
MOCCPP := $(TOMOC:%=%.moc.cpp) MOCCPP := $(TOMOC:%=%.moc.cpp)
if ENABLE_QT4 if ENABLE_QT4
...@@ -28,7 +29,8 @@ BUILT_SOURCES += \ ...@@ -28,7 +29,8 @@ BUILT_SOURCES += \
input_manager.moc.cpp \ input_manager.moc.cpp \
dialogs/playlist.moc.cpp \ dialogs/playlist.moc.cpp \
dialogs/streaminfo.moc.cpp \ dialogs/streaminfo.moc.cpp \
components/infopanels.moc.cpp components/infopanels.moc.cpp \
util/input_slider.moc.cpp
$(MOCCPP): %.moc.cpp: %.hpp $(MOCCPP): %.moc.cpp: %.hpp
@echo "MOC $< -> $@" @echo "MOC $< -> $@"
...@@ -46,7 +48,8 @@ nodist_SOURCES_qt4 = \ ...@@ -46,7 +48,8 @@ nodist_SOURCES_qt4 = \
input_manager.moc.cpp \ input_manager.moc.cpp \
dialogs/playlist.moc.cpp \ dialogs/playlist.moc.cpp \
dialogs/streaminfo.moc.cpp \ dialogs/streaminfo.moc.cpp \
components/infopanels.moc.cpp components/infopanels.moc.cpp \
util/input_slider.moc.cpp
endif endif
...@@ -56,7 +59,8 @@ SOURCES_qt4 = qt4.cpp \ ...@@ -56,7 +59,8 @@ SOURCES_qt4 = qt4.cpp \
input_manager.cpp \ input_manager.cpp \
dialogs/playlist.cpp \ dialogs/playlist.cpp \
dialogs/streaminfo.cpp \ dialogs/streaminfo.cpp \
components/infopanels.cpp components/infopanels.cpp \
util/input_slider.cpp
$(NULL) $(NULL)
EXTRA_DIST += \ EXTRA_DIST += \
...@@ -67,4 +71,5 @@ EXTRA_DIST += \ ...@@ -67,4 +71,5 @@ EXTRA_DIST += \
dialogs/playlist.hpp \ dialogs/playlist.hpp \
dialogs/streaminfo.hpp \ dialogs/streaminfo.hpp \
components/infopanels.hpp \ components/infopanels.hpp \
util/input_slider.hpp \
ui/input_stats.ui ui/input_stats.ui
...@@ -36,13 +36,16 @@ StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf ) : QVLCFrame( p_intf ...@@ -36,13 +36,16 @@ StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf ) : QVLCFrame( p_intf
fprintf( stderr, "CONNECTING\n"); fprintf( stderr, "CONNECTING\n");
QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer, SIGNAL( timeout() ), DialogsProvider::getInstance(NULL), SLOT( messagesDialog() )) ;
QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer, SIGNAL( timeout() ), this, SLOT(update() ) );
fprintf( stderr, "Done\n"); fprintf( stderr, "Done\n");
} }
void StreamInfoDialog::init()
{
QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer,
SIGNAL( timeout() ), this, SLOT(update() ) );
}
void StreamInfoDialog::update() void StreamInfoDialog::update()
{ {
fprintf( stderr, "timer\n"); fprintf( stderr, "timer\n");
......
...@@ -31,16 +31,22 @@ class StreamInfoDialog : public QVLCFrame ...@@ -31,16 +31,22 @@ class StreamInfoDialog : public QVLCFrame
public: public:
static StreamInfoDialog * getInstance( intf_thread_t *p_intf ) static StreamInfoDialog * getInstance( intf_thread_t *p_intf )
{ {
if( !instance) instance = new StreamInfoDialog( p_intf ); if( !instance)
{
instance = new StreamInfoDialog( p_intf );
instance->init();
}
return instance; return instance;
} }
virtual ~StreamInfoDialog(); virtual ~StreamInfoDialog();
private: private:
StreamInfoDialog( intf_thread_t * ); StreamInfoDialog( intf_thread_t * );
void init();
intf_thread_t *p_intf; intf_thread_t *p_intf;
static StreamInfoDialog *instance; static StreamInfoDialog *instance;
public slots: public slots:
void update(); void update();
}; };
......
...@@ -59,5 +59,4 @@ void InputManager::update() ...@@ -59,5 +59,4 @@ void InputManager::update()
f_pos = var_GetFloat( p_input, "position" ); f_pos = var_GetFloat( p_input, "position" );
emit positionUpdated( f_pos, i_time, i_length ); emit positionUpdated( f_pos, i_time, i_length );
} }
...@@ -33,7 +33,6 @@ class InputManager : public QObject ...@@ -33,7 +33,6 @@ class InputManager : public QObject
public: public:
InputManager( QObject *, intf_thread_t *); InputManager( QObject *, intf_thread_t *);
virtual ~InputManager(); virtual ~InputManager();
void setInput( input_thread_t * );
private: private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
...@@ -41,6 +40,7 @@ private: ...@@ -41,6 +40,7 @@ private:
public slots: public slots:
void update(); ///< Periodic updates void update(); ///< Periodic updates
void setInput( input_thread_t * ); ///< Our controlled input changed
void sliderUpdate( float ); ///< User dragged the slider. We get new pos void sliderUpdate( float ); ///< User dragged the slider. We get new pos
signals: signals:
/// Send new position, new time and new length /// Send new position, new time and new length
......
...@@ -21,12 +21,33 @@ ...@@ -21,12 +21,33 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
#include "main_interface.hpp" #include "main_interface.hpp"
#include "input_manager.hpp"
#include "dialogs_provider.hpp"
MainInterface::MainInterface( intf_thread_t *p_intf ) : QWidget( NULL ) MainInterface::MainInterface( intf_thread_t *p_intf ) : QWidget( NULL )
{ {
fprintf( stderr, "QT Main interface" ); fprintf( stderr, "QT Main interface\n" );
/* Init UI */
/* Init input manager */
}
void MainInterface::init()
{
/* Get timer updates */
QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer,
SIGNAL( timeout() ), this, SLOT(updateOnTimer() ) );
/* Tell input manager about the input changes */
QObject::connect( this, SIGNAL( inputChanged( input_thread_t * ) ),
main_input_manager, SLOT( setInput( input_thread_t * ) ) );
} }
MainInterface::~MainInterface() MainInterface::~MainInterface()
{ {
} }
void MainInterface::updateOnTimer()
{
}
...@@ -26,12 +26,19 @@ ...@@ -26,12 +26,19 @@
#include <vlc/intf.h> #include <vlc/intf.h>
#include <QWidget> #include <QWidget>
class InputManager;
class MainInterface : public QWidget class MainInterface : public QWidget
{ {
Q_OBJECT; Q_OBJECT;
public: public:
MainInterface( intf_thread_t *); MainInterface( intf_thread_t *);
virtual ~MainInterface(); virtual ~MainInterface();
void init();
private:
InputManager *main_input_manager;
private slots:
void updateOnTimer();
}; };
#endif #endif
/*****************************************************************************
* input_manager.cpp : Manage an input and interact with its GUI elements
****************************************************************************
* Copyright (C) 2000-2005 the VideoLAN team
* $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $
*
* Authors: Clément Stenac <zorglub@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.
*****************************************************************************/
#include "util/input_slider.hpp"
void InputSlider::init()
{
setMinimum( 0 );
setMaximum( 1000 );
setSingleStep( 2 );
setPageStep( 100 );
setTracking( true );
QObject::connect( this, SIGNAL( valueChanged(int) ), this,
SLOT( userDrag( int ) ) );
}
void InputSlider::setPosition( float pos, int a, int b )
{
setValue( (int)(pos * 1000.0 ) );
}
void InputSlider::userDrag( int new_value )
{
float f_pos = (float)(new_value)/1000.0;
emit positionUpdated( f_pos );
}
/*****************************************************************************
* input_slider.hpp : A slider that controls an input
****************************************************************************
* Copyright (C) 2000-2005 the VideoLAN team
* $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $
*
* Authors: Clément Stenac <zorglub@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 _INPUTSLIDER_H_
#define _INPUTSLIDER_H_
#include "util/directslider.hpp"
class InputSlider : public DirectSlider
{
Q_OBJECT
public:
InputSlider( QWidget *_parent ) : DirectSlider( _parent ) {};
InputSlider( Qt::Orientation q,QWidget *_parent ) : DirectSlider( q,_parent )
{};
virtual ~InputSlider() {};
void init();
public slots:
void setPosition( float, int, int );
private slots:
void userDrag( int );
signals:
void positionUpdated( float );
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment