Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion trunk/src/gx_head/engine/gx_record.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ inline std::string SCapture::get_ffilename() {
case(2) :
name = "guitarix_session0.w64";
break;
case(3) :
name = "guitarix_session0.flac";
break;
default :
break;
}
Expand Down Expand Up @@ -204,6 +207,9 @@ SNDFILE *SCapture::open_stream(std::string fname)
case(2) :
sfinfo.format = SF_FORMAT_W64 | SF_FORMAT_PCM_24;
break;
case(3) :
sfinfo.format = SF_FORMAT_FLAC | SF_FORMAT_PCM_24;
break;
default :
sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_FLOAT;
break;
Expand Down Expand Up @@ -367,7 +373,7 @@ void SCapture::compute_static_st(int count, float *input0, float *input1, float

int SCapture::register_par(const ParamReg& reg)
{
static const value_pair fformat_values[] = {{"wav"},{"ogg"},{"w64"},{0}};
static const value_pair fformat_values[] = {{"wav"},{"ogg"},{"w64"},{"flac"},{0}};
if (channel == 1) {
reg.registerFloatVar("recorder.file","","S",N_("select file format"),&fformat, 0.0, 0.0, 2.0, 1.0, fformat_values);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. But didn't we need to change the max value for fformat to 3.0 in order to allow to select flac?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that what that's for?

Odldy enough it doesn't make a difference with what I tested (see attached image). But, it makes sense looking at what the registerFloatVar is supposed to do. I'm not sure these values are being validated anywhere otherwise I would have expected it to fail.

It applies to this line too:

reg.registerFloatVar("st_recorder.file","","S",N_("select file format"),&fformat, 0.0, 0.0, 2.0, 1.0, fformat_values);

Odldy enough it doesn't make a difference with what I tested. But, it makes sense looking at what the registerFloatVar is supposed to do.

Screenshot_20251027_123014

I'll change these and commit

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW I have a few other changes that I've done for my own workflow - which may or may not be interesting for other people. Let me know if anything sounds interesting.

First, I'm saving the files as std::strftime(datetime, sizeof(datetime), "%Y%m%d-%H%M%S", now) + extension. This is because I use guitarix running on multiple machines (desktop, laptop and portable pi) and then when I go to combine the files (to listen to on my phone) the ones with the same index number and file format are overwritten with the old naming scheme.

The other is that I added Taglib as a requirement and I'm writing the bank:preset to the metadata comment tag. Which maybe is interesting for other people. Actually, I'm writing the bank:preset into the genre and album fields too and hard-coding a few others like artist so that I can see what setup I was using when I listen to the files on my phone with some players (auxio) I can sort by genre which I find handy. But, this is my workflow so maybe too specific.

This maybe shouldn't be required (although it seems that taglib seems to also be available for mac and windows) and maybe things like artist should be picked up from some external json file (maybe that's too much trouble - besides if people want to add tags there are other ways to do it).

Another is that I dump the pmap into a file with the the .txt extension, so that if something sounds particularly interesting I can reproduce the settings at a later date.

Maybe this would be handy but then as a setting it should be possible to turn this off.

reg.registerFloatVar("recorder.rec","","B",N_("Record files to ~/gxrecord/"),&fcheckbox0, 0.0, 0.0, 1.0, 1.0, 0);
Expand Down