/builddir/build/BUILD/raul-0.4.0/raul/LashServerInterface.hpp

00001 /* This file is part of Raul.
00002  * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
00003  * 
00004  * Raul is free software; you can redistribute it and/or modify it under the
00005  * terms of the GNU General Public License as published by the Free Software
00006  * Foundation; either version 2 of the License, or (at your option) any later
00007  * version.
00008  * 
00009  * Raul is distributed in the hope that it will be useful, but WITHOUT ANY
00010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.
00012  * 
00013  * You should have received a copy of the GNU General Public License along
00014  * with this program; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00016  */
00017 
00018 #ifndef RAUL_LASH_SERVER_INTERFACE_HPP
00019 #define RAUL_LASH_SERVER_INTERFACE_HPP
00020 
00021 #include <string>
00022 #include <list>
00023 #include <lash/lash.h>
00024 #include <raul/LashClient.hpp>
00025 #include <raul/LashProject.hpp>
00026 #include <raul/SharedPtr.hpp>
00027 #include <sigc++/sigc++.h>
00028 
00029 namespace Raul {
00030 
00031 
00032 class LashServerInterface : public LashClient, public sigc::trackable {
00033 public:
00034     static SharedPtr<LashServerInterface> create(
00035             lash_args_t*         args,
00036             const std::string&   name,
00037             int                  flags);
00038 
00039     sigc::signal<void>                                signal_quit;
00040     sigc::signal<void, const SharedPtr<LashProject> > signal_project_add;
00041     sigc::signal<void, const SharedPtr<LashProject> > signal_project_remove;
00042 
00043     void restore_project(const std::string& filename);
00044 
00045     typedef std::list<SharedPtr<LashProject> > Projects;
00046     Projects& projects() { return _projects; }
00047 
00048     SharedPtr<LashProject> project(const std::string& name);
00049 
00050 private:
00051     LashServerInterface(lash_client_t* client);
00052     void handle_event(lash_event_t* ev);
00053     void project_closed(const std::string& name);
00054 
00055     Projects _projects;
00056 };
00057 
00058 
00059 } // namespace Raul
00060 
00061 #endif // RAUL_LASH_SERVER_INTERFACE_HPP
00062 

Generated on Wed Apr 9 08:14:41 2008 for RAUL by  doxygen 1.5.1