Commit d27d6a25 authored by Luis de Bethencourt's avatar Luis de Bethencourt

ui: add audio stream toggle icon

parent 1ef3a9f1
icons_DATA = \
audio-stream-toggle.png \
audio-volume-high.png \
audio-volume-low.png \
media-actions-pause.png \
media-actions-start.png \
media-actions-segment-point.png \
audio-volume-low.png \
audio-volume-high.png \
vid-panel.png \
media-actions-start.png \
subtitle-toggle.png \
video-stream-toggle.png
video-stream-toggle.png \
vid-panel.png
iconsdir = $(datadir)/snappy
EXTRA_DIST = \
......
......@@ -413,7 +413,7 @@ load_controls (UserInterface * ui)
{
// Check icon files exist
gchar *vid_panel_png;
gchar *icon_files[8];
gchar *icon_files[9];
gchar *duration_str;
gint c;
ClutterColor control_color1 = { 0x12, 0x12, 0x12, 0xff };
......@@ -447,6 +447,8 @@ load_controls (UserInterface * ui)
"/subtitle-toggle.png");
ui->video_stream_toggle_png = g_strdup_printf ("%s%s", SNAPPY_DATA_DIR,
"/video-stream-toggle.png");
ui->audio_stream_toggle_png = g_strdup_printf ("%s%s", SNAPPY_DATA_DIR,
"/audio-stream-toggle.png");
icon_files[0] = vid_panel_png;
icon_files[1] = ui->play_png;
......@@ -456,8 +458,9 @@ load_controls (UserInterface * ui)
icon_files[5] = ui->segment_png;
icon_files[6] = ui->subtitle_toggle_png;
icon_files[7] = ui->video_stream_toggle_png;
icon_files[8] = ui->audio_stream_toggle_png;
for (c = 0; c < 8; c++) {
for (c = 0; c < 9; c++) {
if (!g_file_test (icon_files[c], G_FILE_TEST_EXISTS)) {
g_print ("Icon file doesn't exist, are you sure you have "
" installed snappy correctly?\nThis file needed is: %s\n",
......@@ -660,6 +663,18 @@ load_controls (UserInterface * ui)
clutter_box_pack (CLUTTER_BOX (bottom_box), ui->video_stream_toggle, "x-align",
CLUTTER_BOX_ALIGNMENT_START, NULL);
// Controls audio stream toggle
ui->audio_stream_toggle = clutter_texture_new_from_file
(ui->audio_stream_toggle_png, &error);
if (!ui->audio_stream_toggle && error)
g_debug ("Clutter error: %s\n", error->message);
if (error) {
g_error_free (error);
error = NULL;
}
clutter_box_pack (CLUTTER_BOX (bottom_box), ui->audio_stream_toggle, "x-align",
CLUTTER_BOX_ALIGNMENT_END, NULL);
// Controls subtitle toggle
ui->subtitle_toggle = clutter_texture_new_from_file (ui->subtitle_toggle_png,
&error);
......@@ -1025,6 +1040,7 @@ update_controls_size (UserInterface * ui)
icon_size * 1.2f, icon_size); /* originally 120x100 */
clutter_actor_set_size (ui->subtitle_toggle, icon_size, icon_size);
clutter_actor_set_size (ui->video_stream_toggle, icon_size, icon_size);
clutter_actor_set_size (ui->audio_stream_toggle, icon_size, icon_size);
update_volume (ui, -1);
}
......@@ -1057,6 +1073,7 @@ interface_init (UserInterface * ui)
ui->subtitle_toggle_png = NULL;
ui->video_stream_toggle_png = NULL;
ui->audio_stream_toggle_png = NULL;
ui->duration_str = NULL;
......
......@@ -87,7 +87,7 @@ struct _UserInterface
gchar *segment_png;
gchar *volume_low_png, *volume_high_png;
gchar *subtitle_toggle_png;
gchar *video_stream_toggle_png;
gchar *video_stream_toggle_png, *audio_stream_toggle_png;
gchar *duration_str;
ClutterColor stage_color, control_color1, control_color2;
......@@ -102,7 +102,7 @@ struct _UserInterface
ClutterActor *volume_box;
ClutterActor *volume_low, *volume_high;
ClutterActor *subtitle_toggle;
ClutterActor *video_stream_toggle;
ClutterActor *video_stream_toggle, *audio_stream_toggle;
ClutterActor *vol_int, *vol_int_bg, *volume_point;
ClutterActor *info_box;
ClutterActor *main_box;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment