Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
02746c1c
Commit
02746c1c
authored
Apr 17, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: rationalize QVLCVariable and add missing classes
parent
bc2987f3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
31 deletions
+96
-31
modules/gui/qt4/dialogs/external.cpp
modules/gui/qt4/dialogs/external.cpp
+12
-12
modules/gui/qt4/dialogs/external.hpp
modules/gui/qt4/dialogs/external.hpp
+4
-4
modules/gui/qt4/variables.cpp
modules/gui/qt4/variables.cpp
+36
-7
modules/gui/qt4/variables.hpp
modules/gui/qt4/variables.hpp
+44
-8
No files found.
modules/gui/qt4/dialogs/external.cpp
View file @
02746c1c
...
@@ -50,17 +50,17 @@ DialogHandler::DialogHandler (intf_thread_t *p_intf, QObject *_parent)
...
@@ -50,17 +50,17 @@ DialogHandler::DialogHandler (intf_thread_t *p_intf, QObject *_parent)
connect
(
this
,
SIGNAL
(
error
(
const
QString
&
,
const
QString
&
)),
connect
(
this
,
SIGNAL
(
error
(
const
QString
&
,
const
QString
&
)),
SLOT
(
displayError
(
const
QString
&
,
const
QString
&
)));
SLOT
(
displayError
(
const
QString
&
,
const
QString
&
)));
connect
(
&
critical
,
SIGNAL
(
pointerChanged
(
v
lc_object_t
*
,
v
oid
*
)),
connect
(
&
critical
,
SIGNAL
(
pointerChanged
(
void
*
)),
SLOT
(
displayCritical
(
v
lc_object_t
*
,
v
oid
*
)),
SLOT
(
displayCritical
(
void
*
)),
Qt
::
BlockingQueuedConnection
);
Qt
::
BlockingQueuedConnection
);
connect
(
&
login
,
SIGNAL
(
pointerChanged
(
v
lc_object_t
*
,
v
oid
*
)),
connect
(
&
login
,
SIGNAL
(
pointerChanged
(
void
*
)),
SLOT
(
requestLogin
(
v
lc_object_t
*
,
v
oid
*
)),
SLOT
(
requestLogin
(
void
*
)),
Qt
::
BlockingQueuedConnection
);
Qt
::
BlockingQueuedConnection
);
connect
(
&
question
,
SIGNAL
(
pointerChanged
(
v
lc_object_t
*
,
v
oid
*
)),
connect
(
&
question
,
SIGNAL
(
pointerChanged
(
void
*
)),
SLOT
(
requestAnswer
(
v
lc_object_t
*
,
v
oid
*
)),
SLOT
(
requestAnswer
(
void
*
)),
Qt
::
BlockingQueuedConnection
);
Qt
::
BlockingQueuedConnection
);
connect
(
&
progressBar
,
SIGNAL
(
pointerChanged
(
v
lc_object_t
*
,
v
oid
*
)),
connect
(
&
progressBar
,
SIGNAL
(
pointerChanged
(
void
*
)),
SLOT
(
startProgressBar
(
v
lc_object_t
*
,
v
oid
*
)),
SLOT
(
startProgressBar
(
void
*
)),
Qt
::
BlockingQueuedConnection
);
Qt
::
BlockingQueuedConnection
);
connect
(
this
,
connect
(
this
,
SIGNAL
(
progressBarDestroyed
(
QWidget
*
)),
SIGNAL
(
progressBarDestroyed
(
QWidget
*
)),
...
@@ -93,7 +93,7 @@ void DialogHandler::displayError (const QString& title, const QString& message)
...
@@ -93,7 +93,7 @@ void DialogHandler::displayError (const QString& title, const QString& message)
ErrorsDialog
::
getInstance
(
intf
)
->
addError
(
title
,
message
);
ErrorsDialog
::
getInstance
(
intf
)
->
addError
(
title
,
message
);
}
}
void
DialogHandler
::
displayCritical
(
v
lc_object_t
*
,
v
oid
*
value
)
void
DialogHandler
::
displayCritical
(
void
*
value
)
{
{
const
dialog_fatal_t
*
dialog
=
(
const
dialog_fatal_t
*
)
value
;
const
dialog_fatal_t
*
dialog
=
(
const
dialog_fatal_t
*
)
value
;
...
@@ -101,7 +101,7 @@ void DialogHandler::displayCritical (vlc_object_t *, void *value)
...
@@ -101,7 +101,7 @@ void DialogHandler::displayCritical (vlc_object_t *, void *value)
QMessageBox
::
Ok
);
QMessageBox
::
Ok
);
}
}
void
DialogHandler
::
requestLogin
(
v
lc_object_t
*
,
v
oid
*
value
)
void
DialogHandler
::
requestLogin
(
void
*
value
)
{
{
dialog_login_t
*
data
=
(
dialog_login_t
*
)
value
;
dialog_login_t
*
data
=
(
dialog_login_t
*
)
value
;
QDialog
*
dialog
=
new
QDialog
;
QDialog
*
dialog
=
new
QDialog
;
...
@@ -153,7 +153,7 @@ void DialogHandler::requestLogin (vlc_object_t *, void *value)
...
@@ -153,7 +153,7 @@ void DialogHandler::requestLogin (vlc_object_t *, void *value)
delete
dialog
;
delete
dialog
;
}
}
void
DialogHandler
::
requestAnswer
(
v
lc_object_t
*
,
v
oid
*
value
)
void
DialogHandler
::
requestAnswer
(
void
*
value
)
{
{
dialog_question_t
*
data
=
(
dialog_question_t
*
)
value
;
dialog_question_t
*
data
=
(
dialog_question_t
*
)
value
;
...
@@ -245,7 +245,7 @@ void QVLCProgressDialog::saveCancel (void)
...
@@ -245,7 +245,7 @@ void QVLCProgressDialog::saveCancel (void)
cancelled
=
true
;
cancelled
=
true
;
}
}
void
DialogHandler
::
startProgressBar
(
v
lc_object_t
*
,
v
oid
*
value
)
void
DialogHandler
::
startProgressBar
(
void
*
value
)
{
{
dialog_progress_bar_t
*
data
=
(
dialog_progress_bar_t
*
)
value
;
dialog_progress_bar_t
*
data
=
(
dialog_progress_bar_t
*
)
value
;
QWidget
*
dlg
=
new
QVLCProgressDialog
(
this
,
data
);
QWidget
*
dlg
=
new
QVLCProgressDialog
(
this
,
data
);
...
...
modules/gui/qt4/dialogs/external.hpp
View file @
02746c1c
...
@@ -56,10 +56,10 @@ signals:
...
@@ -56,10 +56,10 @@ signals:
private
slots
:
private
slots
:
void
displayError
(
const
QString
&
,
const
QString
&
);
void
displayError
(
const
QString
&
,
const
QString
&
);
void
displayCritical
(
v
lc_object_t
*
,
v
oid
*
);
void
displayCritical
(
void
*
);
void
requestLogin
(
v
lc_object_t
*
,
v
oid
*
);
void
requestLogin
(
void
*
);
void
requestAnswer
(
v
lc_object_t
*
,
v
oid
*
);
void
requestAnswer
(
void
*
);
void
startProgressBar
(
v
lc_object_t
*
,
v
oid
*
);
void
startProgressBar
(
void
*
);
void
stopProgressBar
(
QWidget
*
);
void
stopProgressBar
(
QWidget
*
);
};
};
...
...
modules/gui/qt4/variables.cpp
View file @
02746c1c
...
@@ -52,7 +52,7 @@ int QVLCVariable::callback (vlc_object_t *object, const char *,
...
@@ -52,7 +52,7 @@ int QVLCVariable::callback (vlc_object_t *object, const char *,
QVLCVariable
*
self
=
static_cast
<
QVLCVariable
*>
(
data
);
QVLCVariable
*
self
=
static_cast
<
QVLCVariable
*>
(
data
);
self
->
trigger
(
self
->
object
,
old
,
cur
);
self
->
trigger
(
old
,
cur
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
@@ -62,10 +62,9 @@ QVLCPointer::QVLCPointer (vlc_object_t *obj, const char *varname, bool inherit)
...
@@ -62,10 +62,9 @@ QVLCPointer::QVLCPointer (vlc_object_t *obj, const char *varname, bool inherit)
{
{
}
}
void
QVLCPointer
::
trigger
(
vlc_
object_t
*
obj
,
vlc_value_t
old
,
vlc_value_t
cur
)
void
QVLCPointer
::
trigger
(
vlc_
value_t
,
vlc_value_t
cur
)
{
{
emit
pointerChanged
(
obj
,
old
.
p_address
,
cur
.
p_address
);
emit
pointerChanged
(
cur
.
p_address
);
emit
pointerChanged
(
obj
,
cur
.
p_address
);
}
}
...
@@ -74,8 +73,38 @@ QVLCInteger::QVLCInteger (vlc_object_t *obj, const char *varname, bool inherit)
...
@@ -74,8 +73,38 @@ QVLCInteger::QVLCInteger (vlc_object_t *obj, const char *varname, bool inherit)
{
{
}
}
void
QVLCInteger
::
trigger
(
vlc_
object_t
*
obj
,
vlc_value_t
old
,
vlc_value_t
cur
)
void
QVLCInteger
::
trigger
(
vlc_
value_t
,
vlc_value_t
cur
)
{
{
emit
integerChanged
(
obj
,
old
.
i_int
,
cur
.
i_int
);
emit
integerChanged
(
cur
.
i_int
);
emit
integerChanged
(
obj
,
cur
.
i_int
);
}
QVLCBool
::
QVLCBool
(
vlc_object_t
*
obj
,
const
char
*
varname
,
bool
inherit
)
:
QVLCVariable
(
obj
,
varname
,
VLC_VAR_BOOL
,
inherit
)
{
}
void
QVLCBool
::
trigger
(
vlc_value_t
,
vlc_value_t
cur
)
{
emit
boolChanged
(
cur
.
b_bool
);
}
QVLCFloat
::
QVLCFloat
(
vlc_object_t
*
obj
,
const
char
*
varname
,
bool
inherit
)
:
QVLCVariable
(
obj
,
varname
,
VLC_VAR_FLOAT
,
inherit
)
{
}
void
QVLCFloat
::
trigger
(
vlc_value_t
,
vlc_value_t
cur
)
{
emit
floatChanged
(
cur
.
f_float
);
}
QVLCString
::
QVLCString
(
vlc_object_t
*
obj
,
const
char
*
varname
,
bool
inherit
)
:
QVLCVariable
(
obj
,
varname
,
VLC_VAR_STRING
,
inherit
)
{
}
void
QVLCString
::
trigger
(
vlc_value_t
,
vlc_value_t
cur
)
{
QString
str
=
qfu
(
cur
.
psz_string
);
emit
stringChanged
(
str
);
}
}
modules/gui/qt4/variables.hpp
View file @
02746c1c
...
@@ -36,39 +36,75 @@ private:
...
@@ -36,39 +36,75 @@ private:
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_object_t
*
object
;
vlc_object_t
*
object
;
QString
name
;
QString
name
;
virtual
void
trigger
(
vlc_
object_t
*
,
vlc_
value_t
,
vlc_value_t
)
=
0
;
virtual
void
trigger
(
vlc_value_t
,
vlc_value_t
)
=
0
;
public:
public:
QVLCVariable
(
vlc_object_t
*
,
const
char
*
,
int
,
bool
);
QVLCVariable
(
vlc_object_t
*
,
const
char
*
,
int
,
bool
);
virtual
~
QVLCVariable
(
void
);
~
QVLCVariable
(
void
);
};
};
class
QVLCPointer
:
public
QVLCVariable
class
QVLCPointer
:
public
QVLCVariable
{
{
Q_OBJECT
Q_OBJECT
private:
private:
virtual
void
trigger
(
vlc_
object_t
*
,
vlc_
value_t
,
vlc_value_t
);
virtual
void
trigger
(
vlc_value_t
,
vlc_value_t
);
public:
public:
QVLCPointer
(
vlc_object_t
*
,
const
char
*
,
bool
inherit
=
false
);
QVLCPointer
(
vlc_object_t
*
,
const
char
*
,
bool
inherit
=
false
);
signals:
signals:
void
pointerChanged
(
vlc_object_t
*
,
void
*
,
void
*
);
void
pointerChanged
(
void
*
);
void
pointerChanged
(
vlc_object_t
*
,
void
*
);
};
};
class
QVLCInteger
:
public
QVLCVariable
class
QVLCInteger
:
public
QVLCVariable
{
{
Q_OBJECT
Q_OBJECT
private:
private:
virtual
void
trigger
(
vlc_
object_t
*
,
vlc_
value_t
,
vlc_value_t
);
virtual
void
trigger
(
vlc_value_t
,
vlc_value_t
);
public:
public:
QVLCInteger
(
vlc_object_t
*
,
const
char
*
,
bool
inherit
=
false
);
QVLCInteger
(
vlc_object_t
*
,
const
char
*
,
bool
inherit
=
false
);
signals:
signals:
void
integerChanged
(
vlc_object_t
*
,
int
,
int
);
void
integerChanged
(
int64_t
);
void
integerChanged
(
vlc_object_t
*
,
int
);
};
};
class
QVLCBool
:
public
QVLCVariable
{
Q_OBJECT
private:
virtual
void
trigger
(
vlc_value_t
,
vlc_value_t
);
public:
QVLCBool
(
vlc_object_t
*
,
const
char
*
,
bool
inherit
=
false
);
signals:
void
boolChanged
(
bool
);
};
class
QVLCFloat
:
public
QVLCVariable
{
Q_OBJECT
private:
virtual
void
trigger
(
vlc_value_t
,
vlc_value_t
);
public:
QVLCFloat
(
vlc_object_t
*
,
const
char
*
,
bool
inherit
=
false
);
signals:
void
floatChanged
(
float
);
};
class
QVLCString
:
public
QVLCVariable
{
Q_OBJECT
private:
virtual
void
trigger
(
vlc_value_t
,
vlc_value_t
);
public:
QVLCString
(
vlc_object_t
*
,
const
char
*
,
bool
inherit
=
false
);
signals:
void
stringChanged
(
QString
);
};
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment