Make the video recording button an icon
This commit is contained in:
10
src/main.c
10
src/main.c
@@ -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
14
src/medianame.h
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user