Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
39a8ee9f
Commit
39a8ee9f
authored
Apr 05, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/components/codecs): supports codecs ordering
parent
71d2c9aa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
0 deletions
+28
-0
AbstractCodecsModel.cpp
...one-desktop/src/components/codecs/AbstractCodecsModel.cpp
+8
-0
AbstractCodecsModel.hpp
...one-desktop/src/components/codecs/AbstractCodecsModel.hpp
+2
-0
AudioCodecsModel.cpp
linphone-desktop/src/components/codecs/AudioCodecsModel.cpp
+6
-0
AudioCodecsModel.hpp
linphone-desktop/src/components/codecs/AudioCodecsModel.hpp
+3
-0
VideoCodecsModel.cpp
linphone-desktop/src/components/codecs/VideoCodecsModel.cpp
+6
-0
VideoCodecsModel.hpp
linphone-desktop/src/components/codecs/VideoCodecsModel.hpp
+3
-0
No files found.
linphone-desktop/src/components/codecs/AbstractCodecsModel.cpp
View file @
39a8ee9f
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <linphone++/linphone.hh>
#include <linphone++/linphone.hh>
#include "../../utils.hpp"
#include "../../utils.hpp"
#include "../core/CoreManager.hpp"
#include "AbstractCodecsModel.hpp"
#include "AbstractCodecsModel.hpp"
...
@@ -96,6 +97,7 @@ bool AbstractCodecsModel::moveRows (
...
@@ -96,6 +97,7 @@ bool AbstractCodecsModel::moveRows (
beginMoveRows
(
source_parent
,
source_row
,
limit
,
destination_parent
,
destination_child
);
beginMoveRows
(
source_parent
,
source_row
,
limit
,
destination_parent
,
destination_child
);
// Update UI.
if
(
destination_child
>
source_row
)
{
if
(
destination_child
>
source_row
)
{
--
destination_child
;
--
destination_child
;
for
(
int
i
=
source_row
;
i
<=
limit
;
++
i
)
{
for
(
int
i
=
source_row
;
i
<=
limit
;
++
i
)
{
...
@@ -106,6 +108,12 @@ bool AbstractCodecsModel::moveRows (
...
@@ -106,6 +108,12 @@ bool AbstractCodecsModel::moveRows (
m_codecs
.
move
(
source_row
+
i
-
source_row
,
destination_child
+
i
-
source_row
);
m_codecs
.
move
(
source_row
+
i
-
source_row
,
destination_child
+
i
-
source_row
);
}
}
// Update linphone codecs list.
list
<
shared_ptr
<
linphone
::
PayloadType
>
>
codecs
;
for
(
const
auto
&
map
:
m_codecs
)
codecs
.
push_back
(
map
.
value
(
"__codec"
).
value
<
shared_ptr
<
linphone
::
PayloadType
>
>
());
updateCodecs
(
codecs
);
endMoveRows
();
endMoveRows
();
return
true
;
return
true
;
...
...
linphone-desktop/src/components/codecs/AbstractCodecsModel.hpp
View file @
39a8ee9f
...
@@ -59,6 +59,8 @@ protected:
...
@@ -59,6 +59,8 @@ protected:
void
addCodec
(
std
::
shared_ptr
<
linphone
::
PayloadType
>
&
codec
);
void
addCodec
(
std
::
shared_ptr
<
linphone
::
PayloadType
>
&
codec
);
virtual
void
updateCodecs
(
std
::
list
<
std
::
shared_ptr
<
linphone
::
PayloadType
>
>
&
codecs
)
=
0
;
private:
private:
QList
<
QVariantMap
>
m_codecs
;
QList
<
QVariantMap
>
m_codecs
;
};
};
...
...
linphone-desktop/src/components/codecs/AudioCodecsModel.cpp
View file @
39a8ee9f
...
@@ -24,9 +24,15 @@
...
@@ -24,9 +24,15 @@
#include "AudioCodecsModel.hpp"
#include "AudioCodecsModel.hpp"
using
namespace
std
;
// =============================================================================
// =============================================================================
AudioCodecsModel
::
AudioCodecsModel
(
QObject
*
parent
)
:
AbstractCodecsModel
(
parent
)
{
AudioCodecsModel
::
AudioCodecsModel
(
QObject
*
parent
)
:
AbstractCodecsModel
(
parent
)
{
for
(
auto
&
codec
:
CoreManager
::
getInstance
()
->
getCore
()
->
getAudioPayloadTypes
())
for
(
auto
&
codec
:
CoreManager
::
getInstance
()
->
getCore
()
->
getAudioPayloadTypes
())
addCodec
(
codec
);
addCodec
(
codec
);
}
}
void
AudioCodecsModel
::
updateCodecs
(
list
<
shared_ptr
<
linphone
::
PayloadType
>
>
&
codecs
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setAudioPayloadTypes
(
codecs
);
}
linphone-desktop/src/components/codecs/AudioCodecsModel.hpp
View file @
39a8ee9f
...
@@ -33,6 +33,9 @@ class AudioCodecsModel : public AbstractCodecsModel {
...
@@ -33,6 +33,9 @@ class AudioCodecsModel : public AbstractCodecsModel {
public:
public:
AudioCodecsModel
(
QObject
*
parent
=
Q_NULLPTR
);
AudioCodecsModel
(
QObject
*
parent
=
Q_NULLPTR
);
~
AudioCodecsModel
()
=
default
;
~
AudioCodecsModel
()
=
default
;
protected:
void
updateCodecs
(
std
::
list
<
std
::
shared_ptr
<
linphone
::
PayloadType
>
>
&
codecs
)
override
;
};
};
#endif // AUDIO_CODECS_MODEL_H_
#endif // AUDIO_CODECS_MODEL_H_
linphone-desktop/src/components/codecs/VideoCodecsModel.cpp
View file @
39a8ee9f
...
@@ -24,9 +24,15 @@
...
@@ -24,9 +24,15 @@
#include "VideoCodecsModel.hpp"
#include "VideoCodecsModel.hpp"
using
namespace
std
;
// =============================================================================
// =============================================================================
VideoCodecsModel
::
VideoCodecsModel
(
QObject
*
parent
)
:
AbstractCodecsModel
(
parent
)
{
VideoCodecsModel
::
VideoCodecsModel
(
QObject
*
parent
)
:
AbstractCodecsModel
(
parent
)
{
for
(
auto
&
codec
:
CoreManager
::
getInstance
()
->
getCore
()
->
getVideoPayloadTypes
())
for
(
auto
&
codec
:
CoreManager
::
getInstance
()
->
getCore
()
->
getVideoPayloadTypes
())
addCodec
(
codec
);
addCodec
(
codec
);
}
}
void
VideoCodecsModel
::
updateCodecs
(
list
<
shared_ptr
<
linphone
::
PayloadType
>
>
&
codecs
)
{
CoreManager
::
getInstance
()
->
getCore
()
->
setVideoPayloadTypes
(
codecs
);
}
linphone-desktop/src/components/codecs/VideoCodecsModel.hpp
View file @
39a8ee9f
...
@@ -33,6 +33,9 @@ class VideoCodecsModel : public AbstractCodecsModel {
...
@@ -33,6 +33,9 @@ class VideoCodecsModel : public AbstractCodecsModel {
public:
public:
VideoCodecsModel
(
QObject
*
parent
=
Q_NULLPTR
);
VideoCodecsModel
(
QObject
*
parent
=
Q_NULLPTR
);
~
VideoCodecsModel
()
=
default
;
~
VideoCodecsModel
()
=
default
;
protected:
void
updateCodecs
(
std
::
list
<
std
::
shared_ptr
<
linphone
::
PayloadType
>
>
&
codecs
)
override
;
};
};
#endif // VIDEO_CODECS_MODEL_H_
#endif // VIDEO_CODECS_MODEL_H_
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