Commit Graph

1496 Commits

Author SHA1 Message Date
Mark Liversedge
7c8e9d983f Remove executable bit on source files
ANTMessage and ANTChannel source files are created with
the executable bit set. This patch removes that.
2011-11-13 11:16:26 +00:00
Mark Liversedge
78c1923e57 Fix RideFileCache taking too long on dodgy files
When the samples in a ride file start from a large offset
e.g. 6hrs is the timestamp for the first sample. The
ridefilecache will compute bests over the initial 6hr
gap.

This patch adjusts the timestamps so they always start
from zero, but only when calculating bests -- it does not
modify the ride data.

We may want to consider 'automatically' fixing this during
ridefile reading, but for now this fixes a nasty bug that
causes GC to hog CPU for large periods of time when computing
the cache.

Fixes #510.
2011-11-12 20:29:53 +00:00
Mark Liversedge
bf0609f5e1 Linux/Win disable screensaver using VLC
VLC will disable the screensaver during playback. This patch
exploits this functionality bringing it in line with the Mac
builds.

One small nit remains; under Windows/Linux the screensaver
is only disabled if video playback is being used, whilst on
the Mac the screensaver is disabled whenever you are active
(e.g. on a basic workout or streetview).
2011-11-12 20:01:45 +00:00
Mark Liversedge
fb626e683f Add support for Tacx/RLV Workout (.pgmf)
The Tacx ergometer has a workout file format
(.pgmf) that is similar in concept to the
Racermate .CRS/.ERG/.MRC file format.

This patch adds support for this kind of
workout file.

Further work is required to support the .rlv
file format in order to support video playback
to match the user's speed (keeping the video
in sync as you ride).

In addition, for Turbos that do not support
variable load using gradient/slope we will need
to add an algorithm to approximate speed from
power/weight/slope.

Fixes #382
2011-11-12 18:30:56 +00:00
Mark Liversedge
5c05cc6572 Mac Video use GC_HAVE_LION
When compiling the Mac video stuff on Lion with SDK10.5
the code used a pre-processor directive to include code
based upon the max version allowed.

But if you are using an earlier SDK the max version allowed
is still higher, so instead we use the GC_HAVE_LION define
instead.

This change only really affects anyone on Lion or higher building
with an earlier version of the SDK.
2011-11-11 21:44:29 +00:00
Mark Liversedge
d83a74dc08 Show/Hide Sidebar toolbar button 2011-11-09 20:25:26 +00:00
Mark Liversedge
2de1160fe5 Windows/Linux (VLC) DVD Playback
Added the option to select "DVD" from the video/media
list to playback a DVD if one is present.
2011-11-09 18:16:08 +00:00
Mark Liversedge
0a1e3cd53b QTMovieView has autoresize enabled. 2011-11-09 15:57:45 +00:00
Mark Liversedge
27e8e81240 VLC --no-xlib on Linux
To avoid errors related to threading during video
playback.
2011-11-08 22:46:45 +00:00
Mark Liversedge
6b289dd750 Workout Plot remove gap on Load Curve. 2011-11-08 07:20:31 +00:00
Mark Liversedge
b9b1383cbb Allow smaller widths in tile view 2011-11-07 22:57:08 +00:00
Mark Liversedge
3e7c3025f2 Plot marker default color now Gray
Because black does not show up against a black background
(the default for a ride plot).

This was not a big issue, but it is used by the train view
as the color for the timer and results in black writing on
a black background.

This might be cool if you're in a band called Disaster Area
but not so cool if you want to ride your turbo.
2011-11-07 20:41:03 +00:00
Mark Liversedge
cefb69512c signpost toggle fullscreen is F11. 2011-11-07 19:52:44 +00:00
Mark Liversedge
2007759ca1 Fix play icon after stop pressed. 2011-11-07 19:06:12 +00:00
Mark Liversedge
ad046efc0c minor alignment fix in train buttons. 2011-11-06 22:42:22 +00:00
Mark Liversedge
e03f496811 ToolBar even more like Flare
The "tabs" of the toolbar are now offset to the right
and fixed with a specific spacing.

Similarly, the training view buttons are fixed to the
left.

This ensures that the "tabs" don't move as toolbar
buttons are added/removed.

This removes the flickery artefacts when moving away
from train view and also gets ready for more specific
buttons on the other views.
2011-11-06 21:24:26 +00:00
Mark Liversedge
9a12bdf8be Fix GcToolBar paint artefacts. 2011-11-06 21:02:42 +00:00
Mark Liversedge
053bd6ca69 Train View controls in Toolbar
Updated the realtime view (Train) to put the
realtime controls in the toolbar and removed
the old realtime controls chart.  They only
appear in Train view.

Additionally, the workout list and media list
are now in the sidebar under 'Workout Library'.

Finally, the first device configured is always
selected at startup, but this is a temporary
change until the realtime device wizard is coded
to set a default device.
2011-11-06 19:34:46 +00:00
Mark Liversedge
57c1102b50 Mac OS X Realtime Fixups
A few minor fixups for Mac OS X;

* LionFullScreen.mm compile issues resolved by introducing
  a new define in gcconfig.pri. This will hopefully go when
  issues with Qt and AvailabilityMacros are resolved. See
  DEFINES += GC_HAVE_LION in gcconfig.pri.in

* The buttons on the realtime controls are now set to GTK to
  avoid Qt constraints regarding spacing and format of
  QPushButtons. This will hopefully go when we move the controls
  to a task bar at the bottom of the screen.
2011-11-05 23:21:28 +00:00
Mark Liversedge
da6a2dc6d4 Further realtime improvements
A number of new features / enhancements;

* Display IF/TSS or Elevation/Grade in the controller
  when a workout is selected.

* Added buttons for forward/back which emulate the
  forward/back from a computrainer controller

* Added a slider to increase and decrease intensity/grade
  on-the-fly (during a workout), tied in with the
  computrainer controller's + and - keys.

* Unpicked the manualOverride code previously implemented

Mostly, or at least for this release, fixes #494.
2011-11-05 18:31:55 +00:00
Mark Liversedge
368aeba04d Remove Globals from ErgFilePlot
The original ErgFilePlot code used local static variables
to bridge between the selected ErgFile and the Qwt data
handlers.

This was not an issue when we only allowed one chart of this
type to be available at once. But now, with a more configurable
layout it is possible to have multiple.

The currently selected ErgFile can now be referenced from
MainWindow in the same manner as the current RideFile can.

This patch introduces no functional change for users.
2011-11-05 13:06:31 +00:00
Mark Liversedge
cd6e9df377 Fix slow startup of Train View on Windows
The train view video/media list is constructed by attempting
to parse any file found in the workout directory. This was
a strategy to avoid missing files with odd extensions that
could be processed by VLC and also to avoid needing to
maintain a list of common extensions.

In practice, this was very slow to process and quite annoying.
VLC would load large volumes of DLLs and Codecs when trying
to parse.

In addition, the most common file types /by far/ are from
a relatively short list i.e; .mov, .avi, .mkv, .mp4 etc.

The strategy is now adjusted to search for a common list of
file types, namely;

    3GP ASF AVI DIVX FLAC FLV M4V MKV MOV MP4 MPEG MPG
    MXF Nut OGG OGM RM VOB WAV WMA WMV

The filename is checked without case sensitivity, i.e. files
will match regardless of whether they are in upper or lower
case (or combination of upper/lower).
2011-11-05 00:53:37 +00:00
Mark Liversedge
2f51c730a1 Remove VLC debug output console on Windows
The libvlc options setup used --extraintf=logger, which
causes a debug console window to be opened on Windows.

This patch removes this since debug output is only of
value to developers and should not be in released code.
2011-11-05 00:37:59 +00:00
Mark Liversedge
0edbc5ef11 Reverse unwanted change to ErgFile::wattsAt() 2011-11-04 23:15:29 +00:00
Mark Liversedge
3ca9c14710 Workout (ErgFile) computes metrics
When a workout file is opened, the contents are used
to calculate the NP,xPower thru TSS/Bikescore values
for the workout.

This is in preparation for on-the-fly adjustment of the
intensity of a workout and displaying the target stress
load (TSS/BikeScore) the workout will produce.

No user functional change.
2011-11-04 23:09:06 +00:00
Mark Liversedge
c4f41447de Disable Screensaver on Mac OS X
Update training view on a Mac to disable the screen saver
and power saver when a workout is active.
2011-11-04 18:34:18 +00:00
Gareth Coco
6f913f118d Fix Windows LibUsb compile error
declaration of int rc was missing on Windows
since it was removed by the pre-processor.

This patch declares int rc before use.
2011-11-04 16:34:07 +00:00
Mark Liversedge
1e8b6edb62 Show kJoules, TSS/BikeScore et al on Train View
The refactoring of the realtime display last year
removed the display of metrics such as BikeScore and
kJoules.

This patch adds more metrics that can be displayed;
* Averages for; power, hr, cadence, speed
* KJoules of work
* Coggan Metrics; NP, TSS, IF, VI
* Skiba Metrics; xPower, BikeScore, RI, Skiba VI

Also included is an updated default layout to
include some of these metrics.

Fixes #231
2011-11-04 16:28:36 +00:00
Mark Liversedge
c977d8aba0 Metric/Imperial bug in Realtime
Display of speed and distance is in kph, regardless of
the unit of measure user preferences. This patch fixes
that.
2011-11-04 09:12:45 +00:00
Mark Liversedge
9691746be2 LibUsb does not have usb_reset on Windows
We call usb_reset between sessions on Linux/Mac
because the USB device is left in an undetermined
state after close. In the comments I noted that
it was odd this was not required on Windows.

Well, it turns out it is not available on Windows.
This patch ensures we do not try to call it when
compiling for Windows.
2011-11-04 08:42:40 +00:00
Mark Liversedge
04f2abd00e Add Support for FullScreen on Linux/Windows
Add support to toggle full screen mode on Linux
and Windows, in similar fashion to the recent
update for Mac OSX Lion.

A new view menu option to toggle full screen has
been added in lieu of the Mac titlebar icon on
either Win/Linux. Additionally, hitting Function
key F11 toggles fullscreen and hitting ESC whilst
in full screen also returns to normal.
2011-11-03 23:35:00 +00:00
Mark Liversedge
0a67ed1e01 LionFullScreen saga. Ugh.
Even if the C pre-processor will remove a class definition
in a header file the QT moc utility will still create a
moc_Xxxx.cpp file which requires the class to be defined.

As a result the attempt to create an empty header for the
LionFullScreen class when compiling on earlier versions than
Lion causes issues.

The LionFullScreen class is now always declared and defined
but will be not do anything useful on earlier versions of
Mac OS X than Lion.
2011-11-03 21:58:21 +00:00
Mark Liversedge
69a52f250d Fix HEADERS += LionFullScreen.h in src.pro
Temporary modification so non-OSX builds work (Linux/Windows).
The header was added to the main HEADERS += entry due to problems
with moc runs when added conditionally.

Will test on OSX and make further updates if needed.
2011-11-03 21:30:47 +00:00
Mark Liversedge
e9bfa20f08 LionFullScreen.h moc error on non-Mac
Because of a bug in qmake we add LionFullScreen.h to the
list of headers to ensure moc is called for the include.
When adding AvailabilityMacros.h to the header it needed
to check that we were compiling for a Mac.
2011-11-03 11:12:35 +00:00
Mark Liversedge
1f22545197 Fix MAC_OS_X_VERSION_MAX_ALLOWED
LionFullScreen used this macro to determine if the version
of the SDK is recent enough (Lion or higher).

Unfortunately, I forgot to also check if the OS was Mac OSX
and didn't include the correct header (AvailaibilityMacros.h)
to get the define. As a result all builds on anything other
than OSX Lion failed.
2011-11-02 20:50:46 +00:00
Mark Liversedge
0684eb48ea Mac OSX SDK10.4 CALayer.h 'slots' variable
The Cocoa header defines an array called 'slots'
that conflicts with the QT macro (which replaces it
with whitespace).

Re-ordered header includes to avoid the macro clash when
compiling on SDK10.4 or earlier.
2011-11-01 22:27:19 +00:00
Mark Liversedge
7bf516547b Mac QTKit Video OpenForPlayback conditional
Building for versions of OSX prior to Snow Leopard
fails since QTMovieOpenForPlaybackAttribute is not
available, this patch makes this setting conditional
on build support for OS X >= 10.6.
2011-11-01 19:55:47 +00:00
Mark Liversedge
8e92efbaf7 Ctrl-Cmd-F *toggles* fullscreen
Previous commit only cancelled fullscreen mode
when Ctrl-Cmd-F is pressed, but the common usage
is for the key sequence to toggle fullscreen
on and off.
2011-11-01 15:48:13 +00:00
Mark Liversedge
a09e2d1348 Support Control-Cmd-F to exit full screen
It is common for many fullscreen apps to use this command
sequence to exit full-screen (e.g. Chrome, Safari).
2011-11-01 15:41:40 +00:00
Mark Liversedge
bae9ce8bc1 Remove QTMovieOpenAsyncRequiredAttribute
So we can build on earlier versions of OSX. To improve
things a little since we will no get QuicktimeX without
this reference we now set QTOpenForPlaybackAttribute to
get at least some optimisation.
2011-11-01 15:08:27 +00:00
Mark Liversedge
2c08708c78 Fullscreen Support for Mac OSX Lion
Mac OS X Lion introduces support for fullscreen applications
and places a fullscreen button on the title bar and animates
etc.

This patch adds support for fullscreen mode. Since there is
no standard way of exiting fullscreen mode we have adopted
pressing the 'ESC' key, since this is inline with most of the
Apple applications (e.g. Mail).
2011-11-01 14:46:30 +00:00
Mark Liversedge
6ed5437ddb Fix memory leak in Video Window on Mac (QTKit)
Need to call QTMovie::invalidate before QTMovieView::setMovie to
ensure the mmap is deleted before allocating for the new one. This
fixes mmap errors when scrolling up and down a list of videos.
2011-11-01 10:42:52 +00:00
Mark Liversedge
4c3266d5dd Fix repaint() when resizing
When resizing windows in tile view the update is a bit
wonky when you have a video window on screen. The layout
code now repaints the entire homewindow when one of the
charts are resized.
2011-11-01 08:57:52 +00:00
Mark Liversedge
2c8a5347b4 Fix memory leak in Video Window on Mac (QTKit)
Need to call QTMovie::deallocate before setMovie to
ensure it is free'd by the QTMoveView.
2011-11-01 08:47:39 +00:00
Mark Liversedge
0f60badc82 Fixup QTKit Video Playback
Deallocate errors when scrolling through large numbers
of videos, but otherwise functional.

The redraw of the layouts needs to be looked at, since
there are some nasty artefacts when resizing the video
window that need to be fixed separately.
2011-10-31 20:56:48 +00:00
Mark Liversedge
09724e5796 Mac Video Playback via QTKit not VLC
Ghetto code with video selection and all the basic
building blocks in place. Playback is only via the
quicktime controls, paint issues abound and there
is a problem with deallocation of the movie object.

But the basic stuff is there, time to refine and iron
out all the little bugs.

Written whilst on hols in Gran Canaria :)
2011-10-30 22:35:23 +00:00
Mark Liversedge
482b2c32a1 missing break statement in virtual power calculation. 2011-10-26 22:59:12 +01:00
Mark Liversedge
cd2e02fb69 Tweak Virtual Power
If cadence is zero when calculating power then we
should set power to zero. Speed will not be zero
when freewheeling and therefore the calculation
will overstate power output.

Secondly, the NullController (for testing) did
not call the realtimeController post process
function. It does now so we can test the virtual
power calculation.
2011-10-26 22:18:37 +01:00
Mark Liversedge
8e9a93f50d Add virtual power for LeMond Revolution
The LeMond revolution trainer has been analysed in
some depth by Tom Anhalt and as a happy by-product
idenitfied the power/speed curve.

Since Darren Hague had already added the ability to
approximate power from Speed when training on a turbo
this patch extends that to include the LeMond device.

All the analysis Tom performed can be read over on
wattagetraining.com here:
http://wattagetraining.com/forum/viewtopic.php?t=335

Fixes #498.
2011-10-26 21:49:12 +01:00
Mark Liversedge
7cf3325351 use # not // for comments in src.pro 2011-10-26 16:09:27 +01:00