Commit a365fd5a authored by Ole Aamot's avatar Ole Aamot

GNOME Gingerblue 0.1.6

parent 306c47a7
commit 306c47a75c8f7dcf18c2e7869479b75818198bdd
Author: Ole Aamot <ole@gnome.org>
Date: Tue Jul 14 12:31:46 2020 +0200
GNOME Gingerblue 0.1.5
NEWS | 9 +++++++++
configure.ac | 2 +-
gingerblue.spec.in | 6 ++++++
src/gingerblue-main.c | 2 +-
src/gingerblue-record.c | 7 +++++--
5 files changed, 22 insertions(+), 4 deletions(-)
commit 6f3023f0fc8636cdfe141248528ca718bb0b85ea
Author: Ole Aamot <ole@gnome.org>
Date: Sun Jul 5 11:51:04 2020 +0200
GNOME Gingerblue 0.1.4
ChangeLog | 36 ++++++++++++++++++++++++++++++++++++
NEWS | 19 +++++++++++++++++++
configure.ac | 2 +-
data/gingerblue.appdata.xml.in | 4 +++-
4 files changed, 59 insertions(+), 2 deletions(-)
commit 4930c0e381f3f1599b92edf109977752d4229b06
Author: Ole Aamot <oleaamot@localhost.localdomain>
Date: Sun Jul 5 11:35:44 2020 +0200
......
=============
Version 0.1.6
=============
Gingerblue
* src/gingerblue-main.c: Add recording support with GStreamer
* src/gingerblue-record.c: Remove the obsolete recording code
=============
Version 0.1.5
=============
......
......@@ -155,6 +155,7 @@ int main (int argc, char **argv) {
gtk_box_pack_start (GTK_BOX (page[5].widget), label_label, FALSE, FALSE, 5);
gtk_box_pack_start (GTK_BOX (page[5].widget), label_entry, FALSE, FALSE, 5);
recording_label = gtk_button_new_with_label ("Record");
g_signal_connect (G_OBJECT (recording_label), "clicked", G_CALLBACK (gb_record_cb), g_strconcat (g_get_user_special_dir (G_USER_DIRECTORY_MUSIC), "/", g_get_real_name(), " - ", gtk_entry_get_text (GTK_ENTRY (song_entry)), ".ogg", NULL));
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),
......@@ -173,7 +174,6 @@ 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);
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, */
......@@ -232,6 +232,31 @@ int main (int argc, char **argv) {
gtk_widget_show_all (main_window);
*/
gst_init (&argc, &argv);
GstElement *src, *conv, *enc, *muxer, *sink, *pipeline;
gst_init(NULL, NULL);
pipeline = gst_pipeline_new ("record_pipe");
src = gst_element_factory_make ("autoaudiosrc", "auto_source");
conv = gst_element_factory_make ("audioconvert", "convert");
enc = gst_element_factory_make ("vorbisenc", "vorbis_enc");
muxer = gst_element_factory_make ("oggmux", "oggmux");
sink = gst_element_factory_make ("filesink", "sink");
g_object_set (G_OBJECT (sink), "location" , g_strconcat (g_get_user_special_dir (G_USER_DIRECTORY_MUSIC), "/", g_get_real_name(), " - ", gtk_entry_get_text (GTK_ENTRY (song_entry)), ".ogg", NULL), NULL);
gst_bin_add_many (GST_BIN (pipeline), src, conv, enc, muxer, sink, NULL);
gst_element_link_many (src, conv, enc, muxer, sink, NULL);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
GMainLoop *loop = g_main_loop_new (NULL, TRUE);
g_main_loop_run (loop);
gst_element_set_state (pipeline, GST_STATE_NULL);
g_main_loop_unref (loop);
gst_object_unref (GST_OBJECT (pipeline));
/* player = play_new ("http://stream.radionorwegian.com/56.ogg", gingerblue_data->volume); */
/* input_volume_value = gb_window_set_volume(GTK_VOLUME_BUTTON (input_volume), 0.00); *\/ */
/* g_signal_connect (GTK_BUTTON (input_record), "clicked", G_CALLBACK (gb_window_new_record), gingerblue_data->volume); */
......
......@@ -163,46 +163,5 @@ int sigintHandler(int unused) {
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("audio_stream");
audio_source = gst_element_factory_make ("alsasrc", "audio_source");
sink = gst_element_factory_make ("alsasink", "audio_sink");
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;
}
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