Commit 776ba66b authored by Clément Stenac's avatar Clément Stenac

* Fix QT detection and make dist

* First dialog
* Start of input management
parent b1580c14
......@@ -4610,8 +4610,12 @@ enableqt4=false
AC_ARG_ENABLE(qt4,
[ --enable-qt4 QT 4 support (default disabled) ],
[if test "${enable_qt4}" = "yes"; then
VLC_ADD_PLUGINS([qt4])
enableqt4=true
PKG_CHECK_MODULES(QT4, QtCore QtGui,
[ VLC_ADD_PLUGINS([qt4])
enableqt4=true
VLC_ADD_LDFLAGS([qt4],[$QT4_LIBS])
VLC_ADD_CXXFLAGS([qt4],[$QT4_CFLAGS])],
[AC_MSG_WARN(QT4 library not found)])
fi])
AM_CONDITIONAL(ENABLE_QT4, test "$enableqt4" = "true")
......
TOUI = ui/file_open
## Howto
# For each Q_OBJECT:
# - Add it without extension to TOMOC
# - Add the moc.cpp to BUILT_SOURCES and nodist_SOURCES_qt4
# - Add the cpp to SOURCES_qt4
# - Add the hpp to EXTRA_DIST
# For each UI
# - Add it without extension to TOUI
# - Add it to EXTRA_DIST
TOUI = ui/input_stats
UIH := $(TOUI:%=%.h)
TOMOC = main_interface dialogs_provider dialogs/playlist
TOMOC = main_interface \
dialogs_provider \
input_manager
dialogs/playlist \
dialogs/streaminfo \
components/infopanels
MOCCPP := $(TOMOC:%=%.moc.cpp)
if ENABLE_QT4
BUILT_SOURCES += $(UIH)
BUILT_SOURCES += $(MOCCPP)
BUILT_SOURCES += \
main_interface.moc.cpp \
dialogs_provider.moc.cpp \
input_manager.moc.cpp \
dialogs/playlist.moc.cpp \
dialogs/streaminfo.moc.cpp \
components/infopanels.moc.cpp
$(MOCCPP): %.moc.cpp: %.hpp
@echo "MOC $< -> $@"
......@@ -15,22 +36,35 @@ $(MOCCPP): %.moc.cpp: %.hpp
$(UIH): %.h: %.ui
@echo "UIC $< -> $@"
uic -tr _ -o $@ $<
rm -f $@
echo "#define Q_(a,b) _(a)" > $@
uic -tr "Q_" $< >> $@
nodist_SOURCES_qt4 = \
main_interface.moc.cpp \
dialogs_provider.moc.cpp \
input_manager.moc.cpp \
dialogs/playlist.moc.cpp \
dialogs/streaminfo.moc.cpp \
components/infopanels.moc.cpp
endif
SOURCES_qt4 = qt4.cpp \
main_interface.cpp \
dialogs_provider.cpp \
input_manager.cpp \
dialogs/playlist.cpp \
main_interface.moc.cpp \
dialogs_provider.moc.cpp \
dialogs/playlist.moc.cpp
dialogs/streaminfo.cpp \
components/infopanels.cpp
$(NULL)
# Why do I have to put it manually ??
EXTRA_DIST += \
qt4.hpp \
main_interface.hpp \
dialogs_provider.hpp
dialogs_provider.hpp \
input_manager.hpp \
dialogs/playlist.hpp \
dialogs/streaminfo.hpp \
components/infopanels.hpp \
ui/input_stats.ui
/*****************************************************************************
* infopanels.cpp : Panels for the information dialogs
****************************************************************************
* 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 "components/infopanels.hpp"
#include "qt4.hpp"
#include "ui/input_stats.h"
#include <QWidget>
InputStatsPanel::InputStatsPanel( QWidget *parent, intf_thread_t *_p_intf ) :
QWidget( parent ), p_intf( _p_intf )
{
ui.setupUi( this );
}
InputStatsPanel::~InputStatsPanel()
{
}
void InputStatsPanel::Update( input_item_t *p_item )
{
vlc_mutex_lock( &p_item->p_stats->lock );
#define UPDATE( widget,format, calc... ) \
{ QString str; ui.widget->setText( str.sprintf( format, ## calc ) ); }
UPDATE( read_text, "%8.0f kB", (float)(p_item->p_stats->i_read_bytes)/1000);
vlc_mutex_unlock(& p_item->p_stats->lock );
}
/*****************************************************************************
* infopanels.hpp : Panels for the information dialogs
****************************************************************************
* 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 _INFOPANELS_H_
#define _INFOPANELS_H_
#include <vlc/vlc.h>
#include <QWidget>
#include "ui/input_stats.h"
class InputStatsPanel: public QWidget
{
Q_OBJECT;
public:
InputStatsPanel( QWidget *, intf_thread_t * );
virtual ~InputStatsPanel();
private:
intf_thread_t *p_intf;
Ui::InputStats ui;
public slots:
void Update( input_item_t * );
};
#endif
/*****************************************************************************
* streaminfo.cpp : Information about an item
****************************************************************************
* 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 "dialogs/streaminfo.hpp"
#include "dialogs_provider.hpp"
#include "util/qvlcframe.hpp"
#include "components/infopanels.hpp"
#include "qt4.hpp"
StreamInfoDialog *StreamInfoDialog::instance = NULL;
StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf ) : QVLCFrame( p_intf )
{
setWindowTitle( _("Stream information" ) );
// InputStatsPanel *ISP = new InputStatsPanel( this, 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::update()
{
fprintf( stderr, "timer\n");
}
StreamInfoDialog::~StreamInfoDialog()
{
}
/*****************************************************************************
* streaminfo.hpp : Information about a stream
****************************************************************************
* 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 _STREAMINFO_DIALOG_H_
#define _STREAMINFO_DIALOG_H_
#include "util/qvlcframe.hpp"
class StreamInfoDialog : public QVLCFrame
{
Q_OBJECT;
public:
static StreamInfoDialog * getInstance( intf_thread_t *p_intf )
{
if( !instance) instance = new StreamInfoDialog( p_intf );
return instance;
}
virtual ~StreamInfoDialog();
private:
StreamInfoDialog( intf_thread_t * );
intf_thread_t *p_intf;
static StreamInfoDialog *instance;
public slots:
void update();
};
#endif
......@@ -24,14 +24,21 @@
#include "qt4.hpp"
#include <QEvent>
#include "dialogs/playlist.hpp"
#include "dialogs/streaminfo.hpp"
#include <QApplication>
DialogsProvider* DialogsProvider::instance = NULL;
DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) : QObject(),
p_intf( _p_intf )
DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
QObject( NULL ), p_intf( _p_intf )
{
fprintf( stderr, "QT DP" );
idle_timer = new QTimer( this );
idle_timer->start( 0 );
fixed_timer = new QTimer( this );
fixed_timer->start( 100 /* milliseconds */ );
}
DialogsProvider::~DialogsProvider()
{
}
......@@ -59,15 +66,15 @@ void DialogsProvider::customEvent( QEvent *event )
case INTF_DIALOG_VIDEOPOPUPMENU:
case INTF_DIALOG_MISCPOPUPMENU:
popupMenu( de->i_dialog ); break;
case INTF_DIALOG_FILEINFO:
streaminfoDialog(); break;
case INTF_DIALOG_VLM:
case INTF_DIALOG_INTERACTION:
case INTF_DIALOG_BOOKMARKS:
case INTF_DIALOG_FILEINFO:
case INTF_DIALOG_WIZARD:
default:
fprintf( stderr, "Unimplemented dialog\n");
}
fprintf( stderr, "Showing dialog\n");
}
}
......@@ -80,12 +87,20 @@ void DialogsProvider::openDialog( int i_dialog )
{
}
void DialogsProvider::streaminfoDialog()
{
StreamInfoDialog::getInstance( p_intf )->toggleVisible();
QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer, SIGNAL( timeout() ), this, SLOT( prefsDialog() )) ;
}
void DialogsProvider::prefsDialog()
{
fprintf( stderr, "P\n");
}
void DialogsProvider::messagesDialog()
{
fprintf( stderr, "M\n");
}
void DialogsProvider::popupMenu( int i_dialog )
......
......@@ -24,6 +24,8 @@
#define _DIALOGS_PROVIDER_H_
#include <QObject>
#include <QTimer>
#include <QApplication>
#include <vlc/vlc.h>
class QEvent;
......@@ -34,19 +36,25 @@ class DialogsProvider : public QObject
public:
static DialogsProvider *getInstance( intf_thread_t *p_intf )
{
if( !instance) instance = new DialogsProvider( p_intf );
if( !instance )
instance = new DialogsProvider( p_intf );
return instance;
}
virtual ~DialogsProvider();
void init();
QTimer *idle_timer;
QTimer *fixed_timer;
protected:
void customEvent( QEvent *);
private:
DialogsProvider( intf_thread_t * );
DialogsProvider( intf_thread_t *);
intf_thread_t *p_intf;
static DialogsProvider *instance;
public slots:
void playlistDialog();
void streaminfoDialog();
void prefsDialog();
void messagesDialog();
void openDialog( int );
......
/*****************************************************************************
* 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 "input_manager.hpp"
#include "dialogs_provider.hpp"
#include "qt4.hpp"
InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
QObject( parent ), p_intf( _p_intf )
{
p_input = NULL;
/* Subscribe to updates */
QObject::connect( DialogsProvider::getInstance( p_intf )->fixed_timer,
SIGNAL( timeout() ), this, SLOT( update() ) );
}
InputManager::~InputManager()
{
}
void InputManager::setInput( input_thread_t *_p_input )
{
p_input = _p_input;
emit reset();
}
void InputManager::update()
{
if( !p_input || p_input->b_die ) return;
if( p_input->b_dead )
{
//emit statusChanged( 0 );
}
mtime_t i_length, i_time;
float f_pos;
i_length = var_GetTime( p_input, "length" ) / 1000000;
i_time = var_GetTime( p_input, "time") / 1000000;
f_pos = var_GetFloat( p_input, "position" );
emit positionUpdated( f_pos, i_time, i_length );
}
/*****************************************************************************
* input_manager.hpp : 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.
*****************************************************************************/
#ifndef _INPUT_MANAGER_H_
#define _INPUT_MANAGER_H_
#include <QObject>
#include <vlc/vlc.h>
class InputManager : public QObject
{
Q_OBJECT;
public:
InputManager( QObject *, intf_thread_t *);
virtual ~InputManager();
void setInput( input_thread_t * );
private:
intf_thread_t *p_intf;
input_thread_t *p_input;
public slots:
void update(); ///< Periodic updates
void sliderUpdate( float ); ///< User dragged the slider. We get new pos
signals:
/// Send new position, new time and new length
void positionUpdated( float , int, int );
void reset(); ///< Input changed, tell others to reset
};
#endif
......@@ -123,9 +123,12 @@ static void Init( intf_thread_t *p_intf )
p_mi->show();
}
DialogsProvider::getInstance( p_intf );
if( p_intf->pf_show_dialog )
vlc_thread_ready( p_intf );
app->setQuitOnLastWindowClosed( false );
app->exec();
}
......
......@@ -31,6 +31,7 @@ class QApplication;
class MainInterface;
class DialogsProvider;
struct intf_sys_t
{
QApplication *p_app;
......
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>InputStats</class>
<widget class="QWidget" name="InputStats" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>437</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<widget class="QGroupBox" name="groupBox" >
<property name="geometry" >
<rect>
<x>9</x>
<y>9</y>
<width>207</width>
<height>138</height>
</rect>
</property>
<property name="title" >
<string>Input</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="1" >
<widget class="QLabel" name="read_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QLabel" name="stream_bitrate_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="input_bitrate_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>Input bitrate</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Read at media</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Stream bitrate</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_7" >
<property name="text" >
<string>Demuxed</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLabel" name="demuxed_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_3" >
<property name="geometry" >
<rect>
<x>9</x>
<y>153</y>
<width>207</width>
<height>138</height>
</rect>
</property>
<property name="title" >
<string>Streaming</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="1" >
<widget class="QLabel" name="sent_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLabel" name="send_bitrate_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="sent_bytes_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_13" >
<property name="text" >
<string>Send bitrate</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_12" >
<property name="text" >
<string>Sent bytes</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label_11" >
<property name="text" >
<string>Sent packets</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_4" >
<property name="geometry" >
<rect>
<x>222</x>
<y>153</y>
<width>206</width>
<height>138</height>
</rect>
</property>
<property name="title" >
<string>Audio</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="1" >
<widget class="QLabel" name="alost_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="aplayed_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="adecoded_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_10" >
<property name="text" >
<string>Lost buffers</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_9" >
<property name="text" >
<string>Played buffers</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label_8" >
<property name="text" >
<string>Decoded blocks</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_2" >
<property name="geometry" >
<rect>
<x>222</x>
<y>9</y>
<width>206</width>
<height>138</height>
</rect>
</property>
<property name="title" >
<string>Video</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="0" >
<widget class="QLabel" name="label_6" >
<property name="text" >
<string>Lost frames</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLabel" name="vlost_frames" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Displayed frames</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Decoded blocks</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="vdecoded_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="vdisplayed_text" >
<property name="text" >
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
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