On the profile, the run-length of the videos is visualized by a bar.
Add the same information to video-thumbnails in the dive-photo-tab.
Though in this case, render it as text on top of the thumbnails.
Fixes#359
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Extract thumbnails using ffmpeg.
Behavior is controlled by three new preferences fields:
- extract_video_thumbnails (bool): if true, thumbnails are calculated.
- extract_video_thumbnail_position (int 0..100): position in video
where thumbnail is fetched.
- ffmpeg_executable (string): path of ffmpeg executable.
If ffmpeg refuses to start, extract_video_thumbnails is set to false
to avoid unnecessary churn.
Video thumbnails are marked by an overlay.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
remove Facebook from SettingsObjectWrapper and reference qPrefFacebook
update files using SettingsObjectWrapper/Facebook to use qPrefFacebook
this activated qPrefFacebook and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
Update set/get functions to follow common name scheme:
- get function have same name as in struct diveComputer
- set function have set_<name>
- signal function have <name>_changed
one class one .h/.cpp is the C++ idiom. Having load/sync of each
variable in 1 functions (in contrast to the distributed way
SettingsObjectWrapper handles it) secures the same storage name
is used. Having the set/get/load/sync functions grouped together
makes it easier to get an overview.
REMARK: this commit only defines the class, it is not active in production
Signed-off-by: Jan Iversen <jani@apache.org>
remove set_git_url and git_url_changed, because it is not possible
to set git_url, this is done inderectly through set_base_url
Update disk_base_url to generated git_url for both load/sync
Signed-off-by: Jan Iversen <jani@apache.org>
The column-widths must only be set once the source-model is that.
The old code realized this with a rather complicated logic.
Instead, simply set the source-model in the constructor and
set the column widths after that. Rename the corresponding
function from "setupUi" to "setColumnWidths".
Moreover, the setupUi function had different code-paths for
the first and other calls. Since it is only called once,
remove the other code paths.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Conceptually, the width of the columns should probably reside in
the view not the model. But much more severly, the old code didn't
work: Columns were set in a DiveTripModel, which was deleted
right away.
Therefore, move the logic back to the DiveListView. Introduce
a QVector<int> of the initial column widths, so that they can be
erased from the setting if unchanged.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
We can argue about any of the changes here, but they are the result of our
whitespace.pl script - so if any of this is offensive to you, part of the
resolution will be fixing the script...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
userid was saved outside all groups, even though it belongs to cloudStorage
Add code to save in new location and read from new/old location
Signed-off-by: Jan Iversen <jani@apache.org>
remove DiveComputer from SettingsObjectWrapper and reference qPrefDiveComputer
update files using SettingsObjectWrapper/DiveComputer to use qPrefDiveComputer
this activated qPrefDiveComputer and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
Update set/get functions to follow common name scheme:
- get function have same name as in struct diveComputer
- set function have set_<name>
- signal function have <name>_changed
one class one .h/.cpp is the C++ idiom. Having load/sync of each
variable in 1 functions (in contrast to the distributed way
SettingsObjectWrapper handles it) secures the same storage name
is used. Having the set/get/load/sync functions grouped together
makes it easier to get an overview.
REMARK: this commit only defines the class, it is not active in production
Signed-off-by: Jan Iversen <jani@apache.org>
Expand SET_, DISK_ and HANDLE_ macros with field for substructure
Structure prefs contains e.g. prefs.dive_computer.vendor an extra field
are added to the macros to allow this.
Signed-off-by: Jan Iversen <jani@apache.org>
expend LOADSYNC* into DISK_* macros
remove LOADSYNC* from qPrefPrivate.h
update qPrefDisplay to not use LOADSYNC*
Signed-off-by: Jan Iversen <jani@apache.org>
Add static and inline to getter in all qPref header files
Remove call to GET_PREFERENCE_* in qPrefDisplay.cpp
Remove GET_PREFERENCE_* from qPrefPrivate.h
static inline is slightly faster than a function call, but it saves
a lot of coding lines (no lines in qPref*.cpp). Getters are a direct
reference to struct preferences, so they will normally only be used
from QML.
Signed-off-by: Jan Iversen <jani@apache.org>
Add static and inline to getter in all qPref header files
Remove call to GET_PREFERENCE_* in qPrefDisplay.cpp
static inline is slightly faster than a function call, but it saves
a lot of coding lines (no lines in qPref*.cpp). Getters are a direct
reference to struct preferences, so they will normally only be used
from QML.
Signed-off-by: Jan Iversen <jani@apache.org>
Add copy_txt function to qPrefPrivate class
Remove macro COPY_TXT from qPrefPrivate.h
Replace use of COPY_TXT with copy_txt in qPref classes
copy_txt is only once, COPY_TXT was expanded approx. 160 times, so
this commit saves space (and removes a macro).
Signed-off-by: Jan Iversen <jani@apache.org>
Paint a rectangle on top of thumbnails indicating the run-time
of the video.
Use the z=100.0-101.0 range for painting the thumbnails, whereby
the z-value increases uniformly from first to last thumbnail
(sorted by timestamp). The duration-bars are placed at z-values
midway between those of the thumbnails.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Video thumbnails are more complex than simple picture thumbnails.
We store a duration and might want to store multiple images.
Therefore, refactor the thumbnailing in imagedownloader.cpp. Move
the thumbnail-writing down in the call chain to where the thumbnails
are created, since we have more information there (i.e. whether we
could parse the file but not extract an image, etc.).
Split the write-to-cache function into three versions:
- pictures
- videos
- unknown
Define the video-thumbnail on-disk format as
- uint32 MEDIATYPE_VIDEO
- uint32 duration of video in seconds
- uint32 number of pictures
for each picture:
- uint32 offset in msec from begining of video
- QImage frame
Currently, we write 0 pictures. This will be filled in subsequent commits.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Each DiveItem (which is a wrapper around diveId with some virtual
functions), had a member icon_names, which is an array of
four QStrings. These were not used anywhere and must be an obscure
oversight and was probably planned as a static cons array?.
In any case, remove it.
There *was* a function-local analogous icon_names array in
DiveItem::data() though. This array would initialize four
QStrings from C-string literals on every invocation. Make
this array static, local to the translation unit and use
the QStringLiteral macro to construct the QString object at
compile-time.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
remove CloudStorage from SettingsObjectWrapper and reference qPrefCloudStorage
update files using SettingsObjectWrapper/CloudStorage to use qPrefCloudStorage
this activated qPrefCloudStorage and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
Update set/get functions to follow common name scheme:
- get function have same name as in struct preferences
- set function have set_<name> (from struct preferences>)
- signal function have <name>_changed (from struct preferences>)
one class one .h/.cpp is the C++ idiom. Having load/sync of each
variable in 1 functions (in contrast to the distributed way SettingsObjectWrapper
handles it) secures the same storage name is used. Having the set/get/load/sync
functions grouped together makes it easier to get an overview.
REMARK: this commit only defines the class, it is not active in production
Signed-off-by: Jan Iversen <jani@apache.org>
There were numerous inlined functions in dive.h. For many of them
inlining is dubious. Let's uninline most of them, with the exception
of trivial accessors and interpolate().
On current master, this gave a size reduction of 5 pages:
-rwxrwxr-x 1 bs bs 5863656 Jul 18 20:57 subsurface-inline
-rwxrwxr-x 1 bs bs 5843176 Jul 18 20:48 subsurface-noinline
-----------------------------------------------------------
20480
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>