diff options
Diffstat (limited to 'src')
70 files changed, 243 insertions, 243 deletions
diff --git a/src/client/ClientModel.cpp b/src/client/ClientModel.cpp index 1cc4d3e..099d997 100644 --- a/src/client/ClientModel.cpp +++ b/src/client/ClientModel.cpp @@ -17,8 +17,8 @@ #include "ClientModel.hpp" -namespace Machina { -namespace Client { +namespace machina { +namespace client { SPtr<ClientObject> ClientModel::find(uint64_t id) diff --git a/src/client/ClientModel.hpp b/src/client/ClientModel.hpp index b629a37..e3bccb4 100644 --- a/src/client/ClientModel.hpp +++ b/src/client/ClientModel.hpp @@ -28,8 +28,8 @@ namespace Raul { class Atom; } -namespace Machina { -namespace Client { +namespace machina { +namespace client { class ClientModel { diff --git a/src/client/ClientObject.cpp b/src/client/ClientObject.cpp index 7f7eb9e..9b7c319 100644 --- a/src/client/ClientObject.cpp +++ b/src/client/ClientObject.cpp @@ -19,8 +19,8 @@ #include "ClientObject.hpp" -namespace Machina { -namespace Client { +namespace machina { +namespace client { ClientObject::ClientObject(uint64_t id) : _id(id) diff --git a/src/client/ClientObject.hpp b/src/client/ClientObject.hpp index df8a1dd..c9469ed 100644 --- a/src/client/ClientObject.hpp +++ b/src/client/ClientObject.hpp @@ -26,8 +26,8 @@ #include "machina/types.hpp" -namespace Machina { -namespace Client { +namespace machina { +namespace client { class ClientObject { diff --git a/src/engine/Action.cpp b/src/engine/Action.cpp index e49e69b..6d825e6 100644 --- a/src/engine/Action.cpp +++ b/src/engine/Action.cpp @@ -19,7 +19,7 @@ #include "Action.hpp" -namespace Machina { +namespace machina { void Action::write_state(Sord::Model& model) @@ -31,4 +31,4 @@ Action::write_state(Sord::Model& model) Sord::Curie(model.world(), "machina:Action")); } -} // namespace Machina +} // namespace machina diff --git a/src/engine/Action.hpp b/src/engine/Action.hpp index 7397eaa..8afa926 100644 --- a/src/engine/Action.hpp +++ b/src/engine/Action.hpp @@ -29,7 +29,7 @@ #include "MIDISink.hpp" #include "Stateful.hpp" -namespace Machina { +namespace machina { /** An Action, executed on entering or exiting of a state. */ @@ -54,6 +54,6 @@ private: std::string _msg; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_ACTION_HPP diff --git a/src/engine/ActionFactory.cpp b/src/engine/ActionFactory.cpp index afcc178..f880819 100644 --- a/src/engine/ActionFactory.cpp +++ b/src/engine/ActionFactory.cpp @@ -18,7 +18,7 @@ #include "ActionFactory.hpp" #include "MidiAction.hpp" -namespace Machina { +namespace machina { SPtr<Action> ActionFactory::copy(SPtr<Action> copy) diff --git a/src/engine/ActionFactory.hpp b/src/engine/ActionFactory.hpp index d273274..3bd9cf7 100644 --- a/src/engine/ActionFactory.hpp +++ b/src/engine/ActionFactory.hpp @@ -20,7 +20,7 @@ #include "machina/types.hpp" -namespace Machina { +namespace machina { struct Action; @@ -30,6 +30,6 @@ SPtr<Action> note_on(unsigned char note); SPtr<Action> note_off(unsigned char note); } -} // namespace Machina +} // namespace machina #endif // MACHINA_ACTIONFACTORY_HPP diff --git a/src/engine/Controller.cpp b/src/engine/Controller.cpp index ffe30e1..6d0cf86 100644 --- a/src/engine/Controller.cpp +++ b/src/engine/Controller.cpp @@ -25,10 +25,10 @@ #include "Edge.hpp" -namespace Machina { +namespace machina { Controller::Controller(SPtr<Engine> engine, - Client::ClientModel& client_model) + client::ClientModel& client_model) : _engine(engine) , _client_model(client_model) , _updates(new Raul::RingBuffer(4096)) @@ -37,13 +37,13 @@ Controller::Controller(SPtr<Engine> engine, } uint64_t -Controller::create(const Client::ClientObject& properties) +Controller::create(const client::ClientObject& properties) { TimeDuration dur(_engine->machine()->time().unit(), properties.get(URIs::instance().machina_duration).get_float()); - SPtr<Machina::Node> node(new Machina::Node(dur)); - SPtr<Client::ClientObject> obj( - new Client::ClientObject(properties, node->id())); + SPtr<machina::Node> node(new machina::Node(dur)); + SPtr<client::ClientObject> obj( + new client::ClientObject(properties, node->id())); _objects.insert(node); _client_model.new_object(obj); _engine->machine()->add_node(node); @@ -55,10 +55,10 @@ Controller::announce(SPtr<Machine> machine) { Raul::Forge& forge = _engine->forge(); - for (Machina::Machine::Nodes::const_iterator n = machine->nodes().begin(); + for (machina::Machine::Nodes::const_iterator n = machine->nodes().begin(); n != machine->nodes().end(); ++n) { - SPtr<Machina::Client::ClientObject> obj( - new Machina::Client::ClientObject((*n)->id())); + SPtr<machina::client::ClientObject> obj( + new machina::client::ClientObject((*n)->id())); obj->set(URIs::instance().rdf_type, forge.make_urid(URIs::instance().machina_Node)); obj->set(URIs::instance().machina_duration, @@ -70,13 +70,13 @@ Controller::announce(SPtr<Machine> machine) _client_model.new_object(obj); } - for (Machina::Machine::Nodes::const_iterator n = machine->nodes().begin(); + for (machina::Machine::Nodes::const_iterator n = machine->nodes().begin(); n != machine->nodes().end(); ++n) { - for (Machina::Node::Edges::const_iterator e = (*n)->edges().begin(); + for (machina::Node::Edges::const_iterator e = (*n)->edges().begin(); e != (*n)->edges().end(); ++e) { _objects.insert(*e); - SPtr<Client::ClientObject> eobj( - new Client::ClientObject((*e)->id())); + SPtr<client::ClientObject> eobj( + new client::ClientObject((*e)->id())); eobj->set(URIs::instance().rdf_type, forge.make_urid(URIs::instance().machina_Edge)); eobj->set(URIs::instance().machina_probability, @@ -105,7 +105,7 @@ Controller::find(uint64_t id) void Controller::learn(SPtr<Raul::Maid> maid, uint64_t node_id) { - SPtr<Machina::Node> node = dynamic_ptr_cast<Machina::Node>(find(node_id)); + SPtr<machina::Node> node = dynamic_ptr_cast<machina::Node>(find(node_id)); if (node) { _engine->machine()->learn(maid, node); } else { @@ -129,16 +129,16 @@ Controller::set_property(uint64_t object_id, uint64_t Controller::connect(uint64_t tail_id, uint64_t head_id) { - SPtr<Machina::Node> tail = dynamic_ptr_cast<Machina::Node>(find(tail_id)); - SPtr<Machina::Node> head = dynamic_ptr_cast<Machina::Node>(find(head_id)); + SPtr<machina::Node> tail = dynamic_ptr_cast<machina::Node>(find(tail_id)); + SPtr<machina::Node> head = dynamic_ptr_cast<machina::Node>(find(head_id)); - SPtr<Machina::Edge> edge(new Machina::Edge(tail, head)); + SPtr<machina::Edge> edge(new machina::Edge(tail, head)); tail->add_edge(edge); _objects.insert(edge); Raul::Forge& forge = _engine->forge(); - SPtr<Client::ClientObject> obj(new Client::ClientObject(edge->id())); + SPtr<client::ClientObject> obj(new client::ClientObject(edge->id())); obj->set(URIs::instance().rdf_type, forge.make_urid(URIs::instance().machina_Edge)); obj->set(URIs::instance().machina_probability, forge.make(1.0f)); @@ -153,8 +153,8 @@ Controller::connect(uint64_t tail_id, uint64_t head_id) void Controller::disconnect(uint64_t tail_id, uint64_t head_id) { - SPtr<Machina::Node> tail = dynamic_ptr_cast<Machina::Node>(find(tail_id)); - SPtr<Machina::Node> head = dynamic_ptr_cast<Machina::Node>(find(head_id)); + SPtr<machina::Node> tail = dynamic_ptr_cast<machina::Node>(find(tail_id)); + SPtr<machina::Node> head = dynamic_ptr_cast<machina::Node>(find(head_id)); SPtr<Edge> edge = tail->remove_edge_to(head); if (edge) { @@ -192,11 +192,11 @@ Controller::process_updates() Raul::Atom value; for (uint32_t i = 0; i < read_space; ) { i += read_set(_updates, &subject, &key, &value); - SPtr<Machina::Client::ClientObject> obj = _client_model.find(subject); + SPtr<machina::client::ClientObject> obj = _client_model.find(subject); if (obj) { obj->set(key, value); } else { - SPtr<Client::ClientObject> obj(new Client::ClientObject(subject)); + SPtr<client::ClientObject> obj(new client::ClientObject(subject)); obj->set(key, value); _client_model.new_object(obj); } diff --git a/src/engine/Edge.cpp b/src/engine/Edge.cpp index e43efa1..0538c3c 100644 --- a/src/engine/Edge.cpp +++ b/src/engine/Edge.cpp @@ -22,7 +22,7 @@ #include "Edge.hpp" #include "Node.hpp" -namespace Machina { +namespace machina { void Edge::set(URIInt key, const Raul::Atom& value) @@ -68,4 +68,4 @@ Edge::write_state(Sord::Model& model) */ } -} // namespace Machina +} // namespace machina diff --git a/src/engine/Edge.hpp b/src/engine/Edge.hpp index 6d916c1..ab2ae73 100644 --- a/src/engine/Edge.hpp +++ b/src/engine/Edge.hpp @@ -28,7 +28,7 @@ #include "Action.hpp" #include "Stateful.hpp" -namespace Machina { +namespace machina { class Node; @@ -61,6 +61,6 @@ private: SPtr<Node> _head; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_EDGE_HPP diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp index e151cae..12c351d 100644 --- a/src/engine/Engine.cpp +++ b/src/engine/Engine.cpp @@ -26,7 +26,7 @@ #include "JackDriver.hpp" #endif -namespace Machina { +namespace machina { Engine::Engine(Raul::Forge& forge, SPtr<Driver> driver, @@ -112,8 +112,8 @@ void Engine::export_midi(const Glib::ustring& filename, Raul::TimeDuration dur) { SPtr<Machine> machine = _driver->machine(); - SPtr<Machina::SMFDriver> file_driver( - new Machina::SMFDriver(_forge, dur.unit())); + SPtr<machina::SMFDriver> file_driver( + new machina::SMFDriver(_forge, dur.unit())); const bool activated = _driver->is_activated(); if (activated) { @@ -142,4 +142,4 @@ Engine::set_quantization(double q) _driver->set_quantization(q); } -} // namespace Machina +} // namespace machina diff --git a/src/engine/Evolver.cpp b/src/engine/Evolver.cpp index 56b3b45..0ebf21a 100644 --- a/src/engine/Evolver.cpp +++ b/src/engine/Evolver.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace Eugene; using namespace boost; -namespace Machina { +namespace machina { Evolver::Evolver(TimeUnit unit, const string& target_midi, @@ -106,4 +106,4 @@ Evolver::_run() } } -} // namespace Machina +} // namespace machina diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp index 8b9b5de..4b49103 100644 --- a/src/engine/JackDriver.cpp +++ b/src/engine/JackDriver.cpp @@ -27,10 +27,10 @@ #include "LearnRequest.hpp" #include "MidiAction.hpp" -using namespace Machina; +using namespace machina; using namespace std; -namespace Machina { +namespace machina { JackDriver::JackDriver(Raul::Forge& forge, SPtr<Machine> machine) : Driver(forge, machine) @@ -455,4 +455,4 @@ JackDriver::jack_error_cb(const char* msg) cerr << "[JACK] Error: " << msg << endl; } -} // namespace Machina +} // namespace machina diff --git a/src/engine/JackDriver.hpp b/src/engine/JackDriver.hpp index 06ffabe..3045165 100644 --- a/src/engine/JackDriver.hpp +++ b/src/engine/JackDriver.hpp @@ -33,7 +33,7 @@ #include "Recorder.hpp" -namespace Machina { +namespace machina { class MidiAction; class Node; @@ -44,7 +44,7 @@ class Node; * in the processing context must be realtime safe (non-blocking). */ class JackDriver - : public Machina::Driver + : public machina::Driver { public: JackDriver(Raul::Forge& forge, @@ -127,6 +127,6 @@ private: bool _is_activated; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_JACKDRIVER_HPP diff --git a/src/engine/LearnRequest.cpp b/src/engine/LearnRequest.cpp index acf5bf0..b477045 100644 --- a/src/engine/LearnRequest.cpp +++ b/src/engine/LearnRequest.cpp @@ -18,7 +18,7 @@ #include "LearnRequest.hpp" #include "quantize.hpp" -namespace Machina { +namespace machina { LearnRequest::LearnRequest(SPtr<Raul::Maid> maid, SPtr<Node> node) : _started(false) diff --git a/src/engine/LearnRequest.hpp b/src/engine/LearnRequest.hpp index 4093d24..a5773ad 100644 --- a/src/engine/LearnRequest.hpp +++ b/src/engine/LearnRequest.hpp @@ -25,7 +25,7 @@ #include "MidiAction.hpp" #include "Node.hpp" -namespace Machina { +namespace machina { class Node; class MidiAction; @@ -58,6 +58,6 @@ private: SPtr<MidiAction> _exit_action; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_LEARNREQUEST_HPP diff --git a/src/engine/Loader.cpp b/src/engine/Loader.cpp index c206c4c..0ee5ba7 100644 --- a/src/engine/Loader.cpp +++ b/src/engine/Loader.cpp @@ -35,7 +35,7 @@ using namespace std; #define NS_MACHINA "http://drobilla.net/ns/machina#" #define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" -namespace Machina { +namespace machina { Loader::Loader(Raul::Forge& forge, Sord::World& rdf_world) : _forge(forge) @@ -200,4 +200,4 @@ Loader::load(const Glib::ustring& uri) } } -} // namespace Machina +} // namespace machina diff --git a/src/engine/MIDISink.hpp b/src/engine/MIDISink.hpp index 1bf53dc..40edcad 100644 --- a/src/engine/MIDISink.hpp +++ b/src/engine/MIDISink.hpp @@ -21,7 +21,7 @@ #include "raul/Deletable.hpp" #include "raul/TimeStamp.hpp" -namespace Machina { +namespace machina { /** Pure virtual base for anything you can write MIDI to. */ class MIDISink @@ -33,6 +33,6 @@ public: const uint8_t* ev) = 0; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_MIDI_SINK_HPP diff --git a/src/engine/Machine.cpp b/src/engine/Machine.cpp index 63c37b8..fc026f9 100644 --- a/src/engine/Machine.cpp +++ b/src/engine/Machine.cpp @@ -36,7 +36,7 @@ using namespace std; using namespace Raul; -namespace Machina { +namespace machina { Machine::Machine(TimeUnit unit) : _active_nodes(MAX_ACTIVE_NODES, SPtr<Node>()) @@ -61,7 +61,7 @@ Machine::Machine(const Machine& copy) for (Nodes::const_iterator n = copy._nodes.begin(); n != copy._nodes.end(); ++n) { - SPtr<Machina::Node> node(new Machina::Node(*n->get())); + SPtr<machina::Node> node(new machina::Node(*n->get())); _nodes.insert(node); replacements[*n] = node; } @@ -91,7 +91,7 @@ Machine::operator=(const Machine& other) for (Nodes::const_iterator n = other._nodes.begin(); n != other._nodes.end(); ++n) { - SPtr<Machina::Node> node(new Machina::Node(*n->get())); + SPtr<machina::Node> node(new machina::Node(*n->get())); _nodes.insert(node); replacements[*n] = node; } @@ -435,4 +435,4 @@ Machine::write_state(Sord::Model& model) } } -} // namespace Machina +} // namespace machina diff --git a/src/engine/MachineBuilder.cpp b/src/engine/MachineBuilder.cpp index 27fb68c..a6ecb32 100644 --- a/src/engine/MachineBuilder.cpp +++ b/src/engine/MachineBuilder.cpp @@ -29,7 +29,7 @@ using namespace std; using namespace Raul; -namespace Machina { +namespace machina { MachineBuilder::MachineBuilder(SPtr<Machine> machine, double q, bool step) : _quantization(q) @@ -307,4 +307,4 @@ MachineBuilder::finish() return _machine; } -} // namespace Machina +} // namespace machina diff --git a/src/engine/MachineBuilder.hpp b/src/engine/MachineBuilder.hpp index 4a915aa..6c35724 100644 --- a/src/engine/MachineBuilder.hpp +++ b/src/engine/MachineBuilder.hpp @@ -25,7 +25,7 @@ #include "machina/types.hpp" #include "raul/TimeStamp.hpp" -namespace Machina { +namespace machina { class Machine; class Node; @@ -80,6 +80,6 @@ private: bool _step; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_MACHINEBUILDER_HPP diff --git a/src/engine/MidiAction.cpp b/src/engine/MidiAction.cpp index cac01a3..8ebfee9 100644 --- a/src/engine/MidiAction.cpp +++ b/src/engine/MidiAction.cpp @@ -24,7 +24,7 @@ #include "MIDISink.hpp" #include "MidiAction.hpp" -namespace Machina { +namespace machina { /** Create a MIDI action. * @@ -110,4 +110,4 @@ MidiAction::write_state(Sord::Model& model) */ } -} // namespace Machina +} // namespace machina diff --git a/src/engine/MidiAction.hpp b/src/engine/MidiAction.hpp index 96d104c..5347792 100644 --- a/src/engine/MidiAction.hpp +++ b/src/engine/MidiAction.hpp @@ -26,7 +26,7 @@ #include "Action.hpp" -namespace Machina { +namespace machina { class MIDISink; @@ -55,6 +55,6 @@ private: std::atomic<byte*> _event; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_MIDIACTION_HPP diff --git a/src/engine/Mutation.cpp b/src/engine/Mutation.cpp index fde1ba6..b0c4e2b 100644 --- a/src/engine/Mutation.cpp +++ b/src/engine/Mutation.cpp @@ -27,7 +27,7 @@ using namespace std; -namespace Machina { +namespace machina { namespace Mutation { void @@ -188,4 +188,4 @@ AdjustEdge::mutate(Machine& machine) } } // namespace Mutation -} // namespace Machina +} // namespace machina diff --git a/src/engine/Node.cpp b/src/engine/Node.cpp index d8d89b9..962a3c7 100644 --- a/src/engine/Node.cpp +++ b/src/engine/Node.cpp @@ -31,7 +31,7 @@ using namespace Raul; using namespace std; -namespace Machina { +namespace machina { Node::Node(TimeDuration duration, bool initial) : _enter_time(duration.unit()) @@ -257,4 +257,4 @@ Node::write_state(Sord::Model& model) } } -} // namespace Machina +} // namespace machina diff --git a/src/engine/Node.hpp b/src/engine/Node.hpp index 953f652..575f39e 100644 --- a/src/engine/Node.hpp +++ b/src/engine/Node.hpp @@ -27,7 +27,7 @@ #include "Stateful.hpp" #include "MIDISink.hpp" -namespace Machina { +namespace machina { class Edge; using Raul::TimeDuration; @@ -108,6 +108,6 @@ private: bool _is_active; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_NODE_HPP diff --git a/src/engine/Problem.cpp b/src/engine/Problem.cpp index 3540b2b..88e2bad 100644 --- a/src/engine/Problem.cpp +++ b/src/engine/Problem.cpp @@ -36,7 +36,7 @@ using namespace std; -namespace Machina { +namespace machina { Problem::Problem(TimeUnit unit, const std::string& target_midi, @@ -380,4 +380,4 @@ Problem::distance(const std::vector<uint8_t>& source, return _matrix[n][m]; } -} // namespace Machina +} // namespace machina diff --git a/src/engine/Problem.hpp b/src/engine/Problem.hpp index 7d96250..4569469 100644 --- a/src/engine/Problem.hpp +++ b/src/engine/Problem.hpp @@ -25,7 +25,7 @@ #include "MIDISink.hpp" -namespace Machina { +namespace machina { class Problem : public Eugene::Problem<Machine> { public: @@ -121,6 +121,6 @@ private: mutable std::map<Machine*, float> _fitness; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_PROBLEM_HPP diff --git a/src/engine/Recorder.cpp b/src/engine/Recorder.cpp index df9a200..559298f 100644 --- a/src/engine/Recorder.cpp +++ b/src/engine/Recorder.cpp @@ -24,7 +24,7 @@ using namespace std; using namespace Raul; -namespace Machina { +namespace machina { Recorder::Recorder(Raul::Forge& forge, size_t buffer_size, diff --git a/src/engine/Recorder.hpp b/src/engine/Recorder.hpp index 62295cf..0fbf0b1 100644 --- a/src/engine/Recorder.hpp +++ b/src/engine/Recorder.hpp @@ -25,7 +25,7 @@ #include "Slave.hpp" -namespace Machina { +namespace machina { class MachineBuilder; @@ -63,6 +63,6 @@ private: SPtr<MachineBuilder> _builder; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_RECORDER_HPP diff --git a/src/engine/SMFDriver.cpp b/src/engine/SMFDriver.cpp index 923c2fa..538b540 100644 --- a/src/engine/SMFDriver.cpp +++ b/src/engine/SMFDriver.cpp @@ -32,7 +32,7 @@ using namespace std; -namespace Machina { +namespace machina { SMFDriver::SMFDriver(Raul::Forge& forge, Raul::TimeUnit unit) : Driver(forge, SPtr<Machine>()) @@ -165,4 +165,4 @@ SMFDriver::run(SPtr<Machine> machine, Raul::TimeStamp max_time) machine->run(context, SPtr<Raul::RingBuffer>()); } -} // namespace Machina +} // namespace machina diff --git a/src/engine/SMFDriver.hpp b/src/engine/SMFDriver.hpp index ee3c220..c67186a 100644 --- a/src/engine/SMFDriver.hpp +++ b/src/engine/SMFDriver.hpp @@ -27,7 +27,7 @@ #include "SMFReader.hpp" #include "SMFWriter.hpp" -namespace Machina { +namespace machina { class Node; class Machine; @@ -69,6 +69,6 @@ private: Raul::TimeDuration max_duration); }; -} // namespace Machina +} // namespace machina #endif // MACHINA_SMFDRIVER_HPP diff --git a/src/engine/SMFReader.cpp b/src/engine/SMFReader.cpp index d482eb5..d38ab65 100644 --- a/src/engine/SMFReader.cpp +++ b/src/engine/SMFReader.cpp @@ -27,7 +27,7 @@ using std::endl; -namespace Machina { +namespace machina { /** Return the size of the given event NOT including the status byte, * or -1 if unknown (eg sysex) @@ -323,4 +323,4 @@ SMFReader::read_var_len(FILE* fd) throw (PrematureEOF) return value; } -} // namespace Machina +} // namespace machina diff --git a/src/engine/SMFReader.hpp b/src/engine/SMFReader.hpp index a3f38ed..e403588 100644 --- a/src/engine/SMFReader.hpp +++ b/src/engine/SMFReader.hpp @@ -22,7 +22,7 @@ #include <inttypes.h> #include "raul/TimeStamp.hpp" -namespace Machina { +namespace machina { /** Standard Midi File (Type 0) Reader * @@ -84,6 +84,6 @@ protected: uint32_t _track_size; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_SMF_READER_HPP diff --git a/src/engine/SMFWriter.cpp b/src/engine/SMFWriter.cpp index 388aa1f..262009f 100644 --- a/src/engine/SMFWriter.cpp +++ b/src/engine/SMFWriter.cpp @@ -28,7 +28,7 @@ using std::endl; -namespace Machina { +namespace machina { /** Create a new SMF writer. * @@ -240,4 +240,4 @@ SMFWriter::write_var_len(uint32_t value) return ret; } -} // namespace Machina +} // namespace machina diff --git a/src/engine/SMFWriter.hpp b/src/engine/SMFWriter.hpp index ba530a8..8d82501 100644 --- a/src/engine/SMFWriter.hpp +++ b/src/engine/SMFWriter.hpp @@ -24,7 +24,7 @@ #include "MIDISink.hpp" -namespace Machina { +namespace machina { /** Standard Midi File (Type 0) Writer * \ingroup raul @@ -68,6 +68,6 @@ protected: uint32_t _header_size; ///< size of SMF header, including MTrk chunk header }; -} // namespace Machina +} // namespace machina #endif // MACHINA_SMF_WRITER_HPP diff --git a/src/engine/Slave.hpp b/src/engine/Slave.hpp index 7a16c10..b5bcf34 100644 --- a/src/engine/Slave.hpp +++ b/src/engine/Slave.hpp @@ -21,7 +21,7 @@ #include "raul/Semaphore.hpp" #include "raul/Thread.hpp" -namespace Machina { +namespace machina { /** Thread driven by (realtime safe) signals. * @@ -68,6 +68,6 @@ private: }; -} // namespace Machina +} // namespace machina #endif // MACHINA_SLAVE_HPP diff --git a/src/engine/Stateful.cpp b/src/engine/Stateful.cpp index d778b85..a08ec51 100644 --- a/src/engine/Stateful.cpp +++ b/src/engine/Stateful.cpp @@ -17,7 +17,7 @@ #include "Stateful.hpp" -namespace Machina { +namespace machina { uint64_t Stateful::_next_id = 1; @@ -37,4 +37,4 @@ Stateful::rdf_id(Sord::World& world) const return _rdf_id; } -} // namespace Machina +} // namespace machina diff --git a/src/engine/Stateful.hpp b/src/engine/Stateful.hpp index 928be3b..67ae757 100644 --- a/src/engine/Stateful.hpp +++ b/src/engine/Stateful.hpp @@ -28,7 +28,7 @@ namespace Raul { class Atom; } -namespace Machina { +namespace machina { class URIs; @@ -66,6 +66,6 @@ public: void write_state(Sord::Model& model) {} }; -} // namespace Machina +} // namespace machina #endif // MACHINA_STATEFUL_HPP diff --git a/src/engine/URIs.cpp b/src/engine/URIs.cpp index 3d40262..cd2d45a 100644 --- a/src/engine/URIs.cpp +++ b/src/engine/URIs.cpp @@ -17,8 +17,8 @@ #include "machina/URIs.hpp" -namespace Machina { +namespace machina { URIs* URIs::_instance = NULL; -} // namespace Machina +} // namespace machina diff --git a/src/engine/Updates.cpp b/src/engine/Updates.cpp index 2775292..9bdedef 100644 --- a/src/engine/Updates.cpp +++ b/src/engine/Updates.cpp @@ -22,7 +22,7 @@ #include "machina/types.hpp" #include "machina/Updates.hpp" -namespace Machina { +namespace machina { void write_set(SPtr<Raul::RingBuffer> buf, diff --git a/src/engine/machina/Context.hpp b/src/engine/machina/Context.hpp index 8195a0e..bedaa76 100644 --- a/src/engine/machina/Context.hpp +++ b/src/engine/machina/Context.hpp @@ -22,7 +22,7 @@ #include "raul/Atom.hpp" #include "raul/TimeSlice.hpp" -namespace Machina { +namespace machina { class MIDISink; @@ -47,6 +47,6 @@ private: MIDISink* _sink; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_CONTEXT_HPP diff --git a/src/engine/machina/Controller.hpp b/src/engine/machina/Controller.hpp index d5a7928..c77ee16 100644 --- a/src/engine/machina/Controller.hpp +++ b/src/engine/machina/Controller.hpp @@ -34,22 +34,22 @@ namespace Raul { class Atom; } -namespace Machina { +namespace machina { class Engine; class Machine; class Stateful; -namespace Client { +namespace client { class ClientModel; class ClientObject; } class Controller { public: - Controller(SPtr<Engine> engine, Client::ClientModel& client_model); + Controller(SPtr<Engine> engine, client::ClientModel& client_model); - uint64_t create(const Client::ClientObject& obj); + uint64_t create(const client::ClientObject& obj); uint64_t connect(uint64_t tail_id, uint64_t head_id); void set_property(uint64_t object_id, @@ -79,7 +79,7 @@ private: Objects _objects; SPtr<Engine> _engine; - Client::ClientModel& _client_model; + client::ClientModel& _client_model; SPtr<Raul::RingBuffer> _updates; }; diff --git a/src/engine/machina/Driver.hpp b/src/engine/machina/Driver.hpp index 1ef0a7f..3e65c9d 100644 --- a/src/engine/machina/Driver.hpp +++ b/src/engine/machina/Driver.hpp @@ -24,7 +24,7 @@ #include "MIDISink.hpp" -namespace Machina { +namespace machina { class Machine; @@ -70,6 +70,6 @@ protected: SPtr<Raul::RingBuffer> _updates; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_JACKDRIVER_HPP diff --git a/src/engine/machina/Engine.hpp b/src/engine/machina/Engine.hpp index 1c8d6ae..7e0c9bc 100644 --- a/src/engine/machina/Engine.hpp +++ b/src/engine/machina/Engine.hpp @@ -28,7 +28,7 @@ #include "machina/Driver.hpp" #include "machina/Loader.hpp" -namespace Machina { +namespace machina { class Machine; @@ -69,6 +69,6 @@ private: Raul::Forge _forge; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_ENGINE_HPP diff --git a/src/engine/machina/Evolver.hpp b/src/engine/machina/Evolver.hpp index 7c5504e..a467f4f 100644 --- a/src/engine/machina/Evolver.hpp +++ b/src/engine/machina/Evolver.hpp @@ -30,7 +30,7 @@ template<typename G> class HybridMutation; } -namespace Machina { +namespace machina { class Machine; class Problem; @@ -59,6 +59,6 @@ private: Schrodinbit _improvement; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_EVOLVER_HPP diff --git a/src/engine/machina/Loader.hpp b/src/engine/machina/Loader.hpp index 665f7b7..edcfabc 100644 --- a/src/engine/machina/Loader.hpp +++ b/src/engine/machina/Loader.hpp @@ -26,7 +26,7 @@ using Sord::Namespaces; -namespace Machina { +namespace machina { class Machine; @@ -42,6 +42,6 @@ private: Sord::World& _rdf_world; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_LOADER_HPP diff --git a/src/engine/machina/Machine.hpp b/src/engine/machina/Machine.hpp index d65cec4..84e819d 100644 --- a/src/engine/machina/Machine.hpp +++ b/src/engine/machina/Machine.hpp @@ -31,7 +31,7 @@ #include "types.hpp" #include "Node.hpp" -namespace Machina { +namespace machina { class Context; class Controller; @@ -105,6 +105,6 @@ private: bool _is_finished; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_MACHINE_HPP diff --git a/src/engine/machina/Mutation.hpp b/src/engine/machina/Mutation.hpp index dd2dbbf..bce4abe 100644 --- a/src/engine/machina/Mutation.hpp +++ b/src/engine/machina/Mutation.hpp @@ -27,7 +27,7 @@ # define SUPER : public Mutation #endif -namespace Machina { +namespace machina { class Machine; @@ -50,6 +50,6 @@ struct AdjustEdge SUPER { void mutate(Machine& machine); }; } // namespace Mutation -} // namespace Machina +} // namespace machina #endif // MACHINA_MACHINE_MUTATION_HPP diff --git a/src/engine/machina/URIs.hpp b/src/engine/machina/URIs.hpp index caed196..3f63fd2 100644 --- a/src/engine/machina/URIs.hpp +++ b/src/engine/machina/URIs.hpp @@ -24,7 +24,7 @@ #include "machina/types.hpp" -namespace Machina { +namespace machina { class URIs { @@ -73,6 +73,6 @@ private: static URIs* _instance; }; -} // namespace Machina +} // namespace machina #endif // MACHINA_URIS_HPP diff --git a/src/engine/machina/Updates.hpp b/src/engine/machina/Updates.hpp index 5f6a324..c7d02ab 100644 --- a/src/engine/machina/Updates.hpp +++ b/src/engine/machina/Updates.hpp @@ -24,7 +24,7 @@ #include "machina/types.hpp" -namespace Machina { +namespace machina { enum UpdateType { UPDATE_SET = 1 @@ -42,6 +42,6 @@ read_set(SPtr<Raul::RingBuffer> buf, URIInt* key, Raul::Atom* value); -} // namespace Machina +} // namespace machina #endif // MACHINA_UPDATES_HPP diff --git a/src/engine/machina/types.hpp b/src/engine/machina/types.hpp index 23d5f1c..f929d87 100644 --- a/src/engine/machina/types.hpp +++ b/src/engine/machina/types.hpp @@ -22,7 +22,7 @@ #include "raul/RingBuffer.hpp" -namespace Machina { +namespace machina { typedef unsigned char byte; @@ -52,6 +52,6 @@ SPtr<T> const_ptr_cast(const SPtr<U>& r) { return std::const_pointer_cast<T>(r); } -} // namespace Machina +} // namespace machina #endif // MACHINA_TYPES_HPP diff --git a/src/engine/quantize.hpp b/src/engine/quantize.hpp index de4d20b..da2ad9d 100644 --- a/src/engine/quantize.hpp +++ b/src/engine/quantize.hpp @@ -21,7 +21,7 @@ #include "raul/TimeStamp.hpp" -namespace Machina { +namespace machina { inline TimeStamp quantize(TimeStamp q, TimeStamp t) @@ -41,6 +41,6 @@ quantize(double q, double t) : t; } -} // namespace Machina +} // namespace machina #endif // MACHINA_QUANTIZE_HPP diff --git a/src/engine/quantize_test.cpp b/src/engine/quantize_test.cpp index d690990..96ba6d8 100644 --- a/src/engine/quantize_test.cpp +++ b/src/engine/quantize_test.cpp @@ -19,7 +19,7 @@ #include "quantize.hpp" using namespace std; -using namespace Machina; +using namespace machina; int main() diff --git a/src/engine/smf_test.cpp b/src/engine/smf_test.cpp index ce0a7d6..9e603f2 100644 --- a/src/engine/smf_test.cpp +++ b/src/engine/smf_test.cpp @@ -21,7 +21,7 @@ #include "raul/SMFWriter.hpp" using namespace std; -using namespace Machina; +using namespace machina; int main(int argc, char** argv) diff --git a/src/gui/EdgeView.cpp b/src/gui/EdgeView.cpp index dd28a41..ec77a7b 100644 --- a/src/gui/EdgeView.cpp +++ b/src/gui/EdgeView.cpp @@ -25,8 +25,8 @@ #include "MachinaGUI.hpp" #include "NodeView.hpp" -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { /* probability colour stuff */ @@ -67,7 +67,7 @@ using namespace Ganv; EdgeView::EdgeView(Canvas& canvas, SPtr<NodeView> src, SPtr<NodeView> dst, - SPtr<Machina::Client::ClientObject> edge) + SPtr<machina::client::ClientObject> edge) : Ganv::Edge(canvas, src.get(), dst.get(), 0x9FA0A0F4, true, false) , _edge(edge) { @@ -127,12 +127,12 @@ EdgeView::on_event(GdkEvent* ev) } void -EdgeView::on_property(Machina::URIInt key, const Raul::Atom& value) +EdgeView::on_property(machina::URIInt key, const Raul::Atom& value) { if (key == URIs::instance().machina_probability) { set_color(edge_color(value.get_float())); } } -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/EdgeView.hpp b/src/gui/EdgeView.hpp index bafcb6b..6d51427 100644 --- a/src/gui/EdgeView.hpp +++ b/src/gui/EdgeView.hpp @@ -24,20 +24,20 @@ #include "machina/types.hpp" -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { class NodeView; class EdgeView : public Ganv::Edge - , public Machina::Client::ClientObject::View + , public machina::client::ClientObject::View { public: EdgeView(Ganv::Canvas& canvas, SPtr<NodeView> src, SPtr<NodeView> dst, - SPtr<Machina::Client::ClientObject> edge); + SPtr<machina::client::ClientObject> edge); void show_label(bool show); @@ -45,14 +45,14 @@ public: private: bool on_event(GdkEvent* ev); - void on_property(Machina::URIInt key, const Raul::Atom& value); + void on_property(machina::URIInt key, const Raul::Atom& value); float probability() const; - SPtr<Machina::Client::ClientObject> _edge; + SPtr<machina::client::ClientObject> _edge; }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui #endif // MACHINA_EDGEVIEW_HPP diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp index 95a3f14..7a26ef0 100644 --- a/src/gui/MachinaCanvas.cpp +++ b/src/gui/MachinaCanvas.cpp @@ -33,8 +33,8 @@ using namespace Raul; using namespace Ganv; -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { MachinaCanvas::MachinaCanvas(MachinaGUI* app, int width, int height) : Canvas(width, height) @@ -103,9 +103,9 @@ MachinaCanvas::on_event(GdkEvent* event) } void -MachinaCanvas::on_new_object(SPtr<Client::ClientObject> object) +MachinaCanvas::on_new_object(SPtr<client::ClientObject> object) { - const Machina::URIs& uris = URIs::instance(); + const machina::URIs& uris = URIs::instance(); const Raul::Atom& type = object->get(uris.rdf_type); if (!type.is_valid()) { return; @@ -127,9 +127,9 @@ MachinaCanvas::on_new_object(SPtr<Client::ClientObject> object) object->set_view(view); } else if (type.get<URIInt>() == uris.machina_Edge) { - SPtr<Machina::Client::ClientObject> tail = _app->client_model()->find( + SPtr<machina::client::ClientObject> tail = _app->client_model()->find( object->get(uris.machina_tail_id).get_int32()); - SPtr<Machina::Client::ClientObject> head = _app->client_model()->find( + SPtr<machina::client::ClientObject> head = _app->client_model()->find( object->get(uris.machina_head_id).get_int32()); if (!tail || !head) { @@ -150,13 +150,13 @@ MachinaCanvas::on_new_object(SPtr<Client::ClientObject> object) } void -MachinaCanvas::on_erase_object(SPtr<Client::ClientObject> object) +MachinaCanvas::on_erase_object(SPtr<client::ClientObject> object) { const Raul::Atom& type = object->get(URIs::instance().rdf_type); if (type.get<URIInt>() == URIs::instance().machina_Node) { // Destruction of the view will remove from the canvas } else if (type.get<URIInt>() == URIs::instance().machina_Edge) { - object->set_view(SPtr<Client::ClientObject::View>()); + object->set_view(SPtr<client::ClientObject::View>()); } else { std::cerr << "Unknown object type" << std::endl; } @@ -165,7 +165,7 @@ MachinaCanvas::on_erase_object(SPtr<Client::ClientObject> object) void MachinaCanvas::action_create_node(double x, double y) { - Machina::Client::ClientObject obj(0); + machina::client::ClientObject obj(0); obj.set(URIs::instance().rdf_type, _app->forge().make_urid(URIs::instance().machina_Node)); obj.set(URIs::instance().machina_canvas_x, _app->forge().make((float)x)); @@ -188,5 +188,5 @@ MachinaCanvas::action_disconnect(SPtr<NodeView> src, _app->controller()->disconnect(src->node()->id(), head->node()->id()); } -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/MachinaCanvas.hpp b/src/gui/MachinaCanvas.hpp index a9ca5b9..c396931 100644 --- a/src/gui/MachinaCanvas.hpp +++ b/src/gui/MachinaCanvas.hpp @@ -25,11 +25,11 @@ using namespace Ganv; -namespace Machina { +namespace machina { -namespace Client { class ClientObject; } +namespace client { class ClientObject; } -namespace GUI { +namespace gui { class MachinaGUI; class NodeView; @@ -40,11 +40,11 @@ class MachinaCanvas public: MachinaCanvas(MachinaGUI* app, int width, int height); - //void build(SPtr<const Machina::Machine> machine, bool show_labels); + //void build(SPtr<const machina::Machine> machine, bool show_labels); //void update_edges(); - void on_new_object(SPtr<Machina::Client::ClientObject> object); - void on_erase_object(SPtr<Machina::Client::ClientObject> object); + void on_new_object(SPtr<machina::client::ClientObject> object); + void on_erase_object(SPtr<machina::client::ClientObject> object); MachinaGUI* app() { return _app; } @@ -54,7 +54,7 @@ protected: bool node_clicked(WPtr<NodeView> item, GdkEventButton* ev); private: - //SPtr<NodeView> create_node_view(SPtr<Machina::Node> node); + //SPtr<NodeView> create_node_view(SPtr<machina::Node> node); void action_create_node(double x, double y); @@ -68,7 +68,7 @@ private: WPtr<NodeView> _last_clicked; }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui #endif // MACHINA_CANVAS_HPP_HPP diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp index f162ebd..376f42e 100644 --- a/src/gui/MachinaGUI.cpp +++ b/src/gui/MachinaGUI.cpp @@ -38,16 +38,16 @@ #include "machina/Evolver.hpp" #endif -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { -MachinaGUI::MachinaGUI(SPtr<Machina::Engine> engine) +MachinaGUI::MachinaGUI(SPtr<machina::Engine> engine) : _refresh(false) , _evolve(false) , _unit(TimeUnit::BEATS, 19200) , _engine(engine) - , _client_model(new Machina::Client::ClientModel()) - , _controller(new Machina::Controller(_engine, *_client_model.get())) + , _client_model(new machina::client::ClientModel()) + , _controller(new machina::Controller(_engine, *_client_model.get())) , _maid(new Raul::Maid()) { _canvas = SPtr<MachinaCanvas>(new MachinaCanvas(this, 1600*2, 1200*2)); @@ -241,7 +241,7 @@ MachinaGUI::idle_callback() static void erase_node(GanvNode* node, void* data) { - Machina::Controller* controller = (Machina::Controller*)data; + machina::Controller* controller = (machina::Controller*)data; NodeView* const view = dynamic_cast<NodeView*>( Glib::wrap(GANV_NODE(node))); if (view) { @@ -429,7 +429,7 @@ MachinaGUI::menu_file_open() const int result = dialog.run(); if (result == Gtk::RESPONSE_OK) { - SPtr<Machina::Machine> new_machine = _engine->load_machine(dialog.get_uri()); + SPtr<machina::Machine> new_machine = _engine->load_machine(dialog.get_uri()); if (new_machine) { _canvas->destroy(); _controller->announce(new_machine); @@ -536,7 +536,7 @@ MachinaGUI::menu_import_midi() const double length_dbl = length_sb->get_value_as_int(); const Raul::TimeStamp length(_unit, length_dbl); - SPtr<Machina::Machine> machine = _engine->load_machine_midi( + SPtr<machina::Machine> machine = _engine->load_machine_midi( dialog.get_filename(), 0.0, length); if (machine) { @@ -695,16 +695,16 @@ MachinaGUI::play_toggled() } void -MachinaGUI::on_new_object(SPtr<Client::ClientObject> object) +MachinaGUI::on_new_object(SPtr<client::ClientObject> object) { _canvas->on_new_object(object); } void -MachinaGUI::on_erase_object(SPtr<Client::ClientObject> object) +MachinaGUI::on_erase_object(SPtr<client::ClientObject> object) { _canvas->on_erase_object(object); } -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/MachinaGUI.hpp b/src/gui/MachinaGUI.hpp index f9b0857..2636051 100644 --- a/src/gui/MachinaGUI.hpp +++ b/src/gui/MachinaGUI.hpp @@ -29,30 +29,30 @@ using namespace std; -namespace Machina { +namespace machina { class Machine; class Engine; class Evolver; class Controller; -namespace Client { +namespace client { class ClientModel; class ClientObject; } -namespace GUI { +namespace gui { class MachinaCanvas; class MachinaGUI { public: - MachinaGUI(SPtr<Machina::Engine> engine); + MachinaGUI(SPtr<machina::Engine> engine); ~MachinaGUI(); SPtr<MachinaCanvas> canvas() { return _canvas; } - SPtr<Machina::Engine> engine() { return _engine; } + SPtr<machina::Engine> engine() { return _engine; } Raul::Forge& forge() { return _forge; } @@ -63,14 +63,14 @@ public: void attach(); void quit() { _main_window->hide(); } - SPtr<Machina::Controller> controller() { return _controller; } + SPtr<machina::Controller> controller() { return _controller; } inline void queue_refresh() { _refresh = true; } - void on_new_object(SPtr<Machina::Client::ClientObject> object); - void on_erase_object(SPtr<Machina::Client::ClientObject> object); + void on_new_object(SPtr<machina::client::ClientObject> object); + void on_erase_object(SPtr<machina::client::ClientObject> object); - SPtr<Machina::Client::ClientModel> client_model() { + SPtr<machina::client::ClientModel> client_model() { return _client_model; } @@ -91,8 +91,8 @@ protected: void arrange(); void load_target_clicked(); - void random_mutation(SPtr<Machina::Machine> machine); - void mutate(SPtr<Machina::Machine> machine, unsigned mutation); + void random_mutation(SPtr<machina::Machine> machine); + void mutate(SPtr<machina::Machine> machine, unsigned mutation); void zoom(double z); void update_toolbar(); @@ -120,12 +120,12 @@ protected: Raul::TimeUnit _unit; SPtr<MachinaCanvas> _canvas; - SPtr<Machina::Engine> _engine; - SPtr<Machina::Client::ClientModel> _client_model; - SPtr<Machina::Controller> _controller; + SPtr<machina::Engine> _engine; + SPtr<machina::client::ClientModel> _client_model; + SPtr<machina::Controller> _controller; SPtr<Raul::Maid> _maid; - SPtr<Machina::Evolver> _evolver; + SPtr<machina::Evolver> _evolver; Raul::Forge _forge; @@ -174,7 +174,7 @@ protected: Gtk::ToolButton* _adjust_edge_button; }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui #endif // MACHINA_GUI_HPP diff --git a/src/gui/NodePropertiesWindow.cpp b/src/gui/NodePropertiesWindow.cpp index a58d649..bd275f5 100644 --- a/src/gui/NodePropertiesWindow.cpp +++ b/src/gui/NodePropertiesWindow.cpp @@ -21,8 +21,8 @@ using namespace std; -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { NodePropertiesWindow* NodePropertiesWindow::_instance = NULL; @@ -88,7 +88,7 @@ NodePropertiesWindow::ok_clicked() } void -NodePropertiesWindow::set_node(SPtr<Machina::Client::ClientObject> node) +NodePropertiesWindow::set_node(SPtr<machina::client::ClientObject> node) { _node = node; #if 0 @@ -109,7 +109,7 @@ NodePropertiesWindow::set_node(SPtr<Machina::Client::ClientObject> node) void NodePropertiesWindow::present(Gtk::Window* parent, - SPtr<Machina::Client::ClientObject> node) + SPtr<machina::client::ClientObject> node) { if (!_instance) { Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create(); @@ -125,5 +125,5 @@ NodePropertiesWindow::present(Gtk::Window* parent, _instance->show(); } -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/NodePropertiesWindow.hpp b/src/gui/NodePropertiesWindow.hpp index 78a5285..002f0cd 100644 --- a/src/gui/NodePropertiesWindow.hpp +++ b/src/gui/NodePropertiesWindow.hpp @@ -22,11 +22,11 @@ #include "machina/types.hpp" -namespace Machina { +namespace machina { -namespace Client { class ClientObject; } +namespace client { class ClientObject; } -namespace GUI { +namespace gui { class NodePropertiesWindow : public Gtk::Dialog @@ -38,10 +38,10 @@ public: ~NodePropertiesWindow(); static void present(Gtk::Window* parent, - SPtr<Machina::Client::ClientObject> node); + SPtr<machina::client::ClientObject> node); private: - void set_node(SPtr<Machina::Client::ClientObject> node); + void set_node(SPtr<machina::client::ClientObject> node); void apply_clicked(); void cancel_clicked(); @@ -49,7 +49,7 @@ private: static NodePropertiesWindow* _instance; - SPtr<Machina::Client::ClientObject> _node; + SPtr<machina::client::ClientObject> _node; Gtk::SpinButton* _note_spinbutton; Gtk::SpinButton* _duration_spinbutton; @@ -58,7 +58,7 @@ private: Gtk::Button* _ok_button; }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui #endif // NODEPROPERTIESWINDOW_HPP diff --git a/src/gui/NodeView.cpp b/src/gui/NodeView.cpp index 79258cd..674531c 100644 --- a/src/gui/NodeView.cpp +++ b/src/gui/NodeView.cpp @@ -28,12 +28,12 @@ using namespace std; -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { NodeView::NodeView(Gtk::Window* window, Ganv::Canvas& canvas, - SPtr<Machina::Client::ClientObject> node, + SPtr<machina::client::ClientObject> node, double x, double y) : Ganv::Circle(canvas, "", x, y, 20, false) @@ -57,7 +57,7 @@ NodeView::on_double_click(GdkEventButton*) } bool -NodeView::node_is(Raul::Forge& forge, Machina::URIInt key) +NodeView::node_is(Raul::Forge& forge, machina::URIInt key) { const Raul::Atom& value = _node->get(key); return value.type() == forge.Bool && value.get_bool(); @@ -124,7 +124,7 @@ NodeView::show_label(bool show) } void -NodeView::on_property(Machina::URIInt key, const Raul::Atom& value) +NodeView::on_property(machina::URIInt key, const Raul::Atom& value) { static const uint32_t active_color = 0x408040FF; static const uint32_t active_border_color = 0x00FF00FF; @@ -161,7 +161,7 @@ NodeView::on_property(Machina::URIInt key, const Raul::Atom& value) } void -NodeView::on_action_property(Machina::URIInt key, const Raul::Atom& value) +NodeView::on_action_property(machina::URIInt key, const Raul::Atom& value) { if (key == URIs::instance().machina_note_number) { show_label(true); @@ -175,5 +175,5 @@ NodeView::set_default_colors() set_border_color(_default_border_color); } -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/NodeView.hpp b/src/gui/NodeView.hpp index 5507a75..815e9e2 100644 --- a/src/gui/NodeView.hpp +++ b/src/gui/NodeView.hpp @@ -24,21 +24,21 @@ #include "machina/types.hpp" -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { class NodeView : public Ganv::Circle - , public Machina::Client::ClientObject::View + , public machina::client::ClientObject::View { public: NodeView(Gtk::Window* window, Canvas& canvas, - SPtr<Machina::Client::ClientObject> node, + SPtr<machina::client::ClientObject> node, double x, double y); - SPtr<Machina::Client::ClientObject> node() { return _node; } + SPtr<machina::client::ClientObject> node() { return _node; } void show_label(bool show); @@ -53,23 +53,23 @@ public: private: bool on_event(GdkEvent* ev); bool on_double_click(GdkEventButton* ev); - void on_property(Machina::URIInt key, const Raul::Atom& value); - void on_action_property(Machina::URIInt key, const Raul::Atom& value); + void on_property(machina::URIInt key, const Raul::Atom& value); + void on_action_property(machina::URIInt key, const Raul::Atom& value); - bool node_is(Raul::Forge& forge, Machina::URIInt key); + bool node_is(Raul::Forge& forge, machina::URIInt key); Gtk::Window* _window; - SPtr<Machina::Client::ClientObject> _node; + SPtr<machina::client::ClientObject> _node; uint32_t _default_border_color; uint32_t _default_fill_color; - SPtr<Machina::Client::ClientObject> _enter_action; + SPtr<machina::client::ClientObject> _enter_action; sigc::connection _enter_action_connection; sigc::signal<bool, GdkEventButton*> _signal_clicked; }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui #endif // MACHINA_NODEVIEW_HPP diff --git a/src/gui/WidgetFactory.hpp b/src/gui/WidgetFactory.hpp index 4f54998..38ed809 100644 --- a/src/gui/WidgetFactory.hpp +++ b/src/gui/WidgetFactory.hpp @@ -23,8 +23,8 @@ #include "machina_config.h" -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { class WidgetFactory { @@ -62,5 +62,5 @@ public: }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 25b1254..c61c7a3 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -27,7 +27,7 @@ #include "MachinaGUI.hpp" using namespace std; -using namespace Machina; +using namespace machina; int main(int argc, char** argv) @@ -38,16 +38,16 @@ main(int argc, char** argv) Sord::World rdf_world; - Machina::URIs::init(); + machina::URIs::init(); - SPtr<Machina::Machine> machine; + SPtr<machina::Machine> machine; // Load machine, if given #if 0 if (argc >= 2) { const string filename = argv[1]; cout << "Building machine from MIDI file " << filename << endl; - SPtr<Machina::SMFDriver> file_driver(new Machina::SMFDriver()); + SPtr<machina::SMFDriver> file_driver(new machina::SMFDriver()); if (argc >= 3) { float q = strtof(argv[2], NULL); @@ -83,7 +83,7 @@ main(int argc, char** argv) Gtk::Main app(argc, argv); driver->activate(); - GUI::MachinaGUI gui(engine); + gui::MachinaGUI gui(engine); app.run(*gui.window()); diff --git a/src/machina.cpp b/src/machina.cpp index 7772da5..579ca89 100644 --- a/src/machina.cpp +++ b/src/machina.cpp @@ -31,7 +31,7 @@ #include "JackDriver.hpp" using namespace std; -using namespace Machina; +using namespace machina; bool quit = false; diff --git a/src/midi2machina.cpp b/src/midi2machina.cpp index 7cd6242..62dfcef 100644 --- a/src/midi2machina.cpp +++ b/src/midi2machina.cpp @@ -26,7 +26,7 @@ #include "machina/MidiAction.hpp" using namespace std; -using namespace Machina; +using namespace machina; bool quit = false; |