QtFit  0.1
Internal library development documentation
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
VideoTitleMessagePrivate Class Reference
Inheritance diagram for VideoTitleMessagePrivate:
[legend]
Collaboration diagram for VideoTitleMessagePrivate:
[legend]

Public Member Functions

 VideoTitleMessagePrivate (VideoTitleMessage *const q)
 
virtual ~VideoTitleMessagePrivate ()
 
- Public Member Functions inherited from AbstractDataMessagePrivate
 AbstractDataMessagePrivate (AbstractDataMessage *const q)
 
virtual ~AbstractDataMessagePrivate ()
 
bool setFields (const DataDefinition *const defn, const QByteArray &record)
 

Public Attributes

MessageIndex messageIndex
 The VideoTitleMessage FIT message's messageIndex field. More...
 
quint16 messageCount
 The VideoTitleMessage FIT message's messageCount field. More...
 
QString text
 The VideoTitleMessage FIT message's text field.
 
- Public Attributes inherited from AbstractDataMessagePrivate
MesgNum globalMessageNumber
 FIT Globla Message Number for this FIT Data Message.
 

Protected Member Functions

bool setField (const int fieldId, const QByteArray &data, const FitBaseType baseType, const bool bigEndian) override
 
- Protected Member Functions inherited from AbstractDataMessagePrivate
bool verify (const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractDataMessagePrivate
AbstractDataMessage *const q_ptr
 Internal q-pointer.
 

Detailed Description

The VideoTitleMessagePrivate class provides private implementation for the VideoTitleMessage.

See also
VideoTitleMessage

Definition at line 38 of file videotitlemessage_p.h.

Constructor & Destructor Documentation

◆ VideoTitleMessagePrivate()

VideoTitleMessagePrivate::VideoTitleMessagePrivate ( VideoTitleMessage *const  q)
explicit

Constructs a VideoTitleMessagePrivate object with public implementation q.

Parameters
qPointer to public implementaton.

Definition at line 156 of file videotitlemessage.cpp.

158  , messageIndex(static_cast<MessageIndex>(-1))
159  , messageCount(0xFFFF)
160 {
161  globalMessageNumber = MesgNum::VideoTitle;
162 }
MesgNum globalMessageNumber
FIT Globla Message Number for this FIT Data Message.
MessageIndex messageIndex
The VideoTitleMessage FIT message's messageIndex field.
quint16 messageCount
The VideoTitleMessage FIT message's messageCount field.
MessageIndex
Garmin FIT MessageIndex type.
Definition: types.h:263

References AbstractDataMessagePrivate::globalMessageNumber.

◆ ~VideoTitleMessagePrivate()

VideoTitleMessagePrivate::~VideoTitleMessagePrivate ( )
virtual

Destroys the VideoTitleMessagePrivate object.

Definition at line 169 of file videotitlemessage.cpp.

170 {
171 
172 }

Member Function Documentation

◆ setField()

bool VideoTitleMessagePrivate::setField ( const int  fieldId,
const QByteArray &  data,
const FitBaseType  baseType,
const bool  bigEndian 
)
overrideprotectedvirtual

Sets the value of the fieldId field.

Derived classes must implement this method to extract the baseType value from data, and assign the extracted value the fieldId field.

Parameters
fieldIdThe field number within the given FIT data message.
dataThe raw data to extract the field value from.
baseTypeThe FIT base type for the field.
bigEndianWhether or not multibyte values in record are big-endian.
Returns
true if the field was set, or safely ignored; false otherwise.

Implements AbstractDataMessagePrivate.

Definition at line 174 of file videotitlemessage.cpp.

176 {
177  switch (fieldId) {
178  case 254: // See Profile.xlsx::Messages:video_title.messageIndex
179  if (!verify(data, baseType, 2, FitBaseType::Uint16, "video_title.messageIndex")) return false;
180  this->messageIndex = static_cast<MessageIndex>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
181  break;
182  case 0: // See Profile.xlsx::Messages:video_title.messageCount
183  if (!verify(data, baseType, 2, FitBaseType::Uint16, "video_title.messageCount")) return false;
184  this->messageCount = static_cast<quint16>(bigEndian ? qFromBigEndian<quint16>(data) : qFromLittleEndian<quint16>(data));
185  break;
186  case 1: // See Profile.xlsx::Messages:video_title.text
187  if (!verify(data, baseType, 1, FitBaseType::String, "video_title.text")) return false;
188  this->text = QString::fromUtf8(data);
189  break;
190  default:
191  qWarning() << "ignoring unknown video_title message field number" << fieldId << bigEndian;
192  // Fall through to return true, as its still 'safe' to continue parsing data messages.
193  }
194  return true;
195 }
bool verify(const QByteArray &data, const FitBaseType actualType, const int expectedSize, const FitBaseType expectedType, const char *messageFieldName)
QString text
The VideoTitleMessage FIT message's text field.

References AbstractDataMessagePrivate::verify().

Here is the call graph for this function:

Member Data Documentation

◆ messageCount

quint16 VideoTitleMessagePrivate::messageCount

The VideoTitleMessage FIT message's messageCount field.

Total number of title parts

Definition at line 53 of file videotitlemessage_p.h.

◆ messageIndex

MessageIndex VideoTitleMessagePrivate::messageIndex

The VideoTitleMessage FIT message's messageIndex field.

Long titles will be split into multiple parts

Definition at line 46 of file videotitlemessage_p.h.


The documentation for this class was generated from the following files: