Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
d5d09d94
Commit
d5d09d94
authored
Jan 28, 2013
by
Erwan Tulou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: factorize some code
parent
9e52153f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
21 deletions
+34
-21
modules/gui/skins2/src/vlcproc.cpp
modules/gui/skins2/src/vlcproc.cpp
+31
-21
modules/gui/skins2/src/vlcproc.hpp
modules/gui/skins2/src/vlcproc.hpp
+3
-0
No files found.
modules/gui/skins2/src/vlcproc.cpp
View file @
d5d09d94
...
@@ -453,27 +453,7 @@ void VlcProc::on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal )
...
@@ -453,27 +453,7 @@ void VlcProc::on_intf_event_changed( vlc_object_t* p_obj, vlc_value_t newVal )
getIntf
()
->
p_sys
->
p_input
=
pInput
;
getIntf
()
->
p_sys
->
p_input
=
pInput
;
vlc_object_hold
(
pInput
);
vlc_object_hold
(
pInput
);
input_item_t
*
p_item
=
input_GetItem
(
pInput
);
update_current_input
();
if
(
p_item
)
{
// Update short name
char
*
psz_name
=
input_item_GetName
(
p_item
);
SET_TEXT
(
m_cVarStreamName
,
UString
(
getIntf
(),
psz_name
)
);
free
(
psz_name
);
// Update local path (if possible) or full uri
char
*
psz_uri
=
input_item_GetURI
(
p_item
);
char
*
psz_path
=
make_path
(
psz_uri
);
char
*
psz_save
=
psz_path
?
psz_path
:
psz_uri
;
SET_TEXT
(
m_cVarStreamURI
,
UString
(
getIntf
(),
psz_save
)
);
free
(
psz_path
);
free
(
psz_uri
);
// Update art uri
char
*
psz_art
=
input_item_GetArtURL
(
p_item
);
SET_STRING
(
m_cVarStreamArt
,
string
(
psz_art
?
psz_art
:
""
)
);
free
(
psz_art
);
}
}
}
switch
(
newVal
.
i_int
)
switch
(
newVal
.
i_int
)
...
@@ -794,6 +774,36 @@ void VlcProc::init_variables()
...
@@ -794,6 +774,36 @@ void VlcProc::init_variables()
update_equalizer
();
update_equalizer
();
}
}
void
VlcProc
::
update_current_input
()
{
input_thread_t
*
pInput
=
getIntf
()
->
p_sys
->
p_input
;
if
(
!
pInput
)
return
;
input_item_t
*
p_item
=
input_GetItem
(
pInput
);
if
(
p_item
)
{
// Update short name
char
*
psz_name
=
input_item_GetName
(
p_item
);
SET_TEXT
(
m_cVarStreamName
,
UString
(
getIntf
(),
psz_name
)
);
free
(
psz_name
);
// Update local path (if possible) or full uri
char
*
psz_uri
=
input_item_GetURI
(
p_item
);
char
*
psz_path
=
make_path
(
psz_uri
);
char
*
psz_save
=
psz_path
?
psz_path
:
psz_uri
;
SET_TEXT
(
m_cVarStreamURI
,
UString
(
getIntf
(),
psz_save
)
);
free
(
psz_path
);
free
(
psz_uri
);
// Update art uri
char
*
psz_art
=
input_item_GetArtURL
(
p_item
);
SET_STRING
(
m_cVarStreamArt
,
string
(
psz_art
?
psz_art
:
""
)
);
free
(
psz_art
);
}
}
void
VlcProc
::
update_equalizer
()
void
VlcProc
::
update_equalizer
()
{
{
...
...
modules/gui/skins2/src/vlcproc.hpp
View file @
d5d09d94
...
@@ -98,6 +98,9 @@ public:
...
@@ -98,6 +98,9 @@ public:
/// update equalizer
/// update equalizer
void
update_equalizer
(
);
void
update_equalizer
(
);
/// update global variables for the current input
void
update_current_input
(
);
void
on_intf_event_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_intf_event_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_bit_rate_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_bit_rate_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_sample_rate_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
void
on_sample_rate_changed
(
vlc_object_t
*
p_obj
,
vlc_value_t
newVal
);
...
...
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