input_manager \
dialogs/playlist \
dialogs/streaminfo \
- components/infopanels
+ components/infopanels \
+ util/input_slider
MOCCPP := $(TOMOC:%=%.moc.cpp)
if ENABLE_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
$(MOCCPP): %.moc.cpp: %.hpp
@echo "MOC $< -> $@"
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
input_manager.cpp \
dialogs/playlist.cpp \
dialogs/streaminfo.cpp \
- components/infopanels.cpp
+ components/infopanels.cpp \
+ util/input_slider.cpp
$(NULL)
EXTRA_DIST += \
dialogs/playlist.hpp \
dialogs/streaminfo.hpp \
components/infopanels.hpp \
+ util/input_slider.hpp \
ui/input_stats.ui
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");
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();
};
f_pos = var_GetFloat( p_input, "position" );
emit positionUpdated( f_pos, i_time, i_length );
-
}
public:
InputManager( QObject *, intf_thread_t *);
virtual ~InputManager();
- void setInput( input_thread_t * );
private:
intf_thread_t *p_intf;
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
* 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()
+{
+
+}
#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
--- /dev/null
+/*****************************************************************************
+ * 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 );
+}
--- /dev/null
+/*****************************************************************************
+ * 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