Remove use of C++ stdstreams
This commit is contained in:
parent
ad9551a28a
commit
605531c2f1
73
gui/main.cpp
73
gui/main.cpp
|
@ -25,29 +25,17 @@
|
||||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <libgnomecanvasmm.h>
|
|
||||||
#include <glibmm/exception.h>
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <fstream>
|
|
||||||
#include <sstream>
|
|
||||||
#include <stdexcept>
|
|
||||||
#include <libglademm/xml.h>
|
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "Widget.hpp"
|
#include <libglademm/xml.h>
|
||||||
|
#include <glibmm/exception.h>
|
||||||
#include <gtkmm.h>
|
#include <gtkmm.h>
|
||||||
#include "../common/debug.h"
|
#include "Widget.hpp"
|
||||||
|
|
||||||
//class a2j_proxy;
|
#include "../common/debug.h"
|
||||||
//class lash_proxy;
|
|
||||||
//class project_list;
|
|
||||||
//class session;
|
|
||||||
|
|
||||||
class Patchage {
|
class Patchage {
|
||||||
public:
|
public:
|
||||||
Patchage(int argc, char** argv);
|
Patchage();
|
||||||
~Patchage();
|
~Patchage();
|
||||||
|
|
||||||
Gtk::Window* window() { return _main_win.get(); }
|
Gtk::Window* window() { return _main_win.get(); }
|
||||||
|
@ -150,8 +138,6 @@ protected:
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <sstream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <libgnomecanvasmm.h>
|
#include <libgnomecanvasmm.h>
|
||||||
#include <libglademm/xml.h>
|
#include <libglademm/xml.h>
|
||||||
#include <gtk/gtkwindow.h>
|
#include <gtk/gtkwindow.h>
|
||||||
|
@ -206,7 +192,7 @@ gtkmm_set_width_for_given_text (Gtk::Widget &w, const gchar *text,
|
||||||
|
|
||||||
#define INIT_WIDGET(x) x(g_xml, ((const char*)#x) + 1)
|
#define INIT_WIDGET(x) x(g_xml, ((const char*)#x) + 1)
|
||||||
|
|
||||||
Patchage::Patchage(int argc, char** argv)
|
Patchage::Patchage()
|
||||||
: _max_dsp_load(0.0)
|
: _max_dsp_load(0.0)
|
||||||
, INIT_WIDGET(_about_win)
|
, INIT_WIDGET(_about_win)
|
||||||
, INIT_WIDGET(_buffer_size_combo)
|
, INIT_WIDGET(_buffer_size_combo)
|
||||||
|
@ -237,16 +223,6 @@ Patchage::Patchage(int argc, char** argv)
|
||||||
{
|
{
|
||||||
g_app = this;
|
g_app = this;
|
||||||
|
|
||||||
while (argc > 0) {
|
|
||||||
if (!strcmp(*argv, "--help")) {
|
|
||||||
std::cout << "Usage: patchage [OPTIONS]\nOptions: --no-alsa" << std::endl;
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
argv++;
|
|
||||||
argc--;
|
|
||||||
}
|
|
||||||
|
|
||||||
patchage_dbus_init();
|
patchage_dbus_init();
|
||||||
|
|
||||||
graph_create(JACKDBUS_SERVICE, JACKDBUS_OBJECT, &g_jack_graph);
|
graph_create(JACKDBUS_SERVICE, JACKDBUS_OBJECT, &g_jack_graph);
|
||||||
|
@ -511,7 +487,7 @@ Patchage::on_view_toolbar()
|
||||||
bool
|
bool
|
||||||
Patchage::on_scroll(GdkEventScroll* ev)
|
Patchage::on_scroll(GdkEventScroll* ev)
|
||||||
{
|
{
|
||||||
std::cout << "ON SCROLL" << std::endl;
|
lash_debug("ON SCROLL");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -878,6 +854,9 @@ Patchage::is_canvas_empty()
|
||||||
|
|
||||||
Glib::RefPtr<Gnome::Glade::Xml> g_xml;
|
Glib::RefPtr<Gnome::Glade::Xml> g_xml;
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
static
|
static
|
||||||
Glib::RefPtr<Gnome::Glade::Xml>
|
Glib::RefPtr<Gnome::Glade::Xml>
|
||||||
glade_open()
|
glade_open()
|
||||||
|
@ -906,32 +885,32 @@ glade_open()
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
if (!canvas_init()) {
|
if (!canvas_init())
|
||||||
|
{
|
||||||
lash_error("Canvas initialization failed.");
|
lash_error("Canvas initialization failed.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
Gtk::Main app(argc, argv);
|
Gtk::Main app(argc, argv);
|
||||||
|
|
||||||
g_xml = glade_open();
|
g_xml = glade_open();
|
||||||
|
|
||||||
Patchage patchage(argc, argv);
|
Patchage patchage;
|
||||||
app.run(*patchage.window());
|
app.run(*patchage.window());
|
||||||
|
}
|
||||||
} catch (std::exception& e) {
|
catch (std::exception& e)
|
||||||
std::cerr << "Caught exception, aborting. Error message was: "
|
{
|
||||||
<< e.what() << std::endl;
|
lash_error("Caught exception, aborting. Error message was: %s\n", e.what());
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
} catch (Glib::Exception& e) {
|
}
|
||||||
std::cerr << "Caught exception, aborting. Error message was: "
|
catch (Glib::Exception& e)
|
||||||
<< e.what() << std::endl;
|
{
|
||||||
|
lash_error("Caught exception, aborting. Error message was: %s\n", e.what().c_str());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue