Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
525c382e
Commit
525c382e
authored
May 21, 2014
by
Emmanuel Lepage Vallee
Browse files
Options
Downloads
Patches
Plain Diff
[ #48205 ] Add device configuration widget skeleton
parent
e0d38a6f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/videodevicemodel.cpp
+14
-2
14 additions, 2 deletions
src/videodevicemodel.cpp
src/videodevicemodel.h
+7
-6
7 additions, 6 deletions
src/videodevicemodel.h
with
21 additions
and
8 deletions
src/videodevicemodel.cpp
+
14
−
2
View file @
525c382e
...
...
@@ -67,7 +67,8 @@ bool VideoDeviceModel::setData(const QModelIndex& idx, const QVariant &value, in
///Constructor
VideoDeviceModel
::
VideoDeviceModel
()
:
QAbstractListModel
(
QCoreApplication
::
instance
()),
m_pResolutionModel
(
nullptr
),
m_pChannelModel
(
nullptr
),
m_pRateModel
(
nullptr
)
m_pResolutionModel
(
nullptr
),
m_pChannelModel
(
nullptr
),
m_pRateModel
(
nullptr
),
m_pDummyDevice
(
nullptr
)
{
connect
(
this
,
SIGNAL
(
changed
())
,
channelModel
()
,
SLOT
(
reload
()));
connect
(
channelModel
()
,
SIGNAL
(
changed
())
,
resolutionModel
()
,
SLOT
(
reload
()));
...
...
@@ -155,7 +156,18 @@ VideoDevice* VideoDeviceModel::activeDevice() const
const
QString
deId
=
interface
.
getActiveDevice
();
if
(
!
m_lDevices
.
size
())
const_cast
<
VideoDeviceModel
*>
(
this
)
->
reload
();
return
m_hDevices
[
deId
];
VideoDevice
*
dev
=
m_hDevices
[
deId
];
//Handling null everywhere is too long, better create a dummy device and
//log the event
if
(
!
dev
)
{
if
(
!
deId
.
isEmpty
())
qWarning
()
<<
"Requested unknown device"
<<
deId
;
if
(
!
m_pDummyDevice
)
const_cast
<
VideoDeviceModel
*>
(
this
)
->
m_pDummyDevice
=
new
VideoDevice
(
"None"
);
return
m_pDummyDevice
;
}
return
dev
;
}
...
...
This diff is collapsed.
Click to expand it.
src/videodevicemodel.h
+
7
−
6
View file @
525c382e
...
...
@@ -112,6 +112,12 @@ Q_DECLARE_METATYPE(VideoDeviceChannelModel*)
class
LIB_EXPORT
ExtendedVideoDeviceModel
:
public
QAbstractListModel
{
Q_OBJECT
public:
enum
ExtendedDeviceList
{
NONE
,
SCREEN
,
FILE
,
__COUNT
};
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
;
int
rowCount
(
const
QModelIndex
&
parent
=
QModelIndex
()
)
const
;
Qt
::
ItemFlags
flags
(
const
QModelIndex
&
index
)
const
;
...
...
@@ -120,12 +126,6 @@ public:
//Singleton
static
ExtendedVideoDeviceModel
*
instance
();
private
:
enum
ExtendedDeviceList
{
NONE
,
SCREEN
,
FILE
,
__COUNT
};
struct
Display
{
Display
()
:
res
(
"0x0"
),
point
(
0
,
0
),
index
(
0
){}
Resolution
res
;
/* Resolution 0x0 for native */
...
...
@@ -215,6 +215,7 @@ private:
VideoDeviceResolutionModel
*
m_pResolutionModel
;
VideoDeviceChannelModel
*
m_pChannelModel
;
VideoDeviceRateModel
*
m_pRateModel
;
VideoDevice
*
m_pDummyDevice
;
public
Q_SLOTS
:
void
setActive
(
const
QModelIndex
&
idx
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment