From c0d0364c030688aa8bfe4ad8dcaa2cffed8c0d04 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 13 May 2009 16:04:14 +0000 Subject: Strip trailing whitespace. git-svn-id: http://svn.drobilla.net/lad/trunk/raul@1999 a436a847-0d15-0410-975c-d299462d15a1 --- src/LashClient.cpp | 12 ++++++------ src/LashProject.cpp | 8 ++++---- src/LashServerInterface.cpp | 12 ++++++------ src/Maid.cpp | 6 +++--- src/Path.cpp | 24 ++++++++++++------------ src/SMFReader.cpp | 24 ++++++++++++------------ src/SMFWriter.cpp | 16 ++++++++-------- src/Symbol.cpp | 12 ++++++------ src/Thread.cpp | 6 +++--- src/TimeSlice.cpp | 10 +++++----- 10 files changed, 65 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/LashClient.cpp b/src/LashClient.cpp index 8da0131..5e7dd83 100644 --- a/src/LashClient.cpp +++ b/src/LashClient.cpp @@ -1,15 +1,15 @@ /* This file is part of Raul. * Copyright (C) 2007 Dave Robillard - * + * * Raul is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Raul is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -51,7 +51,7 @@ LashClient::create( return result; } - + /** Process all pending LASH events. * * This should be called regularly to keep track of LASH state. @@ -65,13 +65,13 @@ LashClient::process_events() // Process events while ((ev = lash_get_event(_lash_client)) != NULL) { handle_event(ev); - lash_event_destroy(ev); + lash_event_destroy(ev); } // Process configs while ((conf = lash_get_config(_lash_client)) != NULL) { handle_config(conf); - lash_config_destroy(conf); + lash_config_destroy(conf); } } diff --git a/src/LashProject.cpp b/src/LashProject.cpp index 84c83c6..626788b 100644 --- a/src/LashProject.cpp +++ b/src/LashProject.cpp @@ -1,15 +1,15 @@ /* This file is part of Raul. * Copyright (C) 2007 Dave Robillard - * + * * Raul is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Raul is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -80,7 +80,7 @@ LashProject::set_name(const string& name) lash_event_set_string(event, name.c_str()); lash_send_event(client->lash_client(), event); } - + _name = name; } diff --git a/src/LashServerInterface.cpp b/src/LashServerInterface.cpp index ed62794..7514b2f 100644 --- a/src/LashServerInterface.cpp +++ b/src/LashServerInterface.cpp @@ -1,15 +1,15 @@ /* This file is part of Raul. * Copyright (C) 2007 Dave Robillard - * + * * Raul is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Raul is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -55,10 +55,10 @@ LashServerInterface::handle_event(lash_event_t* ev) const string str = (c_str == NULL) ? "" : c_str; SharedPtr p; - + //cout << "[LashServerInterface] Event, type = " << (unsigned int)type // << ", string = " << str << endl; - + switch (type) { case LASH_Project_Add: p = project(str); @@ -121,7 +121,7 @@ LashServerInterface::handle_event(lash_event_t* ev) LashClient::handle_event(ev); } - + void LashServerInterface::restore_project(const std::string& filename) diff --git a/src/Maid.cpp b/src/Maid.cpp index bbf5475..4c5c032 100644 --- a/src/Maid.cpp +++ b/src/Maid.cpp @@ -1,15 +1,15 @@ /* This file is part of Raul. * Copyright (C) 2007 Dave Robillard - * + * * Raul is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Raul is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/src/Path.cpp b/src/Path.cpp index e7d4d23..b5c228e 100644 --- a/src/Path.cpp +++ b/src/Path.cpp @@ -1,15 +1,15 @@ /* This file is part of Raul. * Copyright (C) 2007 Dave Robillard - * + * * Raul is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Raul is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -38,13 +38,13 @@ Path::is_valid(const std::basic_string& path_str) // Must start with a / if (path[0] != '/') return false; - + // Must not end with a slash unless "/" if (path.length() > 1 && path[path.length()-1] == '/') return false; assert(path.find_last_of("/") != string::npos); - + // Double slash not allowed if (path.find("//") != string::npos) return false; @@ -74,24 +74,24 @@ Path::pathify(const std::basic_string& str) { if (str.length() == 0) return root_uri; // this might not be wise? - + string path = (str.substr(0, prefix_len) == prefix) ? str : prefix + str; size_t start = prefix_len + 1; // Must start with a / if (path.at(start) != '/') path = string("/").append(path); - + // Must not end with a slash unless "/" if (path.length() > prefix_len + 1 && path.at(path.length()-1) == '/') path = path.substr(0, path.length()-1); // chop trailing slash assert(path.find_last_of("/") != string::npos); - + replace_invalid_chars(path, start, false); assert(is_valid(path)); - + return path; } @@ -127,7 +127,7 @@ Path::replace_invalid_chars(string& str, size_t start, bool replace_slash) size_t open_bracket = str.find_first_of('('); if (open_bracket != string::npos) str = str.substr(0, open_bracket); - + open_bracket = str.find_first_of('['); if (open_bracket != string::npos) str = str.substr(0, open_bracket); @@ -137,7 +137,7 @@ Path::replace_invalid_chars(string& str, size_t start, bool replace_slash) if (isdigit(str[0])) str = string("_").append(str); - + for (size_t i=0; i < str.length(); ++i) { if (i > 0 && str[i-1] == '/' && isdigit(str[i])) { str = str.substr(0, i) + "_" + str.substr(i); @@ -157,7 +157,7 @@ Path::replace_invalid_chars(string& str, size_t start, bool replace_slash) str[i] = '_'; } } - + if (str.length() != 1 && str[str.length()-1] == '_') str = str.substr(0, str.length()-1); diff --git a/src/SMFReader.cpp b/src/SMFReader.cpp index 0160875..b684c14 100644 --- a/src/SMFReader.cpp +++ b/src/SMFReader.cpp @@ -1,15 +1,15 @@ /* This file is part of Raul. * Copyright (C) 2007 Dave Robillard - * + * * Raul is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Raul is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -88,7 +88,7 @@ SMFReader::~SMFReader() close(); } - + bool SMFReader::open(const string& filename) throw (logic_error, UnsupportedTime) { @@ -111,7 +111,7 @@ SMFReader::open(const string& filename) throw (logic_error, UnsupportedTime) _fd = NULL; return false; } - + // Read type (bytes 8..9) fseek(_fd, 8, SEEK_SET); uint16_t type_be = 0; @@ -127,20 +127,20 @@ SMFReader::open(const string& filename) throw (logic_error, UnsupportedTime) uint16_t ppqn_be = 0; fread(&ppqn_be, 2, 1, _fd); _ppqn = GUINT16_FROM_BE(ppqn_be); - + // TODO: Absolute (SMPTE seconds) time support if ((_ppqn & 0x8000) != 0) throw UnsupportedTime(); seek_to_track(1); - + return true; } else { return false; } } - + /** Seek to the start of a given track, starting from 1. * Returns true if specified track was found. */ @@ -188,7 +188,7 @@ SMFReader::seek_to_track(unsigned track) throw (std::logic_error) } } - + /** Read an event from the current position in file. * * File position MUST be at the beginning of a delta time, or this will die very messily. @@ -274,14 +274,14 @@ SMFReader::read_event(size_t buf_len, // Read event, return size if (ferror(_fd)) throw CorruptFile(); - + fread(buf+1, 1, *ev_size - 1, _fd); - + if ((buf[0] & 0xF0) == 0x90 && buf[2] == 0) { buf[0] = (0x80 | (buf[0] & 0x0F)); buf[2] = 0x40; } - + return *ev_size; } } diff --git a/src/SMFWriter.cpp b/src/SMFWriter.cpp index 771b3bf..a3609b0 100644 --- a/src/SMFWriter.cpp +++ b/src/SMFWriter.cpp @@ -1,15 +1,15 @@ /* This file is part of Raul. * Copyright (C) 2007 Dave Robillard - * + * * Raul is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Raul is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -71,7 +71,7 @@ SMFWriter::start(const string& filename, _fd = fopen(filename.c_str(), "w+"); - if (_fd) { + if (_fd) { _track_size = 0; _filename = filename; _start_time = start_time; @@ -106,7 +106,7 @@ SMFWriter::write_event(Raul::TimeStamp time, delta_time -= _start_time; fseek(_fd, 0, SEEK_END); - + uint64_t delta_ticks = delta_time.ticks() * _unit.ppt() + delta_time.subticks(); size_t stamp_size = 0; @@ -121,7 +121,7 @@ SMFWriter::write_event(Raul::TimeStamp time, _track_size += stamp_size + 3; delta_ticks -= VAR_LEN_MAX; } - + assert(delta_ticks <= VAR_LEN_MAX); stamp_size = write_var_len((uint32_t)delta_ticks); fwrite(ev, 1, ev_size, _fd); @@ -173,7 +173,7 @@ SMFWriter::write_header() assert(_fd); fseek(_fd, 0, 0); write_chunk("MThd", 6, data); - write_chunk_header("MTrk", _track_size); + write_chunk_header("MTrk", _track_size); } @@ -203,7 +203,7 @@ void SMFWriter::write_chunk(const char id[4], uint32_t length, void* data) { write_chunk_header(id, length); - + fwrite(data, 1, length, _fd); } diff --git a/src/Symbol.cpp b/src/Symbol.cpp index a56b6db..d470417 100644 --- a/src/Symbol.cpp +++ b/src/Symbol.cpp @@ -1,15 +1,15 @@ /* This file is part of Raul. * Copyright (C) 2008 Dave Robillard - * + * * Raul is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Raul is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -60,15 +60,15 @@ Symbol::symbolify(const std::basic_string& str) string symbol = str; Path::replace_invalid_chars(symbol, true); - + if (symbol.length() == 0) return "_"; if (isdigit(symbol[0])) - symbol = string("_").append(symbol); + symbol = string("_").append(symbol); assert(is_valid(symbol)); - + return symbol; } diff --git a/src/Thread.cpp b/src/Thread.cpp index 1a40594..cbbba55 100644 --- a/src/Thread.cpp +++ b/src/Thread.cpp @@ -1,15 +1,15 @@ /* This file is part of Raul. * Copyright (C) 2007 Dave Robillard - * + * * Raul is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Raul is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/src/TimeSlice.cpp b/src/TimeSlice.cpp index 661b465..3122394 100644 --- a/src/TimeSlice.cpp +++ b/src/TimeSlice.cpp @@ -1,15 +1,15 @@ /* This file is part of Raul. * Copyright (C) 2007 Dave Robillard - * + * * Raul is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Raul is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -28,7 +28,7 @@ TimeSlice::TimeSlice(uint32_t tick_rate, double bpm) , _length(0) , _start_beats(0) {} - + /** Update beat time to match real (tick) time. */ @@ -42,7 +42,7 @@ TimeSlice::update_beat_time() TickTime TimeSlice::beats_to_ticks(BeatTime beats) { - return static_cast(beats_to_seconds(beats) / _tick_rate); + return static_cast(beats_to_seconds(beats) / _tick_rate); } Seconds -- cgit v1.2.1