Commit 6db55f8f authored by Ole Aamot's avatar Ole Aamot

Prepare 0.1.1 release, but waiting on confirmation by Release Team

parent ecf4c7f7
......@@ -4,9 +4,9 @@ gingerbluedir = $(includedir)/gingerblue
gingerblue_DATA = gingerblue.xml
gingerblue_HEADERS = gingerblue.h gingerblue-chord.h gingerblue-file.h gingerblue-main.h gingerblue-song.h
gingerblue_HEADERS = gingerblue.h gingerblue-chord.h gingerblue-file.h gingerblue-main.h gingerblue-record.h gingerblue-song.h
gingerblue_SOURCES = gingerblue.c gingerblue-file.c gingerblue-main.c gingerblue-knob.c gingerblue-line.c gingerblue-song.c
gingerblue_SOURCES = gingerblue.c gingerblue-file.c gingerblue-main.c gingerblue-knob.c gingerblue-line.c gingerblue-record.c gingerblue-song.c
gingerblue_CFLAGS = $(GINGERBLUE_CFLAGS)
......
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......@@ -18,6 +18,7 @@
#include "gingerblue.h"
#include "gingerblue-chord.h"
#include "gingerblue-main.h"
#include "gingerblue-record.h"
static void gb_assistant_entry_changed (GtkEditable *, GtkAssistant *);
static void gb_assistant_button_toggled (GtkCheckButton *, GtkAssistant *);
......@@ -39,6 +40,7 @@ GtkWidget *instrument_entry, *instrument_label;
GtkWidget *label_entry, *label_label;
GtkWidget *line_entry, *line_label;
GtkWidget *recording_entry, *recording_label;
GtkWidget *summary_entry, *summary_label;
static void gb_assistant_entry_changed (GtkEditable *editable, GtkAssistant *assistant)
{
......@@ -84,6 +86,7 @@ int main (int argc, char **argv) {
GstPlayer *player;
GtkWidget *introduction;
GtkWidget *entry, *label, *button, *progress, *hbox;
GtkWidget *summary_label, *summary_entry;
guint i;
GtkWidget *musicianpage;
GtkWidget *songpage;
......@@ -109,8 +112,8 @@ int main (int argc, char **argv) {
{ NULL, -1, "Song", GTK_ASSISTANT_PAGE_CONTENT, TRUE},
{ NULL, -1, "Instrument", GTK_ASSISTANT_PAGE_CONTENT, TRUE},
{ NULL, -1, "Input Line", GTK_ASSISTANT_PAGE_CONTENT, TRUE},
{ NULL, -1, "Label", GTK_ASSISTANT_PAGE_CONFIRM, TRUE},
{ NULL, -1, "Record", GTK_ASSISTANT_PAGE_SUMMARY, TRUE},
{ NULL, -1, "Label", GTK_ASSISTANT_PAGE_CONTENT, TRUE},
{ NULL, -1, "Record", GTK_ASSISTANT_PAGE_CONFIRM, TRUE},
};
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
......@@ -144,12 +147,13 @@ int main (int argc, char **argv) {
gtk_box_pack_start (GTK_BOX (page[4].widget), line_label, FALSE, FALSE, 5);
gtk_box_pack_start (GTK_BOX (page[4].widget), line_entry, FALSE, FALSE, 5);
page[5].widget = gtk_box_new (FALSE, 5);
recording_label = gtk_label_new ("Label:");
recording_entry = gtk_entry_new ();
label_label = gtk_label_new ("Label:");
label_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (recording_entry), "GNOME");
gtk_box_pack_start (GTK_BOX (page[5].widget), recording_label, FALSE, FALSE, 5);
gtk_box_pack_start (GTK_BOX (page[5].widget), recording_entry, FALSE, FALSE, 5);
recording_label = gtk_button_new_with_label ("Record");
page[6].widget = gtk_button_new_with_label ("Record"); gtk_box_pack_start (GTK_BOX (page[6].widget), recording_label, FALSE, FALSE, 5);
for (i = 0; i < 7; i++) {
page[i].index = gtk_assistant_append_page (GTK_ASSISTANT (introduction),
GTK_WIDGET (page[i].widget));
......@@ -167,7 +171,8 @@ int main (int argc, char **argv) {
G_CALLBACK (gb_assistant_cancel), NULL);
g_signal_connect (G_OBJECT (introduction), "close",
G_CALLBACK (gb_assistant_close), NULL);
/* musicianpage = gtk_entry_new (); */
g_signal_connect (G_OBJECT (recording_label), "clicked", G_CALLBACK (gb_record_cb), g_strconcat (g_get_home_dir(), _("/Music/"), g_get_real_name(), " - ", gtk_entry_get_text (GTK_ENTRY (song_entry)), NULL));
/* musicianpage = gtk_entry_new (); */
/* real_time = g_get_real_time(); */
/* gtk_assistant_insert_page (introduction, */
/* musicianpage, */
......@@ -230,6 +235,7 @@ int main (int argc, char **argv) {
/* g_signal_connect (GTK_VOLUME_BUTTON (input_volume), "value-changed", G_CALLBACK (gb_window_pause_record), gingerblue_data->volume); */
/* g_signal_connect (GTK_VOLUME_BUTTON (input_volume), "value-changed", G_CALLBACK (gb_window_store_volume), gingerblue_data->volume); */
g_signal_connect (GTK_WINDOW (introduction), "destroy", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (GTK_WINDOW (introduction), "destroy", G_CALLBACK (gtk_main_quit), NULL);
/* g_free (gingerblue_data); */
/* play_free (player); */
/* g_date_time_free (datestamp); */
......
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......
/* $Id$
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
#include <string.h>
#include <gst/gst.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
// v4l2src ! tee name=t t. ! x264enc ! mp4mux ! filesink location=/home/rish/Desktop/okay.264 t. ! videoconvert ! autovideosink
static GMainLoop *loop;
static GstElement *pipeline, *src, *tee, *encoder, *muxer, *filesink, *videoconvert, *videosink, *queue_record, *queue_display;
static GstBus *bus;
static GstPad *teepad;
static gboolean recording = FALSE;
static gint counter = 0;
static char *file_path;
static gboolean
message_cb (GstBus * bus, GstMessage * message, gpointer user_data)
{
switch (GST_MESSAGE_TYPE (message)) {
case GST_MESSAGE_ERROR:{
GError *err = NULL;
gchar *name, *debug = NULL;
name = gst_object_get_path_string (message->src);
gst_message_parse_error (message, &err, &debug);
g_printerr ("ERROR: from element %s: %s\n", name, err->message);
if (debug != NULL)
g_printerr ("Additional debug info:\n%s\n", debug);
g_error_free (err);
g_free (debug);
g_free (name);
g_main_loop_quit (loop);
break;
}
case GST_MESSAGE_WARNING:{
GError *err = NULL;
gchar *name, *debug = NULL;
name = gst_object_get_path_string (message->src);
gst_message_parse_warning (message, &err, &debug);
g_printerr ("ERROR: from element %s: %s\n", name, err->message);
if (debug != NULL)
g_printerr ("Additional debug info:\n%s\n", debug);
g_error_free (err);
g_free (debug);
g_free (name);
break;
}
case GST_MESSAGE_EOS:{
g_print ("Got EOS\n");
g_main_loop_quit (loop);
gst_element_set_state (pipeline, GST_STATE_NULL);
g_main_loop_unref (loop);
gst_object_unref (pipeline);
exit(0);
break;
}
default:
break;
}
return TRUE;
}
static GstPadProbeReturn unlink_cb(GstPad *pad, GstPadProbeInfo *info, gpointer user_data) {
g_print("Unlinking...");
GstPad *sinkpad;
sinkpad = gst_element_get_static_pad (queue_record, "sink");
gst_pad_unlink (teepad, sinkpad);
gst_object_unref (sinkpad);
gst_element_send_event(encoder, gst_event_new_eos());
sleep(1);
gst_bin_remove(GST_BIN (pipeline), queue_record);
gst_bin_remove(GST_BIN (pipeline), encoder);
gst_bin_remove(GST_BIN (pipeline), muxer);
gst_bin_remove(GST_BIN (pipeline), filesink);
gst_element_set_state(queue_record, GST_STATE_NULL);
gst_element_set_state(encoder, GST_STATE_NULL);
gst_element_set_state(muxer, GST_STATE_NULL);
gst_element_set_state(filesink, GST_STATE_NULL);
gst_object_unref(queue_record);
gst_object_unref(encoder);
gst_object_unref(muxer);
gst_object_unref(filesink);
gst_element_release_request_pad (tee, teepad);
gst_object_unref (teepad);
g_print("Unlinked\n");
return GST_PAD_PROBE_REMOVE;
}
void stopRecording() {
g_print("stopRecording\n");
gst_pad_add_probe(teepad, GST_PAD_PROBE_TYPE_IDLE, unlink_cb, NULL, (GDestroyNotify) g_free);
recording = FALSE;
}
void startRecording() {
g_print("startRecording\n");
GstPad *sinkpad;
GstPadTemplate *templ;
templ = gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(tee), "src_%u");
teepad = gst_element_request_pad(tee, templ, NULL, NULL);
queue_record = gst_element_factory_make("queue", "queue_record");
encoder = gst_element_factory_make("x264enc", NULL);
muxer = gst_element_factory_make("mp4mux", NULL);
filesink = gst_element_factory_make("filesink", NULL);
char *file_name = (char*) malloc(255 * sizeof(char));
sprintf(file_name, "%s%d.mp4", file_path, counter++);
g_print("Recording to file %s", file_name);
g_object_set(filesink, "location", file_name, NULL);
g_object_set(encoder, "tune", 4, NULL);
free(file_name);
gst_bin_add_many(GST_BIN(pipeline), gst_object_ref(queue_record), gst_object_ref(encoder), gst_object_ref(muxer), gst_object_ref(filesink), NULL);
gst_element_link_many(queue_record, encoder, muxer, filesink, NULL);
gst_element_sync_state_with_parent(queue_record);
gst_element_sync_state_with_parent(encoder);
gst_element_sync_state_with_parent(muxer);
gst_element_sync_state_with_parent(filesink);
sinkpad = gst_element_get_static_pad(queue_record, "sink");
gst_pad_link(teepad, sinkpad);
gst_object_unref(sinkpad);
recording = TRUE;
}
int sigintHandler(int unused) {
g_print("You ctrl-c!\n");
if (recording)
stopRecording();
else
startRecording();
return 0;
}
int gb_record_cb (char *path)
{
file_path = (char*) malloc(255 * sizeof(char));
file_path = g_strdup(path);
signal(SIGINT, sigintHandler);
pipeline = gst_pipeline_new(NULL);
src = gst_element_factory_make("v4l2src", NULL);
tee = gst_element_factory_make("tee", "tee");
queue_display = gst_element_factory_make("queue", "queue_display");
videoconvert = gst_element_factory_make("videoconvert", NULL);
videosink = gst_element_factory_make("autovideosink", NULL);
if (!pipeline || !src || !tee || !videoconvert || !videosink || !queue_display) {
g_error("Failed to create elements");
return -1;
}
gst_bin_add_many(GST_BIN(pipeline), src, tee, queue_display, videoconvert, videosink, NULL);
if (!gst_element_link_many(src, tee, NULL)
|| !gst_element_link_many(tee, queue_display, videoconvert, videosink, NULL)) {
g_error("Failed to link elements");
return -2;
}
startRecording();
loop = g_main_loop_new(NULL, FALSE);
bus = gst_pipeline_get_bus(GST_PIPELINE (pipeline));
gst_bus_add_signal_watch(bus);
g_signal_connect(G_OBJECT(bus), "message", G_CALLBACK(message_cb), NULL);
gst_object_unref(GST_OBJECT(bus));
gst_element_set_state(pipeline, GST_STATE_PLAYING);
g_print("Starting loop\n");
g_main_loop_run(loop);
return 0;
}
/* $Id$
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
#include <string.h>
#include <gst/gst.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
static gboolean message_cb (GstBus * bus, GstMessage * message, gpointer user_data);
static GstPadProbeReturn unlink_cb(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
void stopRecording();
void startRecording();
int sigintHandler(int unused);
int gb_record_cb (gchar *path);
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......
......@@ -3,7 +3,7 @@
Copyright (C) 2018 Ole Aamot Software
Author(s): Ole Aamot <ole@gnome.org>
License: GNU GPL version 3
Version: 0.1.1 (2018-12-23)
Version: 0.1.1 (2018-12-26)
Website: http://www.gingerblue.org/
*/
......
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