Commit 0166bb73 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Qt: add QVLCVariable::addCallback helper

parent 02746c1c
......@@ -67,6 +67,11 @@ void QVLCPointer::trigger (vlc_value_t, vlc_value_t cur)
emit pointerChanged (cur.p_address);
}
bool QVLCPointer::addCallback (QObject *tgt, const char *method,
Qt::ConnectionType type)
{
return tgt->connect (this, SIGNAL(pointerChanged(void *)), method, type);
}
QVLCInteger::QVLCInteger (vlc_object_t *obj, const char *varname, bool inherit)
: QVLCVariable (obj, varname, VLC_VAR_INTEGER, inherit)
......@@ -78,6 +83,12 @@ void QVLCInteger::trigger (vlc_value_t, vlc_value_t cur)
emit integerChanged (cur.i_int);
}
bool QVLCInteger::addCallback (QObject *tgt, const char *method,
Qt::ConnectionType type)
{
return tgt->connect (this, SIGNAL(integerChanged(int64_t)), method, type);
}
QVLCBool::QVLCBool (vlc_object_t *obj, const char *varname, bool inherit)
: QVLCVariable (obj, varname, VLC_VAR_BOOL, inherit)
{
......@@ -88,6 +99,12 @@ void QVLCBool::trigger (vlc_value_t, vlc_value_t cur)
emit boolChanged (cur.b_bool);
}
bool QVLCBool::addCallback (QObject *tgt, const char *method,
Qt::ConnectionType type)
{
return tgt->connect (this, SIGNAL(boolChanged(bool)), method, type);
}
QVLCFloat::QVLCFloat (vlc_object_t *obj, const char *varname, bool inherit)
: QVLCVariable (obj, varname, VLC_VAR_FLOAT, inherit)
{
......@@ -98,6 +115,12 @@ void QVLCFloat::trigger (vlc_value_t, vlc_value_t cur)
emit floatChanged (cur.f_float);
}
bool QVLCFloat::addCallback (QObject *tgt, const char *method,
Qt::ConnectionType type)
{
return tgt->connect (this, SIGNAL(floatChanged(float)), method, type);
}
QVLCString::QVLCString (vlc_object_t *obj, const char *varname, bool inherit)
: QVLCVariable (obj, varname, VLC_VAR_STRING, inherit)
{
......@@ -108,3 +131,9 @@ void QVLCString::trigger (vlc_value_t, vlc_value_t cur)
QString str = qfu(cur.psz_string);
emit stringChanged (str);
}
bool QVLCString::addCallback (QObject *tgt, const char *method,
Qt::ConnectionType type)
{
return tgt->connect (this, SIGNAL(stringChanged(QString)), method, type);
}
......@@ -51,6 +51,8 @@ private:
public:
QVLCPointer (vlc_object_t *, const char *, bool inherit = false);
bool addCallback (QObject *, const char *,
Qt::ConnectionType type = Qt::AutoConnection);
signals:
void pointerChanged (void *);
......@@ -64,6 +66,8 @@ private:
public:
QVLCInteger (vlc_object_t *, const char *, bool inherit = false);
bool addCallback (QObject *, const char *,
Qt::ConnectionType type = Qt::AutoConnection);
signals:
void integerChanged (int64_t);
......@@ -77,6 +81,8 @@ private:
public:
QVLCBool (vlc_object_t *, const char *, bool inherit = false);
bool addCallback (QObject *, const char *,
Qt::ConnectionType type = Qt::AutoConnection);
signals:
void boolChanged (bool);
......@@ -90,6 +96,8 @@ private:
public:
QVLCFloat (vlc_object_t *, const char *, bool inherit = false);
bool addCallback (QObject *, const char *,
Qt::ConnectionType type = Qt::AutoConnection);
signals:
void floatChanged (float);
......@@ -103,6 +111,8 @@ private:
public:
QVLCString (vlc_object_t *, const char *, bool inherit = false);
bool addCallback (QObject *, const char *,
Qt::ConnectionType type = Qt::AutoConnection);
signals:
void stringChanged (QString);
......
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