Skip to content

Commit

Permalink
Add a toString() function for the AudioTrackType enum
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartm committed Nov 21, 2012
1 parent 8b09fd3 commit 6846637
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions mythtv/libs/libmythtv/decoderbase.cpp
Expand Up @@ -1104,6 +1104,28 @@ int to_track_type(const QString &str)
return ret;
}

QString toString(AudioTrackType type)
{
QString str;

switch (type)
{
case kAudioTypeAudioDescription :
str = QObject::tr("Audio Description",
"Audio described for the visually impaired");
break;
case kAudioTypeCommentary :
str = QObject::tr("Commentary", "Audio commentary track");
break;
case kAudioTypeNormal :
default:
str = QObject::tr("Normal", "Ordinary audio track");
break;
}

return str;
}

void DecoderBase::SaveTotalDuration(void)
{
if (!m_playbackinfo || !totalDuration)
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/decoderbase.h
Expand Up @@ -54,6 +54,7 @@ typedef enum AudioTrackType
kAudioTypeAudioDescription,
kAudioTypeCommentary
} AudioTrackType;
QString toString(AudioTrackType type);

class StreamInfo
{
Expand Down

0 comments on commit 6846637

Please sign in to comment.