Feature request: Always ask where to save file?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Audio Recorder |
New
|
Undecided
|
Andrey Novikov |
Bug Description
Dear all,
My request origins from a discussion on AskUbuntu [1]. Currently, Audio Recorder doesn't write to the xbel file upon creation of a new file.
This problem could be solved, I think, by a new optional setting to ask the user each time where to save the file. It would then write to xbel by prompting the GTK File Dialog window.
What do you think of this request?
Would you consider it useful?
Thankfully,
~Robert
moma (osmoma) wrote : Re: [Bug 1610508] [NEW] Feature request: Always ask where to save file? | #1 |
moma (osmoma) wrote : | #2 |
Re-hi,
If you make a sample code (with GtkRecentManager) I will bake it to audio-recoder for Ubuntu 16.04+.
Or Schiro (orschiro) wrote : | #3 |
Thank you Osmo!
You're referring to something like this?
GtkRecentManager *manager;
GtkRecentInfo *info;
GError *error = NULL;
manager = gtk_recent_
info = gtk_recent_
if (error)
{
g_warning ("Could not find the file: %s", error->message);
g_error_free (error);
}
else
{
// Use the info object
gtk_
}
moma (osmoma) wrote : Re: [Bug 1610508] Re: Feature request: Always ask where to save file? | #4 |
Yes, very good start, but make a complete sample code, like shown in
test1.c. You may continue from it.
I like to use "gedit" editor and a terminal window.
Look for the audio-recorder/
you might need. For example:
sudo apt install autotools-dev gettext intltool pkg-config libgtk-3-dev
libglib2.0-dev libdbus-1-dev libappindicator
// test1.c
#include <glib.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
// Ref: https:/
// https:/
// Compile:
// gcc $(pkg-config --cflags gtk+-3.0) -o test1 test1.c $(pkg-config
--libs gtk+-3.0)
//
// Run:
// ./test1
static void saveToXBel(
g_print ("Save to xbel.\n");
//...
const gchar *file_uri = "test1.c";
GtkRecentManager *manager = gtk_recent_
gtk_recent_
// Notice: It is better to call gtk_recent_
GtkRecentData; mime type, exec app name, etc..
//
// Ref:
https:/
// gboolean gtk_recent_
// const gchar *uri,
// const GtkRecentData *recent_data);
}
static void activateApp(
GtkWidget *window;
GtkWidget *button;
GtkWidget *button_box;
window = gtk_application
gtk_window_
gtk_window_
button_box = gtk_button_box_new (GTK_ORIENTATIO
gtk_container_add (GTK_CONTAINER (window), button_box);
button = gtk_button_
g_signal_connect (button, "clicked", G_CALLBACK (saveToXBel), NULL);
g_signal_
(gtk_widget_
gtk_container_add (GTK_CONTAINER (button_box), button);
gtk_widget_
}
int main(int argc, char **argv) {
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.example", G_APPLICATION_
g_signal_connect (app, "activate", G_CALLBACK (activateApp), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);
return status;
}
On Sat, Aug 6, 2016 at 10:11 AM, Robert Orzanna <email address hidden> wrote:
> Thank you Osmo!
>
> You're referring to something like this?
>
> GtkRecentManager *manager;
> GtkRecentInfo *info;
> GError *error = NULL;
>
> manager = gtk_recent_
> info = gtk_recent_
> if (error)
> {
> g_warning ("Could not find the file: %s", error->message);
> g_error_free (error);
> }
> else
> {
> // Use the info object
> gtk_recent_
> }
>
> --
> You received this bug notification because you are subscribed to Audio
> Recorder.
> https:/
>
> Title:
> Feature request: Always ask where to save file?
>
> Status in Audio Recor...
Or Schiro (orschiro) wrote : | #5 |
Hi Osmo,
Thank you really for your guidance!
I will try to continue from here.
That's a good exercise. :-)
What should the final sample code actually look like?
What is it supposed to be doing?
Should I basically adapt test1.c to the code base of Audio Recorder?
~Robert
moma (osmoma) wrote : | #6 |
Re-hi,
I do not think gtk_recent_
.mp3) files automatically.
You may need to use gtk_recent_
structure with values.
Here are 2 tests; test a and b.
// Test a) Does this work?
// Put a valid audio1.mp3 file in the current directory.
const gchar *file_uri = "audio1.mp3";
GtkRecentManager *manager = gtk_recent_
gboolean ret = gtk_recent_
if (!ret) {
g_print("Error, cannot add to recent files: %s\n", file_uri);
}
// Check the $HOME/.
$ cat $HOME/.
-------
// Test b) Is this better?
GtkRecentData *recent_data;
recent_data = g_slice_new0 (GtkRecentData);
recent_
recent_
recent_
recent_
gboolean ret = gtk_recent_
recent_data);
g_slice_free (GtkRecentData, recent_data);
if (!ret) {
g_print("Error, cannot add to recent files: %s\n", file_uri);
}
-------
Notice.
You may need to clear the $HOME/.
between tests. Truncate it with.
$ echo "" > $HOME/.
I can add & bake your code to audio-recorder when it is tested.
Muito bem Robert,
Até logo,
Osmo (Moma) Antero
Portugal
Or Schiro (orschiro) wrote : | #7 |
moma (osmoma) wrote : | #8 |
Yes, I think the following code would work for any audio file.
One could set the mime-type more correctly, but I think "audio" is enough.
$ xdg-mime query filetype audio2.ogg
static void saveToXBel(
g_print ("Saving to xbel.\n");
// Make URI (file:///....) of a filename
// Some audio file with complete path ! NOTICE !
const gchar *file = "/home/
GError *error = NULL;
gchar *uri = g_filename_
if (error) {
g_print("Cannot make file uri of %s.\n", file);
g_error_
return;
}
GtkRecentManager *manager = gtk_recent_
GtkRecentData *recent_data = g_slice_new0 (GtkRecentData);
// $ xdg-mime query filetype audio1.mp3
// Set correct mime type
recent_
recent_
recent_
recent_
gboolean ret = gtk_recent_
if (!ret) {
g_print("Error, cannot add to recent files. %s\n", uri);
}
g_slice_
g_free(uri);
}
On Sun, Aug 7, 2016 at 10:34 AM, Robert Orzanna <email address hidden> wrote:
> Hi Osmo,
>
> So, now I compiled and tested the following attached test1.c file and
> yes, the mp3 file does show up in xbel! :-)
>
> Does the same also occur then for ogg files?
>
> Sunny greetings from Poland,
>
> ~Robert
>
> ** Attachment added: "test1.c"
> https:/
> attachment/
>
> --
> You received this bug notification because you are subscribed to Audio
> Recorder.
> https:/
>
> Title:
> Feature request: Always ask where to save file?
>
> Status in Audio Recorder:
> New
>
> Bug description:
> Dear all,
>
> My request origins from a discussion on AskUbuntu [1]. Currently,
> Audio Recorder doesn't write to the xbel file upon creation of a new
> file.
>
> This problem could be solved, I think, by a new optional setting to
> ask the user each time where to save the file. It would then write to
> xbel by prompting the GTK File Dialog window.
>
> What do you think of this request?
>
> Would you consider it useful?
>
> Thankfully,
>
> ~Robert
>
>
> [1] https:/
> indicator-
> noredirect=
>
> To manage notifications about this bug go to:
> https:/
>
--
Sent from my PC, laptop or phone with Ubuntu-Linux.
Or Schiro (orschiro) wrote : | #9 |
Great! So, how do we proceed from here to bake the code into? :-)
~Robert
moma (osmoma) wrote : | #10 |
Ok, very good.
1) Download the source of audio-recorder to your computer.
Ref: https:/
Read README and INSTALL files.
http://
Learn to compile and run the program.
Remember to kill the existing audio-recorder before testing your local copy
from .../src/
$ pkill audio-recorder
------
2) Find a suitable place to add the new code.
http://
See gst-recorder.c file and function
void rec_stop_
...
}
Add the code there.
--------
3) The code must check if the recorded file is valid (if it exists and its
size is > 0)
The code must check if the lastly recorded audio file is already in the
xbel recent list. Do not add duplicates.
Ref: https:/
gtk_recent_
Let me know about your results.
Good luck.
Kindly
Moma
On Sun, Aug 7, 2016 at 12:28 PM, Robert Orzanna <email address hidden> wrote:
> Great! So, how do we proceed from here to bake the code into? :-)
>
> ~Robert
>
> --
> You received this bug notification because you are subscribed to Audio
> Recorder.
> https:/
>
> Title:
> Feature request: Always ask where to save file?
>
> Status in Audio Recorder:
> New
>
> Bug description:
> Dear all,
>
> My request origins from a discussion on AskUbuntu [1]. Currently,
> Audio Recorder doesn't write to the xbel file upon creation of a new
> file.
>
> This problem could be solved, I think, by a new optional setting to
> ask the user each time where to save the file. It would then write to
> xbel by prompting the GTK File Dialog window.
>
> What do you think of this request?
>
> Would you consider it useful?
>
> Thankfully,
>
> ~Robert
>
>
> [1] https:/
> indicator-
> noredirect=
>
> To manage notifications about this bug go to:
> https:/
>
--
Sent from my PC, laptop or phone with Ubuntu-Linux.
moma (osmoma) wrote : | #11 |
Re-hi Robert,
(this is optional)
You may also a new option to [Additional settings] dialog.
http://
New option could be a checkbox with text:
[x] Add new recordings to recent files list.
Some users may not want to add recordings to the xbel recent files.
The new option can be of type BOOLEAN. See
http://
Cumprimentos
Moma
Portugal
On Sun, Aug 7, 2016 at 7:20 PM, Osmo Antero <email address hidden> wrote:
> Ok, very good.
>
> 1) Download the source of audio-recorder to your computer.
> Ref: https:/
>
> Read README and INSTALL files.
> http://
> trunk/view/
>
> Learn to compile and run the program.
> Remember to kill the existing audio-recorder before testing your local
> copy from .../src/
>
> $ pkill audio-recorder
> ------
>
> 2) Find a suitable place to add the new code.
> http://
> trunk/files/
>
> See gst-recorder.c file and function
>
> void rec_stop_
> ...
> }
> Add the code there.
> --------
>
> 3) The code must check if the recorded file is valid (if it exists and its
> size is > 0)
> The code must check if the lastly recorded audio file is already in the
> xbel recent list. Do not add duplicates.
> Ref: https:/
>
> gtk_recent_
>
> Let me know about your results.
> Good luck.
>
> Kindly
> Moma
>
>
>
>
>
>
>
> On Sun, Aug 7, 2016 at 12:28 PM, Robert Orzanna <email address hidden>
> wrote:
>
>> Great! So, how do we proceed from here to bake the code into? :-)
>>
>> ~Robert
>>
>> --
>> You received this bug notification because you are subscribed to Audio
>> Recorder.
>> https:/
>>
>> Title:
>> Feature request: Always ask where to save file?
>>
>> Status in Audio Recorder:
>> New
>>
>> Bug description:
>> Dear all,
>>
>> My request origins from a discussion on AskUbuntu [1]. Currently,
>> Audio Recorder doesn't write to the xbel file upon creation of a new
>> file.
>>
>> This problem could be solved, I think, by a new optional setting to
>> ask the user each time where to save the file. It would then write to
>> xbel by prompting the GTK File Dialog window.
>>
>> What do you think of this request?
>>
>> Would you consider it useful?
>>
>> Thankfully,
>>
>> ~Robert
>>
>>
>> [1] https:/
>> -to-quickly-
>> 1#comment122180
>>
>> To manage notifications about this bug go to:
>> https:/
>>
>
>
>
> --
> Sent from my PC, laptop or phone with Ubuntu-Linux.
>
--
Sent from my PC, laptop or phone with Ubuntu-Linux.
Or Schiro (orschiro) wrote : | #12 |
Thank you Moma!
Just to let you know that I am on it but need some more time to understand the details. :-)
Warmly,
~Robert
Or Schiro (orschiro) wrote : | #13 |
Dear Moma,
I feel this is going beyond my scope of skills.
I did what you told me and:
- Added the function below the function rec_stop_
- Integrated the gtk_recent_
Am I doing it right at this stage?
I would appreciate your short feedback!
Thankfully,
~Robert
Or Schiro (orschiro) wrote : | #14 |
moma (osmoma) wrote : | #15 |
Re-hi,
Very good, but first, you must learn to compile and run the program. You can add modifications later on and I will help you. Your code (in gst-recorder.c) WILL NOT COMPILE! It is not complete.
Step 0)
Install these -dev packages. Run each sudo apt-get install... command separately in a terminal window (notice the long line)
sudo apt install autotools-dev gettext intltool pkg-config libgtk-3-dev libglib2.0-dev libgstreamer1.0-dev libdbus-1-dev libappindicator
sudo apt install pulseaudio gstreamer1.
sudo apt install build-essential autotools-dev automake autoconf intltool gettext libtool devscripts
------------
Step 1) Learn to ./configure and compile the program.
# Move into your audio-recorder folder
cd audio-recorder
make clean
./configure
make
------------
Step 2) If your code has no errors, test it
pkill audio-recorder
src/audio-recorder
src/audio-recorder --help
------------
Step 3)
Next time you make changes, just run "make" again. It will re-compile your code.
make
# pkill audio-recorder
src/audio-recorder
------------
Please tell me how you're doing.
moma (osmoma) wrote : | #16 |
Notice.
You may need to run "sudo make install" at least once in the step 1. You just need to run it once after first successful make.
make clean
./configure
make
sudo make install
Very good Robert. Go on!
Or Schiro (orschiro) wrote : | #17 |
Thanks Moma!
I finally got it compiled and now know how to recompile it after making changes to the code. :-)
What do you advise as a next step?
Thankfully,
-Robert
moma (osmoma) wrote : | #18 |
Re-hi,
0) Create a new c-function in the gst-recorder.c module that takes a filename (of the recorded file) as argument. See the previous examples and postings in this thread.
You must check if the filename is valid, it exists, its size is > 0, etc.
If the file is not valid: then bail out.
If the file is valid: Save it to the xbel recent list. Fill the GtkRecentData structure with correct values.
Also check if the file has already been added to the recent-files list. Do not add duplicates.
----
1) Call your new function from rec_stop_
Add it to the very end.
You can obtain the recorded filename by:
gchar *filename = NULL;
conf_get_
Then call
your-new-
g_free(filename);
Use g_print("xxxx") as help to debug your code.
----
Please PM me (send a private message) if you need help.
Andrey Novikov (andreynovikov) wrote : | #19 |
audio-recorder 1.9.7-1 don't work with skype for linux 5.3.0.1 in archlinux
$ audio-recorder
(audio-
Error:Cannot create element "pulsesrc" ((null)).
Error:Cannot create element "level" (level).
(audio-
(audio-
Error:Невозможно создать звуковой конвейер. Cannot link..
Changed in audio-recorder: | |
assignee: | nobody → Андрей (cooking95) |
Hello,
Thanks for your report.
GTK3 has a GtkRecentManager class that can manage the xbel file. /developer. gnome.org/ gtk3/stable/ GtkRecentManage r.html
https:/
It would be easy to add this to the audio-recorder (no need for GTK
open-file dialog).
BTW: I have not worked on the audio-recorder for a long time. /launchpad. net/~audio- recorder ) will continue to
Maybe the team (at https:/
maintain it.
Let us see what happens.
Cumprimentos
Osmo (moma) Antero
On Sat, Aug 6, 2016 at 8:30 AM, Robert Orzanna <email address hidden> wrote:
> Public bug reported: /askubuntu. com/questions/ 803869/ is-there- an- to-quickly- access- recently- used-files/ 804533? 1#comment122180 6_804533 /bugs.launchpad .net/bugs/ 1610508 /askubuntu. com/questions/ 803869/ is-there- an- to-quickly- access- recently- used-files/ 804533? 1#comment122180 6_804533 /bugs.launchpad .net/audio- recorder/ +bug/1610508/ +subscriptions
>
> Dear all,
>
> My request origins from a discussion on AskUbuntu [1]. Currently, Audio
> Recorder doesn't write to the xbel file upon creation of a new file.
>
> This problem could be solved, I think, by a new optional setting to ask
> the user each time where to save the file. It would then write to xbel
> by prompting the GTK File Dialog window.
>
> What do you think of this request?
>
> Would you consider it useful?
>
> Thankfully,
>
> ~Robert
>
>
> [1] https:/
> indicator-
> noredirect=
>
> ** Affects: audio-recorder
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to Audio
> Recorder.
> https:/
>
> Title:
> Feature request: Always ask where to save file?
>
> Status in Audio Recorder:
> New
>
> Bug description:
> Dear all,
>
> My request origins from a discussion on AskUbuntu [1]. Currently,
> Audio Recorder doesn't write to the xbel file upon creation of a new
> file.
>
> This problem could be solved, I think, by a new optional setting to
> ask the user each time where to save the file. It would then write to
> xbel by prompting the GTK File Dialog window.
>
> What do you think of this request?
>
> Would you consider it useful?
>
> Thankfully,
>
> ~Robert
>
>
> [1] https:/
> indicator-
> noredirect=
>
> To manage notifications about this bug go to:
> https:/
>
--
Sent from my PC, laptop or phone with Ubuntu-Linux.