Commit 1fa283fd authored by zorglub's avatar zorglub

Some progress

parent 79854934
......@@ -16,7 +16,8 @@ TOMOC = main_interface \
input_manager \
dialogs/playlist \
dialogs/streaminfo \
components/infopanels
components/infopanels \
util/input_slider
MOCCPP := $(TOMOC:%=%.moc.cpp)
if ENABLE_QT4
......@@ -28,7 +29,8 @@ BUILT_SOURCES += \
input_manager.moc.cpp \
dialogs/playlist.moc.cpp \
dialogs/streaminfo.moc.cpp \
components/infopanels.moc.cpp
components/infopanels.moc.cpp \
util/input_slider.moc.cpp
$(MOCCPP): %.moc.cpp: %.hpp
@echo "MOC $< -> $@"
......@@ -46,7 +48,8 @@ nodist_SOURCES_qt4 = \
input_manager.moc.cpp \
dialogs/playlist.moc.cpp \
dialogs/streaminfo.moc.cpp \
components/infopanels.moc.cpp
components/infopanels.moc.cpp \
util/input_slider.moc.cpp
endif
......@@ -56,7 +59,8 @@ SOURCES_qt4 = qt4.cpp \
input_manager.cpp \
dialogs/playlist.cpp \
dialogs/streaminfo.cpp \
components/infopanels.cpp
components/infopanels.cpp \
util/input_slider.cpp
$(NULL)
EXTRA_DIST += \
......@@ -67,4 +71,5 @@ EXTRA_DIST += \
dialogs/playlist.hpp \
dialogs/streaminfo.hpp \
components/infopanels.hpp \
util/input_slider.hpp \
ui/input_stats.ui
......@@ -36,13 +36,16 @@ StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf ) : QVLCFrame( p_intf
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");
}
void StreamInfoDialog::init()
{
QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer,
SIGNAL( timeout() ), this, SLOT(update() ) );
}
void StreamInfoDialog::update()
{
fprintf( stderr, "timer\n");
......
......@@ -31,16 +31,22 @@ class StreamInfoDialog : public QVLCFrame
public:
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;
}
virtual ~StreamInfoDialog();
private:
StreamInfoDialog( intf_thread_t * );
void init();
intf_thread_t *p_intf;
static StreamInfoDialog *instance;
public slots:
void update();
void update();
};
......
......@@ -59,5 +59,4 @@ void InputManager::update()
f_pos = var_GetFloat( p_input, "position" );
emit positionUpdated( f_pos, i_time, i_length );
}
......@@ -33,7 +33,6 @@ class InputManager : public QObject
public:
InputManager( QObject *, intf_thread_t *);
virtual ~InputManager();
void setInput( input_thread_t * );
private:
intf_thread_t *p_intf;
......@@ -41,6 +40,7 @@ private:
public slots:
void update(); ///< Periodic updates
void setInput( input_thread_t * ); ///< Our controlled input changed
void sliderUpdate( float ); ///< User dragged the slider. We get new pos
signals:
/// Send new position, new time and new length
......
......@@ -21,12 +21,33 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
#include "main_interface.hpp"
#include "input_manager.hpp"
#include "dialogs_provider.hpp"
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()
{
}
void MainInterface::updateOnTimer()
{
}
......@@ -26,12 +26,19 @@
#include <vlc/intf.h>
#include <QWidget>
class InputManager;
class MainInterface : public QWidget
{
Q_OBJECT;
public:
MainInterface( intf_thread_t *);
virtual ~MainInterface();
void init();
private:
InputManager *main_input_manager;
private slots:
void updateOnTimer();
};
#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