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
0f1dbde6
Commit
0f1dbde6
authored
Feb 08, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: move animators code
parent
29f4fe99
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
111 additions
and
53 deletions
+111
-53
modules/gui/qt4/Makefile.am
modules/gui/qt4/Makefile.am
+2
-0
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+1
-1
modules/gui/qt4/util/animators.cpp
modules/gui/qt4/util/animators.cpp
+47
-0
modules/gui/qt4/util/animators.hpp
modules/gui/qt4/util/animators.hpp
+59
-0
modules/gui/qt4/util/customwidgets.cpp
modules/gui/qt4/util/customwidgets.cpp
+0
-22
modules/gui/qt4/util/customwidgets.hpp
modules/gui/qt4/util/customwidgets.hpp
+2
-30
No files found.
modules/gui/qt4/Makefile.am
View file @
0f1dbde6
...
...
@@ -100,6 +100,7 @@ libqt4_plugin_la_SOURCES = \
components/sout/profile_selector.hpp
\
components/sout/sout_widgets.cpp components/sout/sout_widgets.hpp
\
components/sout/profiles.hpp
\
util/animators.cpp util/animators.hpp
\
util/input_slider.cpp util/input_slider.hpp
\
util/timetooltip.cpp util/timetooltip.hpp
\
util/customwidgets.cpp util/customwidgets.hpp
\
...
...
@@ -190,6 +191,7 @@ nodist_libqt4_plugin_la_SOURCES = \
components/playlist/ml_model.moc.cpp
\
components/sout/profile_selector.moc.cpp
\
components/sout/sout_widgets.moc.cpp
\
util/animators.moc.cpp
\
util/input_slider.moc.cpp
\
util/timetooltip.moc.cpp
\
util/customwidgets.moc.cpp
\
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
0f1dbde6
...
...
@@ -33,7 +33,7 @@
#include "components/playlist/ml_model.hpp"
/* MLModel */
#include "components/playlist/views.hpp"
/* 3 views */
#include "components/playlist/selector.hpp"
/* PLSelector */
#include "util/
customwidgets.hpp"
/* PixmapAnimator */
#include "util/
animators.hpp"
/* PixmapAnimator */
#include "menus.hpp"
/* Popup */
#include "input_manager.hpp"
/* THEMIM */
#include "dialogs_provider.hpp"
/* THEDP */
...
...
modules/gui/qt4/util/animators.cpp
0 → 100644
View file @
0f1dbde6
/*****************************************************************************
* animators.cpp: Object animators
****************************************************************************
* Copyright (C) 2006-2014 the VideoLAN team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "animators.hpp"
#include <QWidget>
#include <QPixmap>
PixmapAnimator
::
PixmapAnimator
(
QWidget
*
parent
,
QList
<
QString
>
frames
)
:
QAbstractAnimation
(
parent
),
current_frame
(
0
)
{
foreach
(
QString
name
,
frames
)
pixmaps
.
append
(
new
QPixmap
(
name
)
);
currentPixmap
=
pixmaps
.
at
(
0
);
setFps
(
frames
.
count
()
);
/* default to 1 sec loop */
setLoopCount
(
-
1
);
}
void
PixmapAnimator
::
updateCurrentTime
(
int
msecs
)
{
int
i
=
msecs
/
interval
;
if
(
i
>=
pixmaps
.
count
()
)
i
=
pixmaps
.
count
()
-
1
;
/* roundings */
if
(
i
!=
current_frame
)
{
current_frame
=
i
;
currentPixmap
=
pixmaps
.
at
(
current_frame
);
emit
pixmapReady
(
*
currentPixmap
);
}
}
modules/gui/qt4/util/animators.hpp
0 → 100644
View file @
0f1dbde6
/*****************************************************************************
* animators.hpp: Object animators
****************************************************************************
* Copyright (C) 2006-2014 the VideoLAN team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef ANIMATORS_HPP
#define ANIMATORS_HPP
#include <QObject>
#include <QList>
#include <QString>
#include <QAbstractAnimation>
class
QWidget
;
class
QPixmap
;
/** An animated pixmap
* Use this widget to display an animated icon based on a series of
* pixmaps. The pixmaps will be stored in memory and should be kept small.
* First, create the widget, add frames and then start playing. Looping
* is supported.
**/
class
PixmapAnimator
:
public
QAbstractAnimation
{
Q_OBJECT
public:
PixmapAnimator
(
QWidget
*
parent
,
QList
<
QString
>
_frames
);
void
setFps
(
int
_fps
)
{
fps
=
_fps
;
interval
=
1000.0
/
fps
;
}
virtual
int
duration
()
const
{
return
interval
*
pixmaps
.
count
();
}
virtual
~
PixmapAnimator
()
{
qDeleteAll
(
pixmaps
);
}
QPixmap
*
getPixmap
()
{
return
currentPixmap
;
}
protected:
virtual
void
updateCurrentTime
(
int
msecs
);
QList
<
QPixmap
*>
pixmaps
;
QPixmap
*
currentPixmap
;
int
fps
;
int
interval
;
int
lastframe_msecs
;
int
current_frame
;
signals:
void
pixmapReady
(
const
QPixmap
&
);
};
#endif // ANIMATORS_HPP
modules/gui/qt4/util/customwidgets.cpp
View file @
0f1dbde6
...
...
@@ -318,28 +318,6 @@ QString VLCKeyToString( unsigned val, bool locale )
return
r
;
}
PixmapAnimator
::
PixmapAnimator
(
QWidget
*
parent
,
QList
<
QString
>
frames
)
:
QAbstractAnimation
(
parent
),
current_frame
(
0
)
{
foreach
(
QString
name
,
frames
)
pixmaps
.
append
(
new
QPixmap
(
name
)
);
currentPixmap
=
pixmaps
.
at
(
0
);
setFps
(
frames
.
count
()
);
/* default to 1 sec loop */
setLoopCount
(
-
1
);
}
void
PixmapAnimator
::
updateCurrentTime
(
int
msecs
)
{
int
i
=
msecs
/
interval
;
if
(
i
>=
pixmaps
.
count
()
)
i
=
pixmaps
.
count
()
-
1
;
/* roundings */
if
(
i
!=
current_frame
)
{
current_frame
=
i
;
currentPixmap
=
pixmaps
.
at
(
current_frame
);
emit
pixmapReady
(
*
currentPixmap
);
}
}
/* Animated Icon implementation */
SpinningIcon
::
SpinningIcon
(
QWidget
*
parent
)
:
QLabel
(
parent
)
{
...
...
modules/gui/qt4/util/customwidgets.hpp
View file @
0f1dbde6
...
...
@@ -34,11 +34,11 @@
#include <QSpinBox>
#include <QCheckBox>
#include <QList>
#include <QTimer>
#include <QToolButton>
#include <QAbstractAnimation>
#include <QDial>
#include "animators.hpp"
class
QPixmap
;
class
QWidget
;
...
...
@@ -112,34 +112,6 @@ protected:
virtual
int
valueFromText
(
const
QString
&
)
const
{
return
-
1
;
}
};
/** An animated pixmap
* Use this widget to display an animated icon based on a series of
* pixmaps. The pixmaps will be stored in memory and should be kept small.
* First, create the widget, add frames and then start playing. Looping
* is supported.
**/
class
PixmapAnimator
:
public
QAbstractAnimation
{
Q_OBJECT
public:
PixmapAnimator
(
QWidget
*
parent
,
QList
<
QString
>
_frames
);
void
setFps
(
int
_fps
)
{
fps
=
_fps
;
interval
=
1000.0
/
fps
;
};
virtual
int
duration
()
const
{
return
interval
*
pixmaps
.
count
();
};
virtual
~
PixmapAnimator
()
{
qDeleteAll
(
pixmaps
);
};
QPixmap
*
getPixmap
()
{
return
currentPixmap
;
}
protected:
virtual
void
updateCurrentTime
(
int
msecs
);
QList
<
QPixmap
*>
pixmaps
;
QPixmap
*
currentPixmap
;
int
fps
;
int
interval
;
int
lastframe_msecs
;
int
current_frame
;
signals:
void
pixmapReady
(
const
QPixmap
&
);
};
/** This spinning icon, to the colors of the VLC cone, will show
* that there is some background activity running
**/
...
...
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