Make the video recording button an icon

This commit is contained in:
Martijn Braam
2024-07-15 18:03:35 +02:00
parent 8b525210bc
commit ccf0314b62
8 changed files with 296 additions and 7 deletions

View File

@@ -937,8 +937,10 @@ flash_button_clicked(GtkWidget *button, gpointer user_data)
void
notify_movie_progress(void)
{
if (!movie_start)
gtk_button_set_label(GTK_BUTTON(movie), "Rec");
if (!movie_start) {
// Recording started
gtk_button_set_icon_name(GTK_BUTTON(movie), "video-recording-symbolic");
}
}
void
@@ -952,11 +954,11 @@ on_movie_clicked(GtkWidget *widget, gpointer user_data)
{
if (movie_start) {
movie_start = 0;
gtk_button_set_label(GTK_BUTTON(movie), "Busy");
gtk_button_set_icon_name(GTK_BUTTON(movie), "video-processing-symbolic");
on_movie_stop();
} else {
movie_start = 1;
gtk_button_set_label(GTK_BUTTON(movie), "Stop");
gtk_button_set_icon_name(GTK_BUTTON(movie), "video-recording-symbolic");
on_movie_start();
}
}

14
src/medianame.h Normal file
View File

@@ -0,0 +1,14 @@
#include <sys/time.h>
static inline unsigned long long time_usec(void)
{
struct timeval t;
gettimeofday(&t, NULL);
return t.tv_sec * 1000000 + t.tv_usec;
}
static inline void get_name(char *buf, char *dir, char *templ)
{
sprintf(buf, "%s/%lld.%s", dir, time_usec(), templ);
}