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
00f76ba2
Commit
00f76ba2
authored
Mar 16, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: remove buffering info from TimeLabel
parent
bafe1e39
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
54 deletions
+1
-54
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+1
-46
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/interface_widgets.hpp
+0
-8
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
00f76ba2
...
@@ -730,8 +730,7 @@ void CoverArtLabel::clear()
...
@@ -730,8 +730,7 @@ void CoverArtLabel::clear()
}
}
TimeLabel
::
TimeLabel
(
intf_thread_t
*
_p_intf
,
TimeLabel
::
Display
_displayType
)
TimeLabel
::
TimeLabel
(
intf_thread_t
*
_p_intf
,
TimeLabel
::
Display
_displayType
)
:
ClickableQLabel
(),
p_intf
(
_p_intf
),
bufTimer
(
new
QTimer
(
this
)
),
:
ClickableQLabel
(),
p_intf
(
_p_intf
),
displayType
(
_displayType
)
buffering
(
false
),
showBuffering
(
false
),
bufVal
(
-
1
),
displayType
(
_displayType
)
{
{
b_remainingTime
=
false
;
b_remainingTime
=
false
;
if
(
_displayType
!=
TimeLabel
::
Elapsed
)
if
(
_displayType
!=
TimeLabel
::
Elapsed
)
...
@@ -758,22 +757,14 @@ TimeLabel::TimeLabel( intf_thread_t *_p_intf, TimeLabel::Display _displayType )
...
@@ -758,22 +757,14 @@ TimeLabel::TimeLabel( intf_thread_t *_p_intf, TimeLabel::Display _displayType )
}
}
setAlignment
(
Qt
::
AlignRight
|
Qt
::
AlignVCenter
);
setAlignment
(
Qt
::
AlignRight
|
Qt
::
AlignVCenter
);
bufTimer
->
setSingleShot
(
true
);
CONNECT
(
THEMIM
->
getIM
(),
positionUpdated
(
float
,
int64_t
,
int
),
CONNECT
(
THEMIM
->
getIM
(),
positionUpdated
(
float
,
int64_t
,
int
),
this
,
setDisplayPosition
(
float
,
int64_t
,
int
)
);
this
,
setDisplayPosition
(
float
,
int64_t
,
int
)
);
CONNECT
(
THEMIM
->
getIM
(),
cachingChanged
(
float
),
this
,
updateBuffering
(
float
)
);
CONNECT
(
bufTimer
,
timeout
(),
this
,
updateBuffering
()
);
setStyleSheet
(
"padding-left: 4px; padding-right: 4px;"
);
setStyleSheet
(
"padding-left: 4px; padding-right: 4px;"
);
}
}
void
TimeLabel
::
setDisplayPosition
(
float
pos
,
int64_t
t
,
int
length
)
void
TimeLabel
::
setDisplayPosition
(
float
pos
,
int64_t
t
,
int
length
)
{
{
showBuffering
=
false
;
bufTimer
->
stop
();
if
(
pos
==
-
1.
f
)
if
(
pos
==
-
1.
f
)
{
{
setMinimumSize
(
QSize
(
0
,
0
)
);
setMinimumSize
(
QSize
(
0
,
0
)
);
...
@@ -864,39 +855,3 @@ void TimeLabel::toggleTimeDisplay()
...
@@ -864,39 +855,3 @@ void TimeLabel::toggleTimeDisplay()
getSettings
()
->
setValue
(
"MainWindow/ShowRemainingTime"
,
b_remainingTime
);
getSettings
()
->
setValue
(
"MainWindow/ShowRemainingTime"
,
b_remainingTime
);
}
}
void
TimeLabel
::
updateBuffering
(
float
_buffered
)
{
bufVal
=
_buffered
;
if
(
!
buffering
||
bufVal
==
0
)
{
showBuffering
=
false
;
buffering
=
true
;
bufTimer
->
start
(
200
);
}
else
if
(
bufVal
==
1
)
{
showBuffering
=
buffering
=
false
;
bufTimer
->
stop
();
}
update
();
}
void
TimeLabel
::
updateBuffering
()
{
showBuffering
=
true
;
update
();
}
void
TimeLabel
::
paintEvent
(
QPaintEvent
*
event
)
{
if
(
showBuffering
)
{
QRect
r
(
rect
()
);
r
.
setLeft
(
r
.
width
()
*
bufVal
);
QPainter
p
(
this
);
p
.
setOpacity
(
0.4
);
p
.
fillRect
(
r
,
palette
().
color
(
QPalette
::
Highlight
)
);
}
QLabel
::
paintEvent
(
event
);
}
modules/gui/qt4/components/interface_widgets.hpp
View file @
00f76ba2
...
@@ -200,22 +200,14 @@ private:
...
@@ -200,22 +200,14 @@ private:
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
bool
b_remainingTime
;
bool
b_remainingTime
;
int
cachedLength
;
int
cachedLength
;
QTimer
*
bufTimer
;
bool
buffering
;
bool
showBuffering
;
float
bufVal
;
TimeLabel
::
Display
displayType
;
TimeLabel
::
Display
displayType
;
char
psz_length
[
MSTRTIME_MAX_SIZE
];
char
psz_length
[
MSTRTIME_MAX_SIZE
];
char
psz_time
[
MSTRTIME_MAX_SIZE
];
char
psz_time
[
MSTRTIME_MAX_SIZE
];
void
toggleTimeDisplay
();
void
toggleTimeDisplay
();
void
paintEvent
(
QPaintEvent
*
);
private
slots
:
private
slots
:
void
setDisplayPosition
(
float
pos
,
int64_t
time
,
int
length
);
void
setDisplayPosition
(
float
pos
,
int64_t
time
,
int
length
);
void
setDisplayPosition
(
float
pos
);
void
setDisplayPosition
(
float
pos
);
void
updateBuffering
(
float
);
void
updateBuffering
();
};
};
class
SpeedLabel
:
public
QLabel
class
SpeedLabel
:
public
QLabel
...
...
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