NOOP, remove trailing tabs/whitespace.
This commit is contained in:
@@ -36,11 +36,11 @@ process (jack_nframes_t nframes, void *arg)
|
||||
out = jack_port_get_buffer (output_port, nframes);
|
||||
|
||||
memcpy (out, in, sizeof (jack_default_audio_sample_t) * nframes);
|
||||
|
||||
|
||||
for (i = 0; i < loopsize; ++i) {
|
||||
fooey (nframes);
|
||||
}
|
||||
|
||||
|
||||
last_load = jack_cpu_load (client);
|
||||
|
||||
if ((at_loop += nframes) >= at_loop_size) {
|
||||
@@ -182,7 +182,7 @@ main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
free (ports);
|
||||
|
||||
|
||||
ports = jack_get_ports (client, NULL, NULL,
|
||||
JackPortIsPhysical|JackPortIsInput);
|
||||
if (ports == NULL) {
|
||||
|
||||
@@ -112,7 +112,7 @@ OMF::name_types ()
|
||||
sqlite3_exec(db, "INSERT INTO lookup VALUES (40, '(Type 40)')", 0, 0, 0);
|
||||
sqlite3_exec(db, "INSERT INTO lookup VALUES (41, '(Type 41)')", 0, 0, 0);
|
||||
sqlite3_exec(db, "INSERT INTO lookup VALUES (42, '(Type 42)')", 0, 0, 0);
|
||||
|
||||
|
||||
/* Assign type and property values to names */
|
||||
sqlite3_exec(db, "UPDATE data SET property = (SELECT name FROM lookup WHERE property = key), type = (SELECT name FROM lookup WHERE type = key)", 0, 0, 0);
|
||||
sqlite3_exec(db, "DROP TABLE lookup", 0, 0, 0);
|
||||
@@ -286,7 +286,7 @@ OMF::load (const string& path)
|
||||
}
|
||||
DEBUG(" offset: %d\n", dataOffset);
|
||||
DEBUG(" length: %d\n", dataLength);
|
||||
|
||||
|
||||
if (currentType == 21) {
|
||||
char* string = (char*) malloc((uint32_t) dataLength);
|
||||
fseek(file, dataOffset, SEEK_SET);
|
||||
|
||||
@@ -84,11 +84,11 @@ OMF::OMF ()
|
||||
options = new XMLNode ("RouteGroups");
|
||||
|
||||
/* add master, default 2in/2out */
|
||||
|
||||
|
||||
XMLNode* master = new_route_node ();
|
||||
master->add_property ("name", "master");
|
||||
set_route_node_channels (master, 2, 2, false);
|
||||
|
||||
|
||||
XMLNode* tempo_map = new XMLNode ("TempoMap");
|
||||
XMLNode* tempo = new XMLNode ("Tempo");
|
||||
tempo->add_property ("start", "1|1|0");
|
||||
@@ -125,7 +125,7 @@ OMF::OMF ()
|
||||
connection = new XMLNode ("Connection");
|
||||
connection->add_property ("other", "system:playback_2");
|
||||
port->add_child_nocopy (*connection);
|
||||
|
||||
|
||||
session->add_child_nocopy (*options);
|
||||
session->add_child_nocopy (*sources);
|
||||
session->add_child_nocopy (*regions);
|
||||
@@ -175,7 +175,7 @@ OMF::init ()
|
||||
audiofile_path_vector.push_back ("interchange");
|
||||
audiofile_path_vector.push_back (session_name);
|
||||
audiofile_path_vector.push_back ("audiofiles");
|
||||
|
||||
|
||||
dir = Glib::build_filename (audiofile_path_vector);
|
||||
g_mkdir_with_parents (dir.c_str(), 0775);
|
||||
|
||||
@@ -253,7 +253,7 @@ OMF::new_playlist_node ()
|
||||
add_id (playlist);
|
||||
playlist->add_property ("type", "audio");
|
||||
playlist->add_property ("frozen", "no");
|
||||
|
||||
|
||||
return playlist;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ OMF::new_diskstream_node ()
|
||||
diskstream->add_property ("flags", "Recordable");
|
||||
diskstream->add_property ("speed", "1");
|
||||
diskstream->add_property ("channels", "1");
|
||||
|
||||
|
||||
return diskstream;
|
||||
}
|
||||
void
|
||||
@@ -302,7 +302,7 @@ OMF::set_route_node_channels (XMLNode* route, int in, int out, bool send_to_mast
|
||||
XMLNode* output_io;
|
||||
char sbuf[256];
|
||||
string name = route->property ("name")->value();
|
||||
|
||||
|
||||
legalize_name (name);
|
||||
|
||||
output_io = new XMLNode ("IO");
|
||||
@@ -311,7 +311,7 @@ OMF::set_route_node_channels (XMLNode* route, int in, int out, bool send_to_mast
|
||||
add_id (output_io);
|
||||
output_io->add_property ("direction", "Output");
|
||||
output_io->add_property ("default-type", "audio");
|
||||
|
||||
|
||||
input_io = new XMLNode ("IO");
|
||||
route->add_child_nocopy (*input_io);
|
||||
input_io->add_property ("name", name);
|
||||
@@ -323,9 +323,9 @@ OMF::set_route_node_channels (XMLNode* route, int in, int out, bool send_to_mast
|
||||
XMLNode* port = new XMLNode ("Port");
|
||||
output_io->add_child_nocopy (*port);
|
||||
port->add_property ("type", "audio");
|
||||
|
||||
|
||||
snprintf (sbuf, sizeof (sbuf), "%s/audio_out %d", name.c_str(), i+1);
|
||||
|
||||
|
||||
port->add_property ("name", sbuf);
|
||||
XMLNode* connection = new XMLNode ("Connection");
|
||||
|
||||
@@ -342,7 +342,7 @@ OMF::set_route_node_channels (XMLNode* route, int in, int out, bool send_to_mast
|
||||
snprintf (sbuf, sizeof (sbuf), "system:playback_1");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
connection->add_property ("other", sbuf);
|
||||
port->add_child_nocopy (*connection);
|
||||
}
|
||||
@@ -351,9 +351,9 @@ OMF::set_route_node_channels (XMLNode* route, int in, int out, bool send_to_mast
|
||||
XMLNode* port = new XMLNode ("Port");
|
||||
input_io->add_child_nocopy (*port);
|
||||
port->add_property ("type", "audio");
|
||||
|
||||
|
||||
snprintf (sbuf, sizeof (sbuf), "%s/audio_out %d", name.c_str(), i+1);
|
||||
|
||||
|
||||
port->add_property ("name", sbuf);
|
||||
XMLNode* connection = new XMLNode ("Connection");
|
||||
|
||||
@@ -379,12 +379,12 @@ OMF::set_route_node_channels (XMLNode* route, int in, int out, bool send_to_mast
|
||||
outs->add_property ("output", name);
|
||||
outs->add_property ("type", "main-outs");
|
||||
outs->add_property ("role", "Main");
|
||||
|
||||
|
||||
/* Panner setup */
|
||||
|
||||
XMLNode* panner = new XMLNode ("Panner");
|
||||
outs->add_child_nocopy (*panner);
|
||||
|
||||
|
||||
panner->add_property ("linked", "no");
|
||||
panner->add_property ("link-direction", "SameDirection");
|
||||
panner->add_property ("bypassed", "no");
|
||||
@@ -403,7 +403,7 @@ OMF::set_route_node_channels (XMLNode* route, int in, int out, bool send_to_mast
|
||||
spanner->add_property ("type", "Equal Power Stereo");
|
||||
spanner->add_property ("muted", "no");
|
||||
spanner->add_property ("mono", "no");
|
||||
|
||||
|
||||
XMLNode* spc = new XMLNode ("Controllable");
|
||||
spanner->add_child_nocopy (*spc);
|
||||
add_id (spc);
|
||||
@@ -488,9 +488,9 @@ OMF::new_region_node ()
|
||||
|
||||
region_extra->add_child_nocopy (*gui_extra);
|
||||
region->add_child_nocopy (*region_extra);
|
||||
|
||||
|
||||
/* boilerplate */
|
||||
|
||||
|
||||
region->add_property ("ancestral-start", "0");
|
||||
region->add_property ("ancestral-start", "0");
|
||||
region->add_property ("ancestral-length", "0");
|
||||
@@ -520,9 +520,9 @@ OMF::new_source_node ()
|
||||
add_id (source);
|
||||
source->add_property ("type", "audio");
|
||||
source->add_property ("flags", "CanRename");
|
||||
|
||||
|
||||
sources->add_child_nocopy (*source);
|
||||
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ OMF::create_xml ()
|
||||
int major;
|
||||
int minor;
|
||||
int micro;
|
||||
|
||||
|
||||
major = version / 1000;
|
||||
minor = version - (major * 1000);
|
||||
micro = version - (major * 1000) - (minor * 100);
|
||||
@@ -594,7 +594,7 @@ OMF::create_xml ()
|
||||
|
||||
session->add_property ("version", sbuf);
|
||||
session->add_property ("name", session_name);
|
||||
|
||||
|
||||
char **tracks;
|
||||
int numtracks;
|
||||
sqlite3_get_table(db, "SELECT value FROM data WHERE object IN (SELECT value FROM data WHERE object IN (SELECT object FROM data WHERE property = 'OMFI:OOBJ:ObjClass' AND value = 'CMOB' LIMIT 1) AND property = 'OMFI:MOBJ:Slots')", &tracks, &numtracks, 0, 0);
|
||||
@@ -690,7 +690,7 @@ OMF::create_xml ()
|
||||
}
|
||||
|
||||
sqlite3_free_table(rate);
|
||||
|
||||
|
||||
char **items;
|
||||
int itemCount;
|
||||
//sqlite3_get_table(db, sqlite3_mprintf("SELECT d3.value FROM data d1, data d2, data d3 WHERE d1.object LIKE '%s' AND d1.property LIKE 'OMFI:MSLT:Segment' AND d2.object LIKE d1.value AND d2.property LIKE 'OMFI:SEQU:Components' AND d3.object LIKE d2.value", tracks[i]), &items, &itemCount, 0, 0);
|
||||
@@ -707,7 +707,7 @@ OMF::create_xml ()
|
||||
int lenCount;
|
||||
double length = 0.0;
|
||||
int lenFrames = 0;
|
||||
|
||||
|
||||
region = 0;
|
||||
|
||||
sqlite3_get_table(db, sqlite3_mprintf("SELECT value FROM data WHERE object = %s AND property = 'OMFI:CPNT:Length' LIMIT 1", items[j]), &len, &lenCount, 0, 0);
|
||||
@@ -730,7 +730,7 @@ OMF::create_xml ()
|
||||
|
||||
lenFrames = atoi(len[1]);
|
||||
length = lenFrames * frame_rate;
|
||||
|
||||
|
||||
if (!strcmp(type[1], "TRAN")) {
|
||||
|
||||
position -= length;
|
||||
@@ -796,15 +796,15 @@ OMF::create_xml ()
|
||||
if (sourceFileCount > 0) {
|
||||
uint32_t sfOffs;
|
||||
uint32_t sfLen;
|
||||
|
||||
|
||||
if (get_offset_and_length (sourceFile[2], sourceFile[3], sfOffs, sfLen)) {
|
||||
char *sfBuf = read_name (sfOffs, sfLen);
|
||||
|
||||
|
||||
if ((sinfo = get_known_source (sfBuf)) == 0) {
|
||||
cerr << "Reference to unknown source [" << sfBuf << "]1" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
free (sfBuf);
|
||||
} else {
|
||||
cerr << "offs/len illegal\n";
|
||||
@@ -819,7 +819,7 @@ OMF::create_xml ()
|
||||
cerr << "Reference to unknown source [" << fallbackFile[1] << "]2" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
cerr << "no fallback file\n";
|
||||
}
|
||||
@@ -827,12 +827,12 @@ OMF::create_xml ()
|
||||
sqlite3_free_table(fallbackFile);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (sinfo) {
|
||||
|
||||
|
||||
region = new_region_node ();
|
||||
playlist->add_child_nocopy (*region);
|
||||
|
||||
|
||||
snprintf (sbuf, sizeof (sbuf), "%" PRId64, llrintf (position * sample_rate));
|
||||
region->add_property ("position", sbuf);
|
||||
snprintf (sbuf, sizeof (sbuf), "%" PRId64, llrintf (length * sample_rate));
|
||||
@@ -840,7 +840,7 @@ OMF::create_xml ()
|
||||
snprintf (sbuf, sizeof (sbuf), "%" PRId64, llrintf (start * frame_rate * sample_rate));
|
||||
region->add_property ("start", sbuf);
|
||||
set_region_sources (region, sinfo);
|
||||
|
||||
|
||||
route_max_channels = max (route_max_channels, sinfo->channels);
|
||||
}
|
||||
|
||||
@@ -879,7 +879,7 @@ OMF::create_xml ()
|
||||
if (get_offset_and_length (sourceFile[2], sourceFile[3], sfOffs, sfLen)) {
|
||||
cerr << "get source file from " << sfOffs << " + " << sfLen << endl;
|
||||
char *sfBuf = read_name (sfOffs, sfLen);
|
||||
|
||||
|
||||
if ((sinfo = get_known_source (sfBuf)) == 0) {
|
||||
cerr << "Reference to unknown source [" << sfBuf << ']' << endl;
|
||||
return -1;
|
||||
@@ -908,7 +908,7 @@ OMF::create_xml ()
|
||||
|
||||
region = new_region_node ();
|
||||
playlist->add_child_nocopy (*region);
|
||||
|
||||
|
||||
snprintf (sbuf, sizeof (sbuf), "%" PRId64, llrintf (position * sample_rate));
|
||||
region->add_property ("position", sbuf);
|
||||
snprintf (sbuf, sizeof (sbuf), "%" PRId64, llrintf (length * sample_rate));
|
||||
@@ -916,7 +916,7 @@ OMF::create_xml ()
|
||||
snprintf (sbuf, sizeof (sbuf), "%" PRId64, llrintf (start * frame_rate * sample_rate));
|
||||
region->add_property ("start", sbuf);
|
||||
set_region_sources (region, sinfo);
|
||||
|
||||
|
||||
route_max_channels = max (route_max_channels, sinfo->channels);
|
||||
}
|
||||
|
||||
@@ -930,9 +930,9 @@ OMF::create_xml ()
|
||||
}
|
||||
|
||||
/* finalize route information */
|
||||
|
||||
|
||||
cerr << "Set up track with " << route_max_channels << " channels" << endl;
|
||||
set_route_node_channels (route, route_max_channels, route_max_channels, true);
|
||||
set_route_node_channels (route, route_max_channels, route_max_channels, true);
|
||||
sqlite3_free_table(items);
|
||||
}
|
||||
|
||||
@@ -986,7 +986,7 @@ main (int argc, char* argv[])
|
||||
{ "version", 1, 0, 'v' },
|
||||
{ "help", 0, 0, 'h' },
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
int option_index = 0;
|
||||
@@ -1023,7 +1023,7 @@ main (int argc, char* argv[])
|
||||
print_help (execname);
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
|
||||
OMF omf;
|
||||
|
||||
if (version) {
|
||||
|
||||
@@ -52,16 +52,16 @@ private:
|
||||
XMLNode* diskstreams;
|
||||
XMLNode* locations;
|
||||
XMLNode* options;
|
||||
|
||||
|
||||
XMLNode* new_region_node ();
|
||||
XMLNode* new_source_node ();
|
||||
XMLNode* new_route_node ();
|
||||
XMLNode* new_playlist_node ();
|
||||
XMLNode* new_diskstream_node ();
|
||||
|
||||
|
||||
typedef std::map<std::string,SourceInfo*> KnownSources;
|
||||
KnownSources known_sources;
|
||||
|
||||
|
||||
SourceInfo* get_known_source (const char*);
|
||||
char* read_name (size_t offset, size_t length);
|
||||
bool get_offset_and_length (const char* offstr, const char* lenstr, uint32_t& offset, uint32_t& len);
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
else
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
uint32_t e32(uint32_t x)
|
||||
{
|
||||
if (bigEndian)
|
||||
@@ -91,7 +91,7 @@ private:
|
||||
else
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
uint64_t e64(uint64_t x)
|
||||
{
|
||||
if (bigEndian)
|
||||
@@ -106,7 +106,7 @@ private:
|
||||
else
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif /* __ardour_omftool__ */
|
||||
|
||||
@@ -61,7 +61,7 @@ main (int argc, char* argv[])
|
||||
int n = 0;
|
||||
int nfiles = 0;
|
||||
int quiet = 0;
|
||||
|
||||
|
||||
while (1) {
|
||||
if ((c = getopt_long (argc, argv, optstring, longopts, &option_index)) == -1) {
|
||||
break;
|
||||
@@ -97,7 +97,7 @@ main (int argc, char* argv[])
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (optind < argc) {
|
||||
name_template = argv[optind];
|
||||
} else {
|
||||
@@ -129,7 +129,7 @@ main (int argc, char* argv[])
|
||||
if (!quiet) {
|
||||
printf ("# Discovered %d files using %s\n", n, name_template);
|
||||
}
|
||||
|
||||
|
||||
nfiles = n;
|
||||
files = (int *) malloc (sizeof (int) * nfiles);
|
||||
#ifdef HAVE_MMAP
|
||||
@@ -233,7 +233,7 @@ main (int argc, char* argv[])
|
||||
if (!quiet) {
|
||||
printf ("# BW @ %lu %.3f seconds bandwidth %.4f MB/sec\n", (long unsigned int)_read, elapsed/1000000.0, bandwidth);
|
||||
}
|
||||
|
||||
|
||||
total_time += elapsed;
|
||||
|
||||
++cnt;
|
||||
|
||||
@@ -34,7 +34,7 @@ typedef struct
|
||||
} testRecord;
|
||||
|
||||
static vector<testRecord> gTestSet;
|
||||
|
||||
|
||||
static vector<string> gValidSwitchList;
|
||||
static vector<string> gSwitchDescriptionList;
|
||||
|
||||
@@ -52,7 +52,7 @@ ExecuteAll()
|
||||
}
|
||||
|
||||
OK &= !(system_memlock_amount() == 0);
|
||||
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -97,15 +97,15 @@ PrintUsage()
|
||||
printf(" Options are as follows:\n");
|
||||
printf("\n");
|
||||
printf("\n");
|
||||
|
||||
|
||||
vector<testRecord>::iterator itr;
|
||||
|
||||
|
||||
for (itr = gTestSet.begin(); itr != gTestSet.end(); ++itr) {
|
||||
printf("%20s %s :\t%s\n", (*itr).switchText.c_str(), (*itr).swOptionText.c_str(), (*itr).descriptionText.c_str());
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ void
|
||||
DefineSwitches()
|
||||
{
|
||||
testRecord rec;
|
||||
|
||||
|
||||
// Global switches
|
||||
rec.switchText = "-a";
|
||||
rec.swOptionText = "";
|
||||
@@ -217,7 +217,7 @@ ParseSwitches(
|
||||
vector<testRecord>::iterator itr;
|
||||
bool OK = true;
|
||||
int i;
|
||||
|
||||
|
||||
if (argc == 1) {
|
||||
gSwitchesReceived.push_back("-a");
|
||||
}
|
||||
@@ -249,7 +249,7 @@ ParseSwitches(
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (OK && itr != gTestSet.end()) {
|
||||
// Known option switch found
|
||||
gSwitchesReceived.push_back(tmp);
|
||||
@@ -264,7 +264,7 @@ ParseSwitches(
|
||||
if (OK) {
|
||||
// All switches are at least valid, now check to make sure they are all valid to
|
||||
// be used together.
|
||||
|
||||
|
||||
if (gSwitchesReceived.size() > 1) {
|
||||
// make sure help is not mixed with other options
|
||||
vector<string>::iterator swItr;
|
||||
@@ -304,14 +304,14 @@ Execute()
|
||||
bool OK = true;
|
||||
vector<string>::iterator itr;
|
||||
vector<testRecord>::iterator testItr;
|
||||
|
||||
|
||||
for (itr = gSwitchesReceived.begin(); itr != gSwitchesReceived.end(); ++itr) {
|
||||
for (testItr = gTestSet.begin(); testItr != gTestSet.end(); ++testItr) {
|
||||
if ((*itr) == (*testItr).switchText) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool result;
|
||||
if ((*testItr).hasOption) {
|
||||
result = ((*testItr).opFunctionPtr((*testItr).optionArg) != 0);
|
||||
@@ -329,7 +329,7 @@ Execute()
|
||||
|
||||
OK &= result;
|
||||
}
|
||||
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ main(
|
||||
char **argv)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
|
||||
DefineSwitches();
|
||||
|
||||
if (ParseSwitches(argc, argv)) {
|
||||
|
||||
@@ -61,7 +61,7 @@ main (int argc, char* argv[])
|
||||
int c = 0;
|
||||
char const * name_template = 0;
|
||||
int samplerate;
|
||||
|
||||
|
||||
while (1) {
|
||||
if ((c = getopt_long (argc, argv, optstring, longopts, &option_index)) == -1) {
|
||||
break;
|
||||
@@ -99,7 +99,7 @@ main (int argc, char* argv[])
|
||||
if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
int flags = O_RDONLY;
|
||||
int fd = open (path, flags, 0644);
|
||||
|
||||
@@ -126,15 +126,15 @@ main (int argc, char* argv[])
|
||||
}
|
||||
|
||||
samplerate = format_info.samplerate;
|
||||
|
||||
|
||||
sndfiles.push_back (sf);
|
||||
}
|
||||
|
||||
cout << "Discovered " << sndfiles.size() << " files using " << name_template << endl;
|
||||
|
||||
|
||||
data = new float[block_size];
|
||||
uint64_t read = 0;
|
||||
|
||||
|
||||
while (true) {
|
||||
gint64 before;
|
||||
before = g_get_monotonic_time();
|
||||
@@ -147,7 +147,7 @@ main (int argc, char* argv[])
|
||||
read += block_size;
|
||||
gint64 elapsed = g_get_monotonic_time() - before;
|
||||
double bandwidth = ((sndfiles.size() * block_size * sample_size)/1048576.0) / (elapsed/1000000.0);
|
||||
|
||||
|
||||
printf ("BW @ %Lu %.3f seconds bandwidth %.4f MB/sec\n", read, elapsed/1000000.0, bandwidth);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ main (int argc, char* argv[])
|
||||
|
||||
int option_index = 0;
|
||||
int c = 0;
|
||||
|
||||
|
||||
while (1) {
|
||||
if ((c = getopt_long (argc, argv, optstring, longopts, &option_index)) == -1) {
|
||||
break;
|
||||
@@ -170,7 +170,7 @@ main (int argc, char* argv[])
|
||||
|
||||
format_info.samplerate = samplerate;
|
||||
format_info.channels = channels;
|
||||
|
||||
|
||||
if (strcasecmp (header_format, "wav") == 0) {
|
||||
format_info.format |= SF_FORMAT_WAV;
|
||||
suffix = ".wav";
|
||||
@@ -201,7 +201,7 @@ main (int argc, char* argv[])
|
||||
usage ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
string tmpdirname = Glib::build_filename (dirname, "sftest");
|
||||
if (g_mkdir_with_parents (tmpdirname.c_str(), 0755)) {
|
||||
cerr << "Cannot create output directory\n";
|
||||
@@ -216,7 +216,7 @@ main (int argc, char* argv[])
|
||||
ss << "sf-";
|
||||
ss << n;
|
||||
ss << suffix;
|
||||
|
||||
|
||||
path = Glib::build_filename (tmpdirname, ss.str());
|
||||
|
||||
int flags = O_RDWR|O_CREAT|O_TRUNC;
|
||||
@@ -254,7 +254,7 @@ main (int argc, char* argv[])
|
||||
cout << endl;
|
||||
cout << "Format is " << suffix << ' ' << channels << " channel" << (channels > 1 ? "s" : "") << " written in chunks of " << block_size << " frames, synced ? " << (with_sync ? "yes" : "no") << endl;
|
||||
}
|
||||
|
||||
|
||||
data = new float[block_size*channels];
|
||||
uint64_t written = 0;
|
||||
|
||||
@@ -284,7 +284,7 @@ main (int argc, char* argv[])
|
||||
|
||||
max_bandwidth = max (max_bandwidth, bandwidth);
|
||||
min_bandwidth = min (min_bandwidth, bandwidth);
|
||||
|
||||
|
||||
if (!quiet) {
|
||||
cout << "BW @ " << written << " frames (" << ds.str() << " minutes) = " << (bandwidth/1048576.0) << " MB/sec " << bandwidth / data_rate << " x faster than necessary " << endl;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ main (int argc, char* argv[])
|
||||
}
|
||||
cout << "Done.\n";
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user