Ardour  9.0-pre0-582-g084a23a80d
session_object.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2011 David Robillard <d@drobilla.net>
3  * Copyright (C) 2008-2013 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #pragma once
22 
23 #include <string>
25 #include "pbd/signals.h"
26 #include "pbd/properties.h"
27 
28 #include "ardour/ardour.h"
29 #include "ardour/session_handle.h"
30 
31 namespace ARDOUR {
32 
33 namespace Properties {
35  /* this has no inherent connection to SessionObject, but it needs to go * somewhere so .... */
37 }
38 
39 class Session;
40 
46 {
47  public:
48  static void make_property_quarks ();
49 
50  SessionObject (Session& session, const std::string& name)
52  , _name (Properties::name, name)
53  {
54  add_property (_name);
55  }
56 
57  Session& session() const { return _session; }
58  std::string name() const { return _name; }
59 
60  virtual bool set_name (const std::string& str) {
61  if (_name != str) {
62  _name = str;
63  PropertyChanged (PBD::PropertyChange (Properties::name));
64  }
65  return true;
66  }
67 
68  protected:
70 };
71 
72 } // namespace ARDOUR
73 
PBD::Property< std::string > _name
std::string name() const
static void make_property_quarks()
SessionObject(Session &session, const std::string &name)
Session & session() const
virtual bool set_name(const std::string &str)
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
void session(lua_State *L)
PBD::PropertyDescriptor< std::string > name
PBD::PropertyDescriptor< Temporal::TimeDomain > time_domain
DebugBits Properties