diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/AlsaDriver.cpp | 25 | ||||
-rw-r--r-- | src/AlsaDriver.hpp | 1 | ||||
-rw-r--r-- | src/JackDbusDriver.cpp | 1 | ||||
-rw-r--r-- | src/JackDbusDriver.hpp | 1 | ||||
-rw-r--r-- | src/JackDriver.cpp | 10 | ||||
-rw-r--r-- | src/JackDriver.hpp | 1 | ||||
-rw-r--r-- | src/PatchageEvent.cpp | 19 | ||||
-rw-r--r-- | src/ProjectList.cpp | 3 | ||||
-rw-r--r-- | src/StateManager.cpp | 15 | ||||
-rw-r--r-- | src/StateManager.hpp | 1 | ||||
-rw-r--r-- | src/main.cpp | 14 |
11 files changed, 44 insertions, 47 deletions
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index e10c120..19ebfa8 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -17,8 +17,8 @@ #include <string> #include <set> -#include <iostream> #include <cassert> +#include "raul/log.hpp" #include "raul/SharedPtr.hpp" #include "PatchageCanvas.hpp" #include "AlsaDriver.hpp" @@ -66,7 +66,7 @@ AlsaDriver::attach(bool /*launch_daemon*/) ret = pthread_create(&_refresh_thread, &attr, &AlsaDriver::refresh_main, this); if (ret) - cerr << "Couldn't start refresh thread" << endl; + Raul::error << "Couldn't start refresh thread" << endl; signal_attached.emit(); } @@ -358,13 +358,13 @@ AlsaDriver::connect(boost::shared_ptr<PatchagePort> src_port, boost::shared_ptr< // Already connected (shouldn't happen) if (!snd_seq_get_port_subscription(_seq, subs)) { - cerr << "Error: Attempt to subscribe Alsa ports that are already subscribed." << endl; + Raul::error << "[ALSA] Attempt to subscribe ports that are already subscribed." << endl; result = false; } int ret = snd_seq_subscribe_port(_seq, subs); if (ret < 0) { - cerr << "Alsa subscription failed: " << snd_strerror(ret) << endl; + Raul::error << "[ALSA] Subscription failed: " << snd_strerror(ret) << endl; result = false; } } @@ -402,13 +402,13 @@ AlsaDriver::disconnect(boost::shared_ptr<PatchagePort> src_port, boost::shared_p // Not connected (shouldn't happen) if (snd_seq_get_port_subscription(_seq, subs) != 0) { - cerr << "Error: Attempt to unsubscribe Alsa ports that are not subscribed." << endl; + Raul::error << "[ALSA] Attempt to unsubscribe ports that are not subscribed." << endl; result = false; } int ret = snd_seq_unsubscribe_port(_seq, subs); if (ret < 0) { - cerr << "Alsa unsubscription failed: " << snd_strerror(ret) << endl; + Raul::error << "[ALSA] Unsubscription failed: " << snd_strerror(ret) << endl; result = false; } @@ -440,7 +440,7 @@ AlsaDriver::create_refresh_port() ret = snd_seq_create_port(_seq, port_info); if (ret) { - cerr << "Error creating alsa port: " << snd_strerror(ret) << endl; + Raul::error << "[ALSA] Error creating port: " << snd_strerror(ret) << endl; return false; } @@ -451,7 +451,8 @@ AlsaDriver::create_refresh_port() SND_SEQ_PORT_SYSTEM_ANNOUNCE); if (ret) { - cerr << "Could not connect to system announcer port: " << snd_strerror(ret) << endl; + Raul::error << "[ALSA] Could not connect to system announcer port: " + << snd_strerror(ret) << endl; return false; } @@ -472,7 +473,7 @@ void AlsaDriver::_refresh_main() { if (!create_refresh_port()) { - cerr << "Could not create Alsa listen port. Auto refreshing will not work." << endl; + Raul::error << "[ALSA] Could not create listen port, auto-refresh will not work." << endl; return; } @@ -489,14 +490,14 @@ AlsaDriver::_refresh_main() if (errno == EINTR) continue; - cerr << "Error polling Alsa sequencer: " << strerror(errno) << endl; + Raul::error << "[ALSA] Error polling sequencer: " << strerror(errno) << endl; continue; } ret = snd_seq_poll_descriptors_revents(_seq, pfds, nfds, revents); if (ret) { - cerr << "Error getting Alsa sequencer poll events: " - << snd_strerror(ret) << endl; + Raul::error << "[ALSA] Error getting sequencer poll events: " + << snd_strerror(ret) << endl; continue; } diff --git a/src/AlsaDriver.hpp b/src/AlsaDriver.hpp index b334e89..ba20d95 100644 --- a/src/AlsaDriver.hpp +++ b/src/AlsaDriver.hpp @@ -18,7 +18,6 @@ #ifndef PATCHAGE_ALSADRIVER_HPP #define PATCHAGE_ALSADRIVER_HPP -#include <iostream> #include <alsa/asoundlib.h> #include <pthread.h> #include <string> diff --git a/src/JackDbusDriver.cpp b/src/JackDbusDriver.cpp index 17a6beb..b2ee169 100644 --- a/src/JackDbusDriver.cpp +++ b/src/JackDbusDriver.cpp @@ -20,7 +20,6 @@ #include <cstring> #include <string> #include <set> -#include <iostream> #include "patchage-config.h" diff --git a/src/JackDbusDriver.hpp b/src/JackDbusDriver.hpp index bd13ef1..677fafd 100644 --- a/src/JackDbusDriver.hpp +++ b/src/JackDbusDriver.hpp @@ -18,7 +18,6 @@ #ifndef PATCHAGE_JACKDBUSDRIVER_HPP #define PATCHAGE_JACKDBUSDRIVER_HPP -#include <iostream> #include <boost/shared_ptr.hpp> #include <jack/jack.h> #include <jack/statistics.h> diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index ef67747..e16ee3f 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -19,11 +19,11 @@ #include <cstring> #include <string> #include <set> -#include <iostream> #include "patchage-config.h" #include <jack/jack.h> #include <jack/statistics.h> #include <jack/thread.h> +#include "raul/log.hpp" #include "raul/SharedPtr.hpp" #include "PatchageCanvas.hpp" #include "PatchageEvent.hpp" @@ -210,7 +210,7 @@ JackDriver::create_port(boost::shared_ptr<PatchageModule> parent, jack_port_t* p port_type = JACK_MIDI; #endif } else { - cerr << "WARNING: " << jack_port_name(port) << " has unknown type \'" << type_str << "\'" << endl; + Raul::warn << jack_port_name(port) << " has unknown type \'" << type_str << "\'" << endl; return boost::shared_ptr<PatchagePort>(); } @@ -296,7 +296,7 @@ JackDriver::refresh() port_type = JACK_MIDI; #endif } else { - cerr << "WARNING: " << ports[i] << " has unknown type \'" << type_str << "\'" << endl; + Raul::warn << ports[i] << " has unknown type \'" << type_str << "\'" << endl; continue; } @@ -525,7 +525,7 @@ JackDriver::jack_xrun_cb(void* jack_driver) void JackDriver::jack_shutdown_cb(void* jack_driver) { - cerr << "[JACK] Shutdown" << endl; + Raul::info << "[JACK] Shutdown" << endl; assert(jack_driver); JackDriver* me = reinterpret_cast<JackDriver*>(jack_driver); Glib::Mutex::Lock lock(me->_shutdown_mutex); @@ -538,7 +538,7 @@ JackDriver::jack_shutdown_cb(void* jack_driver) void JackDriver::error_cb(const char* msg) { - cerr << "[JACK] ERROR: " << msg << endl; + Raul::error << "[JACK] " << msg << endl; } diff --git a/src/JackDriver.hpp b/src/JackDriver.hpp index c5da141..03a758a 100644 --- a/src/JackDriver.hpp +++ b/src/JackDriver.hpp @@ -18,7 +18,6 @@ #ifndef PATCHAGE_JACKDRIVER_HPP #define PATCHAGE_JACKDRIVER_HPP -#include <iostream> #include <boost/shared_ptr.hpp> #include <jack/jack.h> #include <jack/statistics.h> diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp index 6789948..c408f59 100644 --- a/src/PatchageEvent.cpp +++ b/src/PatchageEvent.cpp @@ -15,8 +15,10 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "patchage-config.h" +#include "raul/log.hpp" #include "raul/SharedPtr.hpp" + +#include "patchage-config.h" #include "Patchage.hpp" #include "PatchageCanvas.hpp" #include "PatchageModule.hpp" @@ -33,7 +35,6 @@ using namespace std; - void PatchageEvent::execute(Patchage* patchage) { @@ -50,6 +51,8 @@ PatchageEvent::execute(Patchage* patchage) if (module) { patchage->canvas()->remove_item(module); module.reset(); + } else { + Raul::error << "Unable to find client " << _str << " to remove" << endl; } free(_str); @@ -73,9 +76,9 @@ PatchageEvent::execute(Patchage* patchage) if (port) patchage->enqueue_resize(port->module().lock()); else - cerr << "Unable to create port view" << endl; + Raul::error << "Unable to create port view" << endl; } else { - cerr << "ERROR: Create port with unknown port type" << endl; + Raul::error << "Attempt to create port with unknown type" << endl; } } else if (_type == PORT_DESTRUCTION) { @@ -99,7 +102,7 @@ PatchageEvent::execute(Patchage* patchage) } } else { - cerr << "Unable to find port to destroy" << endl; + Raul::error << "Unable to find port to destroy" << endl; } } else if (_type == CONNECTION) { @@ -110,7 +113,7 @@ PatchageEvent::execute(Patchage* patchage) if (port_1 && port_2) patchage->canvas()->add_connection(port_1, port_2, port_1->color() + 0x22222200); else - cerr << "Unable to find port to connect" << endl; + Raul::error << "Unable to find port to connect" << endl; } else if (_type == DISCONNECTION) { @@ -120,9 +123,7 @@ PatchageEvent::execute(Patchage* patchage) if (port_1 && port_2) patchage->canvas()->remove_connection(port_1, port_2); else - cerr << "Unable to find port to disconnect" << endl; + Raul::error << "Unable to find port to disconnect" << endl; } - - //cerr << "}" << endl << endl; } diff --git a/src/ProjectList.cpp b/src/ProjectList.cpp index 9438a5e..c7dbb89 100644 --- a/src/ProjectList.cpp +++ b/src/ProjectList.cpp @@ -16,7 +16,6 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <iostream> #include <gtkmm.h> #include <libglademm/xml.h> @@ -115,7 +114,6 @@ ProjectListImpl::on_button_press_event(GdkEventButton* event) menulist.push_back(Gtk::Menu_Helpers::MenuElem("Save _all projects", sigc::mem_fun(*this, &ProjectListImpl::on_menu_popup_save_all_projects))); if (_widget->get_path_at_pos((int)event->x, (int)event->y, path, column_ptr, cell_x, cell_y)) { - //cout << path.to_string() << endl; selection->unselect_all(); selection->select(path); @@ -147,7 +145,6 @@ ProjectListImpl::on_button_press_event(GdkEventButton* event) project))); } } else { - //cout << "No row" << endl; selection->unselect_all(); } diff --git a/src/StateManager.cpp b/src/StateManager.cpp index fd9a465..a733876 100644 --- a/src/StateManager.cpp +++ b/src/StateManager.cpp @@ -15,10 +15,13 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <stdexcept> #include <stdlib.h> -#include <iostream> + +#include <stdexcept> #include <fstream> + +#include "raul/log.hpp" + #include "StateManager.hpp" #include "Patchage.hpp" @@ -126,15 +129,13 @@ StateManager::load(const string& filename) { _module_settings.clear(); - cerr << "Loading configuration file " << filename << endl; - std::ifstream is; is.open(filename.c_str(), std::ios::in); - if ( ! is.good()) { - std::cerr << "Unable to load file " << filename << "!" << endl; + if ( ! is.good()) return; - } + + Raul::info << "Loading configuration file " << filename << endl; string s; diff --git a/src/StateManager.hpp b/src/StateManager.hpp index e2b2d99..b8fb6cf 100644 --- a/src/StateManager.hpp +++ b/src/StateManager.hpp @@ -21,7 +21,6 @@ #include <string> #include <list> #include <map> -#include <iostream> #include <boost/optional.hpp> #include "PatchagePort.hpp" diff --git a/src/main.cpp b/src/main.cpp index 223ae25..2087e2a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,13 +15,15 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <iostream> #include <libgnomecanvasmm.h> #include <glibmm/exception.h> +#include "raul/log.hpp" + #include "Patchage.hpp" -int main(int argc, char** argv) +int +main(int argc, char** argv) { try { @@ -34,13 +36,13 @@ int main(int argc, char** argv) app.run(*patchage.window()); } catch (std::exception& e) { - std::cerr << "Caught exception, aborting. Error message was: " - << e.what() << std::endl; + Raul::error << "Caught exception, aborting. Error message was: " + << e.what() << std::endl; return 1; } catch (Glib::Exception& e) { - std::cerr << "Caught exception, aborting. Error message was: " - << e.what() << std::endl; + Raul::error << "Caught exception, aborting. Error message was: " + << e.what() << std::endl; return 1; } |