+RESULT eServiceDVD::audioTracks(ePtr<iAudioTrackSelection> &ptr)
+{
+ ptr = this;
+ return 0;
+}
+
+int eServiceDVD::getNumberOfTracks()
+{
+ int i = 0;
+ ddvd_get_audio_count(m_ddvdconfig, &i);
+ eDebug("getNumberOfTracks returns %i", i);
+ return i;
+}
+
+int eServiceDVD::getCurrentTrack()
+{
+ int audio_id,audio_type;
+ uint16_t audio_lang;
+ ddvd_get_last_audio(m_ddvdconfig, &audio_id, &audio_lang, &audio_type);
+ eDebug("getCurrentTrack returns %i", audio_id);
+ return audio_id;
+}
+
+RESULT eServiceDVD::selectTrack(unsigned int i)
+{
+ ddvd_set_audio(m_ddvdconfig, i);
+ eDebug("selectTrack %i", i);
+ return 0;
+}
+
+RESULT eServiceDVD::getTrackInfo(struct iAudioTrackInfo &info, unsigned int audio_id)
+{
+ int audio_type;
+ uint16_t audio_lang;
+ ddvd_get_audio_byid(m_ddvdconfig, audio_id, &audio_lang, &audio_type);
+ char audio_string[3]={audio_lang >> 8, audio_lang, 0};
+ info.m_pid = audio_id+1;
+ info.m_language = audio_string;
+ switch(audio_type)
+ {
+ case DDVD_MPEG:
+ info.m_description = "MPEG";
+ break;
+ case DDVD_AC3:
+ info.m_description = "AC3";
+ break;
+ case DDVD_DTS:
+ info.m_description = "DTS";
+ break;
+ case DDVD_LPCM:
+ info.m_description = "LPCM";
+ break;
+ default:
+ info.m_description = "und";
+ }
+ return 0;
+}
+