-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 05/22/2013 12:58 PM, Hans Ecke wrote:
> Looks to me like this is handled inside gnome-mplayer: see
> src/gui.c around lines 2491 and 2374.
Hans,
In gmtk we are handling the J key using the mplayer slave interface
sub_select
sub_select [value]
Display subtitle with index [value]. Turn subtitle display off if
[value] is -1 or greater than the highest available subtitle index.
Cycle through the available subtitles if [value] is omitted or less
than -1 (forward or backward respectively).
Supported subtitle sources are -sub options on the command
line, VOBsubs, DVD subtitles, and Ogg and Matroska text streams.
This command is mainly for cycling all subtitles, if you want to set
a specific subtitle, use sub_file, sub_vob, or sub_demux.
We are passing no value to it, so it cycles thru the existing set of
subtitles.
switch_audio is the command we use for changing audio tracks
switch_audio [value] (currently MPEG*, AVI, Matroska and streams
handled by libavformat)
Switch to the audio track with the ID [value]. Cycle through the
available tracks if [value] is omitted or negative.
So we are not really doing anything with the tracks. We do know the
tracks in gmtk
player->subtitles
player->audio_tracks
And you can traverse the list with something like this
iter = player->audio_tracks;
while (iter) {
track = (GmtkMediaPlayerAudioTrack *) iter->data;
if (track->id == player->audio_track_id)
value = track->label;
iter = iter->next;
}
break;
iter = player->subtitles;
while (iter) {
subtitle = (GmtkMediaPlayerSubtitle *) iter->data;
if (subtitle->id == player->subtitle_id &&
subtitle->is_file == player->subtitle_is_file)
value = subtitle->label;
iter = iter->next;
}
break;
So if you want to enhance GMTK and use some custom code instead of
sub_select and switch_audio... go for it.
Kevin
- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -
http://www.enigmail.net/
iEYEARECAAYFAlGfcK8ACgkQ6w2kMH0L1dE9DwCgjXJCodIB2HIGY8bURkAYw6y+
lMgAn2TG3LQjVOHGEACw3yM6T4ntrtaP
=TbQR
-----END PGP SIGNATURE-----