--- /dev/null
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+Label
+{
+ anchors
+ {
+ left: parent.left
+ right: parent.right
+ margins: Theme.horizontalPageMargin
+ }
+
+ horizontalAlignment: Text.AlignHCenter
+ color: Theme.secondaryColor
+ font.pixelSize: Theme.fontSizeSmall
+}
wrapMode: Text.WordWrap
}
+ Column
+ {
+ width: parent.width
+ spacing: Theme.paddingSmall
+
+ StreamInfo
+ {
+ text: streamControl.videoSize.width+"×"+streamControl.videoSize.height+" @ "+streamControl.framerate.toFixed(2)+"fps"
+ }
+
+ StreamInfo
+ {
+ text: streamControl.videoCodec
+ }
+
+ StreamInfo
+ {
+ text: streamControl.audioCodec
+ }
+ }
+
Slider
{
id: slider
connect(&xc, &XinemaControl::title_changed, this, &StreamControlItem::title_changed);
connect(&xc, &XinemaControl::duration_changed, this, &StreamControlItem::duration_changed);
connect(&xc, &XinemaControl::position_changed, this, &StreamControlItem::position_changed);
+ connect(&xc, &XinemaControl::size_changed, this, &StreamControlItem::size_changed);
+ connect(&xc, &XinemaControl::framerate_changed, this, &StreamControlItem::framerate_changed);
+ connect(&xc, &XinemaControl::codecs_changed, this, &StreamControlItem::codecs_changed);
connect(&xc, &XinemaControl::channels_changed, this, &StreamControlItem::control_channels_changed);
connect(&xc, &XinemaControl::current_audio_channel_changed, this, &StreamControlItem::current_audio_channel_changed);
connect(&xc, &XinemaControl::current_spu_channel_changed, this, &StreamControlItem::current_spu_channel_changed);
emit title_changed();
emit duration_changed();
emit position_changed();
+ emit size_changed();
+ emit framerate_changed();
+ emit codecs_changed();
emit channels_changed();
emit current_audio_channel_changed();
emit current_spu_channel_changed();
return control->get_control().get_position();
}
+QSize StreamControlItem::get_video_size() const
+{
+ if(!control)
+ return QSize();
+
+ return control->get_control().get_video_size();
+}
+
+float StreamControlItem::get_framerate() const
+{
+ if(!control)
+ return 0.0f;
+
+ return control->get_control().get_framerate();
+}
+
+QString StreamControlItem::get_video_codec() const
+{
+ if(!control)
+ return QString();
+
+ return control->get_control().get_video_codec();
+}
+
+QString StreamControlItem::get_audio_codec() const
+{
+ if(!control)
+ return QString();
+
+ return control->get_control().get_audio_codec();
+}
+
QStringList StreamControlItem::get_audio_channels() const
{
if(!control)
Q_PROPERTY(QString title READ get_title NOTIFY title_changed)
Q_PROPERTY(float duration READ get_duration NOTIFY duration_changed)
Q_PROPERTY(float position READ get_position WRITE set_position NOTIFY position_changed)
+ Q_PROPERTY(QSize videoSize READ get_video_size NOTIFY size_changed)
+ Q_PROPERTY(float framerate READ get_framerate NOTIFY framerate_changed)
+ Q_PROPERTY(QString videoCodec READ get_video_codec NOTIFY codecs_changed)
+ Q_PROPERTY(QString audioCodec READ get_audio_codec NOTIFY codecs_changed)
Q_PROPERTY(QStringList audioChannels READ get_audio_channels NOTIFY channels_changed)
Q_PROPERTY(QStringList spuChannels READ get_spu_channels NOTIFY channels_changed)
Q_PROPERTY(int currentAudioChannel READ get_current_audio_channel WRITE select_audio_channel NOTIFY current_audio_channel_changed)
float get_duration() const;
void set_position(float);
float get_position() const;
+ QSize get_video_size() const;
+ float get_framerate() const;
+ QString get_video_codec() const;
+ QString get_audio_codec() const;
QStringList get_audio_channels() const;
QStringList get_spu_channels() const;
void select_audio_channel(int);
void title_changed();
void duration_changed();
void position_changed();
+ void size_changed();
+ void framerate_changed();
+ void codecs_changed();
void channels_changed();
void current_audio_channel_changed();
void current_spu_channel_changed();
playback_state(STOPPED),
duration(0.0f),
position(0.0f),
+ framerate(0.0f),
current_audio_channel(-1),
current_spu_channel(-1)
{
position = args.toFloat();
emit position_changed(position);
}
+ else if(keyword=="video_size")
+ {
+ space = args.indexOf(' ');
+ video_size = QSize(args.mid(0, space).toInt(), args.mid(space+1).toInt());
+ emit size_changed(video_size);
+ }
+ else if(keyword=="framerate")
+ {
+ framerate = args.toFloat();
+ emit framerate_changed(framerate);
+ }
+ else if(keyword=="video_codec")
+ {
+ video_codec = args;
+ emit codecs_changed(video_codec, audio_codec);
+ }
+ else if(keyword=="audio_codec")
+ {
+ audio_codec = args;
+ emit codecs_changed(video_codec, audio_codec);
+ }
else if(keyword=="audio_count")
resize_list(audio_channels, args.toInt());
else if(keyword=="audio")
#define XINEMACONTROL_H_
#include <QObject>
+#include <QSize>
#include <QTcpSocket>
class XinemaControl: public QObject
QString title;
float duration;
float position;
+ QSize video_size;
+ float framerate;
+ QString video_codec;
+ QString audio_codec;
QStringList audio_channels;
QStringList spu_channels;
int current_audio_channel;
const QString &get_title() const { return title; }
float get_duration() const { return duration; }
float get_position() const { return position; }
+ const QSize &get_video_size() const { return video_size; }
+ float get_framerate() const { return framerate; }
+ const QString &get_video_codec() const { return video_codec; }
+ const QString &get_audio_codec() const { return audio_codec; }
void play();
void seek(float);
void title_changed(const QString &);
void duration_changed(float);
void position_changed(float);
+ void size_changed(const QSize &);
+ void framerate_changed(float);
+ void codecs_changed(const QString &, const QString &);
void channels_changed();
void current_audio_channel_changed(int);
void current_spu_channel_changed(int);