summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
diff options
context:
space:
mode:
authorRafael Antognolli <antognolli@gmail.com>2011-09-05 21:52:11 +0000
committerRafael Antognolli <antognolli@gmail.com>2011-09-05 21:52:11 +0000
commitbed7fa1c6a2b70ce6bab313e17ba4c03370f3792 (patch)
tree8dd42bb2128310761418e4894aeae331e2088b87 /legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
parent883cea4caa64862c7e0cfd712a2bd3fe1af67115 (diff)
emotion/generic: Add audio/video/spu channel set/get/count.
SVN revision: 63218
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c66
1 files changed, 55 insertions, 11 deletions
diff --git a/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c b/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
index a29793151e..2e13ed4878 100644
--- a/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
+++ b/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
@@ -476,6 +476,26 @@ _audio_track_set(struct _App *app)
476} 476}
477 477
478static void 478static void
479_video_track_set(struct _App *app)
480{
481 int track;
482
483 _em_read_safe(app->em_read, &track, sizeof(track));
484
485 libvlc_video_set_track(app->mp, track);
486}
487
488static void
489_spu_track_set(struct _App *app)
490{
491 int track;
492
493 _em_read_safe(app->em_read, &track, sizeof(track));
494
495 libvlc_video_set_spu(app->mp, track);
496}
497
498static void
479_file_set_done(struct _App *app) 499_file_set_done(struct _App *app)
480{ 500{
481 int r; 501 int r;
@@ -578,22 +598,18 @@ _process_emotion_commands(struct _App *app)
578 case EM_CMD_AUDIO_TRACK_SET: 598 case EM_CMD_AUDIO_TRACK_SET:
579 _audio_track_set(app); 599 _audio_track_set(app);
580 break; 600 break;
601 case EM_CMD_VIDEO_TRACK_SET:
602 _video_track_set(app);
603 break;
581 }; 604 };
582} 605}
583 606
584static void 607static void
585_send_track_info(struct _App *app) 608_send_track_info(struct _App *app, int cmd, int current, int count, libvlc_track_description_t *desc)
586{ 609{
587 int track_count, current; 610 _send_cmd_start(app, cmd);
588 libvlc_track_description_t *desc;
589
590 current = libvlc_audio_get_track(app->mp);
591 track_count = libvlc_audio_get_track_count(app->mp);
592 desc = libvlc_audio_get_track_description(app->mp);
593
594 _send_cmd_start(app, EM_RESULT_AUDIO_TRACK_INFO);
595 SEND_CMD_PARAM(app, current); 611 SEND_CMD_PARAM(app, current);
596 SEND_CMD_PARAM(app, track_count); 612 SEND_CMD_PARAM(app, count);
597 while (desc) 613 while (desc)
598 { 614 {
599 int tid = desc->i_id; 615 int tid = desc->i_id;
@@ -606,6 +622,34 @@ _send_track_info(struct _App *app)
606} 622}
607 623
608static void 624static void
625_send_all_track_info(struct _App *app)
626{
627 int track_count, current;
628 libvlc_track_description_t *desc;
629
630 current = libvlc_audio_get_track(app->mp);
631 track_count = libvlc_audio_get_track_count(app->mp);
632 desc = libvlc_audio_get_track_description(app->mp);
633
634 _send_track_info(app, EM_RESULT_AUDIO_TRACK_INFO,
635 current, track_count, desc);
636
637 current = libvlc_video_get_track(app->mp);
638 track_count = libvlc_video_get_track_count(app->mp);
639 desc = libvlc_video_get_track_description(app->mp);
640
641 _send_track_info(app, EM_RESULT_VIDEO_TRACK_INFO,
642 current, track_count, desc);
643
644 current = libvlc_video_get_spu(app->mp);
645 track_count = libvlc_video_get_spu_count(app->mp);
646 desc = libvlc_video_get_spu_description(app->mp);
647
648 _send_track_info(app, EM_RESULT_SPU_TRACK_INFO,
649 current, track_count, desc);
650}
651
652static void
609_position_changed(struct _App *app) 653_position_changed(struct _App *app)
610{ 654{
611 if (!app->opening) 655 if (!app->opening)
@@ -619,7 +663,7 @@ _position_changed(struct _App *app)
619 _send_resize(app, w, h); 663 _send_resize(app, w, h);
620 664
621 /* sending audio track info */ 665 /* sending audio track info */
622 // _send_track_info(app); 666 _send_all_track_info(app);
623 667
624 libvlc_media_player_stop(app->mp); 668 libvlc_media_player_stop(app->mp);
625} 669}